Apology to Bill Gates (was Re: ASV module, CVS modules)

Pete Gilbert Peter.Gilbert at uwe.ac.uk
Mon Mar 4 04:08:16 EST 2002


Tim Peters <tim.one at comcast.net> writes:

> [John Machin -- maybe]
> >     my_data.input_from_file("c:\test_data.csv", ASV.CSV(),
> >   File "C:\PYTHON22\ASV.py", line 222, in input_from_file
> >     file = open(input_file, "rb")
> > IOError: invalid argument: rb
> > Bill behaving badly: Seems like Bill chucks a wobbly if there is
> > a_bloody_tab_character in a file name. I could be maligning Bill
> > unjustly; could be GvR & Co -- I'll have a look at the Python source
> > in a minute -- but I'd bet a couple of pots of beer that it's down to
> > Bill.
> 
> Under Python 2.2 on Win98SE I get this:
> 
> Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> open('c:\test_data.csv', 'rb')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> IOError: [Errno 2] No such file or directory: 'c:\test_data.csv'
> >>>
> 
> Also under 2.1 and 2.0, except under 2.0 the detail reads
> 
> IOError: [Errno 2] No such file or directory: 'c:\011est_data.csv'
> 
> instead.
> 
You must remember to "escape" the backslashes in path names with
a backslash, so for the above:
('c:\test_data.csv', 'rb')
should read:
('c:\\test_data.csv', 'rb')

Hope this helps
Pete

-- 
Pete Gilbert                
UWE,  Bristol	   	




More information about the Python-list mailing list