tags 638707 + patch
tags 638707 + pending
thanks

Dear Robert,

I've prepared an NMU for python-poster (versioned as 0.8.1-0.1) and
Jakub Wilk uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Regards,
    +Emilien
diff -Nru python-poster-0.7.0/debian/changelog 
python-poster-0.8.1/debian/changelog
--- python-poster-0.7.0/debian/changelog        2011-12-10 11:44:12.000000000 
+0100
+++ python-poster-0.8.1/debian/changelog        2011-12-10 11:44:14.000000000 
+0100
@@ -1,3 +1,10 @@
+python-poster (0.8.1-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream release (Closes: #638707)
+
+ -- Emilien Klein <emilien+deb...@klein.st>  Fri, 09 Dec 2011 21:19:18 +0100
+
 python-poster (0.7.0-1.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru python-poster-0.7.0/MANIFEST.in python-poster-0.8.1/MANIFEST.in
--- python-poster-0.7.0/MANIFEST.in     2009-01-06 22:15:06.000000000 +0100
+++ python-poster-0.8.1/MANIFEST.in     2011-04-16 15:36:56.000000000 +0200
@@ -1 +1,2 @@
 include tests/*.py
+exclude setup.cfg
diff -Nru python-poster-0.7.0/PKG-INFO python-poster-0.8.1/PKG-INFO
--- python-poster-0.7.0/PKG-INFO        2010-10-23 17:52:24.000000000 +0200
+++ python-poster-0.8.1/PKG-INFO        2011-04-16 15:40:23.000000000 +0200
@@ -1,12 +1,12 @@
 Metadata-Version: 1.0
 Name: poster
-Version: 0.7.0
+Version: 0.8.1
 Summary: Streaming HTTP uploads and multipart/form-data encoding
 Home-page: http://atlee.ca/software/poster
 Author: Chris AtLee
 Author-email: ch...@atlee.ca
 License: MIT
-Download-URL: http://atlee.ca/software/poster/dist/0.7.0
+Download-URL: http://atlee.ca/software/poster/dist/0.8.1
 Description: The modules in the Python standard library don't provide a way to 
upload large
         files via HTTP without having to load the entire file into memory 
first.
         
diff -Nru python-poster-0.7.0/poster/encode.py 
python-poster-0.8.1/poster/encode.py
--- python-poster-0.7.0/poster/encode.py        2010-10-23 17:15:06.000000000 
+0200
+++ python-poster-0.8.1/poster/encode.py        2010-12-03 06:25:52.000000000 
+0100
@@ -22,6 +22,11 @@
         return sha.new(str(bits)).hexdigest()
 
 import urllib, re, os, mimetypes
+try:
+    from email.header import Header
+except ImportError:
+    # Python 2.4
+    from email.Header import Header
 
 def encode_and_quote(data):
     """If ``data`` is unicode, return urllib.quote_plus(data.encode("utf-8"))
@@ -76,7 +81,7 @@
     """
     def __init__(self, name, value=None, filename=None, filetype=None,
                         filesize=None, fileobj=None, cb=None):
-        self.name = encode_and_quote(name)
+        self.name = Header(name).encode()
         self.value = _strify(value)
         if filename is None:
             self.filename = None
@@ -195,11 +200,6 @@
 
         headers.append("Content-Type: %s" % filetype)
 
-        if self.filesize is not None:
-            headers.append("Content-Length: %i" % self.filesize)
-        else:
-            headers.append("Content-Length: %i" % len(self.value))
-
         headers.append("")
         headers.append("")
 
diff -Nru python-poster-0.7.0/poster/__init__.py 
python-poster-0.8.1/poster/__init__.py
--- python-poster-0.7.0/poster/__init__.py      2010-10-23 17:19:56.000000000 
+0200
+++ python-poster-0.8.1/poster/__init__.py      2011-02-13 20:12:47.000000000 
+0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 Chris AtLee
+# Copyright (c) 2011 Chris AtLee
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -29,4 +29,4 @@
 import poster.streaminghttp
 import poster.encode
 
-version = (0, 7, 0) # Thanks JP!
+version = (0, 8, 1) # Thanks JP!
diff -Nru python-poster-0.7.0/poster/streaminghttp.py 
python-poster-0.8.1/poster/streaminghttp.py
--- python-poster-0.7.0/poster/streaminghttp.py 2010-09-03 16:59:41.000000000 
+0200
+++ python-poster-0.8.1/poster/streaminghttp.py 2011-04-16 15:24:30.000000000 
+0200
@@ -181,16 +181,18 @@
             return urllib2.HTTPSHandler.do_request_(self, req)
 
 
+def get_handlers():
+    handlers = [StreamingHTTPHandler, StreamingHTTPRedirectHandler]
+    if hasattr(httplib, "HTTPS"):
+        handlers.append(StreamingHTTPSHandler)
+    return handlers
+    
 def register_openers():
     """Register the streaming http handlers in the global urllib2 default
     opener object.
 
     Returns the created OpenerDirector object."""
-    handlers = [StreamingHTTPHandler, StreamingHTTPRedirectHandler]
-    if hasattr(httplib, "HTTPS"):
-        handlers.append(StreamingHTTPSHandler)
-
-    opener = urllib2.build_opener(*handlers)
+    opener = urllib2.build_opener(*get_handlers())
 
     urllib2.install_opener(opener)
 
diff -Nru python-poster-0.7.0/poster.egg-info/PKG-INFO 
python-poster-0.8.1/poster.egg-info/PKG-INFO
--- python-poster-0.7.0/poster.egg-info/PKG-INFO        2010-10-23 
17:52:24.000000000 +0200
+++ python-poster-0.8.1/poster.egg-info/PKG-INFO        2011-12-10 
11:44:14.000000000 +0100
@@ -1,12 +1,12 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: poster
-Version: 0.7.0
+Version: 0.8.1
 Summary: Streaming HTTP uploads and multipart/form-data encoding
 Home-page: http://atlee.ca/software/poster
 Author: Chris AtLee
 Author-email: ch...@atlee.ca
 License: MIT
-Download-URL: http://atlee.ca/software/poster/dist/0.7.0
+Download-URL: http://atlee.ca/software/poster/dist/0.8.1
 Description: The modules in the Python standard library don't provide a way to 
upload large
         files via HTTP without having to load the entire file into memory 
first.
         
diff -Nru python-poster-0.7.0/poster.egg-info/SOURCES.txt 
python-poster-0.8.1/poster.egg-info/SOURCES.txt
--- python-poster-0.7.0/poster.egg-info/SOURCES.txt     2010-10-23 
17:52:24.000000000 +0200
+++ python-poster-0.8.1/poster.egg-info/SOURCES.txt     2011-04-16 
15:40:23.000000000 +0200
@@ -1,5 +1,4 @@
 MANIFEST.in
-setup.cfg
 setup.py
 poster/__init__.py
 poster/encode.py
diff -Nru python-poster-0.7.0/setup.cfg python-poster-0.8.1/setup.cfg
--- python-poster-0.7.0/setup.cfg       2010-10-23 17:52:24.000000000 +0200
+++ python-poster-0.8.1/setup.cfg       2011-04-16 15:40:23.000000000 +0200
@@ -3,21 +3,3 @@
 tag_date = 0
 tag_svn_revision = 0
 
-[global]
-command_packages = buildutils.publish_command, buildutils.announce_command
-
-[nosetests]
-with-doctest = 1
-
-[publish]
-dist-dest = 
scp://timat...@atlee.ca/home2/timatlee/public_html/atlee.ca/software/poster/dist/${version}
-doc-dest = 
scp://timat...@atlee.ca/home2/timatlee/public_html/atlee.ca/software/poster/
-make-dirs = 1
-doc-dir = build/docs
-
-[build_sphinx]
-build-dir = build/docs
-
-[aliases]
-distribute = sphinx sdist bdist_egg publish
-
diff -Nru python-poster-0.7.0/tests/test_encode.py 
python-poster-0.8.1/tests/test_encode.py
--- python-poster-0.7.0/tests/test_encode.py    2010-09-03 17:03:44.000000000 
+0200
+++ python-poster-0.8.1/tests/test_encode.py    2010-12-03 06:35:48.000000000 
+0100
@@ -13,29 +13,46 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 3
 
 bar
 """)
         self.assertEqual(expected,
                 poster.encode.encode_string("XXXXXXXXX", "foo", "bar"))
 
-    def test_quote_name(self):
+    def test_quote_name_space(self):
         expected = unix2dos("""--XXXXXXXXX
-Content-Disposition: form-data; name="foo+baz"
+Content-Disposition: form-data; name="foo baz"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 3
 
 bar
 """)
         self.assertEqual(expected,
                 poster.encode.encode_string("XXXXXXXXX", "foo baz", "bar"))
 
+    def test_quote_name_phparray(self):
+        expected = unix2dos("""--XXXXXXXXX
+Content-Disposition: form-data; name="files[]"
+Content-Type: text/plain; charset=utf-8
+
+bar
+""")
+        self.assertEqual(expected,
+                poster.encode.encode_string("XXXXXXXXX", "files[]", "bar"))
+
+    def test_quote_unicode_name(self):
+        expected = unix2dos("""--XXXXXXXXX
+Content-Disposition: form-data; name="=?utf-8?b?4piD?="
+Content-Type: text/plain; charset=utf-8
+
+bar
+""")
+        self.assertEqual(expected,
+                poster.encode.encode_string("XXXXXXXXX", u"\N{SNOWMAN}", 
"bar"))
+
     def test_quote_value(self):
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 11
 
 bar baz@bat
 """)
@@ -46,7 +63,6 @@
         expected = unix2dos("""--ABC+DEF
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 3
 
 bar
 """)
@@ -57,7 +73,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 4
 
 b\xc3\xa1r
 """)
@@ -70,7 +85,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -80,7 +94,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"
 Content-Type: text/html
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -90,7 +103,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"; filename="test.txt"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -101,7 +113,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"; filename="test file.txt"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -111,7 +122,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"; filename="test\\"file.txt"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -122,7 +132,6 @@
         expected = unix2dos("""--XXXXXXXXX
 Content-Disposition: form-data; name="foo"; filename="&#9731;.txt"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 42
 
 """)
         self.assertEqual(expected,
@@ -182,7 +191,6 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 3
 
 bar
 --XYZXYZXYZ--
@@ -210,13 +218,11 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="key"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 6
 
 value1
 --XYZXYZXYZ
 Content-Disposition: form-data; name="key"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 6
 
 value2
 --XYZXYZXYZ--
@@ -234,7 +240,6 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 9
 
 file data
 --XYZXYZXYZ--
@@ -250,7 +255,6 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 3
 
 bar
 --XYZXYZXYZ--
@@ -268,13 +272,11 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="key"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 6
 
 value1
 --XYZXYZXYZ
 Content-Disposition: form-data; name="key"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 6
 
 value2
 --XYZXYZXYZ--
@@ -295,7 +297,6 @@
         expected = unix2dos("""--XYZXYZXYZ
 Content-Disposition: form-data; name="foo"
 Content-Type: text/plain; charset=utf-8
-Content-Length: 9
 
 file data
 --XYZXYZXYZ--

Reply via email to