Issue39517
Created on 2020-02-01 17:02 by Tomas Ravinskas, last changed 2020-03-08 22:29 by kmaork. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 18699 | merged | kmaork, 2020-02-29 11:19 | |
| PR 18862 | merged | miss-islington, 2020-03-08 20:43 | |
| Messages (10) | |||
|---|---|---|---|
| msg361176 - (view) | Author: Tomas Ravinskas (Tomas Ravinskas) | Date: 2020-02-01 17:02 | |
runpy accepts Path like objects but open_code seems to only accept strings, so calling open_code with Path object throws TypeError. I think runpy should call str() on all path passed to open_code. The relevant line is 232 in runpy.py in function _get_code_from_file. |
|||
| msg361181 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2020-02-01 17:50 | |
Is there documentation in runpy where it's stated that path objects are accepted for the function? If not this seems to be an enhancement. |
|||
| msg361182 - (view) | Author: Tomas Ravinskas (Tomas Ravinskas) | Date: 2020-02-01 17:58 | |
Can't see anything about this in the docs, I just noticed that it breaks shiv after upgrade. |
|||
| msg362293 - (view) | Author: Maor Kleinberger (kmaork) * | Date: 2020-02-19 23:04 | |
Not a direct solution, but I have offered that io.open_code should be changed to support pathlike objects: https://bugs.python.org/issue39691 |
|||
| msg362524 - (view) | Author: Steve Dower (steve.dower) * | Date: 2020-02-23 16:56 | |
open_code is correct according to PEP 578, so the fix here is for runpy to ensure the path is absolute and pass it through os.fsdecode() before calling io.open_code(). |
|||
| msg363680 - (view) | Author: Maor Kleinberger (kmaork) * | Date: 2020-03-08 20:20 | |
Hey there, the PR was approved a week ago, is there a reason it is not merged yet? |
|||
| msg363683 - (view) | Author: Steve Dower (steve.dower) * | Date: 2020-03-08 20:43 | |
New changeset 0911ea5c172264eaefa3efe4a1788159c160920d by Maor Kleinberger in branch 'master': bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699) https://github.com/python/cpython/commit/0911ea5c172264eaefa3efe4a1788159c160920d |
|||
| msg363684 - (view) | Author: Steve Dower (steve.dower) * | Date: 2020-03-08 20:43 | |
Nope, just that I apparently forgot to merge (or forgot to come back after CI had finished). Thanks for the reminder! |
|||
| msg363685 - (view) | Author: miss-islington (miss-islington) | Date: 2020-03-08 21:00 | |
New changeset 0687bdf5def13ddca09e854113c0eac0772afea0 by Miss Islington (bot) in branch '3.8': bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699) https://github.com/python/cpython/commit/0687bdf5def13ddca09e854113c0eac0772afea0 |
|||
| msg363688 - (view) | Author: Maor Kleinberger (kmaork) * | Date: 2020-03-08 22:29 | |
Great, thank you! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-03-08 22:29:20 | kmaork | set | messages: + msg363688 |
| 2020-03-08 21:00:03 | miss-islington | set | nosy:
+ miss-islington messages: + msg363685 |
| 2020-03-08 20:44:44 | steve.dower | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-03-08 20:43:53 | steve.dower | set | nosy:
- miss-islington messages: + msg363684 |
| 2020-03-08 20:43:30 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request18219 |
| 2020-03-08 20:43:25 | steve.dower | set | messages: + msg363683 |
| 2020-03-08 20:20:12 | kmaork | set | messages: + msg363680 |
| 2020-02-29 11:19:24 | kmaork | set | keywords:
+ patch stage: patch review pull_requests: + pull_request18060 |
| 2020-02-23 16:56:04 | steve.dower | set | nosy:
+ steve.dower messages:
+ msg362524 |
| 2020-02-19 23:04:17 | kmaork | set | nosy:
+ kmaork messages: + msg362293 |
| 2020-02-01 17:58:26 | Tomas Ravinskas | set | messages: + msg361182 |
| 2020-02-01 17:51:37 | xtreak | set | type: crash -> behavior |
| 2020-02-01 17:50:11 | xtreak | set | nosy:
+ xtreak, ncoghlan messages: + msg361181 |
| 2020-02-01 17:02:12 | Tomas Ravinskas | create | |