classification
Title: fail to "from locale import getpreferredencoding" when there's a dir named "locale" in current dir
Type: behavior Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.3
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Cravix, christian.heimes
Priority: normal Keywords:

Created on 2013-01-02 05:54 by Cravix, last changed 2013-01-02 08:20 by Cravix. This issue is now closed.

Files
File name Uploaded Description Edit
locale.zip Cravix, 2013-01-02 08:03
Messages (5)
msg178799 - (view) Author: Eiro Neemous (Cravix) Date: 2013-01-02 05:55
as title said, what's the problem?
msg178801 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-01-02 07:54
I'm not able to reproduce the issue. Please provide a step by step description of what you did. Does the locale directory contain any files?
msg178802 - (view) Author: Eiro Neemous (Cravix) Date: 2013-01-02 08:03
@Christian:
Sorry that I didnt' attached test file= =
It was long ago that I met this problem, so forget some details= =
The right description is "cannot do 'from locale import getpreferredencoding'".
please extract the attached zip file and test "from locale import getpreferredencoding".
msg178803 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-01-02 08:13
Your locale directory contains a __init__.py file. The file causes the directory to become a Python package, that shadows the locale module from Python's standard library. Please remove the __init__.py file and __pycache__ directory to fix your problem.
msg178804 - (view) Author: Eiro Neemous (Cravix) Date: 2013-01-02 08:20
@Christian:
OK, get it,
thank you for your explanation :-)
History
Date User Action Args
2013-01-02 08:20:23Cravixsetstatus: open -> closed

messages: + msg178804
2013-01-02 08:13:06christian.heimessetmessages: + msg178803
2013-01-02 08:03:04Cravixsetfiles: + locale.zip

messages: + msg178802
title: fail to "import locale" when there's a dir named "locale" in current dir -> fail to "from locale import getpreferredencoding" when there's a dir named "locale" in current dir
2013-01-02 07:54:06christian.heimessettype: compile error -> behavior

messages: + msg178801
nosy: + christian.heimes
2013-01-02 05:57:03Cravixsettitle: fail to import "locale" module when there's a dir named "locale" in pwd -> fail to "import locale" when there's a dir named "locale" in current dir
2013-01-02 05:55:41Cravixsettype: compile error
messages: + msg178799
title: fail to import "locale" module when there -> fail to import "locale" module when there's a dir named "locale" in pwd
2013-01-02 05:54:36Cravixcreate