print _pyrepl.readline._wrapper.reader will raise error'UnixConsole' object has no attribute 'posxy'
Aberta
Ninguém assumiu esta issue ainda.
pending
stdlib
topic-repl
type-bug
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Bug report
Bug description:
print('Before importing _pyrepl.readline:')
import sys
import os
print('PYTHON_HISTORY:', os.environ.get('PYTHON_HISTORY'))
print('\\nImporting _pyrepl.readline...')
import _pyrepl.readline
print('After importing:')
print('History length:', _pyrepl.readline.get_current_history_length())
print('Wrapper object:', _pyrepl.readline._wrapper)
print('Wrapper reader:', _pyrepl.readline._wrapper.reader)
./python.exe test.py
Before importing _pyrepl.readline:
PYTHON_HISTORY: None
\nImporting _pyrepl.readline...
After importing:
History length: 0
Wrapper object: _ReadlineWrapper(f_in=3, f_out=4, saved_history_length=-1, startup_hook=None)
Wrapper reader: Traceback (most recent call last):
File "/Users/yihong/test.py", line 12, in <module>
print('Wrapper reader:', _pyrepl.readline._wrapper.reader)
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/reprlib.py", line 21, in wrapper
result = user_function(self)
File "<string>", line 41, in __repr__
File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/reprlib.py", line 21, in wrapper
result = user_function(self)
File "<string>", line 9, in __repr__
AttributeError: 'UnixConsole' object has no attribute 'posxy'
this exists from 3.13 to 3.15
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-139351
Guia de contribuição
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.
Direção de pesquisa
Reproduza a falha do macOS com o script fornecido, começando pelo ponto de entrada _pyrepl.readline e por sua representação _wrapper.reader. Inspecione o caminho de representação de UnixConsole e verifique se imprimir o reader não gera mais um AttributeError pela ausência de posxy.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100