Project

General

Profile

Bug #12742

pkg server tracebacks with TypeError: string argument expected, got 'bytes'

Added by Alexander Pyhalov 11 months ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

After recent updates when you try to look at pkg summary in pkg server web ui, you get

Traceback (most recent call last):
  File "/usr/lib/python3.5/vendor-packages/cherrypy/_cprequest.py", line 630, in respond
    self._do_respond(path_info)
  File "/usr/lib/python3.5/vendor-packages/cherrypy/_cprequest.py", line 689, in _do_respond
    response.body = self.handler()
  File "/usr/lib/python3.5/vendor-packages/cherrypy/lib/encoding.py", line 221, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python3.5/vendor-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python3.5/vendor-packages/pkg/server/depot.py", line 1360, in info_0
    ignore_hash=True)
  File "/usr/lib/python3.5/vendor-packages/pkg/misc.py", line 449, in gunzip_from_stream
    outfile.write(ubuf)

In depot.py we have on line 1348 and later:

 lsummary = cStringIO()
...
    with open(lpath, "rb") as lfile:
                                misc.gunzip_from_stream(lfile, lsummary,
                                    ignore_hash=True)
...

But lsummary is string object, and gunzip_from_file expects byte object.

#1

Updated by Alexander Pyhalov 11 months ago

  • Description updated (diff)
#2

Updated by Alexander Pyhalov 11 months ago

  • Status changed from New to Resolved
  • Assignee set to Alexander Pyhalov

Also available in: Atom PDF