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

Windows: pyreadline broken on 3.10 #498

Open
goodboy opened this issue Jul 12, 2022 · 6 comments
Open

Windows: pyreadline broken on 3.10 #498

goodboy opened this issue Jul 12, 2022 · 6 comments

Comments

@goodboy
Copy link

goodboy commented Jul 12, 2022

pyreadline issue:
pyreadline/pyreadline#65

In 3.10 the warning becomes a hard error:
pyreadline/pyreadline#65 (comment)

Example of issue in CI:
https://github.com/goodboy/tractor/runs/7293021168?check_suite_focus=true

C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\pyreadline\py3k_compat.py:8: in callable
    return isinstance(x, collections.Callable)
E   AttributeError: module 'collections' has no attribute 'Callable'

Relates to #81.

@goodboy
Copy link
Author

goodboy commented Jul 12, 2022

Ah further info from digging into the fancycompleter docs:
https://github.com/pdbpp/fancycompleter/blob/8ae963eff76b327b7533f39f40d04eb2b99fa3fd/README.md#how-do-i-get-colors

Starting from version 0.6.1, fancycompleter works also on Windows, relying on pyreadline. At the moment of writing, the latest version of pyreadline is 2.1, which does not support colored completions; here is the pyreadline/pyreadline#48 which adds support for them. To enable colors, you can install pyreadline from this fork using the following command:

pip install --upgrade https://github.com/antocuni/pyreadline/tarball/master

If you are using Python 3, pyrepl does not work, and thus is not installed. Your only option to get colors is to use a patched readline, as explained below.

@goodboy
Copy link
Author

goodboy commented Jul 12, 2022

Further iirc i've had windows users install this lib and have things work i think?
https://github.com/pyreadline3/pyreadline3/

And indeed the import is fixed in this project.

@goodboy
Copy link
Author

goodboy commented Jul 12, 2022

Yah so changing to this made our CI run clean so I would say getting the change into pdbpp/fancycompleter#37 would be pretty important for a pdbpp release supporting 3.10 😉

@parejkoj
Copy link

I filed pdbpp/fancycompleter#41 to update fancycompleter, but that PR didn't get any responses.

ymyke added a commit to ymyke/tessa that referenced this issue Jun 27, 2023
Especially remove `pdbpp` as it produces issues via the `readline`
library, see pdbpp/pdbpp#498
@goyalyashpal
Copy link

C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\pyreadline\py3k_compat.py:8: in callable
    return isinstance(x, collections.Callable)
E   AttributeError: module 'collections' has no attribute 'Callable'

reproduced on:

$ pdm list | grep -E "pdbpp|pyreadline"
| pdbpp          | 0.10.3         |                                           |
| pyreadline     | 2.1            |                                           |

$ pdm run python --version
Python 3.12.2

$ systeminfo | grep -iA1 "os name"
OS Name:                   Microsoft Windows 10 Home Single Language
OS Version:                10.0.19045 N/A Build 19045

@goyalyashpal
Copy link

from #519 (comment) , pdbp seems to use pyreadline3 instead of pyreadline

$ pdm remove -d pdbpp
Removing packages from dev dev-dependencies: pdbpp
Changes are written to pyproject.toml.
🔒 Lock successful
Changes are written to pdm.lock.
Synchronizing working set with resolved packages: 0 to add, 0 to update, 7 to remove

  ✔ Remove pyrepl 0.9.0 successful
  ✔ Remove wmctrl 0.5 successful
  ✔ Remove fancycompleter 0.9.1 successful
  ✔ Remove attrs 23.2.0 successful
  ✔ Remove pdbpp 0.10.3 successful
  ✔ Remove pyreadline 2.1 successful
  ✔ Remove pygments 2.17.2 successful
Installing the project as an editable package...
  ✔ Update ... 0.1.0+editable -> 0.1.0 successful

🎉 All complete!

$ pdm add -d pdbp
Adding packages to dev dev-dependencies: pdbp
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 4 to add, 0 to update, 0 to remove

  ✔ Install tabcompleter 1.3.0 successful
  ✔ Install pdbp 1.5.0 successful
  ✔ Install pygments 2.17.2 successful
  ✔ Install pyreadline3 3.4.1 successful

🎉 All complete!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants