From 1243ae7f0767b5636ad1d071d15778f134f7c65f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 11 Jul 1997 18:36:28 +0000 Subject: [PATCH] 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/\'``!@ --- Modules/binascii.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/binascii.c b/Modules/binascii.c index 47761707556..7e037991266 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;