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

Readline internal error #704

Closed
Remiol opened this issue Nov 29, 2023 · 10 comments · Fixed by #705
Closed

Readline internal error #704

Remiol opened this issue Nov 29, 2023 · 10 comments · Fixed by #705

Comments

@Remiol
Copy link

Remiol commented Nov 29, 2023

Bug reports

Python 3.12
buku 4.7.1

I very often get this error when I want to open a web page (see the first line below).

☺buku (? for help) 3
Readline internal error
Traceback (most recent call last):
File "\Python312\Lib\site-packages\pyreadline3\console\console.py", line 804, in hook_wrapper_23
res = ensure_str(readline_hook(prompt))
^^^^^^^^^^^^^^^^^^^^^
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 587, in readline
self.readline_setup(prompt)
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 583, in readline_setup
self._print_prompt()
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 487, in _print_prompt
n = c.write_scrolling(self.prompt, self.prompt_color)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python312\Lib\site-packages\pyreadline3\console\console.py", line 332, in write_scrolling
w, h = self.size()
^^^^
TypeError: cannot unpack non-iterable NoneType object
Readline internal error
Traceback (most recent call last):
File "\Python312\Lib\site-packages\pyreadline3\console\console.py", line 804, in hook_wrapper_23
res = ensure_str(readline_hook(prompt))
^^^^^^^^^^^^^^^^^^^^^
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 587, in readline
self.readline_setup(prompt)
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 583, in readline_setup
self._print_prompt()
File "\Python312\Lib\site-packages\pyreadline3\rlmain.py", line 487, in _print_prompt
n = c.write_scrolling(self.prompt, self.prompt_color)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python312\Lib\site-packages\pyreadline3\console\console.py", line 332, in write_scrolling
w, h = self.size()
^^^^
TypeError: cannot unpack non-iterable NoneType object

@LeXofLeviafan
Copy link
Collaborator

Does this happen on v4.8/nightly as well? If not then it's been fixed already.

(You can download the repo as an archive and run pipx install . inside the unpacked folder to install a specific version locally for the user; running pipx uninstall buku would revert the installation.)

@Remiol
Copy link
Author

Remiol commented Nov 29, 2023

If you don't mind, after previous experiences I have decided not to install any more extensions if they are not from pypi.
I will wait until the official 4.8 version.

@Remiol
Copy link
Author

Remiol commented Dec 1, 2023

I had enough of all these errors and installed buku 4.8 anyway.
Still the same error.

@LeXofLeviafan
Copy link
Collaborator

Haven't managed to reproduce this, no matter which version I tried (4.7.1, 4.8, nightly).

  • You're using Windows, correct? It shouldn't be possible to install pyreadline3 on any other OS.
  • Is the package installed via pipx, in a venv, or globally?
  • The paths in the log are odd. Did you modify them (e.g. by omitting user directory path)?
  • Have you made sure that in the 2nd test you're actually running version 4.8? (Run buku -v to check)
  • Which version of pyreadline3 are you using? The latest one (3.4.1)? (pip show pyreadline3 for global install, pipx runpip buku show pyreadline3 for pipx install)
  • Which terminal emulator are you running buku in? Is it the standard Windows CMD shell, or something else? (I've checked in CMD and in Git Bash which is included in Git-for-Windows installation.)

@Remiol
Copy link
Author

Remiol commented Dec 1, 2023

Hi,

Haven't managed to reproduce this, no matter which version I tried (4.7.1, 4.8, nightly).

* You're using Windows, correct? It shouldn't be possible to install `pyreadline3` on any other OS.

correct

* Is the package installed via pipx, in a venv, or globally?

I used pipx

* The paths in the log are odd. Did you modify them (e.g. by omitting user directory path)?

Yes, I installed python in the root in "c"

* Have you made sure that in the 2nd test you're actually running version 4.8? (Run `buku -v` to check)

buku -v >> 4.8

* Which version of `pyreadline3` are you using? The latest one (3.4.1)? (`pip show pyreadline3` for global install, `pipx runpip buku show pyreadline3` for pipx install)

Name: pyreadline3
Version: 3.4.1

* Which terminal emulator are you running buku in? Is it the standard Windows CMD shell, or something else? (I've checked in CMD and in Git Bash which is included in Git-for-Windows installation.)

yes, windows command prompt.

It does give the error after a search and 'a' (open all results in browser)
buku (? for help) a
or after a search and multiple results to open in browser (p.e. 2 and 4)
buku (? for help) 2 4
or after a search and a one result to open in browser (p.e. 2) and after this one another one (p.e. 4)
buku (? for help) 2 >> no error
buku (? for help) 4 >> error

@LeXofLeviafan
Copy link
Collaborator

…Alright, I've figured it out.

The important missing detail is that this only happens on Windows 11, which uses a new-and-fancy terminal wrapper (and reacts poorly to I/O stream manipulation… I'd call it a bug but I would not be surprised if MS declared it a ‘feature’ 😅).

LeXofLeviafan added a commit to LeXofLeviafan/buku that referenced this issue Dec 5, 2023
@jarun jarun closed this as completed in #705 Dec 8, 2023
jarun added a commit that referenced this issue Dec 8, 2023
@Remiol
Copy link
Author

Remiol commented Dec 11, 2023

Thank you for the adjustment.
Where can I download the new file?
I still see the 4.8 version in downloads and the buku-master.zip file still gives the same error.

@LeXofLeviafan
Copy link
Collaborator

LeXofLeviafan commented Dec 11, 2023

Er… Well, that shouldn't be happening; I just double-checked, the current nightly doesn't cause that error on Windows 11 (at least not in circumstances it did before). Have you made sure you did every step correctly? 😅

  • The current nightly (master) archive should have the size 624681 bytes, and the buku file inside of it has the size 194548 bytes (on Windows this can be found in file properties dialog, or in the output of dir command). It can be downloaded from the same nightly link (since the link points at the master branch, not at a specific commit).
  • Before installing, make sure that the old version is uninstalled (buku -v should produce an error, i.e. "‘buku’ is not recognized…”).
  • Make sure to install from the same archive you downloaded (i.e. I saved it as buku_20231208.zip, and the install command I used is pipx install ./buku_20231208.zip)

I know this might be annoying but I don't really have any other explanation as to why the issue doesn't reproduce with current nightly on my Windows 11 VM (unlike when using the 4.8 archive or previous nightly) but apparently does on your machine.

P.S. To reproduce, I used a dummy database file (C:\Users\%USERNAME%\AppData\Roaming\buku\bookmarks.db) containing 4 bookmarks, 2 of which have a site tag. Then, I ran the buku command, followed by t site (which printed out those two bookmarks), and used one of the suggested inputs (a, 1 2, or 1 followed by 2). Each of these causes an error when using buku installed from 4.8 archive or the old nightly, but works just fine with the current one.

@Remiol
Copy link
Author

Remiol commented Dec 13, 2023

Sorry, you're right. I updated Buku (not uninstalling the previous version).

Now I uninstalled it first. No error any more. :)

(By the way 4.7.1 is still the latest version at PyPi)

@LeXofLeviafan
Copy link
Collaborator

I updated Buku (not uninstalling the previous version)

I've made sure to check what happens if you try installing a new version without uninstalling the old version from pipx… It basically says "I didn't do anything cuz the package is already installed… And I could overwrite it but only if you pass a specific parameter" 😅

By the way 4.7.1 is still the latest version at PyPi

The current 4.8 can't be added to PyPI because it has an external (Github) dependency. And the guy who was maintaining it basically disappeared since February.

I suspect we'll have to deal with this without him after all, but that discussion belongs in the #685 thread.

jarun added a commit that referenced this issue Jan 1, 2024
[#704] fixing required colorama version
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants