Author gregory.p.smith
Recipients Trundle, brian.curtin, eric.araujo, giampaolo.rodola, gregory.p.smith, loewis, neologix, nvetoshkin, pitrou, rhettinger, serhiy.storchaka, socketpair, terry.reedy, tim.golden, torsten
Date 2013-03-25.02:57:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364180245.93.0.0448355132143.issue11406@psf.upfronthosting.co.za>
In-reply-to
Content
Your objection is noted but it is wrong.

A Python program today cannot process arbitrarily large directories within a fixed amount of ram today due to os.listdir. This makes it unsuitable for file system cleanup tasks that we have run into on production servers.  This fixes that without requiring an extension module or fragile ctypes code to work around the deficiency.

It _would've been nice_ for os.listdir to be updated to be an iterator with 3.0 but it wasn't... so we're left supporting its legacy interface rather than just replacing it with this.

If think this functionality belongs in a module other than os, please suggest where.

long term: os.walk and os.fwalk are also unusable on arbitrary filesystems with large directories for the same reason because they use os.listdir.  providing a non-directory-preloading version of those is outside the scope of this issue.
History
Date User Action Args
2013-03-25 02:57:25gregory.p.smithsetrecipients: + gregory.p.smith, loewis, rhettinger, terry.reedy, pitrou, giampaolo.rodola, tim.golden, eric.araujo, Trundle, brian.curtin, torsten, nvetoshkin, neologix, socketpair, serhiy.storchaka
2013-03-25 02:57:25gregory.p.smithsetmessageid: <1364180245.93.0.0448355132143.issue11406@psf.upfronthosting.co.za>
2013-03-25 02:57:25gregory.p.smithlinkissue11406 messages
2013-03-25 02:57:25gregory.p.smithcreate