Issue1336768

classification
Title: Fix for bug [ 1256506 ] Importing package with 12+ chars
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: blfgomes, fwierzbicki
Priority: normal Keywords: patch

Created on 2005-10-24.21:09:21 by anonymous, last changed 2005-11-04.01:56:51 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
imp.diff.txt nobody, 2005-10-24.21:09:21 Diff file for org/jython/core/imp.java
Messages
msg2467 (view) Author: Nobody/Anonymous (nobody) Date: 2005-10-24.21:09:21
This bug was introduced in version 2.65.2.1 of
org/python/core/imp.java when the method

static PyObject loadFromPath(String name, String
modName, PyList path)

was substituted by the method

static PyObject loadFromSource(String name, String
modName, PyObject entry).

In this new method, case checks for files "__init__.py"
and "__init__$py.class" are being made passing the
length of the package's name. When the case of the
"__init__.py" file inside a directory named
"mod456789012" is checked, for instance, the name of
this file is compared against the string "__init__.py",
char by char in 12 iterations, since "mod456789012" has
12 characters. Since "__init__.py" has only 11
characters, the comparison fails and the package isn't
imported.

This bug is fixed by passing the correct length to the
method that does the case checking.
msg2468 (view) Author: Bruno Gomes (blfgomes) Date: 2005-10-24.21:13:21
Logged In: YES 
user_id=1367276

Apparently I wasn't logged in when I submitted it... Sorry =)
msg2469 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2005-11-04.01:56:51
Logged In: YES 
user_id=193969

Thanks Bruno Gomes -- I've applied the patch.
History
Date User Action Args
2005-10-24 21:09:21anonymouscreate