Skip to content

Commit 83af929

Browse files
authored
Merge pull request #2003 from seleniumbase/fix-issue-with-pyo3
Fix issue with pyo3 (PyO3)
2 parents 0c12eb5 + 03cbff8 commit 83af929

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PyYAML>=6.0.1
77
readme-renderer>=40.0
88
pymdown-extensions>=10.1
99
importlib-metadata>=6.8.0
10-
pipdeptree>=2.12.0
10+
pipdeptree>=2.13.0
1111
bleach>=6.0.0
1212
docutils>=0.20.1
1313
python-dateutil>=2.8.2

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ tabcompleter==1.2.1
7373
pdbp==1.4.6
7474
colorama==0.4.5;python_version<"3.7"
7575
colorama==0.4.6;python_version>="3.7"
76-
exceptiongroup==1.1.2;python_version>="3.7"
76+
exceptiongroup==1.1.3;python_version>="3.7"
7777
future-breakpoint==2.0.0;python_version<"3.7"
7878
importlib-metadata==4.2.0;python_version<"3.8"
7979
pyotp==2.7.0;python_version<"3.7"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.17.4"
2+
__version__ = "4.17.5"

seleniumbase/core/mysql.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ def __init__(self, database_env="test", conf_creds=None):
1919
constants.PipInstall.FINDLOCK
2020
)
2121
with pip_find_lock:
22+
if sys.version_info >= (3, 7) and sys.version_info < (3, 9):
23+
# Fix bug in newer cryptography for Python 3.7 and 3.8:
24+
# "pyo3_runtime.PanicException: Python API call failed"
25+
# (Match the version needed for pdfminer.six functions)
26+
try:
27+
import cryptography
28+
if cryptography.__version__ != "39.0.2":
29+
shared_utils.pip_install(
30+
"cryptography", version="39.0.2"
31+
)
32+
except Exception:
33+
shared_utils.pip_install("cryptography", version="39.0.2")
2234
try:
2335
import cryptography # noqa: F401
2436
import pymysql

seleniumbase/fixtures/base_case.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6380,6 +6380,22 @@ def get_pdf_text(
63806380
constants.PipInstall.FINDLOCK
63816381
)
63826382
with pip_find_lock:
6383+
if (
6384+
sys.version_info >= (3, 7)
6385+
and sys.version_info < (3, 9)
6386+
):
6387+
# Fix bug in newer cryptography for Python 3.7 and 3.8:
6388+
# "pyo3_runtime.PanicException: Python API call failed"
6389+
try:
6390+
import cryptography
6391+
if cryptography.__version__ != "39.0.2":
6392+
shared_utils.pip_install(
6393+
"cryptography", version="39.0.2"
6394+
)
6395+
except Exception:
6396+
shared_utils.pip_install(
6397+
"cryptography", version="39.0.2"
6398+
)
63836399
try:
63846400
from pdfminer.high_level import extract_text
63856401
except Exception:

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
"pdbp==1.4.6",
208208
'colorama==0.4.5;python_version<"3.7"',
209209
'colorama==0.4.6;python_version>="3.7"',
210-
'exceptiongroup==1.1.2;python_version>="3.7"',
210+
'exceptiongroup==1.1.3;python_version>="3.7"',
211211
'future-breakpoint==2.0.0;python_version<"3.7"',
212212
'importlib-metadata==4.2.0;python_version<"3.8"',
213213
'pyotp==2.7.0;python_version<"3.7"',
@@ -264,7 +264,8 @@
264264
'pdfminer.six==20211012;python_version<"3.7"',
265265
'pdfminer.six==20221105;python_version>="3.7"',
266266
'cryptography==36.0.2;python_version<"3.7"',
267-
'cryptography==41.0.3;python_version>="3.7"',
267+
'cryptography==39.0.2;python_version>="3.7" and python_version<"3.9"', # noqa: E501
268+
'cryptography==41.0.3;python_version>="3.9"',
268269
"cffi==1.15.1",
269270
"pycparser==2.21",
270271

0 commit comments

Comments
 (0)