[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-03-25 Thread Riccardo Murri
Riccardo Murri added the comment: > you should be handling errors properly in the first place, > e.g. by changing your mount_sshfs manager to: > > @contextmanager > def mount_sshfs(localdir, remote): > subprocess.run(f"sshfs {remote} {lo

[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-03-25 Thread Riccardo Murri
New submission from Riccardo Murri : The behavior of `tempfile.TemporaryDirectory()` is to delete the temporary directory when done; this behavior cannot be turned off (there's no `delete=False`like `NamedTemporaryFile` has instead). However, in case a filesystem has been mounted o

[issue15832] argparse: typechecks default value too early

2012-08-31 Thread Riccardo Murri
New submission from Riccardo Murri: The `argparse` module (tested with 2.7, but other versions might be affected) checks the `default` value of an option too early: if the default value raises an exception, then command-line parsing stops. Consider for example the following code