[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Tal Einat added the comment: New changeset 7c949020ef2520d7a7cbc978f0b34423e6c2a94c by Anthony Sottile in branch '3.9': bpo-40492: Fix --outfile with relative path when the program changes it working dir (GH-19910) https://github.com/python/cpython/commit/7c949020ef2520d7a7cbc978f0b34423e6c2

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Tal Einat added the comment: New changeset 1c5a65723e623be32e246f58b8797a263f616295 by Anthony Sottile in branch '3.8': bpo-40492: Fix --outfile with relative path when the program changes it working dir (GH-19910) https://github.com/python/cpython/commit/1c5a65723e623be32e246f58b8797a263f61

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Tal Einat added the comment: Many thanks for the report and the PR, Anthony! Serhiy, do you think it is worth also calling abspath in the profile._Utils as you mentioned, for cases where those may be called directly? -- ___ Python tracker

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Change by Tal Einat : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +21718 pull_request: https://github.com/python/cpython/pull/22755 ___ Python tracker ___ _

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +21717 pull_request: https://github.com/python/cpython/pull/22754 ___ Python tracker ___ ___

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +21716 pull_request: https://github.com/python/cpython/pull/22753 ___ Python tracker ___ ___

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +21715 pull_request: https://github.com/python/cpython/pull/22752 ___ Python tracker ___ _

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat
Tal Einat added the comment: New changeset 3c0ac18504cfeed822439024339d5717f42bdd66 by Anthony Sottile in branch 'master': bpo-40492: Fix --outfile with relative path when the program changes it working dir (GH-19910) https://github.com/python/cpython/commit/3c0ac18504cfeed822439024339d5717f

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-17 Thread Tal Einat
Tal Einat added the comment: > I am not sure what is better: to fix it at high level, in main() for cProfile > and cProfile, or at low level, in methods runctx() and run() of > profile._Utils. Maybe both, to keep them decoupled and be sure of correct behavior in all cases? -- nosy:

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure what is better: to fix it at high level, in main() for cProfile and cProfile, or at low level, in methods runctx() and run() of profile._Utils. -- ___ Python tracker

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-14 Thread Anthony Sottile
Anthony Sottile added the comment: @serhiy: this was pretty straightfowrard to fix as you suspected -- would you be able to review it? -- ___ Python tracker ___ _

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-04 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +19225 pull_request: https://github.com/python/cpython/pull/19910 ___ Python tracker ___

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is worth to fix and it should be not difficult to fix. Either make the output file name absolute before executing the script, or open the output file before executing the script (what is easier). Unless I miss something. -- nosy: +serhiy

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-03 Thread Anthony Sottile
New submission from Anthony Sottile : just spent quite a bit of time debugging this, here's a minimal example: ```bash # rm -rf a (if you want to reset) cd /tmp mkdir -p a/b echo 'import os; os.chdir("..")' > a/b/c.py cd a/b python3 -m cProfile -o log.pstats c.py ls -al ls -al .. ``` example o