Idea for someone: Run with python warnings in --enable-developer mode

Andrew Bartlett abartlet at samba.org
Tue Mar 10 21:21:54 UTC 2020


We got a wake-up-call with "samba fails to build with Python 3.9:
invalid open() mode U"
https://bugzilla.samba.org/show_bug.cgi?id=14266

We need to find a way to run waf and selftest with python warnings
turned on.

It might be as simple as setting an environment variable in autobuild
or .gitlab-ci.yml, but my current gut feeling is to control it in waf
so we can see it during routine pre-commit testing.

I would like, just with our C warnings, for --disable-warnings-as-
errors to work, so we can still build older versions of Samba with
developer features on newer python (which might have deprecated things
we use). 

https://docs.python.org/3/library/warnings.html

I think we want to set PYTHONWARNINGS=error into the environment and
have waf set on itself
 
import warnings
    warnings.simplefilter("error")

Is anyone interested in taking this on?  Of course what follows would
be no doubt a pile of warning fixes, so it may not be a small task.  

Or should we put this up for GSoC?

Thanks!

Andrew Bartlett
-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT - Expert Open Source
Solutions
https://catalyst.net.nz/services/samba









More information about the samba-technical mailing list