confusion with 2.6's module io.py

Issue #62 invalid
Former user created an issue

It seems that 2.6 introduced the module io.py, backported from 3.0. The code in py.impl.io.capture imports StringIO from there, even on 2.6, but then everything fails because this StringIO only accepts to write() unicodes, not strs. Fix: if sys.version_info < (3, 0), always import StringIO from the module StringIO.

-- Armin

Comments (4)

  1. Holger Krekel repo owner
    • changed status to open

    Hum, using 2.6's IO was somewhat intentional. But maybe it's a bad idea. Could you post a concrete case where it fails?

  2. Former user Account Deleted

    in PyPy: put any random NameError in pypy/objspace/std/test/test_floatobject.py, then run py.test test_floatobject.py. More generally, I doubt that py.test will succeed in writing *any* error message in Python 2.6.

  3. Former user Account Deleted

    Sorry, nonsense. This was caused by interaction with my own conftest.py. I solved it by hacking more in my conftest.py.

  4. Log in to comment