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

Fixing decodegraphics.py import error #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lucas-C
Copy link

@Lucas-C Lucas-C commented Jan 13, 2021

Given this code:

import os, pdfrw, sys
sys.path.append(os.path.join(os.path.dirname(pdfrw.__file__), '../examples'))
from rl2.decodegraphics import parsepage

This fix avoids the following error with Python 3.7:

Traceback (most recent call last):
  File "./extract_table.py", line 3, in <module>
    from rl2.decodegraphics import parsepage
  File "/opt/pdfrw/pdfrw/../examples/rl2/decodegraphics.py", line 377, in <module>
    class _ParseClass(object):
  File "/opt/pdfrw/pdfrw/../examples/rl2/decodegraphics.py", line 378, in _ParseClass
    dispatch = findparsefuncs()
  File "/opt/pdfrw/pdfrw/../examples/rl2/decodegraphics.py", line 362, in findparsefuncs
    for key, func in globals().items():
RuntimeError: dictionary changed size during iteration

@Lucas-C
Copy link
Author

Lucas-C commented Apr 1, 2021

This PR has been merged in @sarnold fork: https://github.com/sarnold/pdfrw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant