• Kirill Smelkov's avatar
    Fix STRING encoding/decoding · f62fe97f
    Kirill Smelkov authored
    STRING is text-based opcode which is used at protocol 0 and follows
    \-escaped argument till EOL.
    
    - for encoding we must not use Go's %q, since that will use \u and \U
      when seeing corresponding bytes, and since Python does not interpret
      \u or \U in string literals, the data received at Python side will be
      different.
    
    - for decoding we must explicitly implement Python's 'string-escape'
      codec decoding which is used by Python's pickle for STRING opcode
      argument.
    
    Updates: https://github.com/kisielk/og-rek/issues/48
    f62fe97f
pyquote.go 3.19 KB