[v7r2] Functional DIRAC client for Python 3#4731
Conversation
Co-authored-by: fstagni <federico.stagni@cern.ch>
|
Without looking at chrisburr@fc9c3c7#diff-243fb299d5af97760799bfe30f97e051 in depth, I'd like to propose an alternative, which we would benefit anyway with HTTPS: stop sending bytes from the CS. We anyway must use Just to add, there was always the consensus that the actual client (like |
That would break using clients that use the previous DIRAC version wouldn't it? I agree that it should be done, but I think it would be simpler to make it so that HTTPS clients always use base64 and DISET continues with the status quo.
I don't think there is any danger with the solution I currently have as it does nothing on Python 2. It just allows calling functions to say "I expect bytes to come out of this function" which only has an effect in Python 3 and once DISET it removed the option will disappear with it. |
|
a
I do think there is :-D As I said, if that is really something we want to keep, then we should add it in the specific client (in that case, only the CS client), which is much less invasive. It's maybe not the nicest, but I really don't like the idea of mangling in the serialization and the |
With these changes the certification hackathon tests pass for a client installed using the
environment-py3.yamlfile that is used for the unit tests. Next I'll work on getting DIRACOS working so we can usedirac-install.pyas well.As this builds on #4726 which hasn't been merged, see here for the diff chrisburr/DIRAC@run-py3-pytest...python3-client. As usual for these changes, reviewing individual commits might be easier that the entire PR.
The biggest change is chrisburr@fc9c3c7#diff-243fb299d5af97760799bfe30f97e051 where I add a
forceBytes=Falsekeyword argument to therecieveDatapart of RPC calls. This is needed to make it possible to say that the data being received is supposed to bebytesinstead of astras most of DIRAC's use ofstris actually ASCII text. This option is only actually needed in a couple of places (downloading the compressed CS and sending files) and the only alternatives I can think are much worse:unicodeinstead ofstrso Python 2 behaves like Python 3EDIT with another idea: The
forceBytes=Trueparameter is only needed when receiving data forFileHelper.receiveDataand the CSgetCompressedDataIfNewer. This ends up being three lines:An alternative would be to add two new methods on the server side
getCompressedBase64DataIfNewer/receiveBase64Dataand deprecate the existing methods.BEGINRELEASENOTES
*Python 3
NEW: Client installation is now functional with Python 3
ENDRELEASENOTES