Giter Site home page Giter Site logo

cache.py not windows friendly about pytmdb3 HOT 8 OPEN

wagnerrp avatar wagnerrp commented on September 25, 2024
cache.py not windows friendly

from pytmdb3.

Comments (8)

wagnerrp avatar wagnerrp commented on September 25, 2024

This might be fixed by 4663490, but the msvcrt locking mechanism is completely untested.

from pytmdb3.

accident12123 avatar accident12123 commented on September 25, 2024

some problems...

the code should have been:

    LOCK_EX = msvcrt.LK_NBLCK
    LOCK_SH = msvcrt.LK_NBLCK

from pytmdb3.

accident12123 avatar accident12123 commented on September 25, 2024

prepending /tmp/ to the start of a path isn't windows \tmp\ path friendly.. os.path.join should fix that up quick.

also there might be driveletter: or unc \ formatting for an absolute path

from pytmdb3.

accident12123 avatar accident12123 commented on September 25, 2024

Now that I have it running, I'm getting permission errors:

\cache_file.py", line 60, in enter
msvcrt.locking(self.fileobj.fileno(), self.operation, self.size)
IOError: [Errno 13] Permission denied

from pytmdb3.

wagnerrp avatar wagnerrp commented on September 25, 2024

Now that I'm thinking about it, those locks should probably be LK_LOCK, so it waits for dedicated access rather than outright fails.

The filename handling does need to be improved, as at current, only caches located in a user's home directory with a '~' would pass the logic. I assume Windows absolute paths would either start with ":" or "\server"?

from pytmdb3.

accident12123 avatar accident12123 commented on September 25, 2024

I would think c:, \server and \path would all be valid.. but it's going to need a default also I think /tmp/ wouldn't work.

from pytmdb3.

wagnerrp avatar wagnerrp commented on September 25, 2024

263d868 adds an independent chunk of logic for Windows systems, based off the module import test. Variables are replaced into the path, and anything starting with lettered drives and ':', or a UNC server are passed through. Everything else gets the %TEMP% directory prepended. That still leaves the issue as to why locking itself is not working.

from pytmdb3.

accident12123 avatar accident12123 commented on September 25, 2024

I'm still getting a bunch of permissions denied on the windows side.... didn't really have the time to look closer at it.

from pytmdb3.

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.