Issues

Issue #248 invalid

eventlet GreenPipe has no encoding property

David Szotten avatarDavid Szotten created an issue

Using pytest with eventlet breaks in _terminal.py pytest_configure which tries to assert stdout.encoding == newstdout.encoding

eventlet's GreenPipe doesn't implement encoding, and according, the python docs "The attribute [encoding] is read-only and may not be present on all file-like objects"

Comments (11)

  1. David Szotten

    eventlet does patch it, but the replacement works fine. it doesn't however implement encoding, which according to the python docs linked above, it doesn't have to

    pytest seems to assume the output stream has an an coding attribute, and i was hoping we could drop/work around this assumption

    i'm on python 2.7 btw

  2. Ronny Pfannschmidt

    whats the value of stdout.encoding?

    edit

    to clarify, there are exactly 2 cases where the rest of fdopen is returned directly from dupfile

    a) encoding is None and b) python3

  3. David Szotten

    After the eventlet patch? The attribute is missing.

    # _pytest/terminal.py", line 47, in pytest_configure
    >>> assert stdout.encoding  == newstdout.encoding
    AttributeError: 'GreenPipe' object has no attribute 'encoding'
    
  4. Ronny Pfannschmidt

    now that i handed in my thesis i can do some more investigation

    from the state you are in, it seems completely incorrect that you get a greenpipe instead of a textio wrapper around the fd

    but according to the code you should be getting a encoded wrapper - i'll have to very carefully re-examine

  5. holger krekel

    Just wrote a little test with "eventlet.monkey_patch()" and also put that in a conftest.py and could run "py.test" fine. So i assume ths problem is gone or resolved through another change. If not, please re-open with a way to reproduce. thanks!

  6. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.