From 2fd585396fb0d89e92436e910fbcfc125837dc4ec58f0e9cd754d2910cc2b3a3 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Fri, 27 Aug 2010 13:52:52 +0000 Subject: [PATCH] Accepting request 46366 from home:Marcus_H:branches:devel:languages:python:Factory Copy from home:Marcus_H:branches:devel:languages:python:Factory/python via accept of submit request 46366 revision 2. Request was accepted with message: OBS-URL: https://build.opensuse.org/request/show/46366 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=78 --- python-base.changes | 5 ++++ python-base.spec | 2 ++ ...2-AbstractBasicAuthHandler_reset_attr.diff | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 urllib2-AbstractBasicAuthHandler_reset_attr.diff diff --git a/python-base.changes b/python-base.changes index 3fc9569..d2af42f 100644 --- a/python-base.changes +++ b/python-base.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 26 15:13:49 UTC 2010 - suse-tux@gmx.de + +- fix for urllib2 (http://bugs.python.org/issue9639) + ------------------------------------------------------------------- Thu Aug 26 13:45:19 UTC 2010 - jmatejek@novell.com diff --git a/python-base.spec b/python-base.spec index ffa6509..801d724 100644 --- a/python-base.spec +++ b/python-base.spec @@ -49,6 +49,7 @@ Patch6: python-2.6-gettext-plurals.patch Patch7: python-2.6.5-distutils_test_path.patch Patch8: sparc_longdouble.patch Patch9: python-2.7-acrequire.patch +Patch10: urllib2-AbstractBasicAuthHandler_reset_attr.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %define python_version %(echo %{version} | head -c 3) @@ -137,6 +138,7 @@ Authors: %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 # some cleanup find . -name .cvsignore -type f -print0 | xargs -0 rm -f diff --git a/urllib2-AbstractBasicAuthHandler_reset_attr.diff b/urllib2-AbstractBasicAuthHandler_reset_attr.diff new file mode 100644 index 0000000..46886aa --- /dev/null +++ b/urllib2-AbstractBasicAuthHandler_reset_attr.diff @@ -0,0 +1,27 @@ +Index: Lib/urllib2.py +=================================================================== +--- Lib/urllib2.py (Revision 84196) ++++ Lib/urllib2.py (Arbeitskopie) +@@ -821,6 +821,9 @@ + self.add_password = self.passwd.add_password + self.retried = 0 + ++ def reset_retry_count(self): ++ self.retried = 0 ++ + def http_error_auth_reqed(self, authreq, host, req, headers): + # host may be an authority (without userinfo) or a URL with an + # authority +@@ -860,8 +863,10 @@ + + def http_error_401(self, req, fp, code, msg, headers): + url = req.get_full_url() +- return self.http_error_auth_reqed('www-authenticate', +- url, req, headers) ++ response = self.http_error_auth_reqed('www-authenticate', ++ url, req, headers) ++ self.reset_retry_count() ++ return response + + + class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):