[2.6] \r does not round-trip the local socket, escape and restore on the other side (#43507)

(cherry picked from commit 9169daa)

Co-authored-by: Nathaniel Case <this.is@nathanielca.se>
pull/43532/merge
Nathaniel Case 6 years ago committed by Matt Clay
parent c687b1b874
commit dc477a3882

@ -209,6 +209,8 @@ def main():
raise Exception("EOF found before vars data was complete")
vars_data += cur_line
cur_line = stdin.readline()
# restore escaped loose \r characters
vars_data = vars_data.replace(br'\r', b'\r')
if PY3:
pc_data = cPickle.loads(init_data, encoding='bytes')

@ -928,6 +928,8 @@ class TaskExecutor:
stdin.write(b'\n#END_INIT#\n')
src = cPickle.dumps(variables, protocol=0)
# remaining \r fail to round-trip the socket
src = src.replace(b'\r', br'\r')
stdin.write(src)
stdin.write(b'\n#END_VARS#\n')

Loading…
Cancel
Save