send2trash模块ValueError

时间:2017-10-07 20:05:03

标签: python

我正在尝试使用python中的send2trash模块跟随'Automate The Boring Stuff',但我不断收到以下错误:

Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import send2trash
>>> send2trash.send2trash(r"C:\Users\Ian\Desktop\tMorph\tMorph.dll")
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    send2trash.send2trash(r"C:\Users\myusernamehere\Desktop\tMorph\tMorph.dll")
  File "C:\Users\myusernamehere\AppData\Local\Programs\Python\Python35\lib\site-
packages\send2trash\plat_win.py", line 49, in send2trash
    fileop.pFrom = LPCWSTR(path + '\0')
ValueError: embedded null character

我在不同的位置尝试了多个文件,但我仍然得到完全相同的错误。

谢谢!

1 个答案:

答案 0 :(得分:0)

升级到send2trash版本1.4.2为我解决了这个问题