[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

Hynek Schlawack report at bugs.python.org
Sun Aug 21 21:15:43 CEST 2011


Hynek Schlawack <hs at ox.cx> added the comment:

While writing my tests I realized, it would be really useful to make write_file() return the path it wrote to. I need the concatenated filenames most of the time, so I'm getting blocks of:

fn = os.path.join(x,y)
write_file(fn, 'contents')

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

Any thoughts? IMHO a write_file that concats path but doesn't return it is only useful in the tree-functions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12721>
_______________________________________


More information about the Python-bugs-list mailing list