Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Proposal: go back to enabling DeprecationWarning by default

Paul Moorep.f.moore at gmail.com
Mon Nov 6 05:21:54 EST 2017


On 6 November 2017 at 03:38, Nick Coghlan <ncoghlan at gmail.com> wrote:> - if we ever write "import foo" ourselves, then we're a Python> developer, and it's our responsibility to work out how to manage> DeprecationWarning when it gets raised by either our own code, or the> libraries and frameworks that we useAs someone who was bitten by this when deprecation warnings weredisplayed by default, what's the process for suppressing deprecationwarnings in modules that I import (and hence have no control over)*without* also suppressing them for my code (where I do want to fixthem, so that my users don't have a problem)?That's the complicated bit that needs to be in the docs - more so thana simple pointer to how to suppress the warning altogether.On 6 November 2017 at 06:38, Nick Coghlan <ncoghlan at gmail.com> wrote:> Put "PYTHONWARNINGS=ignore::DeprecationWarning" before whatever> command is giving them the warnings.>> Even on Windows, you can put that in a batch file with the actual> command you want to run and silence the warnings that way.Batch files do not behave the same in Windows as standard executables.Having to wrap a "normal application" (for example, a script wrapperinstalled via "pip install package" in a bat file is (a) messy forinexperienced users, and (b) likely to cause weird errors (for examplenesting bat files is broken, so you can't use a "wrapped" commandtransparently in another bat file without silent errors).Paul


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp