Git Product home page Git Product logo

Comments (3)

ronnix avatar ronnix commented on July 22, 2024

Thanks for raising this isssue.

The quotes are needed when the path contains a space, so we’d need to find another way to make the ~ work.

Bash will only interpret it if it’s the first character of a token, so maybe we could do the expansion on the Python side?

from fabtools.

csala avatar csala commented on July 22, 2024

That the same happens with other characters, such as "*", or "?", so the expansion in python will not be trivial, and some lib that makes the job will be required.

Perhaps it could be easier to escape any spaces found in the string?

Anyway, bear in mind that this is not really an issue in fabtools but rather in the stats command, since using a string with stats in the command line fails equally, so perhaps just a warning in the docs about this stats behavior would be enough.

from fabtools.

ronnix avatar ronnix commented on July 22, 2024

Actually, most functions in fabtools currently expect a filename. Using globs (? or *) and ~ is not really supported, and may or may not work depending on the function you use.

To be safe, you need to use either the absolute filename like /home/user/.ssh/id_rsa or a relative filename like .ssh/id_rsa based on the current directory.

Tilde expansion is made by the shell, not the stat command. And the shell behavior is a bit tricky. It will expand the ~ to the user’s directory, but only if it’s the first character in a token. That’s why it does not work if you put quotes around it.

You’re right that doing it in Python would not be practical, and using backslashes to escape spaces instead of using quotes might be a good strategy.

from fabtools.

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.