Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2to3 should detect and delete import of removed statvfs module #49502

Closed
yaseppochi mannequin opened this issue Feb 13, 2009 · 6 comments
Closed

2to3 should detect and delete import of removed statvfs module #49502

yaseppochi mannequin opened this issue Feb 13, 2009 · 6 comments
Labels
topic-2to3 type-feature A feature request or enhancement

Comments

@yaseppochi
Copy link
Mannequin

yaseppochi mannequin commented Feb 13, 2009

BPO 5252
Nosy @terryjreedy, @benjaminp, @bitdancer, @yaseppochi

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-05-29.22:08:25.505>
created_at = <Date 2009-02-13.18:27:05.246>
labels = ['type-feature', 'expert-2to3']
title = '2to3 should detect and delete import of removed statvfs module'
updated_at = <Date 2016-05-29.22:08:25.503>
user = 'https://github.com/yaseppochi'

bugs.python.org fields:

activity = <Date 2016-05-29.22:08:25.503>
actor = 'r.david.murray'
assignee = 'none'
closed = True
closed_date = <Date 2016-05-29.22:08:25.505>
closer = 'r.david.murray'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2009-02-13.18:27:05.246>
creator = 'sjt'
dependencies = []
files = []
hgrepos = []
issue_num = 5252
keywords = []
message_count = 6.0
messages = ['81959', '81967', '82006', '82045', '145517', '266641']
nosy_count = 4.0
nosy_names = ['terry.reedy', 'benjamin.peterson', 'r.david.murray', 'sjt']
pr_nums = []
priority = 'low'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue5252'
versions = ['Python 3.0']

@yaseppochi
Copy link
Mannequin Author

yaseppochi mannequin commented Feb 13, 2009

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]

@yaseppochi yaseppochi mannequin added topic-2to3 type-feature A feature request or enhancement labels Feb 13, 2009
@benjaminp
Copy link
Contributor

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.

@yaseppochi
Copy link
Mannequin Author

yaseppochi mannequin commented Feb 14, 2009

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.

@benjaminp
Copy link
Contributor

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.

@terryjreedy
Copy link
Member

Benjamin, you seem to have rejected this feature request. Close it?

@bitdancer
Copy link
Member

Closing based on Benjamin's comments.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-2to3 type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants