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

Add statvfs flags to the posix module #51896

Closed
ajaxredhatcom mannequin opened this issue Jan 6, 2010 · 7 comments
Closed

Add statvfs flags to the posix module #51896

ajaxredhatcom mannequin opened this issue Jan 6, 2010 · 7 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@ajaxredhatcom
Copy link
Mannequin

ajaxredhatcom mannequin commented Jan 6, 2010

BPO 7647
Nosy @loewis, @akuchling, @birkenfeld, @davidmalcolm
Files
  • posix-statvfs-symbols.patch: posix-statvfs-symbols.patch
  • posix-statvfs-flag-docs.txt: Documentation patch
  • 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 = 'https://github.com/loewis'
    closed_at = <Date 2010-08-18.22:46:31.083>
    created_at = <Date 2010-01-06.20:18:18.651>
    labels = ['extension-modules', 'type-feature']
    title = 'Add statvfs flags to the posix module'
    updated_at = <Date 2010-08-18.22:46:31.082>
    user = 'https://bugs.python.org/ajaxredhatcom'

    bugs.python.org fields:

    activity = <Date 2010-08-18.22:46:31.082>
    actor = 'akuchling'
    assignee = 'loewis'
    closed = True
    closed_date = <Date 2010-08-18.22:46:31.083>
    closer = 'akuchling'
    components = ['Extension Modules']
    creation = <Date 2010-01-06.20:18:18.651>
    creator = 'ajax@redhat.com'
    dependencies = []
    files = ['15764', '16318']
    hgrepos = []
    issue_num = 7647
    keywords = ['patch']
    message_count = 7.0
    messages = ['97322', '97449', '97452', '97453', '97657', '99821', '114291']
    nosy_count = 5.0
    nosy_names = ['loewis', 'akuchling', 'georg.brandl', 'dmalcolm', 'ajax@redhat.com']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue7647'
    versions = ['Python 2.7', 'Python 3.2']

    @ajaxredhatcom
    Copy link
    Mannequin Author

    ajaxredhatcom mannequin commented Jan 6, 2010

    Though the statvfs call exists in the posix module, the posix-defined values for the f_flag field are not. This makes it hard to know whether a filesystem is readonly without also knowing the value for ST_READONLY on the machine you're running on.

    Attached patch is against python2 svn, but probably applies to python3 too.

    @ajaxredhatcom ajaxredhatcom mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Jan 6, 2010
    @birkenfeld
    Copy link
    Member

    IMO these symbols should go to the "stat" module, not the "posix" module. However, that module is Python, so the values would need to be hardcoded. Do you know whether they are constant on all relevant systems?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 9, 2010

    I think having a stat module is a mistake in the first place. It's primary purpose (giving symbolic names to fields in a stat result) is out-of-date, now that we have named tuples. It's secondary purpose (collecting symbolic constants and macros around them) is flawed, as there is no guarantee that they are fixed across systems (unless we explicitly map the values correspondingly.

    So I support addition of the constants to the posix module. Not sure whether documentation is lacking in the patch (i.e. whether they ought to be documented).

    @birkenfeld
    Copy link
    Member

    Okay. Would it then make sense to migrate those constants in the stat module to posix, and deprecate the former?

    @ajaxredhatcom
    Copy link
    Mannequin Author

    ajaxredhatcom mannequin commented Jan 12, 2010

    None of the other symbolic constants in 'posix' have documentation. Perhaps they should, but the patch is at least doing the same as what's already done.

    @akuchling
    Copy link
    Member

    Here's a patch that updates the 2.7 docs.

    Adam, have you submitted a contributor agreement (http://www.python.org/psf/contrib/)?

    @akuchling
    Copy link
    Member

    Committed to 3.2 in rev. 84188; thanks, Adam!

    @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
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants