Mailinglist Archive: opensuse-buildservice (306 mails)

< Previous Next >
[opensuse-buildservice] Extra newlines in base64 passx on SLES 10 (python 2.4.2)
When converting an older oscrc that contained a random password, the
add_section part that was rewriting the password to be bz2 and base64
encoded died with:

Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/osc/", line 46,
in run
return prg.main()
File "/usr/lib64/python2.4/site-packages/osc/", line 300, in
File "/usr/lib64/python2.4/site-packages/osc/", line
115, in postoptparse
override_verbose = self.options.verbose)
File "/usr/lib64/python2.4/site-packages/osc/", line 617, in
add_section(conffile, url, user, password)
File "/usr/lib64/python2.4/site-packages/osc/", line 505, in
cp.set(url, 'passx', passwd.encode('bz2').encode('base64'))
File "/usr/lib64/python2.4/", line 640, in set
ConfigParser.set(self, section, option, value)
File "/usr/lib64/python2.4/", line 359, in set
sectdict[self.optionxform(option)] = value
File "/usr/lib64/python2.4/site-packages/osc/", line
134, in __setitem__
self._add_option(key, val)
File "/usr/lib64/python2.4/site-packages/osc/", line
119, in _add_option
self._lines.append(OptionLine(optname, line))
File "/usr/lib64/python2.4/site-packages/osc/", line
182, in __init__
File "/usr/lib64/python2.4/site-packages/osc/", line
186, in format
key, val ='option', 'value')
AttributeError: 'NoneType' object has no attribute 'group'

Looking at the encoded password it was

passx =

the original password is

pass = 'ZlUBqC2PELx4j3bio1kT'

It seemed odd to me that base64 encoding would include \n, so I tried
using base64 instead of encode('base64'):

passx = base64.b64encode(passwd.encode('bz2'))
passx =

If you compare the two encodings you'll notice that the only difference
is the infix newline and the newline at the end.

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

< Previous Next >
Follow Ups