We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8aa94a0 + e5cb5e6 commit 1c40dceCopy full SHA for 1c40dce
src/DIRAC/Core/Utilities/DEncode.py
@@ -499,7 +499,13 @@ def encodeDict(dValue, eList):
499
printDebugCallstack("Encoding dict with numeric keys")
500
501
eList.append(b"d")
502
- for key in sorted(dValue):
+ if six.PY2:
503
+ iterVar = sorted(dValue)
504
+ else:
505
+ # Some systems write dictionaries which a mix of string + int keys
506
+ # Only remove sorted with Python 3 to minimise the chance of regressions
507
+ iterVar = dValue
508
+ for key in iterVar:
509
g_dEncodeFunctions[type(key)](key, eList)
510
g_dEncodeFunctions[type(dValue[key])](dValue[key], eList)
511
eList.append(b"e")
0 commit comments