Giter Club home page Giter Club logo

Comments (3)

tsibley avatar tsibley commented on September 26, 2024

Ah, thanks for this. I'll fix it up when I have a chance. It looks like loading the config should guard against the file missing and return a default instead.

from cli.

tsibley avatar tsibley commented on September 26, 2024

Hmm. I can't reproduce this on 1.7.1, and indeed the code already guards against the cases I thought you were hitting: https://github.com/nextstrain/cli/blob/master/nextstrain/cli/config.py#L36-L41

That error is what I'd expect if the /Users/trvrb/.nextstrain directory didn't exist by the time path.open was called, which would only happen if the mkdir() silently failed. I can't get it to do so.

from cli.

tsibley avatar tsibley commented on September 26, 2024

Ah ha! I think you're hitting this Python bug in path.resolve(), which was fixed first in 3.6.2 (you have 3.6.1) and noted with the following changelog entry:

path.resolve(strict=False) no longer cuts the path after the first element not present in the filesystem. Patch by Antoine Pietri.

Note that strict=False is the default.

Indeed, this description of the effect of the bug matches what we're seeing:

For what it's worth, this bug was the cause of an important downtime in our organization, because someone needed to normalize a path that was later passed to a .mkdir(parents=True), and it was, in some cases, silently doing the mkdir of a wrong path instead of creating all the parents.

This means that the mkdir() in our code on your computer was happening against /Users/trvrb instead of /Users/trvrb/.nextstrain! which matches my diagnosis above.

I'll add a workaround in our code next week. In the meantime, you can mkdir ~/.nextstrain and move on with your life if you haven't already.

On top of all this, I also now see that the default behaviour for path.resolve() changed between 3.5 and 3.6, with no way at all to ask for 3.6's default behaviour (which we want) on 3.5. I'd thought the defaults matched. I'll address that as well.

from cli.

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.