swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

Couldn't open 'parser.out' & 'edn_format.parsetab' #65

Closed PlumpMath closed 4 years ago

PlumpMath commented 4 years ago

import edn_format edn_format.dumps({1,2,3}) '#{1 2 3}'

edn_format.loads("[1 true nil]") WARNING: Couldn't open 'parser.out'. [Errno 30] Read-only file system: 'python3-3.7.5-env/lib/python3.7/site-packages/edn_format/parser.out' Generating LALR tables WARNING: Couldn't create 'edn_format.parsetab'. [Errno 30] Read-only file system: 'python3-3.7.5-env/lib/python3.7/site-packages/edn_format/parsetab.py' [1, True, None]

edn_format.loads_all("1 2 3 4") WARNING: Couldn't open 'parser.out'. [Errno 30] Read-only file system: 'python3-3.7.5-env/lib/python3.7/site-packages/edn_format/parser.out' Generating LALR tables WARNING: Couldn't create 'edn_format.parsetab'. [Errno 30] Read-only file system: 'python3-3.7.5-env/lib/python3.7/site-packages/edn_format/parsetab.py' [1, 2, 3, 4]

bfontaine commented 4 years ago

Looks like Ply can’t write its cache files. There might be a way to remove these warnings as they don’t really prevent you from using edn_format.

bfontaine commented 4 years ago

Don’t worry about these warnings, they’re just informing you edn_format can’t write a parser debug file (parser.out) and the grammar tables cache (parsetab.py). It’s more efficient to write that cache because it’s reused in subsequent parse calls but it still works without that.

I made a PR to add a way to disable these warnings in https://github.com/swaroopch/edn_format/pull/66.