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

SDK: Fix FileExistsErrors on Windows when a dataset is loaded from cache #6722

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Aug 21, 2023

Motivation and context

atomic_writer is supposed to overwrite the destination file, but os.rename doesn't do that on Windows. We have to use os.replace instead.

How has this been tested?

Manual testing.

Checklist

  • I submit my changes into the develop branch
  • I have added a description of my changes into the CHANGELOG file
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

…cache

`atomic_writer` is supposed to overwrite the destination file, but
`os.rename` doesn't do that on Windows. We have to use `os.replace` instead.
@SpecLad SpecLad marked this pull request as ready for review August 21, 2023 16:20
@SpecLad SpecLad requested a review from mdacoca as a code owner August 21, 2023 16:20
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #6722 (daacdcd) into develop (5889c43) will increase coverage by 0.01%.
Report is 4 commits behind head on develop.
The diff coverage is 83.33%.

@@             Coverage Diff             @@
##           develop    #6722      +/-   ##
===========================================
+ Coverage    82.25%   82.26%   +0.01%     
===========================================
  Files          366      366              
  Lines        39771    39767       -4     
  Branches      3531     3531              
===========================================
+ Hits         32714    32715       +1     
+ Misses        7057     7052       -5     
Components Coverage Δ
cvat-ui 77.02% <80.00%> (+0.01%) ⬆️
cvat-server 86.83% <100.00%> (+<0.01%) ⬆️

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

LGTM

@nmanovic nmanovic merged commit a6a2782 into cvat-ai:develop Aug 23, 2023
44 checks passed
@azhavoro azhavoro mentioned this pull request Aug 25, 2023
jonybekov pushed a commit to tezzro/cvat that referenced this pull request Sep 6, 2023
…cache (cvat-ai#6722)

`atomic_writer` is supposed to overwrite the destination file, but
`os.rename` doesn't do that on Windows. We have to use `os.replace`
instead.
@SpecLad SpecLad deleted the os-replace branch October 9, 2023 15:52
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Oct 25, 2023
…cache (cvat-ai#6722)

`atomic_writer` is supposed to overwrite the destination file, but
`os.rename` doesn't do that on Windows. We have to use `os.replace`
instead.
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