Open mapellidario opened 3 years ago
@mapellidario just to make sure I understood what is expected from this issue. Is it supposed to happen only when WMCore is no longer supporting python2?
Well, eventually we changed the code in all of those places:
encodeUnicodeToBytesConditional(query, condition=PY3)
instead of query.encode('ascii')
Maybe we can change this issue in: "Change encodeUnicodeToBytesConditional(query, condition=PY3) to encodeUnicodeToBytes(query) after dropping support to py2", or something like that.
In any case you are correct, this issue was about cleaning up a bit our code after we drop support to py2
Impact of the new feature WMCore in general
Is your feature request related to a problem? Please describe.
When we switch to python 3, we can remove some of the compatibility code that is in place to make sure that dmwm/WMCore works in py2/py3 dual stack. We focus this issue on deprecating management of strings.
Describe the solution you'd like
_unicode()
as a temporary workaround. We should remove it when we finish the migration and we drop py2 support. We can just usestr
and remove that_unicode()
method completely from: WMQuality/Emulators/DBSClient/MockDbsApi.py and WMQuality/Emulators/RucioClient/MockRucioApi.py_unicode()
logic to lookup keys in the python dictionary (json file).src/python/WMCore/MicroService/TaskManager.py
: removekeyhash.update(query.encode('ascii'))
Describe alternatives you've considered We can leave it as it is, but we should really consider removing temporary workarounds :)