-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55858/#review162919
-----------------------------------------------------------


Fix it, then Ship it!





support/apply-reviews.py (line 121)
<https://reviews.apache.org/r/55858/#comment234313>

    Perhaps the following would be more intuitive as to what we're doing rather 
than a default argument?
    ```
    patch=patch_id()
    atexit.register(lambda: os.remove('%s.patch' % patch))
    ```


- Michael Park


On Jan. 23, 2017, 2:15 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55858/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2017, 2:15 p.m.)
> 
> 
> Review request for mesos, Artem Harutyunyan and Joris Van Remoortere.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When applying a chain of reviews with "-c", only the patch for the last
> review in the chain was cleaned up at-exit.
> 
> 
> Diffs
> -----
> 
>   support/apply-reviews.py c77b4c2b2d7a3d5e74e225403e71a84e23a9a1e7 
> 
> Diff: https://reviews.apache.org/r/55858/diff/
> 
> 
> Testing
> -------
> 
> Without this change, `./support/apply-reviews.py -n -c -r 55856` results in a 
> lot of errors:
> 
> ```
> ...
> [tmp-apply-branch c60068d2d] Displayed unreachable tasks in the webui.
>  3 files changed, 60 insertions(+)
> Error in atexit._run_exitfuncs:
> Traceback (most recent call last):
>   File 
> "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py",
>  line 24, in _run_exitfuncs
>     func(*targs, **kargs)
>   File "./support/apply-reviews.py", line 119, in <lambda>
>     atexit.register(lambda: os.remove('%s.patch' % patch_id()))
> OSError: [Errno 2] No such file or directory: '55856.patch'
> Error in atexit._run_exitfuncs:
> Traceback (most recent call last):
>   File 
> "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py",
>  line 24, in _run_exitfuncs
>     func(*targs, **kargs)
>   File "./support/apply-reviews.py", line 119, in <lambda>
>     atexit.register(lambda: os.remove('%s.patch' % patch_id()))
> OSError: [Errno 2] No such file or directory: '55856.patch'
> ...
> ```
> 
> And results in leaving a lot of `.patch` files on the file system. With this 
> patch, no such error is observed and no orphan `.patch` files are left behind.
> 
> 
> Thanks,
> 
> Neil Conway
> 
>

Reply via email to