
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-05-22 08:17 bywolma, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1712 | merged | wolma,2017-05-22 08:27 | |
| Messages (7) | |||
|---|---|---|---|
| msg294130 -(view) | Author: Wolfgang Maier (wolma)* | Date: 2017-05-22 08:17 | |
os.path.normcase as defined in both posixpath and ntpath is now calling os.fspath on its argument first. With that I think the following isinstance(str, bytes) checks have become redundant since AFAIU os.fspath is guaranteed to return either str or bytes instances. | |||
| msg294131 -(view) | Author: Wolfgang Maier (wolma)* | Date: 2017-05-22 08:31 | |
Just created a PR for this, which eliminates the redundancy. This also changes the error message (making it less specific), but not the type of a raised exception.If you think that the error message deserves to be preserved that could, of course, be done too. | |||
| msg294137 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-05-22 09:54 | |
Does calling os.fspath() needed in normcase() at all? Is normcase() even called with arguments which are not just str/bytes? | |||
| msg294206 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2017-05-23 00:13 | |
The problem with leaving os.fspath() out of os.path.normcase() is that suddenly a single function that deals with paths won't work with path-like objects. So that means support for path-like objects won't implicitly work in code that assumes a path but doesn't explicitly go out of its way to support path-like objects. | |||
| msg339077 -(view) | Author: miss-islington (miss-islington) | Date: 2019-03-28 21:47 | |
New changeset74510e2a57f6d4b51ac1ab4f778cd7a4c54b541e by Miss Islington (bot) (Wolfgang Maier) in branch 'master':bpo-30427: eliminate redundant type checks in os.path.normcase() (GH-1712)https://github.com/python/cpython/commit/74510e2a57f6d4b51ac1ab4f778cd7a4c54b541e | |||
| msg358868 -(view) | Author: Batuhan Taskaya (BTaskaya)*![]() | Date: 2019-12-25 15:40 | |
Looks like there is nothing left afterPR 1712 if I am not missing something, can this issue be closed? | |||
| msg359223 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2020-01-02 22:13 | |
Yep, it looks like this is fixed, Batuhan. Thanks for letting us know! | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:46 | admin | set | github: 74612 |
| 2020-01-02 22:13:44 | brett.cannon | set | status: open -> closed resolution: fixed messages: +msg359223 stage: patch review -> resolved |
| 2019-12-25 15:40:39 | BTaskaya | set | nosy: +BTaskaya messages: +msg358868 |
| 2019-03-28 21:47:27 | miss-islington | set | nosy: +miss-islington messages: +msg339077 |
| 2017-05-23 00:13:03 | brett.cannon | set | messages: +msg294206 |
| 2017-05-22 09:54:46 | serhiy.storchaka | set | nosy: +brett.cannon,serhiy.storchaka messages: +msg294137 stage: patch review |
| 2017-05-22 08:31:23 | wolma | set | type: performance messages: +msg294131 |
| 2017-05-22 08:27:59 | wolma | set | pull_requests: +pull_request1803 |
| 2017-05-22 08:17:57 | wolma | create | |