[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2020-01-02 Thread Brett Cannon
Brett Cannon added the comment: Yep, it looks like this is fixed, Batuhan. Thanks for letting us know! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2019-12-25 Thread Batuhan
Batuhan added the comment: Looks like there is nothing left after PR 1712 if I am not missing something, can this issue be closed? -- nosy: +BTaskaya ___ Python tracker ___

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2019-03-28 Thread miss-islington
miss-islington added the comment: New changeset 74510e2a57f6d4b51ac1ab4f778cd7a4c54b541e by Miss Islington (bot) (Wolfgang Maier) in branch 'master': bpo-30427: eliminate redundant type checks in os.path.normcase() (GH-1712)

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2017-05-22 Thread Brett Cannon
Brett Cannon added the comment: 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

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2017-05-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does calling os.fspath() needed in normcase() at all? Is normcase() even called with arguments which are not just str/bytes? -- nosy: +brett.cannon, serhiy.storchaka stage: -> patch review ___ Python tracker

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2017-05-22 Thread Wolfgang Maier
Wolfgang Maier added the comment: 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

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2017-05-22 Thread Wolfgang Maier
Changes by Wolfgang Maier : -- pull_requests: +1803 ___ Python tracker ___

[issue30427] isinstance checks in os.path.normcase redundant with os.fspath

2017-05-22 Thread Wolfgang Maier
New submission from Wolfgang Maier: 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