Fix escaping issue in ansiballz wrapper for sitecustomize (#86236)

* Fix escaping issue in ansiballz wrapper for sitecustomize

* add clog frag
pull/86158/head
sivel / Matt Martz 1 week ago committed by GitHub
parent bff3a9aeb9
commit 6bb7bd760f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- modules - fix AnsiballZ wrapper code escaping of sitecustomize

@ -121,7 +121,7 @@ def _ansiballz_main(
z = zipfile.ZipFile(modlib_path, mode='a')
# py3: modlib_path will be text, py2: it's bytes. Need bytes at the end
sitecustomize = u'import sys\\nsys.path.insert(0,"%s")\\n' % modlib_path
sitecustomize = 'import sys\nsys.path.insert(0, "%s")\n' % modlib_path
sitecustomize = sitecustomize.encode('utf-8')
# Use a ZipInfo to work around zipfile limitation on hosts with
# clocks set to a pre-1980 year (for instance, Raspberry Pi)

Loading…
Cancel
Save