Skip to content

Fix for unicode commands in Python 2 - #131

Merged
tony merged 3 commits into
tmux-python:masterfrom
myw:fix-unicode-py2-config
Jan 13, 2019
Merged

Fix for unicode commands in Python 2#131
tony merged 3 commits into
tmux-python:masterfrom
myw:fix-unicode-py2-config

Conversation

@myw

@myw myw commented Jul 9, 2018

Copy link
Copy Markdown
Contributor

Before this PR, if a command was passed into tmux_command that had unicode characters in it, such as in the name of a session, format string, or window, a unicode error would be thrown when tmuxp was run with Python 2. The provided unit test shows an example failing test case of this behavior—the real-world use-case is config.yml files for tmuxp that contain unicode characters in their names.

This PR resolves the issue by using a python-version-independent conversion inside the tmux_command constructor (instead of str), assuming that unicode data being sent in Python 2 is encoded as utf_8, which is consistent with other places in the code that assumption is made.

Happy to answer any questions, an thanks for making this!

@codecov-io

codecov-io commented Jul 9, 2018

Copy link
Copy Markdown

Codecov Report

Merging #131 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #131   +/-   ##
=======================================
  Coverage   79.49%   79.49%           
=======================================
  Files           8        8           
  Lines         863      863           
=======================================
  Hits          686      686           
  Misses        177      177
Impacted Files Coverage Δ
libtmux/common.py 86.5% <100%> (ø) ⬆️
libtmux/window.py 83.53% <0%> (ø) ⬆️
libtmux/pane.py 81.81% <0%> (ø) ⬆️
libtmux/server.py 77.9% <0%> (ø) ⬆️
libtmux/session.py 80.12% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71d25c4...345de45. Read the comment docs.

@myw

myw commented Jul 23, 2018

Copy link
Copy Markdown
Contributor Author

@tony would you mind taking a look at this?

@tony

tony commented Oct 14, 2018

Copy link
Copy Markdown
Member

@myw Sorry for the delay, can you do a rebase?

@myw
myw force-pushed the fix-unicode-py2-config branch from 0b77906 to 345de45 Compare October 26, 2018 19:39
@myw

myw commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

@tony Rebased! Thanks!

@tony
tony merged commit 9097c31 into tmux-python:master Jan 13, 2019
@tony

tony commented Jan 13, 2019

Copy link
Copy Markdown
Member

@myw Merged! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants