GithubHelp home page GithubHelp logo

Comments (7)

neontapir avatar neontapir commented on May 18, 2024 4

Same. As a workaround, I updated my shell wrapper to do the export PYTHONIOENCODING=utf-8.

from gitinspector.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024 1
Here is the output:
print locale.getpreferredencoding() -> UTF-8
print sys.getdefaultencoding()      -> ascii
print sys.stdout.encoding           -> None
print sys.stdin.encoding            -> None

I tried the the following:
export PYTHONIOENCODING=utf-8

And it worked like a charm!
Jenkins is happy :)

Yeah, I don't know if the terminal is mis-configured, and I agree with you that 
it may not be the best assumption to set a default encoding if "None" is 
detected.  Maybe a potential "fix" is to detect "None" and tell the user to 
export the environment variable with the correct encoding.

Thanks for the quick response! Great tool!

Original comment by [email protected] on 11 Nov 2013 at 2:27

from gitinspector.

meduzapat avatar meduzapat commented on May 18, 2024 1

I also having this issue when the process runs detached:

Traceback (most recent call last): File "/usr/bin/gitinspector", line 9, in <module> load_entry_point('gitinspector==0.4.4', 'console_scripts', 'gitinspector')() File "/usr/lib/python2.7/dist-packages/gitinspector/gitinspector.py", line 105, in main argv = terminal.convert_command_line_to_utf8() File "/usr/lib/python2.7/dist-packages/gitinspector/terminal.py", line 122, in convert_command_line_to_utf8 argv.append(arg.decode(sys.stdin.encoding, "replace")) TypeError: decode() argument 1 must be string, not None
Was able to workaround adding export PYTHONIOENCODING=utf-8
:)

from gitinspector.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024
Hi. I run gitinspector on many remote (headless systems) without a hitch. This 
just sounds to me like a misconfigured terminal? What does the following script 
return?:

import locale
import sys

print locale.getpreferredencoding()
print sys.getdefaultencoding()
print sys.stdout.encoding
print sys.stdin.encoding

Gitinspector uses unicode internally; so it needs a reference point in order to 
properly encode everything and anything into the right format.

It would be possible to just choose a default encoding when "None" is detected; 
I don't know if this is the "correct" solution, though.

Also, if you know the encoding, you could try executing something like the 
following on the terminal:

export PYTHONIOENCODING=utf-8; gitinspector.py <opts>

This forces sys.*.encoding into the encoding you specify. 

/Adam Waldenberg

Original comment by [email protected] on 9 Nov 2013 at 11:28

  • Changed state: Accepted
  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

from gitinspector.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024
Great! Good thing that it worked.

I have been looking around a bit in order to somehow improve the behavior. A 
common solution seems to be to use the preferred encoding (if one is set). As 
you proposed, a warning on stderr is probably in order also; just to let the 
user know that something *might* be wrong with the settings of the terminal.

I'll keep this issue open until I have time to do something about it.

/Adam Waldenberg

Original comment by [email protected] on 15 Nov 2013 at 12:37

from gitinspector.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024
I'll try to improve this before the next release.

Original comment by [email protected] on 8 Jan 2014 at 2:48

  • Added labels: Milestone-Release0.3.2, Usability

from gitinspector.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024
This issue was closed by revision 23bc5fbbea90.

Original comment by [email protected] on 8 Jan 2014 at 5:06

  • Changed state: Fixed

from gitinspector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.