Unicode output problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
doit |
Fix Released
|
High
|
schettino72 |
Bug Description
I'm using doit to automate building of RPMs for python modules. For several modules, somewhere in the output of setup.py, there's some Unicode that's not being handled properly, generating the error:
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/
self.run()
File "/usr/lib/
self.
File "/usr/lib/
realtime.
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 28: ordinal not in range(128)
To see the error in action, download http://
----
# dodo.py
def task_show_bug():
return { "actions": [ "tar --strip-component 1 -xzf pymongo*gz",
]
}
----
...and run the task.
System Information:
============
(asdf)[
0.11.0
bin @ /usr/lib/
lib @ /usr/lib/
(asdf)[
#!/home/
(asdf)[
Python 2.6.5 (r265:79063, Feb 28 2011, 21:55:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
(asdf)[
Linux virtual-matt 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:56 EDT 2011 i686 i686 i386 GNU/Linux
(asdf)[
CentOS release 5.6 (Final)
(asdf)[
Changed in doit: | |
milestone: | none → 0.12.0 |
assignee: | nobody → schettino72 (schettino72) |
status: | In Progress → Fix Committed |
Changed in doit: | |
status: | Fix Committed → Fix Released |
I have to confess that I get very confused with this unicode stuff... can you try this patch?
=== modified file 'doit/action.py'
capture. write(line) write(line) write(line. encode( 'utf-8' ))
break
--- doit/action.py 2011-04-16 17:26:58 +0000
+++ doit/action.py 2011-04-30 02:23:00 +0000
@@ -56,7 +56,7 @@
if line:
if realtime:
- realtime.
+ realtime.
if not line and process.poll() != None: