Hi,
Please unblock python-webob 0.9.3-1. It's a new upstream but a bug fix
only release.
From upstream changelog:
* Fixed resp.set_cookie(max_age=timedelta(...))
* request.POST now supports PUT requests with the appropriate Content-Type.
It's in unstable since 10 days and no bugs has been reported against it.
Package has one[1] rev. dependency in Lenny: python-weberror and it
works fine with python-webob 0.9.3 (I'm [co-]maintaining all 3 mentioned
packages)
I'm attaching diffstat and
`debdiff python-webob_0.9.{2,3}-1.dsc | filterdiff -x '*/doc/*' -x '*/test/*'`
output.
TIA
[1] python-pylons 0.9.7~rc, which also depends on this package, is in
experimental for now
--
:wq!
PKG-INFO | 2 - WebOb.egg-info/PKG-INFO | 2 - WebOb.egg-info/SOURCES.txt | 1 debian/changelog | 6 +++++ docs/conf.py | 2 - docs/differences.txt | 6 ----- docs/file-example.txt | 6 ++--- docs/index.txt | 2 - docs/news.txt | 8 +++++++ docs/reference.txt | 42 +++++++++++++++++++++++++++------------- docs/test-file.txt | 1 setup.cfg | 4 ++- setup.py | 4 +-- tests/test_request.py | 2 - tests/test_request.txt | 28 ++++++++++++++------------ tests/test_response.txt | 10 ++++----- webob/__init__.py | 47 ++++++++++++++++++++++++++++++++------------- webob/multidict.py | 4 +-- 18 files changed, 114 insertions(+), 63 deletions(-)
diff -Nru python-webob-0.9.2/debian/changelog python-webob-0.9.3/debian/changelog
--- python-webob-0.9.2/debian/changelog 2008-09-25 22:41:58.000000000 +0200
+++ python-webob-0.9.3/debian/changelog 2008-09-25 22:41:58.000000000 +0200
@@ -1,3 +1,9 @@
+python-webob (0.9.3-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Piotr Ożarowski <piotr@debian.org> Mon, 15 Sep 2008 21:26:02 +0200
+
python-webob (0.9.2-1) unstable; urgency=low
* New upstream release
diff -Nru python-webob-0.9.2/docs/conf.py python-webob-0.9.3/docs/conf.py
diff -Nru python-webob-0.9.2/docs/differences.txt python-webob-0.9.3/docs/differences.txt
diff -Nru python-webob-0.9.2/docs/file-example.txt python-webob-0.9.3/docs/file-example.txt
diff -Nru python-webob-0.9.2/docs/index.txt python-webob-0.9.3/docs/index.txt
diff -Nru python-webob-0.9.2/docs/news.txt python-webob-0.9.3/docs/news.txt
diff -Nru python-webob-0.9.2/docs/reference.txt python-webob-0.9.3/docs/reference.txt
diff -Nru python-webob-0.9.2/docs/test-file.txt python-webob-0.9.3/docs/test-file.txt
diff -Nru python-webob-0.9.2/PKG-INFO python-webob-0.9.3/PKG-INFO
--- python-webob-0.9.2/PKG-INFO 2008-06-13 18:46:08.000000000 +0200
+++ python-webob-0.9.3/PKG-INFO 2008-09-15 04:30:33.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: WebOb
-Version: 0.9.2
+Version: 0.9.3
Summary: WSGI request and response object
Home-page: http://pythonpaste.org/webob/
Author: Ian Bicking
diff -Nru python-webob-0.9.2/setup.cfg python-webob-0.9.3/setup.cfg
--- python-webob-0.9.2/setup.cfg 2008-06-13 18:46:08.000000000 +0200
+++ python-webob-0.9.3/setup.cfg 2008-09-15 04:30:33.000000000 +0200
@@ -7,9 +7,11 @@
command_packages = buildutils.pudge_command, buildutils.publish_command
[nosetests]
-detailed-errors = True
doctest-extension = txt
+detailed-errors = True
with-doctest = True
+exclude = jsonrpc-example.txt
+include = docs
[publish]
doc-dest = scp://ianb@webwareforpython.org/home/paste/htdocs/webob/
diff -Nru python-webob-0.9.2/setup.py python-webob-0.9.3/setup.py
--- python-webob-0.9.2/setup.py 2008-06-13 18:45:44.000000000 +0200
+++ python-webob-0.9.3/setup.py 2008-09-15 04:29:54.000000000 +0200
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '0.9.2'
+version = '0.9.3'
setup(name='WebOb',
version=version,
@@ -31,5 +31,5 @@
include_package_data=True,
zip_safe=True,
test_suite='nose.collector',
- tests_require=['dtopt', 'nose', 'webtest']
+ tests_require=['dtopt', 'nose', 'tempita', 'webtest', 'wsgiproxy']
)
diff -Nru python-webob-0.9.2/tests/test_request.py python-webob-0.9.3/tests/test_request.py
diff -Nru python-webob-0.9.2/tests/test_request.txt python-webob-0.9.3/tests/test_request.txt
diff -Nru python-webob-0.9.2/tests/test_response.txt python-webob-0.9.3/tests/test_response.txt
diff -Nru python-webob-0.9.2/webob/__init__.py python-webob-0.9.3/webob/__init__.py
--- python-webob-0.9.2/webob/__init__.py 2008-06-13 18:45:44.000000000 +0200
+++ python-webob-0.9.3/webob/__init__.py 2008-09-15 04:29:54.000000000 +0200
@@ -300,7 +300,7 @@
dt = dt.timetuple()
if isinstance(dt, (tuple, time.struct_time)):
dt = calendar.timegm(dt)
- if not isinstance(dt, (float, int)):
+ if not isinstance(dt, (float, int, long)):
raise ValueError(
"You must pass in a datetime, date, time tuple, or integer object, not %r" % dt)
return formatdate(dt)
@@ -857,14 +857,16 @@
def str_POST(self):
"""
- Return a MultiDict containing all the variables from a POST
- form request. Does *not* return anything for non-POST
- requests or for non-form requests (returns empty dict-like
- object in that case).
+ Return a MultiDict containing all the variables from a form
+ request. Returns an empty dict-like object for non-form
+ requests.
+
+ Form requests are typically POST requests, however PUT requests
+ with an appropriate Content-Type are also supported.
"""
env = self.environ
- if self.method != 'POST':
- return NoVars('Not a POST request')
+ if self.method not in ('POST', 'PUT'):
+ return NoVars('Not a form request')
if 'webob._parsed_post_vars' in env:
vars, body_file = env['webob._parsed_post_vars']
if body_file is self.body_file:
@@ -879,8 +881,9 @@
content_type = self.content_type
if ';' in content_type:
content_type = content_type.split(';', 1)[0]
- if content_type not in ('', 'application/x-www-form-urlencoded',
- 'multipart/form-data'):
+ if (self.method == 'PUT' and not content_type) or \
+ content_type not in ('', 'application/x-www-form-urlencoded',
+ 'multipart/form-data'):
# Not an HTML form submission
return NoVars('Not an HTML form submission (Content-Type: %s)'
% content_type)
@@ -1119,7 +1122,7 @@
if remove_range:
check_keys += ['HTTP_IF_RANGE', 'HTTP_RANGE']
if remove_match:
- check_keys.append('HTTP_IF_MATCH')
+ check_keys.append('HTTP_IF_NONE_MATCH')
if remove_modified:
check_keys.append('HTTP_IF_MODIFIED_SINCE')
if remove_encoding:
@@ -1673,6 +1676,12 @@
raise TypeError(
"You can only set the body to a str (not %s)"
% type(value))
+ try:
+ if self._body or self._app_iter:
+ self.content_md5 = None
+ except AttributeError:
+ # if setting body early in initialization _body and _app_iter don't exist yet
+ pass
self._body = value
self.content_length = len(value)
self._app_iter = None
@@ -1766,7 +1775,7 @@
cookies = BaseCookie()
cookies[key] = value
if isinstance(max_age, timedelta):
- max_age = timedelta.seconds + timedelta.days*24*60*60
+ max_age = max_age.seconds + max_age.days*24*60*60
if max_age is not None and expires is None:
expires = datetime.utcnow() + timedelta(seconds=max_age)
if isinstance(expires, timedelta):
@@ -1786,6 +1795,10 @@
if var_value is not None and var_value is not False:
cookies[key][var_name.replace('_', '-')] = str(var_value)
header_value = cookies[key].output(header='').lstrip()
+ if header_value.endswith(';'):
+ # Python 2.4 adds a trailing ; to the end, strip it to be
+ # consistent with 2.5
+ header_value = header_value[:-1]
self.headerlist.append(('Set-Cookie', header_value))
def delete_cookie(self, key, path='/', domain=None):
@@ -1820,6 +1833,10 @@
del cookies[key]
header = cookies.output(header='').lstrip()
if header:
+ if header.endswith(';'):
+ # Python 2.4 adds a trailing ; to the end, strip it
+ # to be consistent with 2.5
+ header = header[:-1]
self.headers.add('Set-Cookie', header)
if not found:
raise KeyError(
@@ -1954,6 +1971,7 @@
identity are supported).
"""
if encoding == 'identity':
+ self.decode_content()
return
if encoding != 'gzip':
raise ValueError(
@@ -2012,13 +2030,14 @@
etag = header_getter('ETag', rfc_section='14.19')
- def md5_etag(self, body=None, set_content_md5=False):
+ def md5_etag(self, body=None, set_content_md5=False, set_conditional_response=False):
"""
Generate an etag for the response object using an MD5 hash of
the body (the body parameter, or ``self.body`` if not given)
Sets ``self.etag``
- If set_content_md5 is True sets self.content_md5 as well
+ If ``set_content_md5`` is True sets ``self.content_md5`` as well
+ If ``set_conditional_response`` is True sets ``self.conditional_response`` to True
"""
if body is None:
body = self.body
@@ -2028,6 +2047,8 @@
self.etag = md5_digest
if set_content_md5:
self.content_md5 = md5_digest
+ if set_conditional_response:
+ self.conditional_response = True
expires = converter(
header_getter('Expires', rfc_section='14.21'),
diff -Nru python-webob-0.9.2/webob/multidict.py python-webob-0.9.3/webob/multidict.py
--- python-webob-0.9.2/webob/multidict.py 2008-06-13 18:45:44.000000000 +0200
+++ python-webob-0.9.3/webob/multidict.py 2008-09-15 04:29:54.000000000 +0200
@@ -595,8 +595,8 @@
['a', 'a', 'b']
>>> d.items()
[('a', 1), ('a', 2), ('b', 4)]
- >>> d.mixed()
- {'a': [1, 2], 'b': 4}
+ >>> d.mixed() == {'a': [1, 2], 'b': 4}
+ True
>>> MultiDict([('a', 'b')], c=2)
MultiDict([('a', 'b'), ('c', 2)])
"""}
diff -Nru python-webob-0.9.2/WebOb.egg-info/PKG-INFO python-webob-0.9.3/WebOb.egg-info/PKG-INFO
--- python-webob-0.9.2/WebOb.egg-info/PKG-INFO 2008-06-13 18:46:06.000000000 +0200
+++ python-webob-0.9.3/WebOb.egg-info/PKG-INFO 2008-09-15 04:30:32.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: WebOb
-Version: 0.9.2
+Version: 0.9.3
Summary: WSGI request and response object
Home-page: http://pythonpaste.org/webob/
Author: Ian Bicking
diff -Nru python-webob-0.9.2/WebOb.egg-info/SOURCES.txt python-webob-0.9.3/WebOb.egg-info/SOURCES.txt
--- python-webob-0.9.2/WebOb.egg-info/SOURCES.txt 2008-06-13 18:46:07.000000000 +0200
+++ python-webob-0.9.3/WebOb.egg-info/SOURCES.txt 2008-09-15 04:30:32.000000000 +0200
@@ -17,6 +17,7 @@
docs/license.txt
docs/news.txt
docs/reference.txt
+docs/test-file.txt
docs/wiki-example.txt
docs/comment-example-code/example.py
docs/jsonrpc-example-code/jsonrpc.py
Attachment:
pgpL6WqFnkisf.pgp
Description: PGP signature