aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2013-07-29 10:09:38 -0700
committerW. Trevor King <wking@tremily.us>2013-07-29 10:09:38 -0700
commit61ac4eee6a137983b9561ad33342197c8278bdbd (patch)
treecfad7b6a29a7db9ed8d43108dcfe9097a0efb3b0
parent9b5b2a1b7ca4541b4b34aa4b4f00c2d96a90d79b (diff)
parent042e66148d4014c459565b4987850fa5e69b562d (diff)
downloadbugseverywhere-61ac4eee6a137983b9561ad33342197c8278bdbd.tar.gz
Merge remote-tracking branch 'mcepl/utf8_user'
* mcepl/utf8_user: Make BE working with non-ASCII username.
-rw-r--r--.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/body49
-rw-r--r--.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/values29
-rw-r--r--.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/body1
-rw-r--r--.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/values29
-rw-r--r--.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/values50
-rw-r--r--libbe/ui/command_line.py2
-rw-r--r--libbe/util/subproc.py4
7 files changed, 163 insertions, 1 deletions
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/body b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/body
new file mode 100644
index 0000000..164115b
--- /dev/null
+++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/body
@@ -0,0 +1,49 @@
+matej@wycliff: CZEKMS-CSP_Bible (master *+%)$ locale
+LANG=en_US.utf8
+LC_CTYPE="en_US.utf8"
+LC_NUMERIC="en_US.utf8"
+LC_TIME="en_US.utf8"
+LC_COLLATE="en_US.utf8"
+LC_MONETARY="en_US.utf8"
+LC_MESSAGES="en_US.utf8"
+LC_PAPER="en_US.utf8"
+LC_NAME="en_US.utf8"
+LC_ADDRESS="en_US.utf8"
+LC_TELEPHONE="en_US.utf8"
+LC_MEASUREMENT="en_US.utf8"
+LC_IDENTIFICATION="en_US.utf8"
+LC_ALL=
+matej@wycliff: CZEKMS-CSP_Bible (master *+%)$ be new 'Incorporate errata into our texts'
+Traceback (most recent call last):
+ File "/home/matej/.local/bin/be", line 26, in <module>
+ sys.exit(libbe.ui.command_line.main())
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/ui/command_line.py", line 391, in main
+ ret = dispatch(ui, command, args)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/ui/command_line.py", line 304, in dispatch
+ ret = ui.run(command, options, args)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/command/base.py", line 590, in run
+ return command.run(options, args)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/command/base.py", line 302, in run
+ self.status = self._run(**params)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/command/new.py", line 132, in _run
+ bug.creator = self._get_user_id()
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/command/base.py", line 606, in _get_user_id
+ self.storage_callbacks.get_storage())
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/ui/util/user.py", line 145, in get_user_id
+ user = storage.get_user_id()
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/storage/vcs/base.py", line 630, in get_user_id
+ self.user_id = self._vcs_get_user_id()
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/storage/vcs/git.py", line 295, in _vcs_get_user_id
+ 'config', 'user.name', expect=(0,1))
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/storage/vcs/base.py", line 934, in _u_invoke_client
+ return self._u_invoke(cl_args, **kwargs)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/storage/vcs/base.py", line 929, in _u_invoke
+ return invoke(*args, **kwargs)
+ File "/home/matej/.local/lib/python2.7/site-packages/libbe/util/subproc.py", line 90, in invoke
+ libbe.LOG.debug('{0}\n{1}{2}'.format(status, stdout, stderr))
+UnicodeEncodeError: 'ascii' codec can't encode character u'\u011b' in position 3: ordinal not in range(128)
+matej@wycliff: CZEKMS-CSP_Bible (master *+%)$ git config user.name
+Matěj Cepl
+matej@wycliff: CZEKMS-CSP_Bible (master *+%)$
+
+
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/values
new file mode 100644
index 0000000..8d6fdcb
--- /dev/null
+++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/94e55330-a4d5-41f5-bc4d-1c7a73964224/values
@@ -0,0 +1,29 @@
+{
+
+
+
+
+
+
+ "Author": "Matej Cepl <mcepl@redhat.com>",
+
+
+
+
+
+
+ "Content-type": "text/plain",
+
+
+
+
+
+
+ "Date": "Mon, 22 Jul 2013 18:02:44 +0000"
+
+
+
+
+
+
+}
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/body b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/body
new file mode 100644
index 0000000..4c91e9f
--- /dev/null
+++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/body
@@ -0,0 +1 @@
+Another testing comment.
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/values
new file mode 100644
index 0000000..2dfc51e
--- /dev/null
+++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/comments/c9e4523f-c016-4139-81ba-f130a1e5323c/values
@@ -0,0 +1,29 @@
+{
+
+
+
+
+
+
+ "Author": "Mat\u011bj Cepl <mcepl@redhat.com>",
+
+
+
+
+
+
+ "Content-type": "text/plain",
+
+
+
+
+
+
+ "Date": "Mon, 22 Jul 2013 18:29:04 +0000"
+
+
+
+
+
+
+}
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/values
new file mode 100644
index 0000000..0174507
--- /dev/null
+++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/742c86f3-0693-4d75-bdee-1785bcebdd43/values
@@ -0,0 +1,50 @@
+{
+
+
+
+
+
+
+ "creator": "Matej Cepl <mcepl@redhat.com>",
+
+
+
+
+
+
+ "reporter": "Matej Cepl <mcepl@redhat.com>",
+
+
+
+
+
+
+ "severity": "minor",
+
+
+
+
+
+
+ "status": "fixed",
+
+
+
+
+
+
+ "summary": "Crash of 'be new' with non-ASCII user name",
+
+
+
+
+
+
+ "time": "Mon, 22 Jul 2013 17:59:19 +0000"
+
+
+
+
+
+
+}
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index d94da80..614366d 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -23,6 +23,7 @@ A command line interface to Bugs Everywhere.
import optparse
import os
import sys
+import locale
import libbe
import libbe.bugdir
@@ -340,6 +341,7 @@ def dispatch(ui, command, args):
return ret
def main():
+ locale.setlocale(locale.LC_ALL, '')
io = libbe.command.StdInputOutput()
ui = CommandLine(io)
be = BE(ui=ui)
diff --git a/libbe/util/subproc.py b/libbe/util/subproc.py
index f1f04c1..0ad010c 100644
--- a/libbe/util/subproc.py
+++ b/libbe/util/subproc.py
@@ -87,7 +87,9 @@ def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,),
stdout = unicode(stdout, encoding)
if stderr != None:
stderr = unicode(stderr, encoding)
- libbe.LOG.debug('{0}\n{1}{2}'.format(status, stdout, stderr))
+ libbe.LOG.debug(u'{0}\n{1}{2}'.format(status, stdout, stderr))
+ else:
+ libbe.LOG.debug('{0}\n{1}{2}'.format(status, stdout, stderr))
if status not in expect:
raise CommandError(list_args, status, stdout, stderr)
return status, stdout, stderr