Code Monkey home page Code Monkey logo

Comments (10)

willbarton avatar willbarton commented on July 18, 2024

The commit in question doesn't appear to do anything that isn't supported in Python 2.6.

The use of OrderedDict is.

It was added in Python 2.7.0.

from collab.

Scotchester avatar Scotchester commented on July 18, 2024

@willbarton So why do the tests pass locally/on the server?

from collab.

Scotchester avatar Scotchester commented on July 18, 2024

And, if you review the PR (#57), why did Travis not start failing on the commit that introduced OrderedDict, af230bf? It started failing one commit later, 0859b16).

from collab.

willbarton avatar willbarton commented on July 18, 2024

In the words of Knuth:

I have only proved it correct, not tried it.

from collections import OrderedDict should always fail on python 2.6.x.

Python 2.6.9 (unknown, Jul 14 2015, 19:46:31) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name OrderedDict

There is an ordreddict package on pypi that can be used for 2.4-2.6, but then the import would look like:

try:
    from collections import OrderedDict
except ImportError:
    from ordereddict import OrderedDict

from collab.

Scotchester avatar Scotchester commented on July 18, 2024

You're still not helping me understand why it happened when it did, and why the software works and tests pass on our actual servers.

from collab.

Scotchester avatar Scotchester commented on July 18, 2024

@willbarton Didn't mean for that to sound snippy, I just want to know! :)

from collab.

willbarton avatar willbarton commented on July 18, 2024

Can you import OrderedDict from collections in the environment where they successfully pass and run?

EDIT: Python version and such and so on would be good to know too.

from collab.

Scotchester avatar Scotchester commented on July 18, 2024

I sure can.

Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> 

from collab.

willbarton avatar willbarton commented on July 18, 2024

So, after some digging with @Scotchester, we've found that Red Hat apparently modifies the Python 2.6.6 standard library collections to include OrderedDict.

Comparing the Python 2.6.6 source code's Lib/collections.py with the /usr/lib64/python2.6/collections.py file as well as with the contents of the python-libs-2.6.6 RPM shows they do not match. Red Hat appears to have broken the promise of the standard library.

flames

from collab.

willbarton avatar willbarton commented on July 18, 2024

This comment in Red Hat's Bugzilla appears to confirm, but I can't access the bug it links to.

from collab.

Related Issues (7)

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.