msg92071 - (view) |
Author: Gabriel Genellina (ggenellina) |
Date: 2009-08-29 21:44 |
A Python source file name doesn't necesarily end in .py/.pyw; on Linux, scripts usually have no extension but are recognized by its shebang line. Windows uses file type associations: .py files are of type Python.File, and .pyc files are Python.NoConFile. This patch makes IDLE recognize as a Python source (and colorize) any file of those types, regardless of extension. http://permalink.gmane.org/ gmane.comp.python.general/636011 |
|
|
msg92412 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2009-09-08 11:08 |
This makes sense, but the code should: - not make the query when the extension is empty - catch the WindowsError raised when the extension is not in the registry. |
|
|
msg95259 - (view) |
Author: Gabriel Genellina (ggenellina) |
Date: 2009-11-14 21:38 |
This new patch addresses the previous comments. |
|
|
msg113184 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2010-08-07 16:56 |
I am a little puzzled by this issue. 1. Why would a Windows user use any extention other than .py or .pyw, which IDLE opens fine. How many people do something senseless like hand-registering, say 'xiq', as a python file? 2. .pyc files are binary files and NOT source code files and cannot be opened by IDLE as it will attempt to decode them into text. So why the check for that? Also, I believe there is another issue to add a 'Treat this as Python code' entry to one of the menus. This would cover the case of files without extensions and files that are not python files but happen (on a case-by-case basis) to have python code embedded within. So I am thinking that this should be closed. |
|
|
msg165561 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-07-16 00:49 |
This is related to . I assume that the point of this issue is to enable syntax highlighting by relying on the Windows registry? |
|
|
msg165658 - (view) |
Author: Daniel Swanson (weirdink13) |
Date: 2012-07-16 21:35 |
I am also somewhat puzzled by this issue. The other day I was able to open some .txt files just to see if I could and they opened just fine. Just now I tryed to open a .jpg file and I got an error message, but then again, why would someone save a python file as a jpeg image? |
|
|
msg165668 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-07-17 00:37 |
Is the error message a traceback? If so, could you open a separate issue for it? |
|
|
msg166169 - (view) |
Author: Daniel Swanson (weirdink13) |
Date: 2012-07-22 20:54 |
No. When I try to open the file a small window entitled "Specify file encoding" pops up that says "The file's encoding is invalid in Python 3.x. Idle will convert it to UTF-8. What is the current encoding of the file?" followed by an entry widget that has "cp1252" and "ok" and "cancel" buttons. When I click "ok" the computer go "dunnn" and a error window titled "Decoding Error" that says "File C:\Python32\misc\bee.jpg Failed to Decode" with an "ok" button which, when clicked, closes idle (the edit window, not the shell). Does that answer your question? |
|
|
msg228305 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2014-10-03 04:05 |
#6858 was the issue I referred to. Recognizing #!...python, common on *nex, which the patch does not do, seems sensible. I thought about coding line, but general idea is not specific to python. |
|
|