Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xgettext: process files with spaces and colons in the filename #18

Open
armijnhemel opened this issue Apr 12, 2024 · 0 comments
Open

xgettext: process files with spaces and colons in the filename #18

armijnhemel opened this issue Apr 12, 2024 · 0 comments

Comments

@armijnhemel
Copy link

From #16 (comments)

So what about file names that have a space in it, or perhaps have a semicolon? Those are valid file names and xgettext will happily process them and you will get something like this (I just renamed a file and then ran xgettext):

#: fdisk:big.c:234 fdisk:big.c:2942

I am not sure how common file names with semicolons are, but file names with spaces are not uncommon.

As far as I can tell partition() will not properly process this:

>>> _, _, bla = a.partition('#:')
>>> bla.partition(':')
(' fdisk', ':', 'big.c:234 fdisk:big.c:2942')

The only certainty that you have is that the part after the last : should be a number, so perhaps rewriting it to rpartition() would be the cleanest way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant