asweigart / asweigart/bext

Python 3.10.7 sys.out.write error

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
21
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Here is an error message from bext module when bext.hide() is used in analogClock.py example.

```
File` "...Documents/python/tutorial-env/lib/python3.10/site-packages/bext/__init__.py", line 588, in hide
sys.out.write('\033[?25l')
AttributeError: module 'sys' has no attribute 'out'`
```
Also, if I experiment and change the 'sys.out.write...' to 'sys.stdout.write...' the next line results in the same error message
```
File "/home/serkank2/Documents/python/tutorial-env/lib/python3.10/site-packages/bext/__init__.py", line 589, in hide
sys.out.flush()
AttributeError: module 'sys' has no attribute 'out'
```

Thank you for the great resources.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the analogClock.py example and inspect bext/__init__.py around lines 588-589, where hide() fails under Python 3.10. Run the example to reproduce the error, then verify that the cursor-hiding path completes without AttributeError during both writing and flushing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.