jiffyclub / snakeviz

An in-browser Python profile viewer
https://jiffyclub.github.io/snakeviz/
Other
2.36k stars 139 forks source link

Fails when spaces present in filename #119

Closed nyanpasu64 closed 5 years ago

nyanpasu64 commented 6 years ago

snakeviz 1.0.0, via Anaconda Python 3.6.5. Kubuntu 18.04.

Running in zsh: snakeviz name\ spaces results in:

FileNotFoundError: [Errno 2] No such file or directory: '/home/jimbo1qaz/path/name+spaces'

snakeviz "name spaces" has the same issue.

Could be related to #107

zachbateman commented 5 years ago

I'm having the same hiccup as @jimbo1qaz in snakeviz 1.1.dev; Python 3.7.1; Windows 10.

It looks like commit 6851ee789b774a3d0cef7d901b47eb8320a6377d in response to #107 is causing the issue ("+" ends up in profile_name path instead of " "). No error is raised after reverting back to the main.py lines deleted in this commit.

@jiffyclub I'm new to GitHub but would be happy to help here if possible; snakeviz is an excellent tool!

jiffyclub commented 5 years ago

Thanks for the report! In my local testing this was addressed by 9505c88, please give master a try and let me know if it doesn't work for you.

nyanpasu64 commented 5 years ago

The hyperlinks in the directory browser are broken still.

http://127.0.0.1:8080/snakeviz/%2Fhome%2Fjimbo1qaz%2FDropbox%2Fencrypted%2Fprojects%2Fovgen%2Fextends%20levant%20v2

points to

http://127.0.0.1:8080/snakeviz/%2Fhome%2Fjimbo1qaz%2FDropbox%2Fencrypted%2Fprojects%2Fovgen%2Fextends+levant+v2%2Fextends+levant+slow-cprofile-2019-01-20_T05-00-01

Replacing + with space char seems to make URLs load.

jiffyclub commented 5 years ago

@jimbo1qaz Thanks for checking things out! There was another place I needed to change the URL quote handling, which I believe is fixed in 765c05a. Hope that works!

nyanpasu64 commented 5 years ago

You still have a "quote_plus" call in one of your unit tests, do you want to remove it?

Anyway it seems to work, thanks!