> you should not use vpython during PRESUBMIT checks
This surprised me because functions like input_api.canned_checks.RunUnitTests use vpython and vpython3. Is the guidance wrong, or does RunUnitTests need to be updated?
Also, while working on presubmits I have found several scripts that fail on Windows. Two of the avoidable problems are related to different defaults for how text files are read and written. Specifically, Python defaults to \r\n line endings when writing files, and Python 3 defaults to the cp1252 encoding when reading and writing files.
In order to avoid latent compatibility problems I would like to propose that the Python style guide be updated to recommend specifying encoding='utf-8' whenever a text file is opened for reading or writing, and newline='' (or newline='\n') whenever opening a text file for writing.
Thoughts?
--