我遇到Python 2.6.6的问题
当我尝试运行我的代码时,我收到了这条消息:
错误 - 无法保存文件 [Errno 22]无效模式('wb')或文件名:“”
我的文件名为script2!
然后我提到如果我在弹出错误消息后尝试保存我的代码,我会收到以下错误消息
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\editor\document.py", line 77, in OnSaveDocument
self.SaveFile(fileName)
File "C:\Python26\Lib\site-packages\pythonwin\pywin\scintilla\document.py", line 54, in SaveFile
ok = view.SaveTextFile(fileName)
File "C:\Python26\Lib\site-packages\pythonwin\pywin\scintilla\view.py", line 394, in SaveTextFile
doc._SaveTextToFile(self, f)
File "C:\Python26\Lib\site-packages\pythonwin\pywin\scintilla\document.py", line 155, in _SaveTextToFile
f.write(s.encode(source_encoding))
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u201c' in position 1638: ordinal not in range(256)
win32ui.error: OnSaveDocument() virtual handler (<bound method SyntEditDocument.OnSaveDocument of <pywin.framework.editor.color.coloreditor.SyntEditDocument instance at 0x033639E0>>) raised an exception
谢谢你的帮助