Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Antoine Pitrou
Le samedi 23 janvier 2010 à 20:43 +0100, M.-A. Lemburg a écrit : > > Now, we cannot easily remove this guessing since we're in stable > mode again with 3.1. Perhaps we should add a way to at least be > able to switch off this guessing, so that applications can be > tested in a predictable way, rat

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Antoine Pitrou
Terry Reedy udel.edu> writes: > > Dreadfully rong. In general, the default encoding on my Windows *does > not work* on Python3 strings but causes > UnicodeEncodeError: > If the text is not written to the file, it is completely non-portable. You must mistake "portable" for something else. "P

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Terry Reedy
On 1/23/2010 7:53 AM, Antoine Pitrou wrote: Terry Reedy udel.edu> writes: If the current guess is based on a mistaken assumption -- that it is giving the user what the user asked for -- it might be reconsidered. I personally would prefer that the default file encoding for Python 3 be utf-8 on

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-23 Thread Cesare Di Mauro
Hi Collin IMO it'll be better to make Unladen Swallow project a module, to be installed and used if needed, so demanding to users the choice of having it or not. The same way psyco does, indeed. Nowadays it requires too much memory, longer loading time, and fat binaries for not-so-great performan

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread M.-A. Lemburg
Nick Coghlan wrote: > M.-A. Lemburg wrote: >> "Martin v. Löwis" wrote: >>> Hmm - what do you mean by "normally"? Normally, text files are meant >>> for human readers, not for exchange between programs. >> >> It's rather common to exchange text files between users... and >> in form of XML and CSV fi

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread M.-A. Lemburg
Antoine Pitrou wrote: > M.-A. Lemburg egenix.com> writes: >> >> It's rather common to exchange text files between users... and >> in form of XML and CSV files, these also tend to get used as >> input for programs every now and then > > For XML files, encoding should be taken care of by the XML l

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Antoine Pitrou
M.-A. Lemburg egenix.com> writes: > > It's rather common to exchange text files between users... and > in form of XML and CSV files, these also tend to get used as > input for programs every now and then For XML files, encoding should be taken care of by the XML layer, not the IO layer. That is

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Nick Coghlan
M.-A. Lemburg wrote: > "Martin v. Löwis" wrote: >> Hmm - what do you mean by "normally"? Normally, text files are meant >> for human readers, not for exchange between programs. > > It's rather common to exchange text files between users... and > in form of XML and CSV files, these also tend to get

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread M.-A. Lemburg
"Martin v. Löwis" wrote: >> No, but it's most likely a wrong guess, since text files don't >> really have anything to do with what the user wants to see in >> a user interface. > > That also depends on the operating system. On Windows, there is > a long tradition of encoding all text in the system

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Martin v. Löwis
> No, but it's most likely a wrong guess, since text files don't > really have anything to do with what the user wants to see in > a user interface. That also depends on the operating system. On Windows, there is a long tradition of encoding all text in the system code page. All text editors on Wi

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread M.-A. Lemburg
"Martin v. Löwis" wrote: >> This all begs the question: why is there a default? and why is the >> default a guess? >> >> I have to admit that I was completely oblivious to this potential >> pitfall, and mostly that's because in the most common case, I am working >> with ASCII files. > > You answer

[Python-Dev] Automatic sys.prefix change

2010-01-23 Thread zachar
Hi list, It looks like the python interpreter environment is easily movable between two directories because the sys.prefix variable is changed automatically when I run the interpreter so the interpreter will find his libraries... however in the Python documentation I found that (http://docs.py

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Antoine Pitrou
Terry Reedy udel.edu> writes: > > If the current guess is based on a mistaken assumption -- that it is > giving the user what the user asked for -- it might be reconsidered. I > personally would prefer that the default file encoding for Python 3 be > utf-8 on any machine my code runs on unless

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Martin v. Löwis
>> So for the limited case of text IO, Python 3.x now makes a guess. >> However, this guess is not in the face of ambiguity: it is the >> locale that the user (or his administrator) has selected, > > That is a mistaken assumption for many. I have never, that I know of, > selected a locale on any o

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-23 Thread Terry Reedy
On 1/23/2010 2:53 AM, "Martin v. Löwis" wrote: So for the limited case of text IO, Python 3.x now makes a guess. However, this guess is not in the face of ambiguity: it is the locale that the user (or his administrator) has selected, That is a mistaken assumption for many. I have never, that I

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-23 Thread Jake McGuire
On Fri, Jan 22, 2010 at 11:07 AM, Collin Winter wrote: > Hey Jake, > > On Thu, Jan 21, 2010 at 10:48 AM, Jake McGuire wrote: >> On Thu, Jan 21, 2010 at 10:19 AM, Reid Kleckner wrote: >>> On Thu, Jan 21, 2010 at 12:27 PM, Jake McGuire wrote: On Wed, Jan 20, 2010 at 2:27 PM, Collin Winter