Comments (4)
I'm just trying out the filelock module myself. In your function, what happens if a file that would have triggered the check that raises OSError()
is created elsewhere between the check and the open()
?
from filelock.
The function halts after the raise, so wherever that problematic locked_file was called will fail as well.
If the file is removed between the check and the open, that's more problematic you'll get a hanging lock file and not sure if it gets released. In my application, files aren't really removed so I'm not concerned about this personally.
from filelock.
Looking at the code, in UnixFileLock._acquire
the call to os.open
is not wrapped in a try-except, but WindowsFileLock._acquire
does wrap the os.open
call in a try-except.
from filelock.
Hello, if you make a PR for this (with tests) we would be happy to review it, thanks!
from filelock.
Related Issues (20)
- typing-extensions is a dependency but is not needed at runtime HOT 5
- Bug: Reentrant behavior does not work with distinct lock objects on the same thread HOT 4
- Using filelock in docker HOT 1
- Allow disabling fcntl (and use softfilelock) with environment variable HOT 2
- Python 3.7 support dropoff at version 3.12.3 not reflected in 'Security' section HOT 1
- Request add `RwLock` HOT 1
- Add cancellation tokens support
- Demo usage in the documentation is uncommon and misleading HOT 2
- Deadlock when a process tries to open and lock on the same file twice HOT 5
- Suggestion on documentation improvement over SoftFileLock
- 6 tests fail HOT 6
- is_singleton=True with nested lock hangs HOT 1
- Release to PyPi is failing HOT 1
- AttributeError: '_CountedFileLock' object has no attribute 'thread_safe' HOT 2
- '_CountedFileLock' object has no attribute 'thread_safe' HOT 34
- the latest filelock package 3.15.1 has compatible issue with package virtualenv HOT 6
- Poetry build fails with new filelock bugfix version HOT 9
- TypeError: LockedJSONData.__init__() got an unexpected keyword argument 'lock_file' ; regression between 3.15.1 and 3.15.3 HOT 3
- Android/Termux doesn't have flock, use lockf, SoftFileLock, or no lock? HOT 1
- Add Fasteners to Similar libraries Documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filelock.