Git Product home page Git Product logo

Comments (6)

peterjc avatar peterjc commented on May 19, 2024

How are you creating the child process with subprocess, and in particular did you ask for unicode rather than bytes in the stdin/stdout/stderr handles by using the (oddly named) universal_newlines=True option?

[Update: You said wiki example but pointed at the tutorial, if the universal_newlines=True trick works would you like to prepare an update to Doc/Tutorial.tex adding it?]

We use this option in Bio.Applications so that the everything is a (unicode) string rather than bytes. This seemed best for most of the command line tools we wrap (one exception is binary formats like SFF or BAM).

from biopython.

brandoninvergo avatar brandoninvergo commented on May 19, 2024

The universal_newlines option did the trick. I probably would not have figured that out unless I reached the point of desperation, since the option name seems quite unrelated to the effect in this case.

Thanks.

from biopython.

peterjc avatar peterjc commented on May 19, 2024

I presume the thought process was that handling DOS/Windows vs Old Mac vs Unix newlines already required a handle wrapper, where file pointers via seek/tell are not transparent, and so that universal newlines code was co-opted during the bytes/unicode separation for Python 3. But is it a stupidly named argument :(

from biopython.

peterjc avatar peterjc commented on May 19, 2024

Tutorial example updated 522a693 - thanks for reporting this.

from biopython.

brandoninvergo avatar brandoninvergo commented on May 19, 2024

Sorry, I missed your edit about updating the tutorial. I would have been happy to update it!

from biopython.

peterjc avatar peterjc commented on May 19, 2024

With hindsight an extra comment would have been better than adding the note to the existing comment. Never mind.

from biopython.

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.