[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2019-10-22 Thread STINNER Victor
Change by STINNER Victor : -- resolution: fixed -> duplicate superseder: -> warnings: get filename from frame.f_code.co_filename ___ Python tracker ___

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2019-10-22 Thread STINNER Victor
STINNER Victor added the comment: Fixed in bpo-33375. commit 11a896652ee98aa44e59ed25237f9efb56635dcf Author: Thomas Kluyver Date: Fri Jun 8 21:28:37 2018 +0200 bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622) More consistent with how other parts of

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2012-11-17 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-09-27 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-05-30 Thread Benjamin Peterson
Benjamin Peterson added the comment: First of all, your patch needs a test. -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Pyt

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-05-30 Thread Sebastian
Sebastian added the comment: any news on this? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-05-25 Thread Sebastian
Sebastian added the comment: attached a patch for this issue now. Now it first uses the name of the script, instead of __file__. -- keywords: +patch Added file: http://bugs.python.org/file17461/_warnings.c.patch ___ Python tracker

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-05-25 Thread Sebastian
Sebastian added the comment: Oh, damn. I really forgot the argv filename thing. Nevermind :) But back to topic. __file__ might be not the best solution for that. What does Python when embedded, and __file__ is not set? That can happen when the source of your code is not a file (multiline text

[issue8787] warnings inside PyRun_SimpleString() display argv[1]

2010-05-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Yes, the warnings module tries to display the file name. Inside PyRun_SimpleString(), globals()['__name__'] == '__main__', and the warnings module supposes that argv[1] is the name of the script. I wonder whether __file__ would be more accurate: it is f