python3.5 contentsource.py:UrlContentSource passes -1 to fd.read

Bug #1523682 reported by Blake Rouse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
simplestreams
Fix Released
Medium
Unassigned
simplestreams (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Passing -1 to http.client.read fails with the following error:

   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 83, in sync
     content, payload = reader.read_json(path)
   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 40, in read_json
     raw = source.read().decode('utf-8')
   File "/usr/lib/python3/dist-packages/simplestreams/contentsource.py", line 144, in read
     return self.fd.read(size)
   File "/usr/lib/python3/dist-packages/simplestreams/contentsource.py", line 341, in read
     return self.req.read(size)
   File "/usr/lib/python3.5/http/client.py", line 432, in read
     b = bytearray(amt)
 builtins.ValueError: negative count

In that case above size is -1, in python 3 that is in Xenial is should be None.

Related branches

Scott Moser (smoser)
Changed in simplestreams:
status: New → Confirmed
importance: Undecided → Medium
Changed in simplestreams (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package simplestreams - 0.1.0~bzr420-0ubuntu1

---------------
simplestreams (0.1.0~bzr420-0ubuntu1) xenial; urgency=medium

  * New upstream snapshot.
    - sstream-query, sstream-mirror: fix a bug where --no-verify did not
      work with signed streams.
    - sanitize size parameter to read on Readers to address differences
      in python2 and python3 (LP: #1523682).
  * debian/control:
    - bump standards version
    - add build-depends on python-requests, python3-requests
    - add build-depends on dh-python
  * debian/copyright: fix lintian error by changing license name
    'agplv3' to 'AGPL-3'

 -- Scott Moser <email address hidden> Tue, 08 Dec 2015 16:20:28 -0500

Changed in simplestreams (Ubuntu):
status: Confirmed → Fix Released
Changed in simplestreams:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.