Mailinglist Archive: opensuse-buildservice (312 mails)

< Previous Next >
Re: [opensuse-buildservice] osc umlaut problem
  • From: Luke Imhoff <luke@xxxxxxxx>
  • Date: Wed, 01 Jul 2009 07:53:57 -0500
  • Message-id: <4A4B5C65.5050405@xxxxxxxx>
Does your terminal support unicode and if it does does python know that? Python should only beconverting down to ascii if it doesn't think your terminal can display unicode.

Susanne Oberhauser wrote:
Hi,

is this just me or can someone reproduce this?

0 froh@byron:/tmp/serna-free $ osc request show 12780
Traceback (most recent call last):
File "/usr/bin/osc", line 12, in <module>
r = babysitter.run(osccli)
File "/usr/lib/python2.6/site-packages/osc/babysitter.py", line 38, in run
return prg.main()
File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 307, in main
return self.cmd(args)
File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 330, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 446, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 1176, in
_dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/lib/python2.6/site-packages/osc/commandline.py", line 783, in
do_request
print r
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position
175: ordinal not in range(128)


I'm using the osc from openSUSE:Tools, which is 0.120

In the debugger I see this unicode problem:

I start the debugger

0 froh@byron:~ $ osc --debugger request show 12780
> /usr/lib/python2.6/site-packages/osc/babysitter.py(38)run()
-> return prg.main()
(Pdb) b /usr/lib/python2.6/site-packages/osc/commandline.py:783
Breakpoint 1 at /usr/lib/python2.6/site-packages/osc/commandline.py:783
(Pdb) c
> /usr/lib/python2.6/site-packages/osc/commandline.py(783)do_request()
-> print r
(Pdb) s
--Call--
> /usr/lib/python2.6/site-packages/osc/core.py(1343)__str__()
-> def __str__(self):
(Pdb) l
1338 return ret
1339
1340 def __cmp__(self, other):
1341 return cmp(self.reqid, other.reqid)
1342
1343 -> def __str__(self):
1344 # XXX: only prints out the first action element
1345 s = """\
1346 Request to %s (sri%s): 1347
1348 %s/%s -> %s/%s
1349
1350 Source revision:
1351 %s
1352
1353 Message:
1354 %s
1355
1356 State: %-10s %s %s
1357 Comment: %s
1358 """ % (self.actions[0].type,
1359 self.reqid,
1360 self.actions[0].src_project, 1361 self.actions[0].src_package, 1362 self.actions[0].dst_project, 1363 self.actions[0].dst_package, 1364 self.actions[0].src_rev or 'not given',
1365 self.descr,
1366 self.state.name, 1367 self.state.when, self.state.who, self.state.comment)
1368
1369 if len(self.statehistory):
1370 histitems = [ '%-10s %s %s' \
1371 % (i.name, i.when, i.who) \
1372 for i in self.statehistory ]
1373 s += 'History: ' + '\n '.join(histitems)
1374
1375 s += '\n'
1376 return s
1377
1378
1379 def shorttime(t):
1380 """format time as Apr 02 18:19
1381 or Apr 02 2005
(Pdb) b 1376
Breakpoint 2 at /usr/lib/python2.6/site-packages/osc/core.py:1376
(Pdb) c
> /usr/lib/python2.6/site-packages/osc/core.py(1376)__str__()
-> return s

I look at the result of this
(Pdb) p s
u"Request to submit (sri12780): \n\n
home:computersalat:branches:openSUSE:Tools/obs-server ->
openSUSE:Tools/obs-server\n\nSource revision:\n 2\n\nMessage:\n applied Marcus
H\xfcwe's inject_localpkgdata patch for backend, cause of broken 'osc build -p
DIR'\n\nState: new 2009-06-21T19:18:52 computersalat\nComment: None\n\n"

I try to print it from the debugger:
(Pdb) print s
Request to submit (sri12780):
home:computersalat:branches:openSUSE:Tools/obs-server ->
openSUSE:Tools/obs-server

Source revision:
2

Message:
applied Marcus Hüwe's inject_localpkgdata patch for backend, cause of
broken 'osc build -p DIR'

State: new 2009-06-21T19:18:52 computersalat
Comment: None

this works fine.

(Pdb) n
--Return--
>
/usr/lib/python2.6/site-packages/osc/core.py(1376)__str__()->u"Reques..None\n\n"
-> return s

Now here I get an exception:

(Pdb) n
UnicodeEncodeError: UnicodeE...ge(128)')
> /usr/lib/python2.6/site-packages/osc/commandline.py(783)do_request()
-> print r
(Pdb) n
--Return--
> /usr/lib/python2.6/site-packages/osc/commandline.py(783)do_request()->None
-> print r
(Pdb) n
--Call--
> /usr/lib/python2.6/site-packages/osc/cmdln.py(419)cmdexc()
-> def cmdexc(self, argv):
(Pdb) n
> /usr/lib/python2.6/site-packages/osc/cmdln.py(429)cmdexc()
-> import sys
(Pdb) n
> /usr/lib/python2.6/site-packages/osc/cmdln.py(430)cmdexc()
-> type, exc, traceback = sys.exc_info()
(Pdb) n
> /usr/lib/python2.6/site-packages/osc/cmdln.py(431)cmdexc()
-> if isinstance(exc, CmdlnUserError):
(Pdb) p exc
UnicodeEncodeError('ascii', u"Request to submit (sri12780): \n\n
home:computersalat:branches:openSUSE:Tools/obs-server ->
openSUSE:Tools/obs-server\n\nSource revision:\n 2\n\nMessage:\n applied Marcus
H\xfcwe's inject_localpkgdata patch for backend, cause of broken 'osc build -p
DIR'\n\nState: new 2009-06-21T19:18:52 computersalat\nComment: None\n\n",
175, 176, 'ordinal not in range(128)')
(Pdb)

whats going on here??


S.

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
References