[issue30726] [Windows] Warnings in elementtree due to new expat

STINNER Victor report at bugs.python.org
Wed Jul 5 02:44:55 EDT 2017


STINNER Victor added the comment:

Steve Dower: "The approach used to suppress this warning will also suppress other warnings that might be fixable. Hard to say it's definitely a good thing in this case, though in general I agree that selectively suppressing warnings that cannot be fixed is a good thing."

First of all, Modules/expat/ is a copy of https://github.com/libexpat/libexpat/. In the past, it contained significant patches. Today, it almost contains zero patch, the major addition is the pyexpatns.h file:

https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h

If someone considers that the following warning deserves a fix, please report it upstream:

Warning	C4996	'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	_elementtree	C:\Users\Segev\prj\python\cpython\Modules\expat\xmlparse.c	796	

I read the code, and I don't think that it deserves a fix. Using non-portable function _dupenv_s() makes the code a little bit more complex for a little benefit.

I agree that if libexpat is upgraded again, suppressing warnings can hide a future real bug. But right now, we embed a copy of libexpat 2.1.1 and I don't want to modify our downstream copy.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30726>
_______________________________________


More information about the Python-bugs-list mailing list