GithubHelp home page GithubHelp logo

Comments (4)

wolph avatar wolph commented on July 23, 2024 1

I've done a bunch of debugging (I should have kept on reading, would have saved me time :P ) and fail_when_locked is not set in this case. And I don't think it should be.

The main issue is that when you're setting custom flags that you override the default so NON_BLOCKING isn't set either. I believe it is mostly a documentation issue because there are valid reasons to have a blocking lock without a timeout.

So... I think the best solution would be to add a warning if an explicit timeout is set when NON_BLOCKING is not set. That way you at least know what to expect :)

from portalocker.

wolph avatar wolph commented on July 23, 2024 1

I've released version 2.5.0 which should fix the issues :)

from portalocker.

daviddavo avatar daviddavo commented on July 23, 2024

It seems like fcntl.flock is what's causing the issue. It hangs in here, but it doesn't even let me pause the debugger.

https://github.com/WoLpH/portalocker/blob/b47d5f485f7c2e4d5af46307c6b3c4d2ea50e5f6/portalocker/portalocker.py#L138

from portalocker.

daviddavo avatar daviddavo commented on July 23, 2024

Solution: I had to pass the NON_BLOCKING flag as well. Maybe it should be automtically added (or raise a warning) if fail_when_locked is True

from portalocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.