<commit_before><!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title>${message or 'Error'}</title>
    <script py:if="frames" type="text/javascript">/*<![CDATA[*/
      $(document).ready(function() {
        $("#traceback a").click(function() {
          $("div", this.parentNode).slideToggle("fast");
          return false;
        });
        $("#tbtoggle").click(function() {
          if (this.value.indexOf("interactive") < 0) {
            this.value = "Switch to interactive view";
            $("#traceback ul").fadeOut("fast", function() {
              $("#traceback pre").fadeIn("fast");
            });
          } else {
            this.value = "Switch to plain text view";
            $("#traceback pre").fadeOut("fast", function() {
              $("#traceback ul").fadeIn("fast");
            });
          }
        });
        return false;
      });
    /*]]>*/</script>
  </head>

  <py:def function="create_ticket(teo=False)">
    <input type="hidden" name="preview" value="1" />
    <input type="hidden" name="reporter" value="${get_reporter_id(req)}" />
    <input py:if="teo" type="hidden" name="version"
           value="${'dev' in trac.version and 'devel' or trac.version}" />
    <input type="hidden" name="summary" value="$message" />
    <textarea name="description">
==== How to Reproduce ====
While doing a $req.method operation on `$req.path_info`, Trac issued an internal error.

<py:if test="req.method.lower() == 'post'">
${pprint(req.args)}
</py:if>

==== System Information ====
<py:for each="k, v in trac.systeminfo">
|| '''$k''' || ${v and '\n' in v and ['`%s`[[br]]' % line for line in v.split('\n')] or '`%s`' % v} ||
</py:for>

==== Python Traceback ====
{{{
${traceback}
}}}
    </textarea>
    <span class="inlinebuttons">
      <input type="submit" name="create" value="Create" />
    </span>
  </py:def>

  <body>
    <div id="ctxtnav" class="nav"></div>

    <div id="content" class="error">
      <py:choose test="type">
        <py:when test="'TracError'">
          <h1>$title</h1>
          <p class="message">$message</p>
        </py:when>
        <py:when test="'internal'">
          <h1>Oops&hellip;</h1>
          <div class="message">
            <strong>Trac detected an internal error:</strong>
            <pre>$message</pre>
          </div>
          <py:choose>
            <py:when test="'TRAC_ADMIN' not in perm">
              <p>There was an internal error in Trac. It is recommended
              that you inform your local
              <a py:strip="not project.admin" href="mailto:${project.admin}">Trac
              administrator</a> and give him all the information he needs to
              reproduce the issue.
              </p>
              <py:if test="not project.admin">
                <form id="newticket" method="get" action="${href.newticket()}">
                  <p>To that end, you could ${create_ticket()} a ticket at this
                  site.</p>
                </form>
              </py:if>
              <p>
                The action that triggered the error was:
                <pre>${req.method}: ${req.path_info}</pre>
              </p>
            </py:when>
            <py:otherwise>
              <p>If you think this should work you can reproduce the problem,
              you should consider reporting this to the Trac team.</p>
              <p>Before you do that, though, please first try
                <a py:with="q = quote_plus(message[:80])"
                   href="${trac.homepage}/search?ticket=yes&amp;noquickjump=1&amp;q=$q">searching</a>
                for similar issues, as it is quite likely that this problem
                has been reported before. For questions about installation
                and configuration of Trac, please try the
                <a href="${trac.homepage}/wiki/MailingList">mailing list</a>
                instead of filing a ticket.
              </p>
              <form id="newticket" method="get" action="${trac.homepage}/newticket">
                <p>Otherwise, please ${create_ticket(True)} a new ticket at
                the Trac project site, where you can describe the problem and
                explain how to reproduce it.</p>
              </form>
              <h2>System Information:</h2>
              <table class="listing" id="systeminfo">
                <tr py:for="name, value in trac.systeminfo">
                  <th>$name:</th>
                  <td>$value</td>
                </tr>
              </table>
              <py:if test="frames">
                <h2>Python Traceback</h2>
                <div id="traceback">
                  Most recent call last:
                  <ul>
                    <li class="frame" py:for="idx, frame in enumerate(frames)">
                      <a href="#frame${idx}" id="#frame${idx}">
                        <span class="file">File "${frame.filename}",
                        line ${frame.lineno + 1}, in</span>
                        <var>${frame.function}</var>
                      </a>
                      <div py:if="frame.line" class="source" style="display: none">
                        <h3>Code fragment:</h3>
                        <ol start="${frame.lineno - len(frame.lines_before)}">
                          <li py:for="line in frame.lines_before"><code>${line or u'\xa0'}</code></li>
                          <li class="current"><code>${frame.line or u'\xa0'}</code></li>
                          <li py:for="line in frame.lines_after"><code>${line or u'\xa0'}</code></li>
                        </ol>
                      </div>
                      <div py:if="frame.vars" class="vars" style="display: none">
                        <h3>Local variables:</h3>
                        <table class="listing">
                          <thead><tr><th>Name</th><th>Value</th></tr></thead>
                          <tbody>
                            <tr py:for="idx, (name, value) in enumerate(sorted(frame.vars.items()))"
                                class="${idx % 2 and 'odd' or None}">
                              <th scope="row"><var>$name</var></th>
                              <td><code>${shorten_line(repr(value))}</code></td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </li>
                  </ul>
                  <pre style="display: none"><py:for each="frame in frames">File "${frame.filename}", line ${frame.lineno}, in ${frame.function}<py:if test="frame.line">
  ${frame.line.lstrip()}
</py:if></py:for></pre>
                  <p><input type="button" id="tbtoggle" value="Switch to plain text view" /></p>
                </div>
              </py:if>
            </py:otherwise>
          </py:choose>
        </py:when>
      </py:choose>
      <p>
        <a href="${href.wiki('TracGuide')}">TracGuide</a> &mdash; The Trac User and Administration Guide
      </p>
    </div>
  </body>
</html>
<commit_msg>cleaner implementation of the line breaking in the error page "System Information" table<commit_after><!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title>${message or 'Error'}</title>
    <script py:if="frames" type="text/javascript">/*<![CDATA[*/
      $(document).ready(function() {
        $("#traceback a").click(function() {
          $("div", this.parentNode).slideToggle("fast");
          return false;
        });
        $("#tbtoggle").click(function() {
          if (this.value.indexOf("interactive") < 0) {
            this.value = "Switch to interactive view";
            $("#traceback ul").fadeOut("fast", function() {
              $("#traceback pre").fadeIn("fast");
            });
          } else {
            this.value = "Switch to plain text view";
            $("#traceback pre").fadeOut("fast", function() {
              $("#traceback ul").fadeIn("fast");
            });
          }
        });
        return false;
      });
    /*]]>*/</script>
  </head>

  <py:def function="create_ticket(teo=False)">
    <input type="hidden" name="preview" value="1" />
    <input type="hidden" name="reporter" value="${get_reporter_id(req)}" />
    <input py:if="teo" type="hidden" name="version"
           value="${'dev' in trac.version and 'devel' or trac.version}" />
    <input type="hidden" name="summary" value="$message" />
    <textarea name="description">
==== How to Reproduce ====
While doing a $req.method operation on `$req.path_info`, Trac issued an internal error.

<py:if test="req.method.lower() == 'post'">
${pprint(req.args)}
</py:if>

==== System Information ====
<py:for each="k, v in trac.systeminfo">
|| '''$k''' || ${'`%s`' % (v and v.replace('\n', '`[[br]]\n`'))} ||
</py:for>

==== Python Traceback ====
{{{
${traceback}
}}}
    </textarea>
    <span class="inlinebuttons">
      <input type="submit" name="create" value="Create" />
    </span>
  </py:def>

  <body>
    <div id="ctxtnav" class="nav"></div>

    <div id="content" class="error">
      <py:choose test="type">
        <py:when test="'TracError'">
          <h1>$title</h1>
          <p class="message">$message</p>
        </py:when>
        <py:when test="'internal'">
          <h1>Oops&hellip;</h1>
          <div class="message">
            <strong>Trac detected an internal error:</strong>
            <pre>$message</pre>
          </div>
          <py:choose>
            <py:when test="'TRAC_ADMIN' not in perm">
              <p>There was an internal error in Trac. It is recommended
              that you inform your local
              <a py:strip="not project.admin" href="mailto:${project.admin}">Trac
              administrator</a> and give him all the information he needs to
              reproduce the issue.
              </p>
              <py:if test="not project.admin">
                <form id="newticket" method="get" action="${href.newticket()}">
                  <p>To that end, you could ${create_ticket()} a ticket at this
                  site.</p>
                </form>
              </py:if>
              <p>
                The action that triggered the error was:
                <pre>${req.method}: ${req.path_info}</pre>
              </p>
            </py:when>
            <py:otherwise>
              <p>If you think this should work you can reproduce the problem,
              you should consider reporting this to the Trac team.</p>
              <p>Before you do that, though, please first try
                <a py:with="q = quote_plus(message[:80])"
                   href="${trac.homepage}/search?ticket=yes&amp;noquickjump=1&amp;q=$q">searching</a>
                for similar issues, as it is quite likely that this problem
                has been reported before. For questions about installation
                and configuration of Trac, please try the
                <a href="${trac.homepage}/wiki/MailingList">mailing list</a>
                instead of filing a ticket.
              </p>
              <form id="newticket" method="get" action="${trac.homepage}/newticket">
                <p>Otherwise, please ${create_ticket(True)} a new ticket at
                the Trac project site, where you can describe the problem and
                explain how to reproduce it.</p>
              </form>
              <h2>System Information:</h2>
              <table class="listing" id="systeminfo">
                <tr py:for="name, value in trac.systeminfo">
                  <th>$name:</th>
                  <td>$value</td>
                </tr>
              </table>
              <py:if test="frames">
                <h2>Python Traceback</h2>
                <div id="traceback">
                  Most recent call last:
                  <ul>
                    <li class="frame" py:for="idx, frame in enumerate(frames)">
                      <a href="#frame${idx}" id="#frame${idx}">
                        <span class="file">File "${frame.filename}",
                        line ${frame.lineno + 1}, in</span>
                        <var>${frame.function}</var>
                      </a>
                      <div py:if="frame.line" class="source" style="display: none">
                        <h3>Code fragment:</h3>
                        <ol start="${frame.lineno - len(frame.lines_before)}">
                          <li py:for="line in frame.lines_before"><code>${line or u'\xa0'}</code></li>
                          <li class="current"><code>${frame.line or u'\xa0'}</code></li>
                          <li py:for="line in frame.lines_after"><code>${line or u'\xa0'}</code></li>
                        </ol>
                      </div>
                      <div py:if="frame.vars" class="vars" style="display: none">
                        <h3>Local variables:</h3>
                        <table class="listing">
                          <thead><tr><th>Name</th><th>Value</th></tr></thead>
                          <tbody>
                            <tr py:for="idx, (name, value) in enumerate(sorted(frame.vars.items()))"
                                class="${idx % 2 and 'odd' or None}">
                              <th scope="row"><var>$name</var></th>
                              <td><code>${shorten_line(repr(value))}</code></td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </li>
                  </ul>
                  <pre style="display: none"><py:for each="frame in frames">File "${frame.filename}", line ${frame.lineno}, in ${frame.function}<py:if test="frame.line">
  ${frame.line.lstrip()}
</py:if></py:for></pre>
                  <p><input type="button" id="tbtoggle" value="Switch to plain text view" /></p>
                </div>
              </py:if>
            </py:otherwise>
          </py:choose>
        </py:when>
      </py:choose>
      <p>
        <a href="${href.wiki('TracGuide')}">TracGuide</a> &mdash; The Trac User and Administration Guide
      </p>
    </div>
  </body>
</html>

{'fraction_non_alphanumeric': 0.1698489010989011, 'fraction_numerical': 0.0052197802197802195, 'mean_word_length': 1.7004821958456973, 'pattern_counts': {'":': 0, '<': 335, '<?xml version=': 0, '>': 333, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590794', 'n_tokens_mistral': 4339, 'n_tokens_neox': 4122, 'n_words': 964}