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

posixmodule.c always using res = utime(path, NULL) #47675

Closed
oskar86 mannequin opened this issue Jul 22, 2008 · 3 comments
Closed

posixmodule.c always using res = utime(path, NULL) #47675

oskar86 mannequin opened this issue Jul 22, 2008 · 3 comments
Labels
build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@oskar86
Copy link
Mannequin

oskar86 mannequin commented Jul 22, 2008

BPO 3425
Nosy @jszakmeister, @bitdancer
Files
  • issue-3425-utimes.patch: Patch to use utimes() when the arg is None.
  • 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 2014-06-19.20:17:18.180>
    created_at = <Date 2008-07-22.13:56:32.473>
    labels = ['extension-modules', 'build']
    title = 'posixmodule.c always using res = utime(path, NULL)'
    updated_at = <Date 2014-06-19.20:17:18.178>
    user = 'https://bugs.python.org/oskar86'

    bugs.python.org fields:

    activity = <Date 2014-06-19.20:17:18.178>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-06-19.20:17:18.180>
    closer = 'r.david.murray'
    components = ['Extension Modules']
    creation = <Date 2008-07-22.13:56:32.473>
    creator = 'oskar86'
    dependencies = []
    files = ['14104']
    hgrepos = []
    issue_num = 3425
    keywords = ['patch']
    message_count = 3.0
    messages = ['70147', '88471', '221016']
    nosy_count = 3.0
    nosy_names = ['jszakmeister', 'oskar86', 'r.david.murray']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue3425'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @oskar86
    Copy link
    Mannequin Author

    oskar86 mannequin commented Jul 22, 2008

    I'm porting, embedding and extending Python in a very limited environment.

    This environment does not have utime.h and have not defined the
    following function:

    int utime(const char *, const struct utimbuf *);

    Although the function called utimes, defined in sys/time.h exist.

    int utimes(const char *path, const struct timeval times[2]);

    In the method, in posixmodule.c:

    static PyObject *
    posix_utime(PyObject *self, PyObject *args);

    usage of these methods are used. If a time is specified in args, a
    define determines which of the two methods to use, utime or utimes
    depending if these exist or not.

    If Py_None is sent instead utime is always used, the solution to solve
    this is to use #ifdef with HAVE_UTIMES.

    Line number 2835 in
    http://svn.python.org/projects/python/trunk/Modules/posixmodule.c

    I have not checked if this is solved in future versions.

    @oskar86 oskar86 mannequin added extension-modules C modules in the Modules dir build The build process and cross-build labels Jul 22, 2008
    @jszakmeister
    Copy link
    Mannequin

    jszakmeister mannequin commented May 28, 2009

    It seems reasonable to prefer utimes() over utime() in all cases, when
    utimes() is available, since utime() is considered obsolete. I've
    attached a patch with the required change and ran all the tests. There
    are some tests failing on trunk with my system. However this patch
    introduced no additional failures (test_posix passes). BTW, the patch is
    against trunk.

    @bitdancer
    Copy link
    Member

    This is no longer an issue in Python3; there utimes is used if it is available (if utimensat is not).

    Since this doesn't affect the platforms actually supported by python2.7, I'm closing this as out of date.

    @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
    build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant