wichert / lingua

Translation toolkit for Python
Other
45 stars 32 forks source link

``--files-from`` parameter does not find any files #103

Closed thet closed 2 years ago

thet commented 2 years ago

When using the --files-from paramter the listed files in the text file cannot be found. When iterating over the files they all contain a \n character (already converted to universal newlines by TextIOWrapper for OS compatibility, see: https://docs.python.org/3/library/io.html#io.TextIOWrapper ), which makes the list_files method fail.

I use Lingua like so:

        find . \
            -path "./.git" -prune \
            -o -path "./bin" -prune \
            -o -path "./develop-eggs" -prune \
            -o -path "./include" -prune \
            -o -path "./lib" -prune \
            -o -path "./lib64" -prune \
            -o -path "./parts" -prune \
            -o -path "./share" -prune \
            -o -path "./var" -prune \
            -o -name "*generated*" -prune \
            -o -name "*prototype*" -prune \
            -o -name "*.py" -print \
            -o -name "*.html" -print \
            -o -name "*.pt" -print \
            -o -name "*.xml" -print \
            -o -name "*.zcml" -print \
            > /tmp/i18nsync-source-files.txt

        ./bin/pot-create \
            -d $DOMAIN \
            -c PATH/TO/lingua.cfg \
            -o PATH/TO/$DOMAIN.pot \
            --add-comments i18n \
            --files-from /tmp/i18nsync-source-files.txt \
            >> /tmp/i18nsync_rebuild.log 2>&1