Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16974
___
R. David Murray added the comment:
Ideally there would be an unambiguous way to know if the object came from a
file or some other source (say, __file__ is None and another special attribute
gives the clue to the actual source), but that's not the way things work now,
and for backward
R. David Murray added the comment:
Hmm. A backward compatible fix would be to add an attribute that indicates
whether or not the __file__ attribute is supposed to be pointing to a real file.
--
___
Python tracker rep...@bugs.python.org
Ramchandra Apte added the comment:
+1
On 16 January 2013 17:43, R. David Murray rep...@bugs.python.org wrote:
R. David Murray added the comment:
Ideally there would be an unambiguous way to know if the object came from
a file or some other source (say, __file__ is None and another special
New submission from Eric Lammerts:
$ echo lovely spam string
$ python -c 'open(nonexistent,r)'
Traceback (most recent call last):
File string, line 1, in module
lovely spam
IOError: [Errno 2] No such file or directory: 'nonexistent'
I see this in python 2.7.3 and 3.2.3 from Ubuntu
R. David Murray added the comment:
Heh. Nice find. I'm not sure how practical it is to fix, though. We don't
have any actual rules about what indicates a 'non-file-stand-in' for the
__file__ attribute, just a loose convention that it is an identifier in angle
brackets. If we make that a
Ramchandra Apte added the comment:
Well, it should't open string IMHO.
--
nosy: +ramchandra.apte
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16974
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16974
___
___
Python-bugs-list
Eric Lammerts added the comment:
Does it have to be an identifier in angle brackets? An empty string makes more
sense to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16974
___