GithubHelp home page GithubHelp logo

Comments (8)

olegvereshchynsky avatar olegvereshchynsky commented on June 7, 2024 1

@rayluo: sorry, indeed there is the typo here. I had to close it before closing the file.
Fixed the it in the description.

from portalocker.

wolph avatar wolph commented on June 7, 2024 1

@rayluo yes, version 1.6.0 indeed. It seems I forgot to do a git push. It's added now :)

from portalocker.

wolph avatar wolph commented on June 7, 2024

Looking at the code my theory would be that it's not unlocking because self._fh is not cleared. At least, that's the only difference I can see between their code and the one I'm using: https://github.com/WoLpH/portalocker/blob/e5e7d760488539857fdeff65231d40c2a1dcdd88/portalocker/utils.py#L165-L169

Having that said, I think the entire CrossPlatLock could be replaced with portalocker.Lock. They do roughly the same and I'm guessing that portalocker.Lock has been tested by many more people :)

from portalocker.

rayluo avatar rayluo commented on June 7, 2024

Hi @olegver , in your investigation, did you have to "explicitly call portalocker.unlock AFTER or BEFORE closing the file"? Your description in this thread and the other thread happens to be different. One of them must be a typo.

@wolph , based on the latest conversation on that thread, will you consider adding that explicitly call portalocker.unlock into portalocker.Lock? That alone would become a big selling point for us adopting your Lock. :-)

from portalocker.

rayluo avatar rayluo commented on June 7, 2024

@wolph , to be clear, I was not suggesting you to include all the non-standard behavior into portalocker.Lock. Instead, only one new line, portalocker.unlock(self._fh), is needed to be inserted into between line 167 and line 168 here.

https://github.com/WoLpH/portalocker/blob/e5e7d760488539857fdeff65231d40c2a1dcdd88/portalocker/utils.py#L165-L169

Let me know if you prefer I create a PR for that.

CC: @olegver

from portalocker.

wolph avatar wolph commented on June 7, 2024

@rayluo no need, I'll create a new release right away :)

from portalocker.

wolph avatar wolph commented on June 7, 2024

The new release is online

from portalocker.

rayluo avatar rayluo commented on June 7, 2024

Thanks @wolph for prompt response!

Just want to double check, is this improvement released in version 1.6.0? I need to be sure, when/if we would choose to make a dependence on this version.

I deduce that version number from this process:

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.