Issue 5252: 2to3 should detect and delete import of removed statvfs module (original) (raw)

Created on 2009-02-13 18:27 by sjt, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg81959 - (view) Author: Stephen J. Turnbull (sjt) * (Python triager) Date: 2009-02-13 18:27
It should also try to convert stuff like from statvfs import F_BAVAIL, F_FRSIZE status = os.statvfs(directory) available = status[F_BAVAIL]/((1024*1024)/status[F_FRSIZE]
msg81967 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-02-13 19:29
Hmm. 2to3 doesn't currently mess with the stat module and os.stat the more common function. Also the new interface (attributes on the objects returned) has been around since 2.2.
msg82006 - (view) Author: Stephen J. Turnbull (sjt) * (Python triager) Date: 2009-02-14 10:33
Benjamin Peterson writes: > Hmm. 2to3 doesn't currently mess with the stat module and os.stat the > more common function. Also the new interface (attributes on the objects > returned) has been around since 2.2. So what? You *can't* import a nonexistent module, so the import statement should be removed to save the programmer the trouble.
msg82045 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-02-14 13:33
On Sat, Feb 14, 2009 at 4:33 AM, Stephen J. Turnbull <report@bugs.python.org> wrote: > > Stephen J. Turnbull <stephen@xemacs.org> added the comment: > > Benjamin Peterson writes: > > > Hmm. 2to3 doesn't currently mess with the stat module and os.stat the > > more common function. Also the new interface (attributes on the objects > > returned) has been around since 2.2. > > So what? You *can't* import a nonexistent module, so the import > statement should be removed to save the programmer the trouble. No, the programmer should remove the import statement when he's porting it to use the attributes of the statvfs call.
msg145517 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-10-14 14:03
Benjamin, you seem to have rejected this feature request. Close it?
msg266641 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-05-29 22:08
Closing based on Benjamin's comments.
History
Date User Action Args
2022-04-11 14:56:45 admin set github: 49502
2016-05-29 22:08:25 r.david.murray set status: open -> closednosy: + r.david.murraymessages: + resolution: rejectedstage: resolved
2011-10-14 14:03:01 terry.reedy set nosy: + terry.reedymessages: +
2009-02-14 13:33:13 benjamin.peterson set messages: +
2009-02-14 10:33:42 sjt set messages: +
2009-02-13 19:29:13 benjamin.peterson set priority: lownosy: + benjamin.petersonmessages: +
2009-02-13 18:27:05 sjt create