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

Ignore rmtree errors for serverless environments #238

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

eighteyes
Copy link
Contributor

Using Contextily in a managed serverless environment removes the tmp directory before atexit fires, which results in the following error. Which, I wager means it can't find the indicated directory to delete.

Traceback (most recent call last):
  File "/layers/google.python.pip/pip/lib/python3.11/site-packages/contextily/tile.py", line 61, in _clear_cache
    shutil.rmtree(tmpdir)
  File "/layers/google.python.runtime/python/lib/python3.11/shutil.py", line 742, in rmtree
    onerror(os.lstat, path, sys.exc_info())
  File "/layers/google.python.runtime/python/lib/python3.11/shutil.py", line 740, in rmtree
    orig_st = os.lstat(path, dir_fd=dir_fd) 

I can put our invocation behind a try-catch, or otherwise ignore this error, but an upstream patch would be preferable.

Thanks!

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will cut a minor patch release so it does not block you.

@martinfleis martinfleis merged commit a0b1a32 into geopandas:main Mar 19, 2024
9 of 10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants