[issue1514420] Traceback display code can attempt to open a file named ""

2021-09-20 Thread Łukasz Langa
Łukasz Langa added the comment: Fixed for Python 3.11. Thanks! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue1514420] Traceback display code can attempt to open a file named ""

2021-09-20 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset f71300cb0442f16ee9abc938e12537aec1eb5979 by Irit Katriel in branch 'main': bpo-1514420: Do not attempt to open files with names in <>s when formatting an exception (GH-28143)

[issue1514420] Traceback display code can attempt to open a file named ""

2021-09-03 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 ___ Python tracker ___ ___

[issue1514420] Traceback display code can attempt to open a file named ""

2021-09-03 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +26582 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28143 ___ Python tracker ___

[issue1514420] Traceback display code can attempt to open a file named ""

2020-12-15 Thread Irit Katriel
Irit Katriel added the comment: Ok, I'm unconfused now - this is the C version of the traceback, in _Py_DisplaySourceLine, not the traceback.py one that uses linecache. It wouldn't be hard to add the check for "<>" in the filename there. Is there a reason not to do it? --

[issue1514420] Traceback display code can attempt to open a file named ""

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: I was able to reproduce it on 3.8, but I'm confused about where the open is happening because linecache.updatecache tries to avoid this: if not filename or (filename.startswith('<') and filename.endswith('>')): return [] -- nosy: +iritkatriel

[issue1514420] Traceback display code can attempt to open a file named stdin

2014-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: The problem is not in the import, but when displaying the traceback of the exception. In other words, if you catch the exception, no attempt to open stdin happens: $ strace -e open ./python [...] Python 3.5.0a0 (default:3417a95df7e2, Apr 16 2014, 17:57:12)

[issue1514420] Traceback display code can attempt to open a file named stdin

2014-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Also, by construction it will only happen if the import happens under the interpreter prompt (hence the stdin filename). I honestly don't think this deserves introducing some complication, only to avoid a couple filesystem accesses. --