Re: [Fuego] [PATCH 2/8] ftc: Use text mode in file operation to make compatible with python3
"Bird, Tim" <[email protected]> Fri, 13 May 2022 17:08:41 +0000
| Newsgroups | dev.linux.lists.fuego |
|---|---|
| Message-ID | <BYAPR13MB250300EEF8FDFB860B79ECE5FDCA9@BYAPR13MB2503.namprd13.prod.outlook.com> |
> -----Original Message----- > From: [email protected] <[email protected]= m> >=20 > From: sireesha <[email protected]> >=20 > In python 2 the str type can be used for both text an binary data, and > it works well even the file is opened in binary mode. >=20 > Whereas in python 3 it has made the text and binary data in distinct type= s, > so use text mode that supports both in python 2 and 3 >=20 > Signed-off-by: sireesha <[email protected]> > Signed-off-by: venkata pyla <[email protected]> > --- > scripts/ftc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/scripts/ftc b/scripts/ftc > index 3d61c4b..ce34b08 100755 > --- a/scripts/ftc > +++ b/scripts/ftc > @@ -2974,7 +2974,7 @@ def gen_csv_report(header_data, report_data, report= _file): > import csv >=20 > # generate header > - with open(report_file, "wb") as report: > + with open(report_file, "w") as report: > writer =3D csv.writer(report) > writer.writerows(header_data) >=20 > -- > 2.20.1 >=20 Looks good. Applied.=20 -- Tim