classification
Title: test_ctypes assumes LANG=C LC_ALL=C
Type: Stage: resolved
Components: ctypes Versions: Python 3.4, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: doko, python-dev
Priority: normal Keywords:

Created on 2013-04-16 11:14 by doko, last changed 2013-05-15 16:09 by doko. This issue is now closed.

Messages (5)
msg187070 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 11:14
this test assumes LANG=C LC_ALL=C

test.test_ctypes (unittest.loader.LoadTestsFailure) ... ERROR

======================================================================
ERROR: test.test_ctypes (unittest.loader.LoadTestsFailure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_ctypes.py", line 11, in load_tests
    skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
  File "/usr/lib/python3.3/ctypes/test/__init__.py", line 64, in get_tests
    mod = __import__(modname, globals(), locals(), ['*'])
  File "/usr/lib/python3.3/ctypes/test/test_find.py", line 17, in <module>
    lib_gle = find_library("gle")
  File "/usr/lib/python3.3/ctypes/util.py", line 242, in find_library
    return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
  File "/usr/lib/python3.3/ctypes/util.py", line 99, in _findLib_gcc
    trace = f.read()
  File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 471: ordinal not in range(128)
msg187071 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 11:16
hmm, looks more an issue in ctypes/util.py. _findLib_gcc should set the environment explicitly as already done in _findSoname_ldconfig.
msg189282 - (view) Author: Roundup Robot (python-dev) Date: 2013-05-15 13:48
New changeset 4f594f9b296a by doko in branch '2.7':
- Issue #17754: Make ctypes.util.find_library() independent of the locale.
http://hg.python.org/cpython/rev/4f594f9b296a
msg189286 - (view) Author: Roundup Robot (python-dev) Date: 2013-05-15 16:05
New changeset d6a43a99aea3 by doko in branch '3.3':
- Issue #17754: Make ctypes.util.find_library() independent of the locale.
http://hg.python.org/cpython/rev/d6a43a99aea3

New changeset 9a44f12df844 by doko in branch 'default':
- Issue #17754: Make ctypes.util.find_library() independent of the locale.
http://hg.python.org/cpython/rev/9a44f12df844
msg189287 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-05-15 16:09
fixed in 2.7, 3.3 and trunk
History
Date User Action Args
2013-05-15 16:09:17dokosetstatus: open -> closed
resolution: fixed
messages: + msg189287

stage: needs patch -> resolved
2013-05-15 16:05:03python-devsetmessages: + msg189286
2013-05-15 13:48:05python-devsetnosy: + python-dev
messages: + msg189282
2013-04-16 11:16:36dokosetcomponents: + ctypes, - Tests
2013-04-16 11:16:12dokosetmessages: + msg187071
versions: + Python 2.7
2013-04-16 11:14:49dokolinkissue17750 dependencies
2013-04-16 11:14:31dokocreate