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 = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 52, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 310, in main
return self.cmd(args)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 333, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 449, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1179, in
_dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 3746, in
do_commit
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/core.py", line 770, in commit
p.commit(msg, validators_dir=validators_dir, verbose=verbose,
skip_local_service_run=skip_local_service_run)
File "/usr/lib/python2.7/site-packages/osc/core.py", line 1286, in commit
self.put_source_file(filename)
File "/usr/lib/python2.7/site-packages/osc/core.py", line 1142, in
put_source_file
http_PUT(u, file = os.path.join(self.dir, n))
File "/usr/lib/python2.7/site-packages/osc/core.py", line 2949, in http_PUT
def http_PUT(*args, **kwargs): return http_request('PUT', *args,
**kwargs)
File "/usr/lib/python2.7/site-packages/osc/core.py", line 2935, in
http_request
fd = urllib2.urlopen(req, data=data)
File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 392, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 410, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 370, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 208, in https_open
h.request(req.get_method(), selector, req.data, headers)
File "/usr/lib64/python2.7/httplib.py", line 941, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 975, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 937, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 801, in _send_output
self.send(message_body)
File "/usr/lib64/python2.7/httplib.py", line 773, in send
self.sock.sendall(data)
File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line
222, in write
return self._write_bio(data)
File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", 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
/usr/lib/python2.7/site-packages/osc/core.py

if file and not data:
size = os.path.getsize(file)
if size < 1024*512:
data = open(file, 'rb').read()
else:
import mmap
filefd = open(file, 'rb')
try:
if sys.platform[:3] != 'win':
data = mmap.mmap(filefd.fileno(), os.path.getsize(file),
mmap.MAP_SHARED, mmap.PROT_READ)
else:
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 http://docs.python.org/c-api/buffer.html 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