Message185180
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. |
|
Date |
User |
Action |
Args |
2013-03-25 02:57:25 | gregory.p.smith | set | recipients:
+ 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:25 | gregory.p.smith | set | messageid: <1364180245.93.0.0448355132143.issue11406@psf.upfronthosting.co.za> |
2013-03-25 02:57:25 | gregory.p.smith | link | issue11406 messages |
2013-03-25 02:57:25 | gregory.p.smith | create | |
|