[pywin32-bugs] [ pywin32-Bugs-3137807 ] Pythonwin can't open a file with # -*- encoding: binary -*-
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2010-12-15 23:24:17
|
Bugs item #3137807, was opened at 2010-12-15 22:13 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3137807&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pythonwin Group: None Status: Open Resolution: Wont Fix Priority: 5 Private: No Submitted By: Greg Hazel (ghazel) Assigned to: Nobody/Anonymous (nobody) Summary: Pythonwin can't open a file with # -*- encoding: binary -*- Initial Comment: If a file starts with "# -*- encoding: binary -*-", Pythonwin cannot seem to open it. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2010-12-16 10:24 Message: Hrm - pep 263 which defines this behaviour says the encoding must be "known" and my tests demonstrate python itself refuses to work with such files. It is hard to justify a special case for the string "binary" - can't you just use latin-1 or similar to achieve the same result? The issue is pythonwin uses that encoding to determine how to translate the bytes into characters... ---------------------------------------------------------------------- Comment By: Greg Hazel (ghazel) Date: 2010-12-16 08:49 Message: I have run in to this with several source files, which were some reason marked with that preamble but otherwise perfectly editable. Also, I can open notepad.exe in pythonwin just fine. I'm not expecting pythonwin to work miracles and let me edit binary data correctly, I just think it should let me open files no matter what they say at the beginning (like notepad.exe opens just fine). Otherwise, I have to open the file with Wordpad, strip the preamble, then open with Pythonwin (and remember to put it back later). Very troublesome. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2010-12-16 06:43 Message: pythonwin only supports editing text and without a text based encoding it can't do much. If the problem is that the error message is unclear I can look at fixing that, but will not enable actual editing of the file. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3137807&group_id=78018 |