#13059 closed task (fixed)
Release Trac 1.2.4
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2.4 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | release |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
This ticket is used to coordinate the finalization and testing of the next stable version of Trac, 1.2.4.
Attachments (0)
Change History (12)
comment:1 by , 7 years ago
follow-up: 7 comment:3 by , 7 years ago
comment:5 by , 6 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:7 by , 6 years ago
Replying to Ryan J Ollos:
comment:1 and comment:2 changes committed to 1.2-stable in r16785, merged to trunk in r16786.
Looks like textwrap.dedent should not be used inside gettext: r17004.
-
trac/web/main.py
commit bf59bcc83100fb98285b47be4722e66d1f2ad91a Author: Ryan J Ollos <ryan.j.ollos@gmail.com> Date: Thu Aug 1 19:12:20 2019 -0400 The fix diff --git a/trac/web/main.py b/trac/web/main.py index c75199f79..51f6fdac9 100644a b from __future__ import print_function 21 21 import cgi 22 22 import dircache 23 23 import fnmatch 24 import textwrap25 24 from functools import partial 26 25 import gc 27 26 import io … … def send_internal_error(env, req, exc_info): 738 737 enabled_plugins = _("''Plugin information not available''\n") 739 738 interface_files = _("''Interface customization information not " 740 739 "available''\n") 741 return _( textwrap.dedent("""\742 ==== How to Reproduce ====743 744 While doing a %(method)s operation on `%(path_info)s`, \745 Trac issued an internal error.746 747 ''(please provide additional details here)''748 749 Request parameters:750 {{{751 %(req_args)s752 }}}753 754 User agent: `#USER_AGENT#`755 756 ==== System Information ====757 %(sys_info)s758 ==== Enabled Plugins ====759 %(enabled_plugins)s760 ==== Interface Customization ====761 %(interface_customization)s762 ==== Python Traceback ====763 {{{764 %(traceback)s}}}"""),740 return _("""\ 741 ==== How to Reproduce ==== 742 743 While doing a %(method)s operation on `%(path_info)s`, \ 744 Trac issued an internal error. 745 746 ''(please provide additional details here)'' 747 748 Request parameters: 749 {{{ 750 %(req_args)s 751 }}} 752 753 User agent: `#USER_AGENT#` 754 755 ==== System Information ==== 756 %(sys_info)s 757 ==== Enabled Plugins ==== 758 %(enabled_plugins)s 759 ==== Interface Customization ==== 760 %(interface_customization)s 761 ==== Python Traceback ==== 762 {{{ 763 %(traceback)s}}}""", 765 764 method=req.method, path_info=req.path_info, 766 765 req_args=pformat(req.args), sys_info=sys_info, 767 766 enabled_plugins=enabled_plugins,
follow-up: 10 comment:8 by , 6 years ago
The changes looks good to me.
We could use cleandoc_ to extract with the dedentation, however the unnecessary spaces between the following lines are not removed even if textwrap.dedent or cleandoc_ is used.
While doing a %(method)s operation on `%(path_info)s`, \
Trac issued an internal error.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import textwrap
>>> text = """\
... While doing a %(method)s operation on `%(path_info)s`, \
... Trac issued an internal error.
... """
>>> textwrap.dedent(text)
'While doing a %(method)s operation on `%(path_info)s`, Trac issued an internal error.\n'
^^^^^^^^^^^^^
comment:9 by , 6 years ago
comment:10 by , 6 years ago
Replying to Jun Omae:
We could use
cleandoc_to extract with the dedentation, however the unnecessary spaces between the following lines are not removed even iftextwrap.dedentorcleandoc_is used.
I considered we could just remove the line continuation marker, but cleandoc_ doesn't take arguments as dgettext does.
comment:11 by , 6 years ago
I made another mistake. Indentation is not removed from CommitTicketReference processor. Proposed fix:
-
tracopt/ticket/commit_updater.py
diff --git a/tracopt/ticket/commit_updater.py b/tracopt/ticket/commit_updater.py index dfdad0576..c81a9c8ed 100644
a b class CommitTicketUpdater(Component): 210 210 drev += '/' + repos.reponame 211 211 return textwrap.dedent("""\ 212 212 In [changeset:"%s" %s]: 213 {{{ 214 #!CommitTicketReference repository="%s" revision="%s" 213 {{{#!CommitTicketReference repository="%s" revision="%s" 215 214 %s 216 }}}""" % (revstring, drev, repos.reponame, rev,217 changeset.message.strip()))215 }}}""") % (revstring, drev, repos.reponame, rev, 216 changeset.message.strip()) 218 217 219 218 def _update_tickets(self, tickets, changeset, comment, date): 220 219 """Update the tickets with the given comment."""
comment:12 by , 6 years ago
Committed comment:11 fix with test in r17043, merged in r17044. Changed WikiProcessor style on trunk in r17045.



We can use textwrap.dedent to improve readability of code like in authz_policy tests: [25c335b6a/rjollos.git].