New submission from Hynek Schlawack <h...@ox.cx>:

test_shutil contains a handy helper function called write_file(filename. 
contents). If *filename* is a tuple, os.path.join() is used to concatenate it 
to a path.

To be really useful, the resulting file name should be returned, so the user 
can work with it.

So instead of:
fn = os.path.join(x,y)
write_file(fn, 'contents')

I'd prefer:
fn = write_file((x,y), 'contents')

I have attached a simple patch that achieves this and also applied the 
resulting simplification to some of the tests.

----------
components: Tests
files: write_file_returns_filename.diff
keywords: patch
messages: 142795
nosy: eric.araujo, hynek
priority: normal
severity: normal
status: open
title: Make the write_file() helper function in test_shutil return the file 
name it wrote to
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file23014/write_file_returns_filename.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12824>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to