tmux-python / tmux-python/libtmux
Need avoiding relying on sys.stdout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 127
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 1
Description
Hi,
Here : https://github.com/tmux-python/libtmux/blob/master/src/libtmux/_compat.py#L7C1-L7C17
the console_encoding variable seems to be unused (no occurence in any import of _compat.py). Yet, the read op on sys.stdout.encoding is throwing an error in nvim, since stdout is overriden internally, and is not providing an encoding.
thus, I am wondering why this line even exists ? libtmux should not even rely on sys.stdout, since it's only a client/server, not a CLI app... (I actually have seen no other reference to sys.stdout neither.
Contributor guide
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
Start in src/libtmux/_compat.py at the console_encoding definition around line 7, then search the repository for imports and usages of it and sys.stdout. Confirm the nvim failure and determine whether the unused access can be removed; done means libtmux no longer raises this encoding error while existing behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100