| ▲ | deathanatos 3 hours ago | |
You're not wrong, but at my place, our main repository does not permit cloning into a directory with spaces in it. Three factors conspire to make a bug:
Say you clone into a directory with a space in it. We use Python, so thus our scripts are scripts in the Unix sense. (So, Python here is replacable with any scripting language that uses a shebang, so long as the rest of what comes after holds.) Some of our Python dependencies install executables; those necessarily start with a shebang:
Note that space.Since we use Python virtualenvs,
But … now what if the dir has a space?
Those look like arguments, now, to a shebang. Shebangs have no escaping mechanism.As I also discovered when I discovered this, the Python tooling checks for this! It will instead emit a polyglot!
Which is really quite clever, IMO. But, … it hits (2.). It execs bash, and worse, it is macOS's bash, and macOS's bash will corrupt^W remove for your safety! certain environment variables from the environment.Took me forever to figure out what was going on. So yeah … spaces in paths. Can't recommend them. Stuff breaks, and it breaks in weird and hard to debug ways. | ||
| ▲ | joshuaissac 2 hours ago | parent [-] | |
If all of your scripts run in the same venv (for a given user), can you inject that into the PATH and rely on env just finding the right interpreter? I suppose it would also need env to be able to handle paths that have spaces in them. | ||