tmux-python / tmux-python/libtmux

Need avoiding relying on sys.stdout

Open
#600 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.