nvda
f66e46ee - Python 3: file function -> open function (#9663)

Commit
6 years ago
Python 3: file function -> open function (#9663) * Add-on handler and update check/Python 3: file function -> with open function for reading from and writing to pickle files. Re #9038. * NVDA helper and watchdog/Python 3: with file -> with open function. Re #9038. * Config/Python 3: use open function when creating an empty profile data file. Re #9038. * Build version/Python 3: use with open function when obtaining Git head/commit for version information construction. Re #9038. Without modifying head/commit values for version info, NVDA will report 'year.major.minor' when running from source. Therefore edit this routine. * Log viewer/Python 3: add an explanatory note on with open function and encoding issue. Re #9038. When saving logs, a log file object will be created. The routine responsible for this is eligible for conversion to 'with open' statement, but there is a note about UTF-8 codecs conversion problem. Thus add a note regarding this and exclude that routine from conversion for now. * Add-on handler and update check/Python 3: use binary format when working with pickles. Re #9038. Clarified by Mick Curran (NV Access): in Python 3, when loading and dumping pickles, binary format must be used (rb/wb). * Log viewer/Python 3: save log file in UTF-8 format. Re #9038. Reviewed by Mick Curran (NV Access): open log file for saving with UTF-8 encoding from the start. Note that Python 2's open function does not include encoding parameter directly, but Python 3 does.
Author
Committer
Parents
Loading