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

Don't use os.rename - it does not work across file systems #84

Closed
odscjames opened this issue May 19, 2021 · 2 comments
Closed

Don't use os.rename - it does not work across file systems #84

odscjames opened this issue May 19, 2021 · 2 comments

Comments

@odscjames
Copy link
Collaborator

We have seen an error on a dev machine - "Invalid cross-device link" - caused by os.rename in get_orgids_prefixes func().

https://github.com/OpenDataServices/lib-cove/blob/main/libcove/lib/common.py#L1344

This error seems to be coming up because on this dev machine a VM with a shared drive for the code was being used, so that /tmp and and the virtualenv directory where on different drives - and sometimes rename will fail in this case.

https://docs.python.org/3/library/os.html#os.rename

The operation may fail on some Unix flavors if src and dst are on different filesystems.

In theory, this could happen on live servers too.

Bjwebb added a commit that referenced this issue Jul 6, 2023
#84

Original pull request:
#115

Co-authored-by: James McKinney <[email protected]>
Co-authored-by: Ben Webb <[email protected]>
Bjwebb added a commit that referenced this issue Jul 6, 2023
#84

Original pull request:
#115

Ben has edited the changelog only.

Co-authored-by: James McKinney <[email protected]>
Co-authored-by: Ben Webb <[email protected]>
@jpmckinney
Copy link
Contributor

Can now be closed (#115 was merged via #122 so it didn’t autoclose)

@jpmckinney
Copy link
Contributor

@duncandewhurst can close.

R2ZER0 added a commit to ThreeSixtyGiving/datastore that referenced this issue Aug 3, 2023
When running ./manage.py migrate, I encountered this bug in libcove:
OpenDataServices/lib-cove#84

Which is fixed in libcove 0.31.0, so I upgraded libcove, without
changing any other deps using the commands:

```
pip-compile --no-upgrade --upgrade-package libcove requirements.in
pip-compile --no-upgrade --upgrade-package libcove requirements_dev.in
```

Note that libcove 0.31.0 no longer requires the cached-property package
when using python >= 3.8, see:
OpenDataServices/lib-cove@00eb1cc
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 a pull request may close this issue.

2 participants