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 serhiy.storchaka
Recipients mboquien, neologix, pitrou, python-dev, sbt, serhiy.storchaka
Date 2015-04-14.11:54:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429012499.55.0.915872859583.issue21116@psf.upfronthosting.co.za>
In-reply-to
Content
Instead of the loop you can use writelines():

    f.writelines([b'\0' * bs] * (size // bs))

It would be nice to add a comment that estimate why os.ftruncate() or seek+write can't be used here. At least a link to this issue with short estimation.
History
Date User Action Args
2015-04-14 11:54:59serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, neologix, python-dev, sbt, mboquien
2015-04-14 11:54:59serhiy.storchakasetmessageid: <1429012499.55.0.915872859583.issue21116@psf.upfronthosting.co.za>
2015-04-14 11:54:59serhiy.storchakalinkissue21116 messages
2015-04-14 11:54:59serhiy.storchakacreate