Message348042
| Author | terry.reedy |
|---|---|
| Recipients | andyharrington, eryksun, jeff.allen, mark, ned.deily, rhettinger, serhiy.storchaka, steve.dower, terry.reedy |
| Date | 2019-07-16.21:18:40 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1563311920.86.0.90108395516.issue22121@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
An implementation note mostly to myself: In 3.8 and before, 'python relative/path/to/file.py' results in the __file__ attribute of the main module being the relative path, and a possibly unnormalized full path is os.curdir + __file__. I believe that this is the only situation in which __file__ is not absolute. After os.chdir(new cwd), relative __file__ becomes useless unless the original curdir is saved or __file__ is made absolute first. The startup part of pyshell has this vulnerable line.
icondir = os.path.join(os.path.dirname(__file__), 'Icons')
But with curdir left alone when starting from a command line, there will be no problem. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-07-16 21:18:40 | terry.reedy | set | recipients: + terry.reedy, rhettinger, andyharrington, mark, ned.deily, serhiy.storchaka, jeff.allen, eryksun, steve.dower |
| 2019-07-16 21:18:40 | terry.reedy | set | messageid: <1563311920.86.0.90108395516.issue22121@roundup.psfhosted.org> |
| 2019-07-16 21:18:40 | terry.reedy | link | issue22121 messages |
| 2019-07-16 21:18:40 | terry.reedy | create | |