question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.5 compatibility

See original GitHub issue

Seems library not 100% python3 compatible. When I’m tying to run simple code:

import doc2text

doc = doc2text.Document()
doc = doc2text.Document(lang="eng")
doc.read('pdf-sample.pdf')

I’m getting

Traceback (most recent call last):
  File "doc2text_test.py", line 13, in <module>
    doc.read('pdf-sample.pdf')
  File "/usr/local/lib/python3.5/dist-packages/doc2text/__init__.py", line 44, in read
    for i in xrange(self.num_pages):
NameError: name 'xrange' is not defined

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
neel17commented, Dec 19, 2018

@andjelx xrange is not supported in Python3, what could be the probable work around?

0reactions
neel17commented, Dec 19, 2018

@andjelx : My regret, your PR works fine, I was trying to solve it and got this issue resolve using the above solution as well. Thanks for making me re-understand it again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Release Python 3.5.0
Python 3.5.10, the final release of the 3.5 series, is available here. ... files compatible with the OS X Gatekeeper security feature.
Read more >
Python Release Python 3.5.10
Python 3.5.10 is the final release in the Python 3.5 series. ... package files compatible with the OS X Gatekeeper security feature.
Read more >
Python Release Python 3.5.3
Python 3.5.10, the final release of the 3.5 series, is available here. ... files compatible with the OS X Gatekeeper security feature.
Read more >
What's New In Python 3.5 — Python 3.11.1 documentation
This article explains the new features in Python 3.5, compared to 3.4. ... should only be used in codebases that need compatibility with...
Read more >
Python Release Python 3.5.0a4
Python 3.5.10, the final release of the 3.5 series, is available here. ... files compatible with the OS X Gatekeeper security feature.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found