Giter VIP home page Giter VIP logo

Comments (11)

mgedmin avatar mgedmin commented on June 19, 2024

@tseaver: you wrote that test, do you have any opinions on this?

My gut feeling is that this exposes a real bug in OLBTree implementation: it can hold 64-bit values on 32-bit Windows, but not on 64-bit Windows? Most illogical!

from btrees.

fgregg avatar fgregg commented on June 19, 2024

This test is skipped for 32 bit architecture https://github.com/zopefoundation/BTrees/blob/master/BTrees/tests/test_OLBTree.py#L112

from btrees.

tseaver avatar tseaver commented on June 19, 2024

I believe this error is due to a Windows oddity: long is 32-bit on 64-bit Windows.

from btrees.

tseaver avatar tseaver commented on June 19, 2024

Which is maybe the stupidest design choice I can think of: likely due to some crazy notion of preserving ABI with Windows 95. :(

from btrees.

fgregg avatar fgregg commented on June 19, 2024

That is weird!

from btrees.

mgedmin avatar mgedmin commented on June 19, 2024

Shall we declare Win64 to be a 32-bit architecture and skip this test too?

from btrees.

tseaver avatar tseaver commented on June 19, 2024

What does platform.architecture() return on Win64? [1]

[1] https://docs.python.org/2/library/platform.html#platform.architecture

Maybe we should be using the workaround from that API reference:

def _skip_on_32_bits(wrapped):
    if sys.maxsize == 2**32:
        def _dummy(*args):
            pass
        return _dummy
    return test_method

from btrees.

mgedmin avatar mgedmin commented on June 19, 2024

+1 for the sys.maxsize check, but I'm tempted to make it sys.maxsize <= 2**32 -- just in case someone ports Python to a 16-bit machine ;)

from btrees.

tseaver avatar tseaver commented on June 19, 2024

LOL

from btrees.

tseaver avatar tseaver commented on June 19, 2024

I think I have the culprit: the longlong_check function in BTrees.BTreeModuleTemplate was not using PyLong_LongLongOverflow (as is used in longlong_convert). See #35 for my attempt at a fix.

from btrees.

tseaver avatar tseaver commented on June 19, 2024

Fixed in #36.

from btrees.

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.