Need avoiding relying on sys.stdout

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

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

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.

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.

Dominant language
Python
Stars
1.2k
Forks
127
Avg merge
2h 13m
Merged PRs (30d)
1

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.

More from tmux-python/libtmux

All issues in tmux-python/libtmux

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.