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

Passing something other than list to extract_text results in error #386

Closed
alexreg opened this issue Mar 19, 2021 · 1 comment
Closed

Passing something other than list to extract_text results in error #386

alexreg opened this issue Mar 19, 2021 · 1 comment
Labels

Comments

@alexreg
Copy link
Contributor

alexreg commented Mar 19, 2021

Describe the bug

This exception is raised when calling pdfplumber.utils.extract_text and passing a chars object that is an iterator (with no __len__ attribute).

TypeError: object of type 'generator' has no len()

Code to reproduce the problem

pdfplumber.utils.extract_text(chars_iterator_obj)

Expected behavior

No error; chars_iterator_obj should get converted to list.

Actual behavior

Error is raised.

Environment

  • pdfplumber version: 0.5.27
  • Python version: 3.9.2
  • OS: all
@alexreg alexreg added the bug label Mar 19, 2021
@alexreg alexreg changed the title Passing something other than list to extract_text results in error Passing something other than list to extract_objects results in error Mar 19, 2021
@alexreg alexreg changed the title Passing something other than list to extract_objects results in error Passing something other than list to cluster_objects results in error Mar 19, 2021
@alexreg alexreg changed the title Passing something other than list to cluster_objects results in error Passing something other than list to extract_text results in error Mar 19, 2021
@jsvine
Copy link
Owner

jsvine commented Mar 19, 2021

I believe #385 fixes this and is merged, so closing this issue. Thanks @alexreg!

@jsvine jsvine closed this as completed Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants