Issue1256506

classification
Title: Importing directory module with 12+ char name fails in 2.2a1
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: blfgomes, fwierzbicki, nobody
Priority: normal Keywords:

Created on 2005-08-11.08:29:20 by anonymous, last changed 2005-11-04.12:49:42 by fwierzbicki.

Messages
msg1016 (view) Author: Nobody/Anonymous (nobody) Date: 2005-08-11.08:29:20
Importing a module, which is implemented as a directory
with a __init__.py, fails if directory name is 12
characters or longer. If the module is a regular .py
file importing it works ok. See the listing below for
an example.

Bug seems to be specific to Jython 2.2 alpha 1 since
importing works ok with Jython 2.1 and Python 2.4. I'm
using Sun Java 1.5 but the problem appeared also with
Java 1.4.

--------8<----------------8<----------------

$ uname
CYGWIN_NT-5.1

$ java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed
mode, sharing)

$ ls -lR 
.:
total 32
drwxr-xr-x  2 peke None 0 Aug 11 09:35 mod_dir__11/
drwxr-xr-x  2 peke None 0 Aug 11 09:58 mod_dir___12/
-rw-r--r--  1 peke None 8 Aug 11 09:58 mod_file_11.py
-rw-r--r--  1 peke None 8 Aug 11 09:58 mod_file__12.py

./mod_dir__11:
total 16
-rw-r--r--  1 peke None 8 Aug 11 09:57 __init__.py

./mod_dir___12:
total 16
-rw-r--r--  1 peke None 8 Aug 11 09:58 __init__.py

$ /cygdrive/c/jython-2.2a1/jython.bat
Jython 2.2a1 on java1.5.0_02 (JIT: null)
Type "copyright", "credits" or "license" for more
information.
>>> import mod_file_11
>>> import mod_file__12 
>>> import mod_dir__11
>>> import mod_dir___12
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named mod_dir___12
>>> 
msg1017 (view) Author: Nobody/Anonymous (nobody) Date: 2005-08-11.08:34:30
Logged In: NO 

The difference in Java versions when running "java -version"
(1.5.0_04) and starting Jython (1.5.0_02) was due to not
updating jython.bat after a Java update. Tested now also
after the update with same results.
msg1018 (view) Author: Bruno Gomes (blfgomes) Date: 2005-10-24.21:17:00
Logged In: YES 
user_id=1367276

I submitted a patch for this, take a look at:

http://sourceforge.net/tracker/?func=detail&atid=312867&aid=1336768&group_id=12867
msg1019 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2005-11-04.12:49:42
Logged In: YES 
user_id=193969

Fix from blgomes applied.
History
Date User Action Args
2005-08-11 08:29:20anonymouscreate