Skip to content

Fix issue with pyo3 (PyO3) #2003

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

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PyYAML>=6.0.1
readme-renderer>=40.0
pymdown-extensions>=10.1
importlib-metadata>=6.8.0
pipdeptree>=2.12.0
pipdeptree>=2.13.0
bleach>=6.0.0
docutils>=0.20.1
python-dateutil>=2.8.2
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ tabcompleter==1.2.1
pdbp==1.4.6
colorama==0.4.5;python_version<"3.7"
colorama==0.4.6;python_version>="3.7"
exceptiongroup==1.1.2;python_version>="3.7"
exceptiongroup==1.1.3;python_version>="3.7"
future-breakpoint==2.0.0;python_version<"3.7"
importlib-metadata==4.2.0;python_version<"3.8"
pyotp==2.7.0;python_version<"3.7"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.17.4"
__version__ = "4.17.5"
12 changes: 12 additions & 0 deletions seleniumbase/core/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ def __init__(self, database_env="test", conf_creds=None):
constants.PipInstall.FINDLOCK
)
with pip_find_lock:
if sys.version_info >= (3, 7) and sys.version_info < (3, 9):
# Fix bug in newer cryptography for Python 3.7 and 3.8:
# "pyo3_runtime.PanicException: Python API call failed"
# (Match the version needed for pdfminer.six functions)
try:
import cryptography
if cryptography.__version__ != "39.0.2":
shared_utils.pip_install(
"cryptography", version="39.0.2"
)
except Exception:
shared_utils.pip_install("cryptography", version="39.0.2")
try:
import cryptography # noqa: F401
import pymysql
Expand Down
16 changes: 16 additions & 0 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6380,6 +6380,22 @@ def get_pdf_text(
constants.PipInstall.FINDLOCK
)
with pip_find_lock:
if (
sys.version_info >= (3, 7)
and sys.version_info < (3, 9)
):
# Fix bug in newer cryptography for Python 3.7 and 3.8:
# "pyo3_runtime.PanicException: Python API call failed"
try:
import cryptography
if cryptography.__version__ != "39.0.2":
shared_utils.pip_install(
"cryptography", version="39.0.2"
)
except Exception:
shared_utils.pip_install(
"cryptography", version="39.0.2"
)
try:
from pdfminer.high_level import extract_text
except Exception:
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"pdbp==1.4.6",
'colorama==0.4.5;python_version<"3.7"',
'colorama==0.4.6;python_version>="3.7"',
'exceptiongroup==1.1.2;python_version>="3.7"',
'exceptiongroup==1.1.3;python_version>="3.7"',
'future-breakpoint==2.0.0;python_version<"3.7"',
'importlib-metadata==4.2.0;python_version<"3.8"',
'pyotp==2.7.0;python_version<"3.7"',
Expand Down Expand Up @@ -264,7 +264,8 @@
'pdfminer.six==20211012;python_version<"3.7"',
'pdfminer.six==20221105;python_version>="3.7"',
'cryptography==36.0.2;python_version<"3.7"',
'cryptography==41.0.3;python_version>="3.7"',
'cryptography==39.0.2;python_version>="3.7" and python_version<"3.9"', # noqa: E501
'cryptography==41.0.3;python_version>="3.9"',
"cffi==1.15.1",
"pycparser==2.21",

Expand Down