Message227653
This looks reasonable. Note that the output of gettempdir is always passed as first argument to os.path.join (possibly via _mkstemp_inner), so perhaps you should rather define something like
def _absolute_child_of_parent_or_tmpdir(parent, *args):
"""Return the absolute child of parent, or gettempdir() if parent is None, given by *args.
"""
if parent is None:
parent = <_sanitize_dir> # inline the code here
return _os.path.join(parent, *args)
and use that function instead.
This factorizes the code a little bit more and makes intent clearer (I don't think _sanitize_dir is a very clear name). |
|
Date |
User |
Action |
Args |
2014-09-26 21:35:20 | Antony.Lee | set | recipients:
+ Antony.Lee, georg.brandl, ncoghlan, serhiy.storchaka, yselivanov |
2014-09-26 21:35:20 | Antony.Lee | set | messageid: <1411767320.37.0.80121768997.issue20267@psf.upfronthosting.co.za> |
2014-09-26 21:35:20 | Antony.Lee | link | issue20267 messages |
2014-09-26 21:35:20 | Antony.Lee | create | |
|