wichert / lingua

Translation toolkit for Python
Other
45 stars 32 forks source link

Directory parameter with quotes doesn't scan files #84

Closed raspi closed 7 years ago

raspi commented 7 years ago

If you use --directory parameter with quotes (") pot-create doesn't scan any files.

$VENV/bin/pot-create --config "lang.conf" --directory "foo/*" --output /dev/null
No files scanned, aborting

$VENV/bin/pot-create --config "lang.conf" --directory foo/* --output /dev/null
PermissionError: [Errno 13] Permission denied: '/dev/tmptzuv_t65'

If you prepend the command with

strace -e trace=open $VENV/bin/pot-create ...

You can see that first example doesn't open any files from foo directory and latter does.

wichert commented 7 years ago

That is by design, and standard for almost every command line tool. Your shell is the thing that expands the foo/* glob normally, but by using quotes you are explicitly telling it not to do that. Instead you are telling pot-create to look for a directory named foo/*, which does not exist.