Skip to content

bpo-31827: Remove os.stat_float_times()#4061

Merged
vstinner merged 3 commits into
python:masterfrom
vstinner:stat_float_time
Oct 24, 2017
Merged

bpo-31827: Remove os.stat_float_times()#4061
vstinner merged 3 commits into
python:masterfrom
vstinner:stat_float_time

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Oct 20, 2017

Comment thread Doc/whatsnew/3.7.rst Outdated
to be executed on a process fork. (Contributed by Antoine Pitrou in
:issue:`16500`.)

The ``os.stat_float_times()`` function has been removed. It was introduced in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be in other section, "API and Feature Removals".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread Lib/test/test_os.py
create_file(self.fname)

def restore_float_times(state):
with ignore_deprecation_warnings('stat_float_times'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore_deprecation_warnings no longer used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread Doc/library/os.rst
``False``, future calls return ints. If *newvalue* is omitted, return the
current setting.

For compatibility with older Python versions, accessing :class:`stat_result` as
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I tried to remove the backward compatibility layer: I modified stat_result[ST_MTIME] to return float rather than int. Problem: it broke test_logging, the code deciding if a log file should be rotated or not.

While I'm not strongly opposed to modify stat_result[ST_MTIME], I prefer to do it in a separated PR. Moreover, we need maybe to emit a DeprecationWarning, or at least deprecate the feature in the doc, before changing the type, no?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it should be done in a separate issue. It needs a special discussion. And maybe this can't be changed.

@vstinner vstinner merged commit 01b5aab into python:master Oct 24, 2017
@vstinner vstinner deleted the stat_float_time branch October 24, 2017 09:02
@vstinner
Copy link
Copy Markdown
Member Author

Thank you @serhiy-storchaka for your useful review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants