cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.32k forks source link

PySys_SetArgv is deprecated in python 3.11 #46057

Open Dr15Jones opened 1 month ago

Dr15Jones commented 1 month ago

We use the deprecated function here https://github.com/cms-sw/cmssw/blob/354a892ac8287945855334f57a27454c40671f25/FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc#L52

It appears that pybind11::initialize_interpreter() does optionally allow passing the argc/argv which would allow us to avoid calling the deprecated function.

Alternatively, PySys_SetArgvEx can be used in place of PySys_SetArgv although the documentation says that it is also not the preferred mechanism to do this ( see https://docs.python.org/3/c-api/init.html#c.PySys_SetArgvEx ).

Dr15Jones commented 1 month ago

assign core

Dr15Jones commented 1 month ago

FYI @davidlange6

cmsbuild commented 1 month ago

New categories assigned: core

@Dr15Jones,@makortel,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild commented 1 month ago

cms-bot internal usage

cmsbuild commented 1 month ago

A new Issue was created by @Dr15Jones.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here