From 0388fc95e696513bbefbde293f3f76cc482df8fa Mon Sep 17 00:00:00 2001 From: lidayan <840286247@qq.com> Date: Tue, 9 Apr 2019 15:18:53 +0800 Subject: [PATCH] update filename_format for ProfilerMiddleware. --- CHANGES.rst | 7 +++++-- src/werkzeug/middleware/profiler.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 0de7ba992..49c29ffbf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,12 +7,15 @@ Unreleased - Properly handle multi-line header folding in development server in Python 2.7. (:issue:`1080`) -- Restore the ``response`` argument to :exc:`exceptions.Unauthorized`. +- Restore the ``response`` argument to :exc:`~exceptions.Unauthorized`. (:pr:`1527`) -- :exc:`exceptions.Unauthorized` doesn't add the ``WWW-Authenticate`` +- :exc:`~exceptions.Unauthorized` doesn't add the ``WWW-Authenticate`` header if ``www_authenticate`` is not given. (:issue:`1516`) - The default URL converter correctly encodes bytes to string rather than representing them with ``b''``. (:issue:`1502`) +- Fix the filename format string in + :class:`~middleware.profiler.ProfilerMiddleware` to correctly handle + float values. (:issue:`1511`) Version 0.15.2 diff --git a/src/werkzeug/middleware/profiler.py b/src/werkzeug/middleware/profiler.py index 289879d94..32a14d9fd 100644 --- a/src/werkzeug/middleware/profiler.py +++ b/src/werkzeug/middleware/profiler.py @@ -77,7 +77,7 @@ def __init__( sort_by=("time", "calls"), restrictions=(), profile_dir=None, - filename_format="{method}.{path}.{elapsed:06d}ms.{time:d}.prof", + filename_format="{method}.{path}.{elapsed:.0f}ms.{time:.0f}.prof", ): self._app = app self._stream = stream