Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PilotBundle is not compatible with Python3 #7948

Open
hmiyake opened this issue Dec 13, 2024 · 0 comments
Open

PilotBundle is not compatible with Python3 #7948

hmiyake opened this issue Dec 13, 2024 · 0 comments
Assignees

Comments

@hmiyake
Copy link
Contributor

hmiyake commented Dec 13, 2024

There are several issues in DIRAC/Resources/Computing/PilotBundle.py to run on python3 environment.

At first,

    compressedAndEncodedProxy = base64.b64encode(bz2.compress(proxy.dumpAllToString()["Value"])).decode()

needs to be something like

    compressedAndEncodedProxy = base64.b64encode(bz2.compress(proxy.dumpAllToString()["Value"].encode())).decode()

This code runs on only python3, however the pilot wrapper generated by the module may run on both python2 and python3.

  open('proxy', "w").write(bz2.decompress(base64.b64decode("{compressedAndEncodedProxy}")))
  open('{executable}', "w").write(bz2.decompress(base64.b64decode("{compressedAndEncodedExecutable}")))

needs to switch to 'wb' under python3 environment

except Exception as x:
  print >> sys.stderr, x
  sys.exit(-1)
cmd = "./{executable}"
print 'Executing: ', cmd

print above should be rewritten for both python2 and python3.

@fstagni fstagni self-assigned this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants