[v7r1] Fix use of io.open in BundleDeliveryClient#4728
Conversation
You mean in general or just this specific case ? I seem to have understand that |
Having just seen this specific issue, I think in general. A bunch of file modes are specified incorrectly in DIRAC, presumably to avoid the error I talk about on the next line.
On Python2 As DIRAC mostly assumes everything is ASCII and just uses Python 2 |
|
Is there a good (ultimate) guide which brings together all the recipes of how to use all the python3 encode/decode/unicode/... string manipulation madness ? |
The page I'd suggest giving a read is: https://portingguide.readthedocs.io/en/latest/strings.html That said, it doesn't really apply as DIRAC is broken for unicode as it uses |
|
@atsareg I liked this reading too https://www.oreilly.com/library/view/fluent-python/9781491946237/ch04.html |
In #4643 various uses of
io.openwhere added. InBundleDeliveryClientthis was incorrect as the written object was still astrtype instead ofunicode. The exception is caught by theexcept BaseExceptionand has the effect of causing the CAs and CRLs to be downloaded every time as the.dab.CAsand.dab.CRLsfiles are always empty causing the hash to never match with the server version.As DIRAC isn't going to convert every
strobject tounicodebefore migrating to Python 3 it makes sense to stick toopen()instead of usingio.open().BEGINRELEASENOTES
*Framework
FIX: Fix hashing of local CA and CRL bundles
ENDRELEASENOTES