From: SourceForge.net <no...@so...> - 2007-07-07 23:11:49
|
Bugs item #1719528, was opened at 2007-05-15 14:16 Message generated for change (Settings changed) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1719528&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None >Group: targeted for 2.2rc2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: David R. Handy (davidhandy) Assigned to: Nobody/Anonymous (nobody) Summary: jython -c "import package" fails (2.2b2) Initial Comment: Importing a package via the -c command-line option is not working for me in Jython 2.2b2. It does work from an interactive session and from a script. I am using the version of Jython installed by the official installer on Windows. Example session in Command Prompt window: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\davhan>mkdir C:\temp2 C:\Documents and Settings\davhan>cd C:\temp2 C:\temp2>mkdir p1 C:\temp2>copy nul p1\__init__.py 1 file(s) copied. C:\temp2>jython Jython 2.2b2 on java1.4.2_05 Type "copyright", "credits" or "license" for more information. >>> import p1 >>> p1.__file__ 'C:\\temp2\\p1\\__init__.py' >>> ^Z C:\temp2>jython -c "import p1" Traceback (innermost last): File "<string>", line 1, in ? ImportError: no module named p1 C:\temp2> ---------------------------------------------------------------------- Comment By: David R. Handy (davidhandy) Date: 2007-06-26 09:42 Message: Logged In: YES user_id=171902 Originator: YES I posted patch 1743594 containing the fix. ---------------------------------------------------------------------- Comment By: David R. Handy (davidhandy) Date: 2007-06-26 09:26 Message: Logged In: YES user_id=171902 Originator: YES This has a simple, one-line fix in jython.java which I have tested and have been using for weeks. I'll attempt to post my fix as an official "patch". I'm hope that the fix gets into Jython 2.2 soon. ---------------------------------------------------------------------- Comment By: David R. Handy (davidhandy) Date: 2007-05-15 15:28 Message: Logged In: YES user_id=171902 Originator: YES A simpler way to describe the problem is that running Jython 2.2b2 with the -c option doesn't put an empty string (representing the current directory) in sys.path like it used to do. C:\temp2>jython -c "import sys; print sys.path" ['C:\\home\\davhan\\tools\\jython2.2b2\\Lib', 'C:\\home\\davhan\\lib\\python', ' __classpath__', 'C:\\home\\davhan\\tools\\jython2.2b2'] C:\temp2>jython Jython 2.2b2 on java1.4.2_05 Type "copyright", "credits" or "license" for more information. >>> import sys; print sys.path ['', 'C:\\home\\davhan\\tools\\jython2.2b2\\Lib', 'C:\\home\\davhan\\lib\\python ', '__classpath__', 'C:\\home\\davhan\\tools\\jython2.2b2'] >>> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1719528&group_id=12867 |