Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 899001 Details for
Bug 920778
Review Request: python-MultipartPostHandler2 - A handler for urllib2 to enable multipart form uploading
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0.1.4.patch
0.1.4.patch (text/plain), 5.07 KB, created by
Sergio Basto
on 2014-05-25 03:28:27 UTC
(
hide
)
Description:
0.1.4.patch
Filename:
MIME Type:
Creator:
Sergio Basto
Created:
2014-05-25 03:28:27 UTC
Size:
5.07 KB
patch
obsolete
>diff --git a/python-MultipartPostHandler2-python3.patch b/python-MultipartPostHandler2-python3.patch >index d6e0108..0f34fc6 100644 >--- a/python-MultipartPostHandler2-python3.patch >+++ b/python-MultipartPostHandler2-python3.patch >@@ -1,16 +1,16 @@ >-diff -ruN a/MultipartPostHandler-example.py b/MultipartPostHandler-example.py >---- a/MultipartPostHandler-example.py 2013-03-21 20:12:27.959314233 +0100 >-+++ b/MultipartPostHandler-example.py 2013-03-22 14:02:15.151389848 +0100 >-@@ -13,17 +13,19 @@ >+diff -ruN a/examples/MultipartPostHandler-example.py b/MultipartPostHandler-example.py >+--- ./examples/MultipartPostHandler-example.py.orig 2014-05-25 04:06:39.038501999 +0100 >++++ ./examples/MultipartPostHandler-example.py 2014-05-25 04:07:14.814883528 +0100 >+@@ -13,17 +13,19 @@ def main(): > def validateFile(url): > temp = tempfile.mkstemp(suffix=".html") > os.write(temp[0], opener.open(url).read()) > + # use the encoding of the uploaded page in open().read().decode() >- params = { "ss" : "0", # show source >- "doctype" : "Inline", >-- "uploaded_file" : open(temp[1], "rb") } >-- print(opener.open(validatorURL, params).read()) >-+ "uploaded_file" : open(temp[1], "rb").read().decode('utf-8') } >+ params = { "ss" : "0", # show source >+ "doctype" : "Inline", >+- "uploaded_file" : open(temp[1], "rb") } >+- print opener.open(validatorURL, params).read() >++ "uploaded_file" : open(temp[1], "rb").read().decode('utf-8') } > + # use the encoding of the validator here > + print(opener.open(validatorURL, params).read().decode('utf-8')) > os.remove(temp[1]) >@@ -24,10 +24,9 @@ diff -ruN a/MultipartPostHandler-example.py b/MultipartPostHandler-example.py > > if __name__=="__main__": > main() >-diff -ruN a/MultipartPostHandler.py b/MultipartPostHandler.py >---- a/MultipartPostHandler.py 2013-03-21 20:12:28.001314190 +0100 >-+++ b/MultipartPostHandler.py 2013-03-22 12:47:39.280527608 +0100 >-@@ -38,9 +38,8 @@ >+--- ./MultipartPostHandler.py.orig 2014-05-25 04:09:41.800449820 +0100 >++++ ./MultipartPostHandler.py 2014-05-25 04:09:41.847450321 +0100 >+@@ -51,9 +51,8 @@ Example: > > import urllib.request, urllib.parse, urllib.error > import urllib.request, urllib.error, urllib.parse >@@ -39,7 +38,7 @@ diff -ruN a/MultipartPostHandler.py b/MultipartPostHandler.py > > class Callable: > def __init__(self, anycallable): >-@@ -60,7 +59,7 @@ >+@@ -73,7 +72,7 @@ class MultipartPostHandler(urllib.reques > v_vars = [] > try: > for(key, value) in list(data.items()): >@@ -48,7 +47,7 @@ diff -ruN a/MultipartPostHandler.py b/MultipartPostHandler.py > v_files.append((key, value)) > else: > v_vars.append((key, value)) >-@@ -78,7 +77,7 @@ >+@@ -91,7 +90,7 @@ class MultipartPostHandler(urllib.reques > print("Replacing %s with %s" % (request.get_header('content-type'), 'multipart/form-data')) > request.add_unredirected_header('Content-Type', contenttype) > >diff --git a/python-MultipartPostHandler2.spec b/python-MultipartPostHandler2.spec >index 4afa820..9804dd6 100644 >--- a/python-MultipartPostHandler2.spec >+++ b/python-MultipartPostHandler2.spec >@@ -3,17 +3,14 @@ > #%%global locally 1 > %global pypi_name MultipartPostHandler2 > Name: python-%{pypi_name} >-Version: 0.1.1 >-Release: 6%{?dist} >+Version: 0.1.4 >+Release: 1%{?dist} > Summary: A handler for urllib2 to enable multipart form uploading > # License note in MultipartPostHandler.py > License: LGPLv2+ > URL: http://pypi.python.org/pypi/%{pypi_name}/%{version} > Source0: http://pypi.python.org/packages/source/M/%{pypi_name}/%{pypi_name}-%{version}.tar.gz > >-# Remove the example in main() from the library and keep it separated >-Patch0: %{name}-cut-out-main.patch >- > # Several Python3 specific things, needs to be applied after 2to3! > Patch1: %{name}-python3.patch > >@@ -42,7 +39,6 @@ Enables the use of multipart/form-data for posting forms. > > %prep > %setup -q -n %{pypi_name}-%{version} >-%patch0 -p1 > rm -rf doc # no real doc there > > %if 0%{?with_python3} >@@ -54,7 +50,7 @@ find . -name '*.py' | xargs sed -i '1s|^#!%{__python}|#!%{__python3}|' > %patch1 -p1 > cd - > # copy the example back so it can be used in %%doc >-cp %{py3dir}/MultipartPostHandler-example.py python3-MultipartPostHandler-example.py >+cp %{py3dir}/examples/MultipartPostHandler-example.py python3-MultipartPostHandler-example.py > %endif # with_python3 > > %build >@@ -86,13 +82,16 @@ cd - > %endif # locally > > %files >-%doc README.txt MultipartPostHandler-example.py >+%doc README.txt examples/MultipartPostHandler-example.py > %{python_sitelib}/* > %files -n python3-%{pypi_name} > %doc README.txt python3-MultipartPostHandler-example.py > %{python3_sitelib}/* > > %changelog >+* Sun May 25 2014 Sérgio Basto <sergio@serjux.com> - 0.1.4-1 >+- Update to 0.1.4 >+ > * Fri May 02 2014 Miro HronÄok <mhroncok@redhat.com> - 0.1.1-6 > - Rebuilt for Python 3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 920778
: 899001 |
899012