Message224034
The use of context lib in _read_output should not be necessary anymore as file objects and NamedTemporaryFile objects already are context managers with the right semantics.
I'm not sure how to avoid the import of tempfile other than adding a minimal implementation of tempfile.mkstemp to _osx_support, in particular because the fallback code in _osx_support is insecure: It uses a named temporary file in /tmp with builtin.open and because the name of the file is predictable there is a small risk of overwriting arbitrary files when an attacker has access to /tmp. I guess the fallback is there to use during bootstrap, it should really be avoided afterwards.
BTW. A small unscientific test on my laptop didn't see any differences between the regular _osx_support and a version where "import re" was moved inside the functions that use that module. But: that's on a fast laptop with SSD for storage, there could easily be a difference on systems with slower storage.
Ned: do you remember what your idea was w.r.t. avoid the use of re? I guess its easy enough to replace the current re-using code by code that only uses str methods, but your phrasing seems to indicate another plan. |
|
Date |
User |
Action |
Args |
2014-07-26 09:37:58 | ronaldoussoren | set | recipients:
+ ronaldoussoren, vstinner, christian.heimes, ned.deily, Esa.Peuha |
2014-07-26 09:37:58 | ronaldoussoren | set | messageid: <1406367478.81.0.657864237714.issue19325@psf.upfronthosting.co.za> |
2014-07-26 09:37:58 | ronaldoussoren | link | issue19325 messages |
2014-07-26 09:37:58 | ronaldoussoren | create | |
|