[Help wanted, macOS] prompt_toolkit/input/vt100.py: `OSError: [Errno 45] Operation not supported`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 10.6k
- Forks
- 825
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de prompt-toolkit/python-prompt-toolkit
-
ANSI.format lets a C1 CSI set a colorPosiblemente ocupada @SashaMIT la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Add CSharp Console to PROJECTS.rstPosiblemente ocupada @jw9829 la tomó hace 11 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
Document.translate_row_col_to_index does not clamp negative rows to zeroPosiblemente ocupada @oodadoudou la tomó hace 25 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Modified arrow keys resolve to the opposite direction: ESC[1;6A is Ctrl+Shift+Up but maps to ControlShiftDown (10 entries)Posiblemente ocupada @despotak la tomó hace 32 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
-
TelnetServer recv error: Forcing an RST request to the telnet server can cause a crashPosiblemente ocupada @liyimil la tomó hace 82 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
prompt-toolkit/python-prompt-toolkit#2073 · 2 comentarios ·
Todos los issues de prompt-toolkit/python-prompt-toolkit
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
pytest-dev/pluggy#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
NousResearch/hermes-agent#134960 ·
Los mantenedores suelen responder en 1 día
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captionsPosiblemente ocupada @morten-lagabote la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
docling-project/docling#4671 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest infra
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día