01-arcadia.patch 955 B

1234567891011121314151617181920212223
  1. --- contrib/python/PyYAML/py2/yaml/scanner.py (index)
  2. +++ contrib/python/PyYAML/py2/yaml/scanner.py (working tree)
  3. @@ -26,6 +26,8 @@
  4. __all__ = ['Scanner', 'ScannerError']
  5. +import sys
  6. +
  7. from error import MarkedYAMLError
  8. from tokens import *
  9. @@ -1220,7 +1222,10 @@ class Scanner(object):
  10. "expected escape sequence of %d hexdecimal numbers, but found %r" %
  11. (length, self.peek(k).encode('utf-8')), self.get_mark())
  12. code = int(self.prefix(length), 16)
  13. - chunks.append(unichr(code))
  14. + if code <= sys.maxunicode:
  15. + chunks.append(unichr(code))
  16. + else:
  17. + chunks.append(('\\U%08x' % code).decode('unicode-escape'))
  18. self.forward(length)
  19. elif ch in u'\r\n\x85\u2028\u2029':
  20. self.scan_line_break()