Re: [Trac] Jina2 2.11.0 on Trac 1.4: "the inline if-expression on line 109 in 'theme.html' evaluated to false and no else section was defined"

2020-01-29 Thread Ryan Ollos
On Wed, Jan 29, 2020 at 3:12 PM Charles Bearden  wrote:

> Hi all,
>
> I'm working on creating a fresh up-to-date Trac install recipe for my
> department, and I encountered an exception with Jinja2 2.11.0 under Trac
> 1.4. I wanted to run this problem by the list before logging a ticket.
>
> Ubuntu 18.04
> Python 2.7.17 virtualenv
> Installing newest version of all prerequisites with pip
>
> When I run the server via tracd, the main page displays correctly, but
> when I click Timeline, Roadmap, View Tickets, or Search, only part of the
> page source is returned (nothing renderable by the browser) and an
> exception appears in the trac.log:
>
> 2020-01-29 16:22:41,020 Trac[chrome] ERROR: Jinja2 UndefinedError error
> while rendering XML/HTML template
> Traceback (most recent call last):
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/web/chrome.py",
> line 1704, in _iterable_jinja_content
> for chunk in stream:
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
> line 1357, in __next__
> return self._next()
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
> line 1334, in _buffered_generator
> c = next(self._gen)
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
> line 1125, in generate
> yield self.environment.handle_exception()
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
> line 832, in handle_exception
> reraise(*rewrite_traceback_stack(source=source))
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/timeline/templates/timeline.html",
> line 12, in top-level template code
> # extends 'layout.html'
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/layout.html",
> line 12, in top-level template code
> # import "macros.html" as jmacros with context
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/theme.html",
> line 22, in top-level template code
> # block body
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/theme.html",
> line 109, in block "body"
> # include resourcepath_template if resourcepath_template ignore missing
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/loaders.py",
> line 179, in get_source
> pieces = split_template_path(template)
>   File
> "/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/loaders.py",
> line 28, in split_template_path
> for piece in template.split("/"):
> UndefinedError: the inline if-expression on line 109 in 'theme.html'
> evaluated to false and no else section was defined.
>
> When I pin Jinja2 to 2.10.3, the problem goes away. So, it seems like
> changes to Jinja2 from 2.10 to 2.11 cause this breakage.
>
> Anyone else seen this?
>
> All the best,
> Chuck Bearden
>

Yes, see:

https://trac.edgewall.org/ticket/13242

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn_gYGVxUv_hF_zdLySCtA-Ani6_%2BPKvemYUqWTugz2G%2Bw%40mail.gmail.com.


[Trac] Jina2 2.11.0 on Trac 1.4: "the inline if-expression on line 109 in 'theme.html' evaluated to false and no else section was defined"

2020-01-29 Thread Charles Bearden
Hi all,

I'm working on creating a fresh up-to-date Trac install recipe for my 
department, and I encountered an exception with Jinja2 2.11.0 under Trac 
1.4. I wanted to run this problem by the list before logging a ticket.

Ubuntu 18.04
Python 2.7.17 virtualenv
Installing newest version of all prerequisites with pip

When I run the server via tracd, the main page displays correctly, but when 
I click Timeline, Roadmap, View Tickets, or Search, only part of the page 
source is returned (nothing renderable by the browser) and an exception 
appears in the trac.log:

2020-01-29 16:22:41,020 Trac[chrome] ERROR: Jinja2 UndefinedError error 
while rendering XML/HTML template 
Traceback (most recent call last):
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/web/chrome.py",
 
line 1704, in _iterable_jinja_content
for chunk in stream:
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
 
line 1357, in __next__
return self._next()
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
 
line 1334, in _buffered_generator
c = next(self._gen)
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
 
line 1125, in generate
yield self.environment.handle_exception()
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/environment.py",
 
line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/timeline/templates/timeline.html",
 
line 12, in top-level template code
# extends 'layout.html'
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/layout.html",
 
line 12, in top-level template code
# import "macros.html" as jmacros with context
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/theme.html",
 
line 22, in top-level template code
# block body
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/trac/templates/theme.html",
 
line 109, in block "body"
# include resourcepath_template if resourcepath_template ignore missing
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/loaders.py",
 
line 179, in get_source
pieces = split_template_path(template)
  File 
"/path/to/projects/tmp/trac/venv2/local/lib/python2.7/site-packages/jinja2/loaders.py",
 
line 28, in split_template_path
for piece in template.split("/"):
UndefinedError: the inline if-expression on line 109 in 'theme.html' 
evaluated to false and no else section was defined.

When I pin Jinja2 to 2.10.3, the problem goes away. So, it seems like 
changes to Jinja2 from 2.10 to 2.11 cause this breakage.

Anyone else seen this?

All the best,
Chuck Bearden



-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/8709da69-33d8-46b6-9031-41f231634970%40googlegroups.com.


Re: [Trac] counter

2020-01-29 Thread 'Dimitri Maziuk' via Trac Users
On 1/29/20 3:02 PM, Leho Kraav wrote:

> Wow, different thing but supernice.
> 

Well, aside from not needing cookies (which would require modifying trac
templates I expect), it's very lightweight. Using something like piwik
or elk on one small-ish trac site would be way overkill. Google too,
even though it's easier to set up.

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/22b1b0c7-dee0-5dcf-4a53-a47f7f8ecdcd%40bmrb.wisc.edu.


signature.asc
Description: OpenPGP digital signature


Re: [Trac] counter

2020-01-29 Thread Leho Kraav
On Wed, Jan 29, 2020 at 01:06:19PM -0600, 'Dimitri Maziuk' via Trac Users wrote:
> On 1/29/20 12:21 PM, Leho Kraav wrote:
> > On 29 January 2020 19:09:14 ONeal Freeman  wrote:
> >> Is there a hit counter for trac to keep a count of how many users are
> >> accessing the site?
> ...
> > I'd probably go with Google Analytics or Matomo.
> 
> Ugh. https://goaccess.io/

Wow, different thing but supernice.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/20200129210207.GE3058%40papaya.


Re: [Trac] counter

2020-01-29 Thread 'Dimitri Maziuk' via Trac Users
On 1/29/20 12:21 PM, Leho Kraav wrote:
> On 29 January 2020 19:09:14 ONeal Freeman  wrote:
>> Is there a hit counter for trac to keep a count of how many users are
>> accessing the site?
...
> I'd probably go with Google Analytics or Matomo.
> 

Ugh. https://goaccess.io/

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/532cdf91-e138-3467-2f8d-8e540974e73b%40bmrb.wisc.edu.


signature.asc
Description: OpenPGP digital signature


Re: [Trac] counter

2020-01-29 Thread Leho Kraav

On 29 January 2020 19:09:14 ONeal Freeman  wrote:
Is there a hit counter for trac to keep a count of how many users are 
accessing the site?


--
You received this message because you are subscribed to the Google Groups 
"Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/0d167c6c-972d-4fdc-a746-f6b3a739093a%40googlegroups.com.


I'd probably go with Google Analytics or Matomo.

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/16ff28921d8.2742.b94389c50b70d4ef8bda8663b7428fe1%40kraav.com.


[Trac] counter

2020-01-29 Thread ONeal Freeman
Is there a hit counter for trac to keep a count of how many users are 
accessing the site?

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/0d167c6c-972d-4fdc-a746-f6b3a739093a%40googlegroups.com.