[Webware-discuss] Library Dirs and Python 2.5

Hello all,
I have a directory named "lib" in my working directory where I keep a
SitePage.py file and call "from lib.SitePage import SitePage" at the top
of all of my pages like it is described in some of the docs. This has
always worked fine use Python 2.4. I recently upgraded to Python 2.5 and
am now getting an error:
ImportError: No module named lib.SitePage
Here's where the bizarreness starts... I put a breakpoint right before
the call to "from lib.SitePage import SitePage" so I can see what is
going on. The directory that contains the "lib" package *IS* in
sys.path. I can import all other packages in that same directory (except
for the "lib" package and one other package I have in there called
"etc"). I can also start a python shell from the working directory in
question and "import lib" just fine.
Is Webware (0.9.2) doing anything funny with the __import__ mechanism?
It only occurs in Python 2.5... Python 2.4 seems to function as
expected.
-Seth
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

Thread view

Hello all,
I have a directory named "lib" in my working directory where I keep a
SitePage.py file and call "from lib.SitePage import SitePage" at the top
of all of my pages like it is described in some of the docs. This has
always worked fine use Python 2.4. I recently upgraded to Python 2.5 and
am now getting an error:
ImportError: No module named lib.SitePage
Here's where the bizarreness starts... I put a breakpoint right before
the call to "from lib.SitePage import SitePage" so I can see what is
going on. The directory that contains the "lib" package *IS* in
sys.path. I can import all other packages in that same directory (except
for the "lib" package and one other package I have in there called
"etc"). I can also start a python shell from the working directory in
question and "import lib" just fine.
Is Webware (0.9.2) doing anything funny with the __import__ mechanism?
It only occurs in Python 2.5... Python 2.4 seems to function as
expected.
-Seth
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

Seth Remington wrote:
> Is Webware (0.9.2) doing anything funny with the __import__ mechanism?
> It only occurs in Python 2.5... Python 2.4 seems to function as
> expected.
Yes, Webware employs an "ImportSpy" so that the AutoReloadAppServer
knows when to restart. Python 2.5 changed some subtle details of the
import mechanisms which can cause such problems in Webware 0.9.2.
I have already fixed this in Webware 0.9.3. Can you try with the new
version and let me know how it works?
-- Christoph

On Mon, 2007-04-30 at 23:07 +0200, Christoph Zwerschke wrote:
> Seth Remington wrote:
> > Is Webware (0.9.2) doing anything funny with the __import__ mechanism?
> > It only occurs in Python 2.5... Python 2.4 seems to function as
> > expected.
>
> Yes, Webware employs an "ImportSpy" so that the AutoReloadAppServer
> knows when to restart. Python 2.5 changed some subtle details of the
> import mechanisms which can cause such problems in Webware 0.9.2.
>
> I have already fixed this in Webware 0.9.3. Can you try with the new
> version and let me know how it works?
>
> -- Christoph
Thank you for the quick response Christoph. I tried Webware 0.9.3 and it
works fine.
-Seth
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details