0

I have a problem with Python 2.6.6

when I try to run my code, I have this message:

Error - could not save file [Errno 22] invalid mode ('wb') or filename: ""

my file is called script2!

Then I forogt to mentionned that if I try to save my code after the error message popped up, i get the following error message

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

Thanks for you help

4

0 に答える 0