On 03:57 pm, gu...@python.org wrote:
On Fri, Feb 5, 2010 at 5:28 AM, Antoine Pitrou <solip...@pitrou.net>
wrote:
Pascal Chambon <pythoniks <at> gmail.com> writes:
By the way, I'm having trouble with the "name" attribute of raw
files,
which can be string or integer (confusing), ambiguous if containing a
relative path,
Why is it ambiguous? It sounds like you're using str() of the name and
then can't tell whether the file is named e.g. '1' or whether it
refers to file descriptor 1 (i.e. sys.stdout).
I think string/integer and ambiguity were different points. Here's the
ambiguity:
exar...@boson:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on
linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import os, io
>>> f = io.open('.bashrc')
>>> os.chdir('/')
>>> f.name
'.bashrc'
>>> os.path.abspath(f.name)
'/.bashrc'
>>>
Jean-Paul
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com