truedat101 / gitinspector

Automatically exported from code.google.com/p/gitinspector
GNU General Public License v3.0
0 stars 0 forks source link

Decoding issue with email #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a commit in the history with a email set to "DOMAIN\\USER"

Note: This happens for example when converting a project from TFVC to GIT

What is the expected output? What do you see instead?
Error is thrown trying to access dictionary, due to key being "DOMAIN\USER"

What version of the product are you using? What version of Python? On what
operating system?
Latest version, python 2.7, Windows

Original issue reported on code.google.com by Jon.Warg...@gmail.com on 17 Nov 2014 at 9:21

GoogleCodeExporter commented 9 years ago
The easiest way to fix this would be

changes.py, line 173    
    def get_latest_author_by_email(self, name):
        name = name.decode("unicode_escape", "ignore")
        return self.authors_by_email[name]

Original comment by Jon.Warg...@gmail.com on 17 Nov 2014 at 9:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here is a patch for solution mentioned above

Original comment by Jon.Warg...@gmail.com on 17 Nov 2014 at 9:58

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Jon, I'm new to gitinspector. Would the above issue explain the following 
error output? "Exception in thread Thread-52:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/gitinspector/blame.py", line 73, in run
    author = self.changes.get_latest_author_by_email(email)
  File "/usr/lib/python2.7/dist-packages/gitinspector/changes.py", line 174, in get_latest_author_by_email
    return self.authors_by_email[name]
KeyError: u'nicolas@apache.org'

^CTraceback (most recent call last):
  File "/usr/bin/gitinspector", line 9, in <module>
    load_entry_point('gitinspector==0.3.2', 'console_scripts', 'gitinspector')()
  File "/usr/lib/python2.7/dist-packages/gitinspector/gitinspector.py", line 194, in main
    __run__.output()
  File "/usr/lib/python2.7/dist-packages/gitinspector/gitinspector.py", line 91, in output
    outputable.output(blame.BlameOutput(self.hard))
  File "/usr/lib/python2.7/dist-packages/gitinspector/blame.py", line 171, in __init__
    get(self.hard, self.changes)
  File "/usr/lib/python2.7/dist-packages/gitinspector/blame.py", line 157, in get
    __blame__ = Blame(hard, changes)
  File "/usr/lib/python2.7/dist-packages/gitinspector/blame.py", line 105, in __init__
    thread = BlameThread(changes, blame_string, FileDiff.get_extension(row), self.blames, row.strip())
  File "/usr/lib/python2.7/dist-packages/gitinspector/blame.py", line 50, in __init__
    __thread_lock__.acquire() # Lock controlling the number of threads running
  File "/usr/lib/python2.7/threading.py", line 323, in acquire
    self.__cond.wait()
  File "/usr/lib/python2.7/threading.py", line 243, in wait
    waiter.acquire()"

Original comment by njw...@hotmail.com on 18 Nov 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Hi. Answering #4.

I think the last exception looks related to the fix recently implemented in 
revision 1d2fd619bdaf ?

Please check out the master branch and see if it still persists.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 19 Nov 2014 at 6:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 68a6e902284a.

Original comment by gitinspe...@ejwa.se on 19 Nov 2014 at 6:46