Modify ↓
Ticket #199 (new defect)
Opened 23 months ago
"\U"-style escape sequences cannot be loaded if python was not compiled with UCS4
| Reported by: | anonymous | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description
If python was built with UCS2 (the default, for example, on OS X), you get:
>>> yaml.load('"\U0001D10C"')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/yaml/__init__.py", line 71, in load
return loader.get_single_data()
File "/Library/Python/2.7/site-packages/yaml/constructor.py", line 37, in get_single_data
node = self.get_single_node()
File "/Library/Python/2.7/site-packages/yaml/composer.py", line 35, in get_single_node
if not self.check_event(StreamEndEvent):
File "/Library/Python/2.7/site-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/Library/Python/2.7/site-packages/yaml/parser.py", line 143, in parse_implicit_document_start
StreamEndToken):
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 116, in check_token
self.fetch_more_tokens()
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 248, in fetch_more_tokens
return self.fetch_double()
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 656, in fetch_double
self.fetch_flow_scalar(style='"')
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 667, in fetch_flow_scalar
self.tokens.append(self.scan_flow_scalar(style))
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 1156, in scan_flow_scalar
chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))
File "/Library/Python/2.7/site-packages/yaml/scanner.py", line 1223, in scan_flow_scalar_non_spaces
chunks.append(unichr(code))
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>
Attachments
Note: See
TracTickets for help on using
tickets.
