New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idle 3.1a1 utf8 #49065
Comments
When you open file without encoding declaration, make changes and save, It could be that at first saving we are asked to use |
IDLE is right to save the file as UTF-8; the file is invalid Python 3.0 Perhaps IDLE should offer to convert it on opening. |
You can open script made in python 2.x and it stops immediately working |
I forgot about "Perhaps IDLE should offer to convert it on opening." |
Here is a patch to provide an explicit message that the file will be If you want to edit Python 2.x scripts with IDLE 3, you need to add Again, please only report one issue at the time. You chose to make |
Sorry, where is the patch? |
OK, I got it. In my opinion it would nice if user can either convert file to utf8 or |
Ypu can still add an encoding declaration after the file got converted.
Right. Here is a patch that fixes that. |
seems to be working. Seems to me now I get it. The file encoding is ruled by the encoding # -- coding: cp1250 -- then the file would be saved in cp1250. Now hoping that I would keep this issue, cause it comes with this |
Actually, the behavior was there before - it's just that conversion was |
Well, thanks a lot. (aware this is really off this issue): Now I even get the system of HNY 2009 |
This is my plan, yes - hence I marked them all release-critical. They |
I might have another problem with this patch and maybe also that one in print ("ěščřžýáíé") Open - confirm converting to utf8 - F5 - error: see attached file |
I can't reproduce the problem. Can you please attach the |
Martin v. Löwis napsal(a), dne 3.1.2009 22:24:
You can use that one that is already here: cp1250.py. It is the same |
Ok, then what are the exact steps to reproduce? What code base, what |
Microsoft Windows XP [Verze 5.1.2600] C:\prg\Python30\Lib\idlelib>svn update # from C:\prg\Python30\Lib\idlelib>patch < conv.diff C:\prg\Python30\Lib\idlelib>patch < idle_encoding_4.patch ------------- Run IDLE - Open cp1250.py - confirm converting to utf8 - F5 (immediately, no change in code!) - error: see attached file All the other python code base is clean 3.0. |
I see. Here is a revised patch. This sets the modified flag on the |
Yes. Goooood jooooob. ;-) |
With this file - hello.py (attached) - I should be also asked for |
Why that? This file is already encoded in utf-8 just fine. It is,
What did you do to find that out? |
Martin v. Löwis napsal(a), dne 4.1.2009 14:39:
Well I am not much experienced but this file is not real utf8. It is |
No, it doesn't.
That's the BOM, or UTF-8 signature. It's optional, and UTF-8-encoded
Your understanding of UTF-8 is incorrect. |
Committed as r68732, r68733. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: