[Python-checkins] (no subject)

José Roberto Meza Cabrera webhook-mailer at python.org
Wed Mar 11 19:51:25 EDT 2020




To: python-checkins at python.org
Subject:
 bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/276a84a0a6c694ce227bf36ec2e2e6ec6686=
170f
commit: 276a84a0a6c694ce227bf36ec2e2e6ec6686170f
branch: master
author: Jos=C3=A9 Roberto Meza Cabrera <robertpro01 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-03-11T23:51:20Z
summary:

bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167)

files:
A Misc/NEWS.d/next/Tools-Demos/2019-09-18-13-49-56.bpo-38080.Nbl7lF.rst
M Lib/lib2to3/fixes/fix_urllib.py
M Lib/lib2to3/tests/test_fixers.py

diff --git a/Lib/lib2to3/fixes/fix_urllib.py b/Lib/lib2to3/fixes/fix_urllib.py
index 5a36049df5cb0..ab892bc52494c 100644
--- a/Lib/lib2to3/fixes/fix_urllib.py
+++ b/Lib/lib2to3/fixes/fix_urllib.py
@@ -13,7 +13,7 @@
                 ("urllib.request",
                     ["URLopener", "FancyURLopener", "urlretrieve",
                      "_urlopener", "urlopen", "urlcleanup",
-                     "pathname2url", "url2pathname"]),
+                     "pathname2url", "url2pathname", "getproxies"]),
                 ("urllib.parse",
                     ["quote", "quote_plus", "unquote", "unquote_plus",
                      "urlencode", "splitattr", "splithost", "splitnport",
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers=
.py
index a285241981813..121ebe68e5402 100644
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -1913,7 +1913,11 @@ def foo():
 """
         self.check(b, a)
=20
+    def test_single_import(self):
+        b =3D "from urllib import getproxies"
+        a =3D "from urllib.request import getproxies"
=20
+        self.check(b, a)
=20
     def test_import_module_usage(self):
         for old, changes in self.modules.items():
diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-09-18-13-49-56.bpo-38080.Nbl7l=
F.rst b/Misc/NEWS.d/next/Tools-Demos/2019-09-18-13-49-56.bpo-38080.Nbl7lF.rst
new file mode 100644
index 0000000000000..1b6def15e722e
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2019-09-18-13-49-56.bpo-38080.Nbl7lF.rst
@@ -0,0 +1,2 @@
+Added support to fix ``getproxies`` in the :mod:`lib2to3.fixes.fix_urllib`
+module. Patch by Jos=C3=A9 Roberto Meza Cabrera.



More information about the Python-checkins mailing list