From: Guido van Rossum Date: Fri, 11 Jul 1997 18:36:28 +0000 (+0000) Subject: Allow '@' character as end of line padding in uuencode format. X-Git-Tag: v1.5a3~307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1243ae7f0767b5636ad1d071d15778f134f7c65f;p=python 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_5(F/\'``!@ --- diff --git a/Modules/binascii.c b/Modules/binascii.c index 4776170755..7e03799126 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -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;