[issue16974] when python -c command does a traceback, it open the file string

2014-12-11 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___

[issue16974] when python -c command does a traceback, it open the file string

2013-01-16 Thread R. David Murray
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

[issue16974] when python -c command does a traceback, it open the file string

2013-01-16 Thread R. David Murray
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

[issue16974] when python -c command does a traceback, it open the file string

2013-01-16 Thread Ramchandra Apte
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

[issue16974] when python -c command does a traceback, it open the file string

2013-01-15 Thread Eric Lammerts
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

[issue16974] when python -c command does a traceback, it open the file string

2013-01-15 Thread R. David Murray
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

[issue16974] when python -c command does a traceback, it open the file string

2013-01-15 Thread Ramchandra Apte
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 ___

[issue16974] when python -c command does a traceback, it open the file string

2013-01-15 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list

[issue16974] when python -c command does a traceback, it open the file string

2013-01-15 Thread Eric Lammerts
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 ___