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

pdfplumber verison 0.11.3 happen error "TypeError: 'type' object is not subscriptable" #1184

Closed
Akiramex opened this issue Aug 13, 2024 · 2 comments
Labels

Comments

@Akiramex
Copy link

When I use the latest pdfplumber verison 0.11.3. to run my program,the bug happen。

Traceback (most recent call last):
File "run.py", line 5, in
from pdf import pdf2mats
File "C:\Users\sinow\Desktop\dsimgocr\dsimgocr\src\pdf.py", line 1, in
import pdfplumber
File "C:\env\anaconda3\envs\imgocr\lib\site-packages\pdfplumber_init_.py", line 15, in
from .pdf import PDF
File "C:\env\anaconda3\envs\imgocr\lib\site-packages\pdfplumber\pdf.py", line 17, in
from .page import Page
File "C:\env\anaconda3\envs\imgocr\lib\site-packages\pdfplumber\page.py", line 35, in
from .table import T_table_settings, Table, TableFinder, TableSettings
File "C:\env\anaconda3\envs\imgocr\lib\site-packages\pdfplumber\table.py", line 377, in
class Table(object):
File "C:\env\anaconda3\envs\imgocr\lib\site-packages\pdfplumber\table.py", line 392, in Table
def _get_rows_or_cols(self, kind: type[CellGroup]) -> List[CellGroup]:
TypeError: 'type' object is not subscriptable

But when i use the version 0.11.2,the program can run nomal.

@Akiramex Akiramex added the bug label Aug 13, 2024
@andrekeller
Copy link

type[CellGroup] looks like python 3.9 syntax (https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections), I'd assume you see this bug on Python 3.8 (which the setup.py lists as compatible)

@jsvine
Copy link
Owner

jsvine commented Aug 18, 2024

Thanks for flagging @Akiramex and for identifying the issue @andrekeller. Now fixed in v0.11.4.

After October 2024, I plan to end pdfplumber's support of Python 3.8, following the official EOL schedule, but happy to make this quickfix in the meantime.

@jsvine jsvine closed this as completed Aug 18, 2024
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

3 participants