aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
435 stars 188 forks source link

Issue with strange characters in code label #2974

Open ezpzbz opened 5 years ago

ezpzbz commented 5 years ago

I found that if by some reason there would be a tab (for example) in the code name, then it will be recorded as \t in the DB, afterward, the code will not be recognized by the name.

For instance: The following code was configured on my system:

$ verdi code list

List of configured codes:

(use 'verdi code show CODEID' to see the details)

Then, when I tried to use it in calculation I got:

$ verdi run test_raspa_base.py raspa5 The code 'raspa5' does not exist

Within the verdi shell, I see the code label as: '\traspa5'

ltalirz commented 5 years ago

@sphuber @giovannipizzi I think here the question is whether we want to put in place some automatic cleaning rule for assigning labels in general (e.g. using something like this to strip out any control character)

giovannipizzi commented 5 years ago

It could be indeed useful. Also stripping spaces (at beginning and end of line) could be a sensible thing to do I guess. PR welcome! ;-)