a3ng7n / Altium-Schematic-Parser

Converts Altium .SchDoc files into json
MIT License
31 stars 6 forks source link

unable to parse SchDoc #12

Closed sirus20x6 closed 5 months ago

sirus20x6 commented 5 months ago
python ./altium_schematic_parser/parse.py -o ./hub.json -f all-hierarchy ../../rpi4_rtc_usb/pi_rtc_hat.SchDoc 
/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py:18: SyntaxWarning: invalid escape sequence '\|'
  pattern = re.compile(b'.{3}\x00\x00\|')
/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py:95: SyntaxWarning: invalid escape sequence '\d'
  p = re.compile('^(?P<prefix>X)(?P<index>\d+)$')
/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py:84: SyntaxWarning: "is" with 'str' literal. Did you mean "=="?
  "records": [ record for record in schematic["records"] if record["RECORD"] is "1" ]
Traceback (most recent call last):
  File "/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py", line 251, in <module>
    main(args)
  File "/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py", line 228, in main
    schematic = parse(**vars(args))
                ^^^^^^^^^^^^^^^^^^^
  File "/run/media/sirus/aux/code/git/Altium-Schematic-Parser/./altium_schematic_parser/parse.py", line 33, in parse
    datum[data[0].decode()] = data[1].decode('utf-8', 'ignore')
a3ng7n commented 5 months ago

I haven't updated this in a long long while, so the python version it was developed with might be old. Which version of python were you using?

sirus20x6 commented 5 months ago

this was 3.12 but I think switching to 3.11 fixed it

a3ng7n commented 5 months ago

Glad to hear it. Going to advertise there's a python version restriction in the readme for now and close this, and put support for 3.12+ on the back burner if I (or someone else) gets around to it.