prompt-toolkit / prompt-toolkit/python-prompt-toolkit
v0.26 bugs in Windows
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
In python 2.7: Need to press meta+enter to execute a line even when multiline mode is off
In python 3.3: Fails with traceback:
raceback (most recent call last):
File "C:\Users\dg\Anaconda3\envs\ppt3\Scripts\ptpython-script.py", line 9, in <module>
load_entry_point('prompt-toolkit==0.25', 'console_scripts', 'ptpython')()
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\contrib\entry_points\ptpython.py", line 77, in run
startup_paths=startup_paths, always_multiline=always_multiline)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\contrib\repl.py", line 189, in embed
cli.start_repl(startup_paths=startup_paths)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\contrib\repl.py", line 48, in start_repl
on_exit=AbortAction.RAISE_EXCEPTION)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\__init__.py", line 251, in read_input
next(g)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\__init__.py", line 301, in _read_input
self._redraw()
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\__init__.py", line 191, in _redraw
self.renderer.render(self)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\renderer.py", line 465, in render
style=self._style, grayed=cli.is_aborting,
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\renderer.py", line 345, in output_screen_diff
current_pos = move_cursor(screen.get_cursor_position())
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\renderer.py", line 232, in move_cursor
output.cursor_up(current_y - new.y)
File "c:\users\dg\documents\python\python-prompt-toolkit\prompt_toolkit\terminal\win32_output.py", line 166, in cursor_up
sr = self._screen_buffer_info().dwCursorPosition
AttributeError: 'NoneType' object has no attribute 'dwCursorPosition'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce both Windows reports under Python 2.7 and Python 3.3, then start with prompt_toolkit/renderer.py and prompt_toolkit/terminal/win32_output.py, following the traceback through read_input and _redraw. Also inspect the multiline execution path in the REPL entry points. Done means single-line execution works without the extra keypress and the Python 3.3 traceback no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100