Edgewall Software
Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#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 Ryan J Ollos, 6 years ago

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

comment:2 by Ryan J Ollos, 6 years ago

Additional changes in [82bc65beb/rjollos.git].

comment:3 by Ryan J Ollos, 6 years ago

comment:1 and comment:2 changes committed to 1.2-stable in r16785, merged to trunk in r16786.

comment:4 by Ryan J Ollos, 6 years ago

DONE Check that de catalogs are included in the release.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:6 by Ryan J Ollos, 5 years ago

Resolution: fixed
Status: assignedclosed

in reply to:  3 comment:7 by Ryan J Ollos, 5 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 100644
    a b from __future__ import print_function  
    2121import cgi
    2222import dircache
    2323import fnmatch
    24 import textwrap
    2524from functools import partial
    2625import gc
    2726import io
    def send_internal_error(env, req, exc_info):  
    738737            enabled_plugins = _("''Plugin information not available''\n")
    739738            interface_files = _("''Interface customization information not "
    740739                                 "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)s
    752             }}}
    753 
    754             User agent: `#USER_AGENT#`
    755 
    756             ==== System Information ====
    757             %(sys_info)s
    758             ==== Enabled Plugins ====
    759             %(enabled_plugins)s
    760             ==== Interface Customization ====
    761             %(interface_customization)s
    762             ==== Python Traceback ====
    763             {{{
    764             %(traceback)s}}}"""),
     740        return _("""\
     741==== How to Reproduce ====
     742
     743While doing a %(method)s operation on `%(path_info)s`, \
     744Trac issued an internal error.
     745
     746''(please provide additional details here)''
     747
     748Request parameters:
     749{{{
     750%(req_args)s
     751}}}
     752
     753User 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}}}""",
    765764            method=req.method, path_info=req.path_info,
    766765            req_args=pformat(req.args), sys_info=sys_info,
    767766            enabled_plugins=enabled_plugins,

comment:8 by Jun Omae, 5 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 Ryan J Ollos, 5 years ago

Thanks, committed to 1.2-stable in r17009, merged to trunk in r17010 (and also extracted the message).

in reply to:  8 comment:10 by Ryan J Ollos, 5 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 if textwrap.dedent or cleandoc_ is used.

I considered we could just remove the line continuation marker, but cleandoc_ doesn't take arguments as dgettext does.

comment:11 by Ryan J Ollos, 5 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):  
    210210            drev += '/' + repos.reponame
    211211        return textwrap.dedent("""\
    212212            In [changeset:"%s" %s]:
    213             {{{
    214             #!CommitTicketReference repository="%s" revision="%s"
     213            {{{#!CommitTicketReference repository="%s" revision="%s"
    215214            %s
    216             }}}""" % (revstring, drev, repos.reponame, rev,
    217                       changeset.message.strip()))
     215            }}}""") % (revstring, drev, repos.reponame, rev,
     216                       changeset.message.strip())
    218217
    219218    def _update_tickets(self, tickets, changeset, comment, date):
    220219        """Update the tickets with the given comment."""

comment:12 by Ryan J Ollos, 5 years ago

Committed comment:11 fix with test in r17043, merged in r17044. Changed WikiProcessor style on trunk in r17045.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.