Mailinglist Archive: opensuse-buildservice (256 mails)

< Previous Next >
[opensuse-buildservice] osc with Python 2.7 (Fedora 15)

While using osc on Fedora 15, which has python 2.7, I am running into the
following issue, while commiting some sources to the OBS:

Transmitting file data .Traceback (most recent call last):
File "/usr/bin/osc", line 21, in <module>
r =
File "/usr/lib/python2.7/site-packages/osc/", line 52, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/", line 310, in main
return self.cmd(args)
File "/usr/lib/python2.7/site-packages/osc/", line 333, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.7/site-packages/osc/", line 449, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.7/site-packages/osc/", line 1179, in
return handler(argv[0], opts, *args)
File "/usr/lib/python2.7/site-packages/osc/", line 3746, in
prj.commit(packages, validators_dir=validators, msg=msg, files=files,
skip_local_service_run=opts.skip_local_service_run, verbose=opts.verbose)
File "/usr/lib/python2.7/site-packages/osc/", line 770, in commit
p.commit(msg, validators_dir=validators_dir, verbose=verbose,
File "/usr/lib/python2.7/site-packages/osc/", line 1286, in commit
File "/usr/lib/python2.7/site-packages/osc/", line 1142, in
http_PUT(u, file = os.path.join(self.dir, n))
File "/usr/lib/python2.7/site-packages/osc/", line 2949, in http_PUT
def http_PUT(*args, **kwargs): return http_request('PUT', *args,
File "/usr/lib/python2.7/site-packages/osc/", line 2935, in
fd = urllib2.urlopen(req, data=data)
File "/usr/lib64/python2.7/", line 126, in urlopen
return, data, timeout)
File "/usr/lib64/python2.7/", line 392, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/", line 410, in _open
'_open', req)
File "/usr/lib64/python2.7/", line 370, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/site-packages/osc/", line 208, in https_open
h.request(req.get_method(), selector,, headers)
File "/usr/lib64/python2.7/", line 941, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/", line 975, in _send_request
File "/usr/lib64/python2.7/", line 937, in endheaders
File "/usr/lib64/python2.7/", line 801, in _send_output
File "/usr/lib64/python2.7/", line 773, in send
File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/", line
222, in write
return self._write_bio(data)
File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/", line
205, in _write_bio
return m2.ssl_write(self.ssl, data, self._timeout)
TypeError: 'buffer' does not have the buffer interface

The source of the issue seems to be the following (the last) line below

if file and not data:
size = os.path.getsize(file)
if size < 1024*512:
data = open(file, 'rb').read()
import mmap
filefd = open(file, 'rb')
if sys.platform[:3] != 'win':
data = mmap.mmap(filefd.fileno(), os.path.getsize(file),
data = mmap.mmap(filefd.fileno(), os.path.getsize(file))
data = buffer(data) <---- line 2916

when commiting files > 512Kb, I am running into the above issue. I am able to
use osc to commit files smaller than 512KB without problems.

The link seems to suggest buffering
in python 2.7 has to be handled differently, Using memoryview?

Did anyone run into this issue? Any ideas on how to fix the issue?

Thank you
Praveen K Paladugu
Dell Linux Engineering

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

< Previous Next >
Follow Ups