Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty line * causing parsing error #363

Open
Argmaster opened this issue Jan 20, 2025 · 1 comment
Open

Empty line * causing parsing error #363

Argmaster opened this issue Jan 20, 2025 · 1 comment
Labels
compatibility Request for compatibility with some other tool / library version help wanted Extra attention is needed

Comments

@Argmaster
Copy link
Owner

I got same error message when I parse a GBS file.

here is my code:


from pygerber.gerberx3.api.v2 import FileTypeEnum, GerberFile

parsed_file = GerberFile.from_file(

    "./80600_50_6-ISS1/80600_50_6-ISS1_bott_resist.GBS",

    file_type=FileTypeEnum.INFER_FROM_ATTRIBUTES

).parse()

print(parsed_file.get_info())

print(parsed_file.get_file_type())

here I attach my gerber zip file:

80600_50_6-ISS1.zip

please advise how to solve it.

Thanks,

Lily

80600_50_6-ISS1.zip

Originally posted by @lily-PHP in #361

@Argmaster
Copy link
Owner Author

Argmaster commented Jan 20, 2025

@lily-PHP thank you for reporting the issue. I think that the problem is caused by * present in empty lines not preceded by any command. I am not sure if it violates the standard but we could add a workaround since i cant see a reason why this would be disruptive. I will work on that soon. If you were interested in contributing this fix yourself, you could try adding in line 371 in src/pygerber/gerberx3/tokenizer/grammar.py just after | comment

            | Suppress("*")

@Argmaster Argmaster added help wanted Extra attention is needed compatibility Request for compatibility with some other tool / library version labels Jan 25, 2025
@Argmaster Argmaster moved this to Todo in PyGerber Jan 25, 2025
@Argmaster Argmaster added this to the Distant Future milestone Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Request for compatibility with some other tool / library version help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

1 participant