X Tutup
Skip to content

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

Merged
gpocentek merged 2 commits intopython-gitlab:masterfrom
cdleonard:master
Aug 21, 2014
Merged

Fix encoding errors on display and update with redirected output#27
gpocentek merged 2 commits intopython-gitlab:masterfrom
cdleonard:master

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

X Tutup