Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pycharm debugger triggers cache download on breakpoints #320

Open
Happyzippy opened this issue Feb 10, 2023 · 3 comments
Open

Pycharm debugger triggers cache download on breakpoints #320

Happyzippy opened this issue Feb 10, 2023 · 3 comments

Comments

@Happyzippy
Copy link

How to replicate:

  • Run pycharm debugger
  • Create CloudPath object
  • Break and click on the item in the debugger to inspect

Alternatively:

  • CloudPath(...).fspath

Why: Pycharm debugger collects all properties on objects in scope, thus accessing .fspath which performs a cache refresh

@Happyzippy
Copy link
Author

Seems i missed this discussion #315 about why .fspath caches the file

@jayqi
Copy link
Member

jayqi commented Feb 11, 2023

This does sound annoying, but I'm unsure about whether there is a sensible solution on our end given the other uses of .fspath. Is there a way to prevent the PyCharm debugger from collecting all properties on the object? I imagine this can't be the only situation where forcing all properties on all objects in scope to compute leads to undesirable side effects.

@jayqi
Copy link
Member

jayqi commented Mar 16, 2023

@pjbull I was thinking about this case some more, and I think this supports the strategy that we want to implement #322 and remove support for .fspath.

It's a convention/expectation in Python development that properties should be cheap and not have side effects, so I think we violate the principle of least surprise here by having the .fspath property refresh the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants