Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

0.4.13 seems to break Python 3.11 compatibility #187

Open
claell opened this issue Jul 23, 2023 · 10 comments
Open

0.4.13 seems to break Python 3.11 compatibility #187

claell opened this issue Jul 23, 2023 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@claell
Copy link

claell commented Jul 23, 2023

          note that quickjs package is not compatible with Python 3.11, so you may face an issue while trying to upgrade poe-api 0.4.13 :D

Originally posted by @asce0 in #184 (comment)

See comment above. Creating as separate issue to keep track of the problem.

@ading2210
Copy link
Owner

I put a note in the README about this. You need the python-dev package installed if you're on Linux.

@ading2210 ading2210 added the documentation Improvements or additions to documentation label Jul 23, 2023
@claell
Copy link
Author

claell commented Jul 23, 2023

Hopefully, in the future, Python 3.11 compatibility can be restored, though?

@claell
Copy link
Author

claell commented Jul 23, 2023

I am on Windows, BTW.

@asce0
Copy link

asce0 commented Jul 23, 2023

I am on Windows, BTW.

So how did you install quickjs 🤔

@claell
Copy link
Author

claell commented Jul 23, 2023

I didn't install it, I used an older Python version for now.

@asce0
Copy link

asce0 commented Jul 23, 2023

Oh, my bad, I thought you did install it 😅

@ichuixue
Copy link

ichuixue commented Jul 24, 2023

@ading2210 You can use js2py instead of quickjs. js2py works fine for Python 3.11

import js2py

def extract_formkey(self, html):
    script_regex = r'<script>(.+?)</script>'
    script_text = "window = {};"
    script_text += "".join(re.findall(script_regex, html))

    function_regex = r'(window\.[a-zA-Z0-9]{17})=function'
    function_text = re.search(function_regex, script_text).group(1)
    script_text += f"{function_text}();"

    formkey = js2py.eval_js(script_text)
    return formkey

@ading2210
Copy link
Owner

js2py is not sandboxed, and it's possible for a script to call Python functions.

@2-3-5-7
Copy link

2-3-5-7 commented Jul 28, 2023

I just found that someone has compiled quickjs for python3.11, and it seems worked for windows

PetterS/quickjs#127

@UchihaYuki
Copy link

I put a note in the README about this. You need the python-dev package installed if you're on Linux.

I still can't install quickjs

> apt-get install python3-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-dev is already the newest version (3.11.2-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> pip install quickjs
...
ERROR: Could not build wheels for quickjs, which is required to install pyproject.toml-based projects

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants