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

2021-09-27 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Traceback display code can attempt to open a file named "" ___ Python tracker _

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

2019-10-04 Thread AWhetter
AWhetter added the comment: If we were to add a new attribute to indicate whether a file is real or not, there would need to be a way for users to indicate whether a file is real or not to functions such as `compile()` (there's lots more!) that take a filename. Without enforcing this being s

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

2018-04-09 Thread Ned Deily
Change by Ned Deily : -- stage: -> needs patch versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___ ___

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

2014-12-11 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

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

2013-01-16 Thread Ramchandra Apte
Ramchandra Apte added the comment: +1 On 16 January 2013 17:43, R. David Murray 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 > attribute gives

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

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

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

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 compatibi

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

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 ___ __

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

2013-01-15 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

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

2013-01-15 Thread Ramchandra Apte
Ramchandra Apte added the comment: Well, it should't open "" IMHO. -- nosy: +ramchandra.apte ___ Python tracker ___ ___ Python-bugs-li

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

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 ha

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

2013-01-15 Thread Eric Lammerts
New submission from Eric Lammerts: $ echo lovely spam > "" $ python -c 'open("nonexistent","r")' Traceback (most recent call last): File "", line 1, in 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 12.04. ---