Open oliver-sanders opened 6 years ago
A user has observed this exact traceback, but reports that the svn info
command works & returns a success status. Therefore the scope of this Issue might be wider than the title & current description suggest. I am amending the title of this Issue accordingly.
I am not sure if it is connected, but I have had this happen to me when I have copied and pasted a suite ID from a trac ticket and somehow got unprintable characters into my command line prompt. This confuses rosie copy but as the suite ID that it prints still have the unprintable characters, it looks like the suite ID is correct. This may be a "don't do that then".
That would be a different issue to do with sanitising inputs.
This may be a "don't do that then".
Maybe, but it might be something we can address in another issue.
Can you find out what these unprintable characters are and send back an example string. We might be able to do something.
I can reproduce the problem by copying a suite Id from a trac ticket, but I don't know how to turn that into an example string. The result of cat -A is:
fris@vld359> echo u-bn027|cat -A
M-bM-^@M-^Ku-bn027$
and the actual string is: u-bn027 (non printable character is before the u)
Hmm, that string contains control characters, I've not been able to replicate this, are you copying text from a browser running on Windows to Linux via a VDI client perchance?
Unfortunately you can't just regex them out as they are instructions to move the terminal cursor position. To expand out control characters (like echo
does) you need the functionality of a vtxxx terminal emulator. There are a few Python emulators kicking about which have simple functions to parse control chars out of strings, however, none of these are in the standard library so we can't do this for any Python2 Rose release (though could possibly do for Python3).
For now the best we can do is to detect control characters and raise a more informative error message. If this makes sense I'll sling up a separate issue to do that for an upcomming Python2 Rose release.
thanks - I can replicate this purely within a Linux environment, just by copying from Firefox a suite ID which is also a Trac link to a rose suite (i.e. what is displayed by [roses-u.x:source:b/q/7/9/5/trunk u-bq795] ) I think the control characters come from arrow inside a box in front of the suite ID.
I think your proposed change would have saved me a heck of a lot of frustration and would be a very good thing.
Rosie raised a
SuiteIdTextError
in the event thatsvn info
fails irrespective of the reason which is confusing to users. e.g. locked keyring.