Hello community, here is the log from the commit of package python3-requests for openSUSE:Factory checked in at 2015-05-11 19:39:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-requests (Old) and /work/SRC/openSUSE:Factory/.python3-requests.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-requests" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-requests/python3-requests.changes 2015-04-25 11:26:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-requests.new/python3-requests.changes 2015-05-11 19:49:10.000000000 +0200 @@ -1,0 +2,7 @@ +Sat May 9 16:37:06 UTC 2015 - a...@gmx.de + +- update to version 2.7.0: + * Updated urllib3 to 1.10.4, resolving several bugs involving + chunked transfer encoding and response framing. + +------------------------------------------------------------------- Old: ---- requests-2.6.2.tar.gz New: ---- requests-2.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-requests.spec ++++++ --- /var/tmp/diff_new_pack.ylTgDK/_old 2015-05-11 19:49:11.000000000 +0200 +++ /var/tmp/diff_new_pack.ylTgDK/_new 2015-05-11 19:49:11.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-requests -Version: 2.6.2 +Version: 2.7.0 Release: 0 Url: http://python-requests.org Summary: Awesome Python HTTP Library That's Actually Usable ++++++ requests-2.6.2.tar.gz -> requests-2.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/HISTORY.rst new/requests-2.7.0/HISTORY.rst --- old/requests-2.6.2/HISTORY.rst 2015-04-23 18:28:35.000000000 +0200 +++ new/requests-2.7.0/HISTORY.rst 2015-05-03 17:00:37.000000000 +0200 @@ -3,6 +3,17 @@ Release History --------------- +2.7.0 (2015-05-03) +++++++++++++++++++ + +This is the first release that follows our new release process. For more, see +[our documentation](http://docs.python-requests.org/en/latest/community/release-process/). + +**Bugfixes** + +- Updated urllib3 to 1.10.4, resolving several bugs involving chunked transfer + encoding and response framing. + 2.6.2 (2015-04-23) ++++++++++++++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/PKG-INFO new/requests-2.7.0/PKG-INFO --- old/requests-2.6.2/PKG-INFO 2015-04-23 18:30:21.000000000 +0200 +++ new/requests-2.7.0/PKG-INFO 2015-05-03 17:01:16.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: requests -Version: 2.6.2 +Version: 2.7.0 Summary: Python HTTP for Humans. Home-page: http://python-requests.org Author: Kenneth Reitz @@ -100,6 +100,17 @@ Release History --------------- + 2.7.0 (2015-05-03) + ++++++++++++++++++ + + This is the first release that follows our new release process. For more, see + [our documentation](http://docs.python-requests.org/en/latest/community/release-process/). + + **Bugfixes** + + - Updated urllib3 to 1.10.4, resolving several bugs involving chunked transfer + encoding and response framing. + 2.6.2 (2015-04-23) ++++++++++++++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests/__init__.py new/requests-2.7.0/requests/__init__.py --- old/requests-2.6.2/requests/__init__.py 2015-04-23 18:28:49.000000000 +0200 +++ new/requests-2.7.0/requests/__init__.py 2015-05-03 17:00:37.000000000 +0200 @@ -42,8 +42,8 @@ """ __title__ = 'requests' -__version__ = '2.6.2' -__build__ = 0x020602 +__version__ = '2.7.0' +__build__ = 0x020700 __author__ = 'Kenneth Reitz' __license__ = 'Apache 2.0' __copyright__ = 'Copyright 2015 Kenneth Reitz' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests/api.py new/requests-2.7.0/requests/api.py --- old/requests-2.6.2/requests/api.py 2015-04-22 23:39:52.000000000 +0200 +++ new/requests-2.7.0/requests/api.py 2015-05-03 16:01:44.000000000 +0200 @@ -55,17 +55,18 @@ return response -def get(url, **kwargs): +def get(url, params=None, **kwargs): """Sends a GET request. :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response <Response>` object :rtype: requests.Response """ kwargs.setdefault('allow_redirects', True) - return request('get', url, **kwargs) + return request('get', url, params=params, **kwargs) def options(url, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests/packages/urllib3/__init__.py new/requests-2.7.0/requests/packages/urllib3/__init__.py --- old/requests-2.6.2/requests/packages/urllib3/__init__.py 2015-04-23 18:27:04.000000000 +0200 +++ new/requests-2.7.0/requests/packages/urllib3/__init__.py 2015-05-03 17:00:37.000000000 +0200 @@ -4,7 +4,7 @@ __author__ = 'Andrey Petrov (andrey.pet...@shazow.net)' __license__ = 'MIT' -__version__ = '1.10.3' +__version__ = '1.10.4' from .connectionpool import ( @@ -57,9 +57,10 @@ import warnings # SecurityWarning's always go off by default. -warnings.simplefilter('always', exceptions.SecurityWarning) +warnings.simplefilter('always', exceptions.SecurityWarning, append=True) # InsecurePlatformWarning's don't vary between requests, so we keep it default. -warnings.simplefilter('default', exceptions.InsecurePlatformWarning) +warnings.simplefilter('default', exceptions.InsecurePlatformWarning, + append=True) def disable_warnings(category=exceptions.HTTPWarning): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests/packages/urllib3/response.py new/requests-2.7.0/requests/packages/urllib3/response.py --- old/requests-2.6.2/requests/packages/urllib3/response.py 2015-04-23 18:26:41.000000000 +0200 +++ new/requests-2.7.0/requests/packages/urllib3/response.py 2015-05-03 17:00:37.000000000 +0200 @@ -126,14 +126,15 @@ # Are we using the chunked-style of transfer encoding? self.chunked = False self.chunk_left = None - tr_enc = self.headers.get('transfer-encoding', '') - if tr_enc.lower() == "chunked": + tr_enc = self.headers.get('transfer-encoding', '').lower() + # Don't incur the penalty of creating a list and then discarding it + encodings = (enc.strip() for enc in tr_enc.split(",")) + if "chunked" in encodings: self.chunked = True # We certainly don't want to preload content when the response is chunked. - if not self.chunked: - if preload_content and not self._body: - self._body = self.read(decode_content=decode_content) + if not self.chunked and preload_content and not self._body: + self._body = self.read(decode_content=decode_content) def get_redirect_location(self): """ @@ -179,9 +180,8 @@ # Note: content-encoding value should be case-insensitive, per RFC 7230 # Section 3.2 content_encoding = self.headers.get('content-encoding', '').lower() - if self._decoder is None: - if content_encoding in self.CONTENT_DECODERS: - self._decoder = _get_decoder(content_encoding) + if self._decoder is None and content_encoding in self.CONTENT_DECODERS: + self._decoder = _get_decoder(content_encoding) def _decode(self, data, decode_content, flush_decoder): """ @@ -299,10 +299,9 @@ If True, will attempt to decode the body based on the 'content-encoding' header. """ - self._init_decoder() if self.chunked: - for line in self.read_chunked(amt): - yield self._decode(line, decode_content, True) + for line in self.read_chunked(amt, decode_content=decode_content): + yield line else: while not is_fp_closed(self._fp): data = self.read(amt=amt, decode_content=decode_content) @@ -387,48 +386,70 @@ b[:len(temp)] = temp return len(temp) - def read_chunked(self, amt=None): - # FIXME: Rewrite this method and make it a class with - # a better structured logic. + def _update_chunk_length(self): + # First, we'll figure out length of a chunk and then + # we'll try to read it from socket. + if self.chunk_left is not None: + return + line = self._fp.fp.readline() + line = line.split(b';', 1)[0] + try: + self.chunk_left = int(line, 16) + except ValueError: + # Invalid chunked protocol response, abort. + self.close() + raise httplib.IncompleteRead(line) + + def _handle_chunk(self, amt): + returned_chunk = None + if amt is None: + chunk = self._fp._safe_read(self.chunk_left) + returned_chunk = chunk + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + elif amt < self.chunk_left: + value = self._fp._safe_read(amt) + self.chunk_left = self.chunk_left - amt + returned_chunk = value + elif amt == self.chunk_left: + value = self._fp._safe_read(amt) + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + returned_chunk = value + else: # amt > self.chunk_left + returned_chunk = self._fp._safe_read(self.chunk_left) + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + return returned_chunk + + def read_chunked(self, amt=None, decode_content=None): + """ + Similar to :meth:`HTTPResponse.read`, but with an additional + parameter: ``decode_content``. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + self._init_decoder() + # FIXME: Rewrite this method and make it a class with a better structured logic. if not self.chunked: raise ResponseNotChunked("Response is not chunked. " "Header 'transfer-encoding: chunked' is missing.") + + if self._original_response and self._original_response._method.upper() == 'HEAD': + # Don't bother reading the body of a HEAD request. + # FIXME: Can we do this somehow without accessing private httplib _method? + self._original_response.close() + return + while True: - # First, we'll figure out length of a chunk and then - # we'll try to read it from socket. - if self.chunk_left is None: - line = self._fp.fp.readline() - line = line.decode() - # See RFC 7230: Chunked Transfer Coding. - i = line.find(';') - if i >= 0: - line = line[:i] # Strip chunk-extensions. - try: - self.chunk_left = int(line, 16) - except ValueError: - # Invalid chunked protocol response, abort. - self.close() - raise httplib.IncompleteRead(''.join(line)) - if self.chunk_left == 0: - break - if amt is None: - chunk = self._fp._safe_read(self.chunk_left) - yield chunk - self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. - self.chunk_left = None - elif amt < self.chunk_left: - value = self._fp._safe_read(amt) - self.chunk_left = self.chunk_left - amt - yield value - elif amt == self.chunk_left: - value = self._fp._safe_read(amt) - self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. - self.chunk_left = None - yield value - else: # amt > self.chunk_left - yield self._fp._safe_read(self.chunk_left) - self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. - self.chunk_left = None + self._update_chunk_length() + if self.chunk_left == 0: + break + chunk = self._handle_chunk(amt) + yield self._decode(chunk, decode_content=decode_content, + flush_decoder=True) # Chunk content ends with \r\n: discard it. while True: @@ -440,5 +461,6 @@ break # We read everything; close the "file". + if self._original_response: + self._original_response.close() self.release_conn() - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests/packages/urllib3/util/url.py new/requests-2.7.0/requests/packages/urllib3/util/url.py --- old/requests-2.6.2/requests/packages/urllib3/util/url.py 2015-04-23 18:26:41.000000000 +0200 +++ new/requests-2.7.0/requests/packages/urllib3/util/url.py 2015-05-03 17:00:37.000000000 +0200 @@ -15,6 +15,8 @@ def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None, query=None, fragment=None): + if path and not path.startswith('/'): + path = '/' + path return super(Url, cls).__new__(cls, scheme, auth, host, port, path, query, fragment) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-2.6.2/requests.egg-info/PKG-INFO new/requests-2.7.0/requests.egg-info/PKG-INFO --- old/requests-2.6.2/requests.egg-info/PKG-INFO 2015-04-23 18:30:21.000000000 +0200 +++ new/requests-2.7.0/requests.egg-info/PKG-INFO 2015-05-03 17:01:16.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: requests -Version: 2.6.2 +Version: 2.7.0 Summary: Python HTTP for Humans. Home-page: http://python-requests.org Author: Kenneth Reitz @@ -100,6 +100,17 @@ Release History --------------- + 2.7.0 (2015-05-03) + ++++++++++++++++++ + + This is the first release that follows our new release process. For more, see + [our documentation](http://docs.python-requests.org/en/latest/community/release-process/). + + **Bugfixes** + + - Updated urllib3 to 1.10.4, resolving several bugs involving chunked transfer + encoding and response framing. + 2.6.2 (2015-04-23) ++++++++++++++++++