Git Product home page Git Product logo

Comments (4)

bcheidemann avatar bcheidemann commented on July 22, 2024

I've created a PR with a failing regression test to illustrate the issue ( PR #774 )

from filer.

humphd avatar humphd commented on July 22, 2024

Nice find. I think this is a bug in validate_file_options(), or how we deal with the encoding being missing on the options object:

function validate_file_options(options, enc, fileMode){
if(!options) {
options = { encoding: enc, flag: fileMode };
} else if(typeof options === 'function') {
options = { encoding: enc, flag: fileMode };
} else if(typeof options === 'string') {
options = { encoding: options, flag: fileMode };
}
return options;
}

We are returning back the options object untouched, which is probably OK (node does the same), but we fail to then use 'utf8' as our default, like node does in https://github.com/nodejs/node/blob/24fd791184ad0ba27f92ac49b820aec78e491296/lib/fs.js#L1512. I'll comment more in the PR.

from filer.

bcheidemann avatar bcheidemann commented on July 22, 2024

Thanks for the pointer - saved me a lot of time!

from filer.

humphd avatar humphd commented on July 22, 2024

Fixed by #774.

from filer.

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.