Giter VIP home page Giter VIP logo

Comments (6)

jamadden avatar jamadden commented on June 16, 2024 1

Although, skipping may not be that great an option. It's not just the test that's failing, apparently. The first test failure is actually showing a bug, the C and Python versions are different:

   self.assertEqual(hash(c), hash(py))
AssertionError: 2875592705 != -1419374591

from persistent.

jamadden avatar jamadden commented on June 16, 2024 1

#39 does it. All builds green.

from persistent.

tseaver avatar tseaver commented on June 16, 2024

@jamadden I'm befuzzled: do you have a clue how to deal with tine Windows ABI-compatible-with-Win95 insanity here?

from persistent.

jamadden avatar jamadden commented on June 16, 2024

@tseaver Sorry, I know I wrote this test initially. I don't know what the right fix is, though. And my Windows VM bit the dust, so I don't currently have access to experiment/test there. My only suggestion would be to skip this one on 64-bit Win?

from persistent.

jamadden avatar jamadden commented on June 16, 2024

ctypes.sizeof(c_long()) == 4 may be a better way to spell is_32_bit.

Except, it looks like is the problem that ctypes.c_long doesn't match what the actual extension module thinks of as long. (Because if it did match, I don't understand why hash( c) != hash(py))

from persistent.

jamadden avatar jamadden commented on June 16, 2024

I think I may have found it, and it's a bug in the C code. The C hash function is defined as static long TimeStamp_hash(self). But the hashfunc slot is defined to return a Py_ssize_t.

On 64-bit windows, Py_ssize_t is 8 bytes long, where long is 4 bytes.

I instrumented both the Python and C implementations, and verified that they both return the same on 64-bit windows; but by the time the internal magic of C and/or the interpreter have their way with the return type, -1419374591 becomes 2875592705.

If I fix the return type, all the tests pass on Windows.

I have to verify the signature of hashfunc on 2.7 (been testing on 3.5) and check a sane platform, but if that holds up, PR coming.

from persistent.

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.