[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-03-06 Thread Ezio Melotti
Ezio Melotti added the comment: The Linux buildbots were running the tests using ./python ./Lib/test/regrtest.py instead of ./python -m test.regrtest and '' was missing from sys.path, so imp.find_module couldn't find the module. This is now fixed in r78711 and backported r78716. Thanks to Flor

[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-03-06 Thread Florent Xicluna
Florent Xicluna added the comment: Thanks for fixing this. Now Win7 buildbot is green on trunk. -- stage: needs patch -> committed/rejected ___ Python tracker ___ ___

[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-03-05 Thread Ezio Melotti
Ezio Melotti added the comment: I fixed all the things listed in the previous message in r78689, but that just enabled the test on several Linux buildbots and some started to fail too. In r78696 (and r78697) I tried to use sys.getfilesystemencoding() instead of locale.getpreferredencoding() an

[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-02-18 Thread Ezio Melotti
Ezio Melotti added the comment: Also the test has a few problems: 1) the keys of known_locales are lowercase, but locale_encoding = locale.getpreferredencoding() can return uppercase encodings (e.g. UTF-8); 2) this masks another error: the b'\xe4' is not a valid utf-8 byte and it can be decode

[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-02-18 Thread Florent Xicluna
Florent Xicluna added the comment: Still an issue for some buildbot: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/1487 http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/1491 It is loosely related with #7712, because now the tests are run in TEM

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-04-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: Continuing work on problem I figured out: * on Windows it's impossible to convert filenames to file system encoding without and don't miss something. * Windows can work properly only with unicode (wchar_t) characters. * all other systems feels itself good using

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-04-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: Martin, can you review latest patch and apply it if this one is correct. I want to start working on conversion import.c to use unicode strings (we spoke about Tuesday) this weekend. It will be nice if I will have synchronized svn before making new changes. -

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: Martin von Loewis added to nosy list -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list ma

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: Continuing work over import.c I fixed bad error message encoding in generated ImportError exception. Tests for checking in case of non-ascii characters added. -- Added file: http://bugs.python.org/file13520/import.zip _

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks Andrew! Committed to 3.0.2 as 70756. Should be merged into 3.1, but should *not* be backported to 2.x. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: According to Hirokazu Yamamoto memory cleanup added. Patch is updated. -- Added file: http://bugs.python.org/file13486/import.zip ___ Python tracker ___

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thank you. On Mon, Mar 30, 2009 at 3:13 PM, Hirokazu Yamamoto wrote: > > Hirokazu Yamamoto added the comment: > > PyMem_Free is needed when "es" is used with PyArg_ParseTuple. See other > part of import.c. I did same mistake before. ;-) > > -- > nosy:

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: PyMem_Free is needed when "es" is used with PyArg_ParseTuple. See other part of import.c. I did same mistake before. ;-) -- nosy: +ocean-city ___ Python tracker

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Problem fixed, patch attached I inserted conversion path parameters to using Py_FileSystemDefaultEncoding for: * load_module * load_compiled * load_dynamic * load_source * load_package find_module is already has conversion. -- Added file: http://bugs.

[issue5604] imp.find_module() mixes UTF8 and MBCS

2009-03-30 Thread Guido van Rossum
New submission from Guido van Rossum : There's a path in imp.find_module that mixes encodings. The module name is encoded to char* using UTF-8 by the 's' format passed to PyArg_ParseTuple(). But the path name is converted (in the loop over the path in find_module()) to char* using the filesyste