PyGerber Bug Report
Mandatory checks
Checks listed below are mandatory for opening a new issue.
If haven't done any of the checks listed below, please do that, we will not look into
the issue until all of the checks in mandatory checks section are checked.
Before opening this issue:
This is my code
from pygerber.examples import ExamplesEnum, get_example_path
from pygerber.gerberx3.api.v2 import ColorScheme, GerberFile, PixelFormatEnum
GerberFile.from_file(
"GerberKicad/dse_vmj_ex_004_legend_top.gbr",
).parse().render_raster(
"output.png",
dpmm=100,
color_scheme=ColorScheme.COPPER_ALPHA,
pixel_format=PixelFormatEnum.RGBA,
)
It shows
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/rajki/Downloads/Glonix/vm.py", line 6, in <module>
).parse().render_raster(
^^^^^^^
File "/Users/rajki/Downloads/Glonix/.venv/lib/python3.12/site-packages/pygerber/gerberx3/api/_v2.py", line 197, in parse
tokens = Tokenizer().tokenize(self.source_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rajki/Downloads/Glonix/.venv/lib/python3.12/site-packages/pygerber/gerberx3/tokenizer/tokenizer.py", line 49, in tokenize
return self._tokenize_grammar(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rajki/Downloads/Glonix/.venv/lib/python3.12/site-packages/pygerber/gerberx3/tokenizer/tokenizer.py", line 84, in _tokenize_grammar
ast = grammar.parse_string(source, parse_all=parse_all)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rajki/Downloads/Glonix/.venv/lib/python3.12/site-packages/pyparsing/core.py", line 1216, in parse_string
raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected End of file, found '%' (at char 198), (line:4, col:1)
Expected behavior
It has to render the image of the layer
Environment:
Please complete the following information:
- Operating system: [
macOS24.04]
- Python version: [
3.12.0]
- PyGerber version: [
2.4.2]
PyGerber Bug Report
Mandatory checks
Before opening this issue:
duplicate.
resolved or marked as won't fix.
known issue.
known issue.
This is my code
It shows
Expected behavior
It has to render the image of the layer
Environment:
Please complete the following information:
macOS24.04]3.12.0]2.4.2]