[Help wanted, macOS] prompt_toolkit/input/vt100.py: `OSError: [Errno 45] Operation not supported`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Start with prompt_toolkit/input/vt100.py and the asyncio selector calls shown in the ptpython and fastanime tracebacks. Reproduce the failure on macOS versions below 10.6.8, then compare behavior with 10.6.8 and newer systems. Done means identifying and documenting a workable compatibility approach or confirming that no upstream change is requested.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Something does not work on macOS < 10.6.8 which leaves dependents of prompt-toolkit defunct.
The issue does not exist on 10.6.8, whether on x86, Rosetta or native powerpc.
I understand that 10.5 is old and there may not be much interest to support it and add dedicated fixes. So I do not ask to make any changes here in upstream. However, there are users of 10.4–10.5, and affected apps are end-user apps, which are desirable to have working.
Could someone suggest a solution? I can add a local patch into my fork of ports for PowerPC and use it conditionally on macOS version, so nothing gets messed up for 10.6+.
Details are below.
Example with radian:
36-137:~ svacchanda$ ptpython
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 256, in _add_reader
key = self._selector.get_key(fd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/selectors.py", line 193, in get_key
raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '0 is not registered'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ptpython/repl.py", line 135, in run
text = self.read()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ptpython/python_input.py", line 1045, in read
result = self.app.run(pre_run=pre_run, in_thread=True)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 961, in run
raise exception
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 939, in run_in_thread
result = self.run(
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 978, in run
return loop.run_until_complete(
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 885, in run_async
return await _run_async(f)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 737, in _run_async
with self.input.raw_mode(), self.input.attach(
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
return next(self.gen)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 176, in _attached_input
loop.add_reader(fd, callback_wrapper)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 331, in add_reader
self._add_reader(fd, callback, *args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 258, in _add_reader
self._selector.register(fd, selectors.EVENT_READ,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/selectors.py", line 523, in register
self._selector.control([kev], 0, 0)
OSError: [Errno 45] Operation not supported
See also: https://trac.macports.org/ticket/67046
Example with fastanime:
PMG5:~ matias$ fastanime --trace anilist
[bold yellow]Welcome to FastAnime![/bold yellow] No configuration file found.
Traceback (most recent call last):
File "/opt/local/bin/fastanime", line 8, in <module>
sys.exit(Cli())
~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fastanime/__init__.py", line 12, in Cli
run_cli()
~~~~~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/core.py", line 1827, in invoke
super().invoke(ctx)
~~~~~~~~~~~~~~^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/click/decorators.py", line 34, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fastanime/cli/cli.py", line 106, in cli
else loader.load(cli_overrides)
~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fastanime/cli/config/loader.py", line 88, in load
return self._handle_first_run()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fastanime/cli/config/loader.py", line 55, in _handle_first_run
).execute()
~~~~~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/InquirerPy/base/simple.py", line 330, in execute
result = self._run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/InquirerPy/base/complex.py", line 208, in _run
return self.application.run()
~~~~~~~~~~~~~~~~~~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/prompt_toolkit/application/application.py", line 1002, in run
return asyncio.run(coro)
~~~~~~~~~~~^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 195, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/prompt_toolkit/application/application.py", line 886, in run_async
return await _run_async(f)
^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/prompt_toolkit/application/application.py", line 734, in _run_async
with self.input.raw_mode(), self.input.attach(
~~~~~~~~~~~~~~~~~^
read_from_input_in_context
^^^^^^^^^^^^^^^^^^^^^^^^^^
), attach_winch_signal_handler(self._on_resize):
^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 141, in __enter__
return next(self.gen)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/prompt_toolkit/input/vt100.py", line 165, in _attached_input
loop.add_reader(fd, callback_wrapper)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/selector_events.py", line 347, in add_reader
self._add_reader(fd, callback, *args)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/selector_events.py", line 279, in _add_reader
self._selector.register(fd, selectors.EVENT_READ,
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
(handle, None))
^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/selectors.py", line 505, in register
self._selector.control([kev], 0, 0)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
OSError: [Errno 45] Operation not supported
P. S. Please do not close the issue immediately; if there is no response for a while, it can be closed as not planned.
- Linguagem predominante
- Python
- Estrelas
- 10.6k
- Forks
- 834
- Merge médio
- 15h 43min
- PRs com merge (30d)
- 1
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de prompt-toolkit/python-prompt-toolkit
-
ANSI.format lets a C1 CSI set a colorTalvez já em andamento @SashaMIT assumiu há 24 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
prompt-toolkit/python-prompt-toolkit#2113 ·
Mantenedores costumam responder em até 1 dia
-
Add CSharp Console to PROJECTS.rstTalvez já em andamento @jw9829 assumiu há 28 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 95/100
prompt-toolkit/python-prompt-toolkit#2102 ·
Mantenedores costumam responder em até 1 dia
-
Document.translate_row_col_to_index does not clamp negative rows to zeroTalvez já em andamento @oodadoudou assumiu há 43 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
prompt-toolkit/python-prompt-toolkit#2097 ·
Mantenedores costumam responder em até 1 dia
-
Modified arrow keys resolve to the opposite direction: ESC[1;6A is Ctrl+Shift+Up but maps to ControlShiftDown (10 entries)Talvez já em andamento @despotak assumiu há 49 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
prompt-toolkit/python-prompt-toolkit#2092 ·
Mantenedores costumam responder em até 1 dia
-
TelnetServer recv error: Forcing an RST request to the telnet server can cause a crashTalvez já em andamento @liyimil assumiu há 99 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
prompt-toolkit/python-prompt-toolkit#2073 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de prompt-toolkit/python-prompt-toolkit
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
google-agentic-commerce/AP2#388 ·
-
area:codegen backend:cuda backend:hip bug direction:input
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CrossGL/crosstl#3061 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
rlaope/oh-my-hermes#2304 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
mochan-tk/agentic-dev-kit-for-codex#64 ·
Mantenedores costumam responder em até 1 dia
-
Windows ARM memory-leakAbertabug docs performance
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 3 dias