pdb bug and questions

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Sep 4 23:55:53 EDT 2008


En Thu, 04 Sep 2008 18:22:50 -0300, Stef Mientki <stef.mientki at gmail.com>  
escribió:

(Sorry, I cannot help you with your main question)

> When I launch the debugger ( winXP, Python 2.5) from with my editor
>   python -u -m pdb  D:\\Data\\test_IDE.py
> I get this error
>   IOError: (2, 'No such file or directory', 'D:\\Data\test_IDE.py')
> NOTICE 1 backslash ----------------------------------^
>
> If I launch the debugger with
>   python -u -m pdb  D:/Data/test_IDE.py
> It runs fine.

How do you launch the debugger from your editor? The "python -u -m ..." is  
a command line, and should contain D:\Data\test_IDE.py (with backslashes).  
Read your editor's documentation on how to put those backslashes there.  
Python doesn't process or "cook" the arguments in any way, whatever the  
editor passes in the command line, is what Python will get as arguments.

> Although I mostly use os.path.join to be OS independent,
> these kind of bugs give me the impression,
> that I can better do the join myself and always use forward slashes.
> Is this a valid conclusion ?

Not directly from this evidence - the issue is not directly related to  
Python.
I'd use the generic path functions in os.path - like os.path.join, split,  
splitext, dirname, basename... The / separator may work most of the time  
on Windows, but not always, and it is not universal. Look at this file  
path in VMS:
cdrom2:[dir1.dir2.dir3]filename.ext;24

-- 
Gabriel Genellina




More information about the Python-list mailing list