[issue7080] locale.strxfrm raises MemoryError

2009-10-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch is now committed to py3k (r75539) and 3.1 (r75541), closing. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue7080] locale.strxfrm raises MemoryError

2009-10-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue7080] locale.strxfrm raises MemoryError

2009-10-19 Thread Derk Drukker
Derk Drukker added the comment: I've entered my real name. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue7080] locale.strxfrm raises MemoryError

2009-10-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Nice work, thanks! One detail: when giving you credit, who should I mention? just "egreen"? -- ___ Python tracker ___ __

[issue7080] locale.strxfrm raises MemoryError

2009-10-19 Thread egreen
egreen added the comment: The tests in TestEnUSCollation I added don't work for all encodings (e.g. Asian ones, or ASCII). Now checked for encodings which are known to work. Found and fixed a bug (result not returned) in getpreferredencoding in Lib/locale.py. This test is skipped on Mac, sinc

[issue7080] locale.strxfrm raises MemoryError

2009-10-17 Thread egreen
egreen added the comment: I've added the tests. I found that on Windows, strxfrm has been unavailable in py3k since r61306, because of an omission in PC/pyconfig.h. (cf. patch) In determining whether I should first test for the existence of strcoll (or strxfrm) in the locale module, as was do

[issue7080] locale.strxfrm raises MemoryError

2009-10-15 Thread egreen
egreen added the comment: All right. The function strcoll also isn't tested (except for issue #3303). I'll look into that one, too. -- ___ Python tracker ___ __

[issue7080] locale.strxfrm raises MemoryError

2009-10-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Nice catch. I wonder why not all of our modules are PY_SSIZE_T_CLEAN in py3k. This function is not actually tested, could you add a test to the regression suite? -- nosy: +pitrou priority: -> high ___ Python tracker

[issue7080] locale.strxfrm raises MemoryError

2009-10-15 Thread egreen
egreen added the comment: Could someone triage this? And review my simple fix? I think it should be a release blocker. It seems to me to be a problem on all 64-bit non-Windows platforms, or any platform if using UCS-4. The 4 high-order bytes of an 8-byte Py_ssize_t variable are not initializ

[issue7080] locale.strxfrm raises MemoryError

2009-10-07 Thread egreen
New submission from egreen : The strxfrm function in the locale module can potentially raise a MemoryError. The failing malloc is in Modules/_localemodule.c, line 291. This is because the variable n0 of type Py_ssize_t is passed to PyArg_ParseTuple, which expects an int when PY_SSIZE_T_CLEAN is