[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

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

2012-11-17 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- nosy: -brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8787 ___ ___ Python-bugs-list

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

2010-09-27 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: brett.cannon - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8787 ___ ___ Python-bugs-list

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

2010-05-30 Thread Sebastian
Sebastian python.10.webmas...@spamgourmet.com added the comment: any news on this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8787 ___ ___

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

2010-05-30 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: First of all, your patch needs a test. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8787 ___

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

2010-05-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com 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

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

2010-05-25 Thread Sebastian
Sebastian python.10.webmas...@spamgourmet.com 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

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

2010-05-25 Thread Sebastian
Sebastian python.10.webmas...@spamgourmet.com 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