Issue36948
Created on 2019-05-17 16:09 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 13389 | merged | xtreak, 2019-05-17 16:15 | |
| PR 13422 | closed | miss-islington, 2019-05-19 13:40 | |
| PR 13476 | merged | berker.peksag, 2019-05-21 22:23 | |
| Messages (10) | |||
|---|---|---|---|
| msg342733 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2019-05-17 16:09 | |
In issue27485 the deprecated functions were replaced with underscore prefixed ones due to which imports where modified. Some of the places where not changed causing NameError in using urllib.request.URLopener.retrieve for local files and non-local files which is deprecated. I found these undefined names while running flake8 on Lib folder. I will raise a PR with tests for the same. Sample Error : ./python.exe Python 3.8.0a4+ (heads/master:870b035bc6, May 17 2019, 16:28:23) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.request import URLopener >>> URLopener().retrieve('file:///tmp/a.txt') sys:1: DeprecationWarning: URLopener style of invoking requests is deprecated. Use newer urlopen functions/methods Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/urllib/request.py", line 1786, in retrieve return url2pathname(splithost(url1)[1]), hdrs NameError: name 'splithost' is not defined |
|||
| msg342850 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2019-05-19 13:40 | |
New changeset c661b30f89ffe7a7995538d3b1649469b184bee4 by Berker Peksag (Xtreak) in branch 'master': bpo-36948: Fix NameError in urllib.request.URLopener.retrieve (GH-13389) https://github.com/python/cpython/commit/c661b30f89ffe7a7995538d3b1649469b184bee4 |
|||
| msg342851 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2019-05-19 13:47 | |
Thanks! Apparently, backport to 3.7 isn't needed, so I just closed PR 13422. |
|||
| msg343103 - (view) | Author: David Bolen (db3l) * | Date: 2019-05-21 21:50 | |
Since this patch was introduced to the 3.x branch my Windows 7 and 10 buildbots have been failing in test_urlopener_retrieve_file. See https://buildbot.python.org/all/#/builders/3/builds/2661 for the first such failure on the Win10 worker. The problem appears to be related to those workers having an explicit TEMP folder that happens to use a lowercase drive letter, causing the test assertion to fail due to differing case in the drive letter. While I could work around this by changing my builder TEMP definition, the test seems fragile on case-insensitive filesystems, so perhaps it should be comparing a normalized path instead? |
|||
| msg343108 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2019-05-21 22:24 | |
Thank you for the heads up, David. Could you please take a look at PR 13476? |
|||
| msg343110 - (view) | Author: David Bolen (db3l) * | Date: 2019-05-21 22:30 | |
Yes, PR 13476 tested locally on the Win10 builder resolves the error. |
|||
| msg343114 - (view) | Author: David Bolen (db3l) * | Date: 2019-05-21 22:37 | |
Oh, and just for historical purposes, it looks like the root cause was that the nturl2path.pathnametourl forces an uppercase drive letter. So that's where the inconsistency in the test got introduced. |
|||
| msg343124 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2019-05-21 23:00 | |
New changeset 2725cb01d7cbf5caecb51cc20d97ba324b09ce96 by Berker Peksag in branch 'master': bpo-36948: Fix test_urlopener_retrieve_file on Windows (GH-13476) https://github.com/python/cpython/commit/2725cb01d7cbf5caecb51cc20d97ba324b09ce96 |
|||
| msg343125 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2019-05-21 23:01 | |
Thanks! |
|||
| msg343139 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2019-05-22 02:19 | |
Thank you David and Berker. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:15 | admin | set | github: 81129 |
| 2019-05-22 02:19:02 | xtreak | set | messages: + msg343139 |
| 2019-05-21 23:01:02 | berker.peksag | set | status: open -> closed messages:
+ msg343125 |
| 2019-05-21 23:00:38 | berker.peksag | set | messages: + msg343124 |
| 2019-05-21 22:37:22 | db3l | set | messages: + msg343114 |
| 2019-05-21 22:30:51 | db3l | set | messages: + msg343110 |
| 2019-05-21 22:24:43 | berker.peksag | set | messages: + msg343108 |
| 2019-05-21 22:23:27 | berker.peksag | set | stage: resolved -> patch review pull_requests: + pull_request13388 |
| 2019-05-21 22:11:33 | berker.peksag | set | status: closed -> open |
| 2019-05-21 21:50:26 | db3l | set | nosy:
+ db3l messages: + msg343103 |
| 2019-05-19 13:47:16 | berker.peksag | set | status: open -> closed resolution: fixed messages: + msg342851 stage: patch review -> resolved |
| 2019-05-19 13:40:23 | miss-islington | set | pull_requests: + pull_request13332 |
| 2019-05-19 13:40:10 | berker.peksag | set | nosy:
+ berker.peksag messages: + msg342850 |
| 2019-05-17 16:15:28 | xtreak | set | keywords:
+ patch stage: patch review pull_requests: + pull_request13297 |
| 2019-05-17 16:09:52 | xtreak | create | |