garcia / synctools

A set of tools to assist syncing simfiles for StepMania
MIT License
9 stars 1 forks source link

YAML parser chokes on tab character #1

Open rdegra opened 11 years ago

rdegra commented 11 years ago

This looks like a YAML limitation but it'd be trivial to replace \t characters with four spaces before parsing.

{'initialize': False, 'backup': True}
Initializing GimmickBuilder...
Processing The 2nd Law...
Loading gimmicks from file 'C:\\Users\\Robyn\\OpenITG\\Songs\\Reject - 5 (Aug 2013 - )\\The 2nd Law Unsustainable\\gimmicks.txt'
Traceback (most recent call last):
  File "C:\Users\Robyn\Desktop\Resources\synctools-0.9.0\dist\.\synctools\gui\gui.py", line 201, in run_button
  File "C:\Users\Robyn\Desktop\Resources\synctools-0.9.0\dist\.\synctools\commands\gimmickbuilder.py", line 103, in run
  File "yaml\__init__.pyc", line 71, in load
  File "yaml\constructor.pyc", line 37, in get_single_data
  File "yaml\composer.pyc", line 36, in get_single_node
  File "yaml\composer.pyc", line 55, in compose_document
  File "yaml\composer.pyc", line 84, in compose_node
  File "yaml\composer.pyc", line 133, in compose_mapping_node
  File "yaml\composer.pyc", line 84, in compose_node
  File "yaml\composer.pyc", line 127, in compose_mapping_node
  File "yaml\parser.pyc", line 98, in check_event
  File "yaml\parser.pyc", line 428, in parse_block_mapping_key
  File "yaml\scanner.pyc", line 116, in check_token
  File "yaml\scanner.pyc", line 257, in fetch_more_tokens
ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "C:\Users\Robyn\OpenITG\Songs\Reject - 5 (Aug 2013 - )\The 2nd Law Unsustainable\gimmicks.txt", line 6, column 1
Done.
garcia commented 11 years ago

This is indeed an issue in the YAML parser; someone else pointed out the same issue to me a few months ago and I forgot about it. I'm probably going to end up writing my own parser for the small subset of YAML that I use.