Skip to content

Fix encoding errors on display and update with redirected output #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2014

Conversation

cdleonard
Copy link
Contributor

I tried #26 and it did not work for me so I fixed it myself.

I use this inside a script for automatically posting bugs to gitlab.

When redirecting output to a file sys.stdout.encoding is None, so use
sys.getdefaultencoding() instead.
When output is redirected sys.stdout.encoding is None. Fix this by
always encoding to utf-8, assuming gitlab handles that. The encoding
used by the local system is irrelevant here.
gpocentek pushed a commit that referenced this pull request Aug 21, 2014
Fix encoding errors on display and update with redirected output
@gpocentek gpocentek merged commit 2b5ea46 into python-gitlab:master Aug 21, 2014
@gpocentek
Copy link
Contributor

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.

2 participants