Author Windson Yang
Recipients Valentin Zhao, Windson Yang, jaraco, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-11-09.06:58:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541746739.22.0.788709270274.issue35131@psf.upfronthosting.co.za>
In-reply-to
Content
I tried to create a PR for it, However, I don't know how to handle the code at https://github.com/python/cpython/blob/d4c76d960b/Lib/site.py#L159

So how to check UnicodeDecodeError when we just open the file, I use readlines() but it may use too many memory than before (I'm not sure it's important in this case).

    try:
        f = open(fullname, "r")
        data = f.readlines()
    except UnicodeDecodeError:
        f = open(fullname, "r", encoding="utf-8")
        data = f.readlines()
History
Date User Action Args
2018-11-09 06:58:59Windson Yangsetrecipients: + Windson Yang, paul.moore, jaraco, tim.golden, zach.ware, steve.dower, Valentin Zhao
2018-11-09 06:58:59Windson Yangsetmessageid: <1541746739.22.0.788709270274.issue35131@psf.upfronthosting.co.za>
2018-11-09 06:58:59Windson Yanglinkissue35131 messages
2018-11-09 06:58:59Windson Yangcreate