Issue1782

classification
Title: os.stat_float_times is not implemented
Type: behaviour Severity: normal
Components: Library Versions: Jython 2.7, Jython 2.5
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amak, fwierzbicki, jeff.allen, psykiatris, smeatonj, zyasoft
Priority: low Keywords: easy

Created on 2011-07-26.08:00:15 by smeatonj, last changed 2018-04-17.18:51:11 by jeff.allen.

Messages
msg6585 (view) Author: Josh Smeaton (smeatonj) Date: 2011-07-26.08:00:14
The module os does not have the stat_float_times function, even though the Jython documentation lists it as an available function.

This directly impacts django 1.3+, as django uses this function for collecting and serving static content. I'm logging a patch to django to work around this function not being available, but I still feel that jython should at least provide a dummy implementation, to maintain compatibility where possible.

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_24
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.stat_float_times()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'stat_float_times'
>>> dir(os)
['EX_OK', 'F_OK', 'O_APPEND', 'O_CREAT', 'O_EXCL', 'O_RDONLY', 'O_RDWR', 'O_SYNC', 'O_TRUNC', 'O_WRONLY', 'R_OK', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'W_OK', 'X_OK', '__all__', '__doc__', '__file__', '__name__', '_exists', '_exit', '_get_exports_list', '_get_shell_commands', '_name', '_native_posix', '_posix_impl', '_wrap_close', 'access', 'altsep', 'chdir', 'chmod', 'chown', 'close', 'curdir', 'defpath', 'devnull', 'environ', 'errno', 'error', 'extsep', 'fdatasync', 'fdopen', 'fsync', 'ftruncate', 'getcwd', 'getcwdu', 'getegid', 'getenv', 'geteuid', 'getgid', 'getlogin', 'getpgrp', 'getpid', 'getppid', 'getuid', 'isatty', 'kill', 'lchmod', 'lchown', 'linesep', 'link', 'listdir', 'lseek', 'lstat', 'makedirs', 'mkdir', 'name', 'open', 'pardir', 'path', 'pathsep', 'popen', 'popen2', 'popen3', 'popen4', 'putenv', 'read', 'readlink', 'remove', 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'setpgrp', 'setsid', 'stat', 'stat_result', 'strerror', 'symlink', 'sys', 'system', 'umask', 'unlink', 'unsetenv', 'urandom', 'utime', 'wait', 'waitpid', 'walk', 'write']
>>>
msg7647 (view) Author: Alan Kennedy (amak) Date: 2013-02-09.13:39:54
Interestingly, the cpython people want to deprecate the stat_float_times function.

Remove os.stat_float_times
http://bugs.python.org/issue14711

Please can you link to the django code that uses this?
msg7654 (view) Author: Josh Smeaton (smeatonj) Date: 2013-02-10.00:22:20
https://code.djangoproject.com/ticket/16518 was accepted into core, meaning the dependency is now resolved dynamically. This is the only spot in django that makes use of stat_float_times. I think it'd be fairly safe (in regards to django at least) to follow the python 3 direction.
msg7764 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-25.21:54:02
I set this as a doc issue, since really we probably won't be adding a stat_float_times function if it is going away in Python 3.
msg9481 (view) Author: Jim Baker (zyasoft) Date: 2015-02-03.01:07:31
As of https://hg.python.org/jython/rev/e04fa277ce19, os.stat and os.lstat now return floating point times, if available, given that they now use Java 7 file attributes. os.fstat also returns floating points times, but with the fraction set to zero since the underlying JNR posix support doesn't make the nanosecond fields available in the returned stat_t structure.

It would be trivial to support this function, so we probably should.
msg11909 (view) Author: Patrick Palczewski (psykiatris) Date: 2018-04-16.03:19:52
So, we are removing the stat_float_times function, or updating the docs?
msg11911 (view) Author: Jeff Allen (jeff.allen) Date: 2018-04-17.18:51:10
I'd go with Jim's last idea: "probably should" support.

We aim to be the same as CPython if we can be, and there aren't independent documents for Jython anyway.
History
Date User Action Args
2018-04-17 18:51:11jeff.allensetnosy: + jeff.allen
messages: + msg11911
components: + Library, - Documentation
versions: + Jython 2.7
2018-04-16 03:19:53psykiatrissetnosy: + psykiatris
messages: + msg11909
2018-04-10 19:49:19jeff.allensetkeywords: + easy
2015-02-03 01:07:32zyasoftsetnosy: + zyasoft
messages: + msg9481
2013-02-25 21:54:02fwierzbickisetpriority: low
nosy: + fwierzbicki
messages: + msg7764
components: + Documentation, - Library
versions: + Jython 2.5, - 2.5.2
2013-02-10 00:22:20smeatonjsetmessages: + msg7654
2013-02-09 13:39:54amaksetnosy: + amak
messages: + msg7647
2011-07-26 08:00:15smeatonjcreate