aboutcode-org / aboutcode-org/source-inspector

xgettext: process files with spaces and colons in the filename

Aperta
#18 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
3
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.