STINNER Victor <victor.stin...@gmail.com> added the comment:

I was explicitly asked to not change the behaviour of BytesWarning with -X dev.

-X dev documentation doesn't menton -Wd/-Wdefault anymore:
https://docs.python.org/dev/using/cmdline.html#id5

"Warning filters: add a filter to display all warnings ("default" action), 
except of BytesWarning which still depends on the -b option, and use "always" 
action for ResourceWarning warnings. For example, display DeprecationWarning 
warnings."

Another implementation issue is subprocess._args_from_interpreter_flags() which 
was unable to properly "rebuild" the -X dev option from sys.warnoptions. I mean 
that it's now simpler and safer with sys.flags.dev_mode.

But I agree that the fact that -X dev doesn't touch sys.warnoptions is 
surprising and can cause issues. IMHO sys.warnoptions shouldn't exist in the 
first place. It looks like a hack to pass options from the C main() function to 
the warnings initilization code. But it's not like we can remove it right now 
:-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32230>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to