PEP on path module for standard library
Reinhold Birkenfeld
reinhold-birkenfeld-nospam at wolke7.net
Thu Jul 21 17:56:18 EDT 2005
Michael Hoffman wrote:
> mkent at webmd.net wrote:
>> I really love Jason's 'path' module. Sadly, I've encountered a serious
>> problem with using it. When you try to 'freeze' an application module,
>> and Jason's 'path' module is present in any of the directories that are
>> looked at by freeze's module finder (your app doesn't have to import
>> it), freeze goes into an infinite loop of imports, eventually getting a
>> 'maximum recursion depth' exception. This seems to be related to
>> freeze getting confused between 'os.path' and Jason's 'path'.
>>
>> I encountered this using Jason's latest 'path' module and Python 2.3.2.
>> I was able to solve it for my use by renaming path.py to newpath.py
>> and using 'from newpath import path' in my modules.
>>
>> I've just notified Jason about this. I presume a solution like mine
>> will be used, and look forward to seeing Jason's module in stdlib.
>
> This sounds like a bug in "freeze" rather than something that should be
> worked around in the standard library. Although there have already been
> people opposed to naming it path because the duplication with os.path
> might confuse humans.
As the most likely placement will be a class named "Path" inside the "os.path"
module, that bug with freeze won't apply to the "stdlib version" of Path.
Reinhold
More information about the Python-list
mailing list