[issue10097] platform.uname gives UnicodeError for non-ASCII computer names on Windows

2010-10-14 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.org/issue10097> ___ ___ Pyth

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Regarding fixing the issue at hand on Windows, I think Python should use the corresponding win32 API for getting the hostname: GetComputerNameEx(). It supports Unicode, so the encoding issue doesn't arise. See http://msdn.microsoft.com/en-us/li

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Wouldn't it be better to use Py_hash_t instead of size_t for calculating the hash values in those hash functions ? -- nosy: +lemburg ___ Python tracker <http://bugs.python.org/i

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: And related to my previous comment: shouldn't Py_hash_t map to size_t instead of Py_ssize_t ? -- ___ Python tracker <http://bugs.python.org/i

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Benjamin Peterson wrote: > > Benjamin Peterson added the comment: >> Marc-Andre Lemburg added the comment: >> >> And related to my previous comment: shouldn't Py_hash_t map to size_t >> instead of Py_ssize_t ? > &g

[issue10154] locale.normalize strips "-" from UTF-8, which fails on Mac

2010-10-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ronald Oussoren wrote: > > Ronald Oussoren added the comment: > > This patch solves the immediate failure: > > Index: Lib/locale.py > === > --- Lib/locale.py (r

[issue10156] Memory leak (r70459)

2010-10-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > To add to the mystery, the leak disappears if the key value is not > interned in PyDict_SetItemString: I'm not sure how you determine what is a leak and what not. Interned

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > >> Sorry, I didn't mean how Windows constructs the result for the >> "A" interface - I was talking about Python code being able to map >> the res

[issue10154] locale.normalize strips "-" from UTF-8, which fails on Mac

2010-10-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stephen Hansen wrote: > > Stephen Hansen added the comment: > > Mark, the locals() right before "if encoding:" (line 399) are: > >>>> locale.normalize("en_US.UTF-8") > {'code'

[issue10147] Python Documentation bugs

2010-10-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Éric Araujo wrote: > > Éric Araujo added the comment: > > Adjectives require hyphens but nouns do not. “thread-safety” should be > reverted to “thread safety”. I haven’t searched for a grammar reference, but > you can take Wikip

[issue9912] Fail when vsvarsall.bat produces stderr

2010-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Éric Araujo wrote: > > Éric Araujo added the comment: > > I’d replace “created stderr” with “printed on stderr”, but otherwise > msvc9_log.diff looks good. > > distutils is feature-frozen, but I think any changes that help debuggin

[issue10093] Warn when files are not explicitly closed

2010-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I wonder why you think a warning is needed if files aren't closed explicitly. The fact that they get closed on garbage collection is one of the nice features of Python and has made programming easy for years. Explicitly having to close files may

[issue9047] Python 2.7rc2 includes -isysroot twice on each gcc command line

2010-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ronald Oussoren wrote: > > Ronald Oussoren added the comment: > > Marc-Andre: does the current HEAD of the 2.7 and 3.2 branches work for you? > > The build still has duplicate flags, but that doesn't seem to cause problems >

[issue10208] add mazovia.py to encodings/

2010-10-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Piotr Matuszewski wrote: > > New submission from Piotr Matuszewski : > > mazovia is an old encoding for Polish language, it's modified cp437 (more > info at http://en.wikipedia.org/wiki/Mazovia_encoding and (in Polish, but > t

[issue1813] Codec lookup failing under turkish locale

2010-10-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Looking at this again, I think we should change the codec registry C code to use Py_TOLOWER() and the encoding search function code to use the .translate() approach that Antoine suggested. -- ___ Python

[issue10203] sqlite3.Row doesn't support sequence protocol

2010-10-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Just as data point: the DB-API 2.0 requires that the row objects returned by the various .fetch*() methods are sequences, i.e. they need to implement the sequence protocol. -- nosy: +lemburg ___ Python tracker

[issue10093] Warn when files are not explicitly closed

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > Brett Cannon added the comment: > > But this is meant to be an optional warning; users will never see it. Me as a > developer, I would like to know when I leave a file open as that is a waste > of resou

[issue10093] Warn when files are not explicitly closed

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> That's what I'm referring to: most Python applications are >> written with the fact in mind, that garbage collection will >> close the files or socket.

[issue10093] Warn when files are not explicitly closed

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> Whether you write an application with automatic closing of >> the file/socket at garbage collection time in mind, or you explicitly >> close the file/socket, the

[issue10093] Warn when files are not explicitly closed

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reposted via the web interface: >> If you want to monitor resource usage in your application it >> would be a lot more useful to provide access to the number of >> currently open FDs > Agreed it would be useful as well, but please t

[issue10208] add mazovia.py to encodings/

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Piotr Matuszewski wrote: > > Piotr Matuszewski added the comment: > > it's still used by some business in Poland, who have DOS based systems, but I > don't think any new deployments are using it Then I think it's better

[issue10208] add mazovia.py to encodings/

2010-10-29 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue10208> ___ ___ Pyth

[issue10093] Warn when files are not explicitly closed

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> The warning will trigger without any reason. > > Well, by now you should have understood the reason, so I conclude that > you are either 1) deaf 2) stupid 3

[issue4431] Distutils MSVC doesn't create manifest file (with fix)

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi David, since both you and Pavel are building mysql-python and using setuptools (which applies a lot of hacks on stock distutils), could you please also try some other package from PyPI in that same configuration and preferably one which doesn't re

[issue4431] Distutils MSVC doesn't create manifest file (with fix)

2010-10-29 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : Removed file: http://bugs.python.org/file13126/unnamed ___ Python tracker <http://bugs.python.org/issue4431> ___ ___ Python-bugs-list m

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > I just did an experiment on Windows 7. I used SetComputerNameEx to set the > NetBIOS name (4) to "e2718", and the DNS name (5) to "π3141"; then I &

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > r85934 now uses GetComputerNameExW on Windows. Thanks, Martin. Here's a similar discussion of the Windows approach (used in bzr): https://bugs.launchpad.net/bzr/+bug/

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > The Solaris case then is already supported, with no change required: if > Solaris bans non-ASCII in the network configuration (or, rather, recommends > to use IDNA), t

[issue10244] PEP100 has broken links

2010-10-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Maciej Fijalkowski wrote: > > New submission from Maciej Fijalkowski : > > PEP100 (http://www.python.org/dev/peps/pep-0100/) links to python starship. > Should it just link to python.org for the newest version of this doc? The starship li

[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > It's unfortunate that the patch had been backported to 2.6.6; we can't fix it > there anymore. Why not ? It looks a lot like a security fix. -- nosy: +lemburg ___ Pytho

[issue10288] Remove

2010-11-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Dave Malcolm wrote: > > New submission from Dave Malcolm : > > Issue 5793 rationalized all usage of C "character" handling to use > "Py_"-prefixed locale-unaware macros, at the "char" level. > > In

[issue10288] Remove deprecated C "character" handling macros ISUPPER() etc

2010-11-02 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- title: Remove -> Remove deprecated C "character" handling macros ISUPPER() etc ___ Python tracker <http://bugs.pytho

[issue10344] codecs.readline doesn't care buffering=0

2010-11-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Amaury Forgeot d'Arc wrote: > > Amaury Forgeot d'Arc added the comment: > > Antoine, should codecs.open() be removed or simply aliased to open()? Both is not possible: codecs.open() provides a different API than open(). Unli

[issue10413] Comments in unicode.h are out of date

2010-11-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > New submission from Alexander Belopolsky : > > Attached patch updates some comments in unicode.h mostly reflecting the fact > that the default encoding is now unconditionally UTF

[issue10413] Comments in unicode.h are out of date

2010-11-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Committed in revision 86478. Should this go in 3.1? This is a comments-only > change, so it is fairly safe and merging may help future maintenance. On the &

[issue10413] Comments in unicode.h are out of date

2010-11-16 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue10413> ___ ___ Python-bugs-list mailing list Un

[issue10413] Comments in unicode.h are out of date

2010-11-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Committed to 3.1 branch in revision 86481. Thanks. -- ___ Python tracker <http://bugs.python

[issue10435] Document unicode C-API in reST

2010-11-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please note that PyCodec_Encode()/PyCodec_Decode() will return whatever the codec returns for these operations. The codec system is not limited to converting between Unicode and bytes only. A typical example is a same-type codec such as rot13 that only

[issue10435] Document unicode C-API in reST

2010-11-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Tue, Nov 16, 2010 at 5:54 PM, Marc-Andre Lemburg > wrote: >> >> Marc-Andre Lemburg added the comment: >> >> Please note that PyCode

[issue10435] Document unicode C-API in reST

2010-11-17 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > If you have time, please take a look at > PyUnicode_As{En,De}codedObject() and > PyUnicode_As{En,De}DecodedUnicode() documentation in the attached > patch. Thanks. I'll try to have

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > I am not sure PyUnicode_Decode() should treat NULL as an empty string. Definitely not. That would hide programming errors. -- nosy: +lemburg title: Some "trivial" python 2.x pickles fails to lo

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >>> I am not sure PyUnicode_Decode() should treat NULL as an empty string. >> >> Definitely not. That would hide programming errors. > > Well, this could b

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> Antoine Pitrou wrote: >>> >>> Antoine Pitrou added the comment: >>> >>>>> I am not sure PyUnicode_Decode() should treat NULL as a

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> PyUnicode_Decode() et al. are conversion functions and these >> require valid content to work on. Passing in a NULL pointer >> does not fit that specificati

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please go with Alexander's solution of fixing the higher level code rather than silently trying to introduce a new feature in PyUnicode_Decode() that hides programming errors. Thanks. -- ___ Python tr

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Jesús Cea Avión wrote: > > Jesús Cea Avión added the comment: > > What if we commit Antoine patch for 3.2.x, and the "correct" patch for py3k > trunk?. > > I am actually +1 to Marc-Andre. I feel in my guts that the provid

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > In issue11303.diff, I add similar optimization for encode('latin1') and for > 'utf8' variant of utf-8. I don't think dash-less var

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > What is the status of this. Status=open and Resolution=rejected contradict > each other. Sorry, forgot to c

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue5902> ___ ___ Python-bugs-list mailing list Unsubscri

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > >> Accepting all common forms for >> encoding names means that you can usually give Python an encoding name >> from, e.g. a HTML page, or any other file

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Ezio and I discussed on IRC the implementation of alias lookup and neither of > us was able to point out to the function that strips non-alphanumeric > charac

[issue11309] #include in Objects/unicodetype_db.h and Objects/unicodectype.c

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Дилян Палаузов wrote: > > New submission from Дилян Палаузов : > > As of python 2.7.1 configured with "--enable-ipv6 --enable-unicode > --with-system-expat --with-system-ffi --with-signal-module --with-threads > --with-wctype-fu

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Thu, Feb 24, 2011 at 10:30 AM, Ezio Melotti wrote: > .. >> See also discussion on #5902. > > Mark has closed #5902 and indeed the discu

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Steffen Daode Nurpmeso wrote: > > Steffen Daode Nurpmeso added the comment: > > .. i don't have actually invented this algorithm (but don't ask me where i > got the idea from years ago), i've just implemented the funct

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: As promised, here's the list of places where the wrong Latin-1 encoding spelling is used: Lib//test/test_cmd_line.py: -- for encoding in ('ascii', 'latin1', 'utf8'): Lib//test/test_codecs.py: -- ef = cod

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > I think that the normalization function in unicodeobject.c (only used for > internal functions) can skip any character different than a-z, A-Z and 0-9. > Something like:

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Thu, Feb 24, 2011 at 11:01 AM, Marc-Andre Lemburg > wrote: > .. >> On this ticker, we're discussing just one application area: that >> o

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > Ooops, I attached the wrong patch. Here is the new fixed patch. That won't work, Victor, since it makes invalid encoding names valid, e.g. 'utf(=)-8'. We

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Thu, Feb 24, 2011 at 11:31 AM, Marc-Andre Lemburg > wrote: > .. >> I think rather than removing any hyphens, spaces, etc. the >> function sho

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Thu, Feb 24, 2011 at 3:54 PM, Antoine Pitrou > wrote: > .. >> I've committed the part of the patch which disallows a NULL data pointer >&

[issue11313] Speed up default encode()/decode()

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > New submission from Alexander Belopolsky : > > In Python 3.x default encoding is always utf-8, but encode()/decode() still > try to look it up. Attached patch eliminates a call to normalize_encoding >

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: r88586: Normalized the encoding names for Latin-1 and UTF-8 to 'latin-1' and 'utf-8' in the stdlib. -- ___ Python tracker <http://bug

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I think we should reset this whole discussion and just go with Alexander's original patch issue11303.diff. I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow impl

[issue11322] encoding package's normalize_encoding() function is too slow

2011-02-25 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg : I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow implementation. The original version used the .translate() method which is a lot faster and can be adapted to w

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Marc-Andre Lemburg wrote: > > I don't know who changed the encoding's package normalize_encoding() function > (wasn't me), but it's a really slow implementation. > > The original version used the .translate() method whi

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> r88586: Normalized the encoding names for Latin-1 and UTF-8 to >> 'latin-1' and 'utf-8' in the stdlib. > > Why did you do that? We are trying

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Closing the ticket again. The problem in question is solved. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue11322] encoding package's normalize_encoding() function is too slow

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > We should first implement the same algorithm of the 3 normalization functions > and add tests for them (at least for the function in normalization): > > - no

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I guess you could regard the wrong encoding name use as bug - it slows down several stdlib modules for no apparent reason. If you agree, Raymond, I'll backport the patch. -- title: b'x'.decode('latin1') is much slowe

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > I guess you could regard the wrong encoding name use as bug - it > slows down several stdlib modules for no apparent reason. > > If you agree, Raymond, I'

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > >> If you agree, Raymond, I'll backport the patch. > > Yes. That will address Antoine's legitimate concern about making other > backports harder, a

[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2011-02-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > The patch turned out to be less trivial than I initially thought. > > The current algorithm checks for invalid continuation bytes in 4 places: > 1) before the switch/case

[issue11377] Deprecate (remove?) platform.popen()

2011-03-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > New submission from STINNER Victor : > > Extract of the documentation: > > 15.14.3.1. Win95/98 specific > > platform.popen(cmd, mode='r', bufsize=None) > > Portable popen() interf

[issue11377] Deprecate (remove?) platform.popen()

2011-03-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > os.popen() is deprecated since Python 2.6 ("Use the subprocess module.") and > it is no more documented in Python 3. The following documentation explains >

[issue11377] Deprecate (remove?) platform.popen()

2011-03-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: BTW: The _popen class can be removed as well, if the function is replaced with os.popen() or the subprocess module Popen(). -- ___ Python tracker <http://bugs.python.org/issue11

[issue11377] Deprecate (remove?) platform.popen()

2011-03-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> Does subprocess work from inside Windows GUI applications? > > You mean: Python embedded in another program? I don't know. How can I test > that? Try to use

[issue11377] Deprecate (remove?) platform.popen()

2011-03-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> Try to use platform from within IDLE ... > > I tried subprocess.call('calc.exec'): it works. > > I tried p=subprocess.Popen('echo

[issue11377] Deprecate (remove?) platform.popen()

2011-03-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > New patch deprecating platform.popen() and removing _popen. Patch looks good. > Marc-Andre: Do you agree to deprecate platform.popen() in favour of > subprocess? Yes

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-03-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: M.-A. Lemburg wrote: > Raymond Hettinger wrote: >> >> Raymond Hettinger added the comment: >> >>> If you agree, Raymond, I'll backport the patch. >> >> Yes. That will address Antoine's legitimate con

[issue6490] os.popen documentation in 2.6 is probably wrong

2011-03-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > r55334 removed popen2, popen3 and popen4 from the os module from Python 3 > (before the 3.0 release), but not os.popen. > > Python 3.2 has now convenience functions

[issue11393] Integrate faulthandler module into Python 3.3

2011-03-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> It would be nice if it were enabled by default for fatal errors >> (and asserts perhaps?). > > That would mean that the module should be a builtin module, or tha

[issue11393] Integrate faulthandler module into Python 3.3

2011-03-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > Le mardi 22 mars 2011 à 09:01 +, Marc-Andre Lemburg a écrit : >> Perhaps you could consider adding a similar approach (raising >> an exception instead of wri

[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-03-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please provide a patch for review. Thanks. -- ___ Python tracker <http://bugs.python.org/issue11678> ___ ___ Python-bug

[issue11681] -b option undocumented

2011-03-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Nick Coghlan wrote: > > Nick Coghlan added the comment: > > Even "from __future__ import unicode_literals" doesn't make it do anything. > > Perhaps Christian merged it by mistake in [5341b30b1812]? It looks more lik

[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-03-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Westley Martínez wrote: > > Westley Martínez added the comment: > > I forgot to say, Arch Linux is rolling release so it doesn't have a version > or id. Ok, but then what's the output of the function on Arch Linux (with the p

[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-03-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Westley Martínez wrote: > > Westley Martínez added the comment: > > ('arch', '', '') I've had a look at http://www.archlinux.org/download/ which does list a release version (currently 2010.05). Could you

[issue6895] locale._parse_localename fails when localename does not contain encoding information

2011-04-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > Is there another (authoritative) source for locale aliases apart > from X.org? On Ubuntu Lucid, many aliases for installed locales > are missing: > > f = open("/var/

[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-04-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Westley Martínez wrote: > > Westley Martínez added the comment: > > Perhaps I wasn't clear. That release version isn't for the system. It's for > the installation disc. There's no way to get that info and it means noth

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Just to add another data point to this discussion: mxDateTime, which in large parts inspired the Python datetime module, has had a .ticks() method (for local time) and a .gmticks() method (for UTC) for more than a decade now and so far, I haven't s

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > Marc, could you maybe write a new patching taking care of the DST and > maybe also the timezone? It looks like you have a long experience in > timestamps :-) Sorry, but no

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > On Tue, Apr 5, 2011 at 4:33 AM, Marc-Andre Lemburg > wrote: > .. >> mxDateTime, which in large parts inspired the Python datetime module, >> has ha

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > MAL> Since most of the datetime module was inspired by mxDateTime, > MAL> I wonder why [ticks()/gmticks()] were left out. (msg75411) > > ""&

[issue11840] Improvements to c-api/unicode documentation

2011-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Sandro Tosi wrote: > > Sandro Tosi added the comment: > > In addition, is there a reason for the sorting of UTF-8 UTF-32 UTF-16 and > UTF-7 sections? why not alphabetically? No particular reason. Alphabetical order would be just as g

[issue11840] Improvements to c-api/unicode documentation

2011-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Sandro Tosi wrote: > > New submission from Sandro Tosi : > > Hi, > After reading tomo cocoa mail at docs@ I gave a look at c-api/unicode file > and fixed some minor editing issues.

[issue11840] Improvements to c-api/unicode documentation

2011-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Sandro Tosi wrote: > > Sandro Tosi added the comment: > > On Tue, Apr 12, 2011 at 23:34, Marc-Andre Lemburg > wrote: >> Sandro Tosi wrote: >>> >>> Sandro Tosi added the comment: >>> >>> In additi

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > The attached patch skips the peepholer optimizations for BINARY_SUBSCR if the > resulting char is a surrogate on narrow builds or a non-bmp char in wide > builds. > Note

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > Are there any cases where v[w] -- where v is a unicode object -- returns a > non-unicode object? There could be: either from subclasses or from buggy code. In any case, macros

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > Here's a new patch that checks that newconst is not NULL and that it's a > unicode object. > I added a test for the case where it's NULL. I don't think

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > PEP 3147 says[0]: > """ > For backward compatibility, Python will still support pyc-only distributions, > however it will only do so when the pyc file li

[issue11850] mktime - OverflowError: mktime argument out of range - on very specific time

2011-04-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: JoeKuan wrote: > > New submission from JoeKuan : > >>>> a = (1970, 1, 1, 0, 59, 58, 0, 0, 0) >>>> time.mktime(a) > -2.0 On Windows, you get an OverflowError for this tuple as well. >>>> a = (19

<    1   2   3   4   5   6   7   8   9   10   >