Giter Site home page Giter Site logo

Comments (4)

markevans avatar markevans commented on August 20, 2024

Hi Jon
Thanks for this - yes this is also something my colleague experienced.
Does your patch definitely need the 'if' clause?
I'm wondering if it's a good idea to always set it to binary mode.
thanks
Mark

from dragonfly.

JonRowe avatar JonRowe commented on August 20, 2024

The if clause is purely because I was uncertain as to the affects of writing actual encoded strings in this fashion;

ASCII-8BIT being a synonym for binary/raw string "encoding" I am fairly certain this is safe to place the file's IO stream into binmode, but according to the ruby docs, http://ruby-doc.org/core/classes/IO.html#M002292, this is irreversible for the lifetime of the file.

So I was merely being cautious.

from dragonfly.

markevans avatar markevans commented on August 20, 2024

ok thanks a lot - I'll have a look into it

from dragonfly.

markevans avatar markevans commented on August 20, 2024

I've added that tempfile.binmode line to v 0.7.6 - it seems to work fine with other versions of Ruby and tests all pass, so I've not used the if clause.
Thanks again

from dragonfly.

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.