Allow '@' character as end of line padding in uuencode format.

Not sure why this is generated, but this fixes a problem with a
particular file that was received with the following final line:

F-WE<-*A5]AY]%7>8'&!!(_Y<F*55_"*%46"<OFG=>_5(F/\'``!@
This commit is contained in:
Guido van Rossum 1997-07-11 18:36:28 +00:00
parent e3cd151d1f
commit 1243ae7f07
1 changed files with 3 additions and 1 deletions

View File

@ -265,7 +265,9 @@ binascii_a2b_uu(self, args)
*/
while( ascii_len-- > 0 ) {
this_ch = *ascii_data++;
if ( this_ch != ' ' && this_ch != '\n' && this_ch != '\r' ) {
/* Extra '@' may be written as padding in some cases */
if ( this_ch != ' ' && this_ch != '@' &&
this_ch != '\n' && this_ch != '\r' ) {
PyErr_SetString(Error, "Trailing garbage");
Py_DECREF(rv);
return NULL;