This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cjwelborn
Recipients cjwelborn, cool-RR
Date 2014-01-21.02:16:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Isn't this something you could do yourself?

import pathlib
def pathread(self, binary=False):
    with'br'if binary else 'r') as fread:

def pathwrite(self, data, mode='w'):
    with as fwrite:
        fwrite.write(data) = pathread
pathlib.Path.write = pathwrite
p = pathlib.Path('/mydir/example.txt')
# 'Content from path.\n'

p.write('I am appending.\n', mode='a')
# 'Content from path.\nI am appending.\n'

...and what about:
"There should be one-- and preferably only one --obvious way to do it."
Date User Action Args
2014-01-21 02:16:46cjwelbornsetrecipients: + cjwelborn, cool-RR
2014-01-21 02:16:46cjwelbornsetmessageid: <>
2014-01-21 02:16:46cjwelbornlinkissue20218 messages
2014-01-21 02:16:46cjwelborncreate