Modify

Opened 6 years ago

Closed 2 years ago

#3335 closed defect (wontfix)

rendering of attached embedded images fails with error trace back

Reported by: bernd.tegge@… Owned by: athomas
Priority: normal Component: PageToPdfPlugin
Severity: normal Keywords: ATTACHMENT_VIEW
Cc: fcorreia@… Trac Release: 0.11

Description

Trying to convert a wiki page with Image-macros for attached image files generates the following output in the system log.

Jul  7 14:59:11 trac-test Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x80b6c86c>
ERROR: Macro Image(Weggen2.jpg, align=left) failed Traceback (most recent call last): 
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 468, in _macro_formatter
        return macro.process(args, in_paragraph=True)
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 179, in process
	    text = self.processor(text)
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 166, in _macro_processor
        text)
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/macros.py", line 425, in expand_macro
        if attachment and 'ATTACHMENT_VIEW' in formatter.perm(attachment):   
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/perm.py", line 523, in has_permission
        return self._has_permission(action, resource)   
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/perm.py", line 537, in _has_permission 
       check_permission(action, perm.username, resource, perm)
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/perm.py", line 432, in check_permission
        (username, action, resource))
   File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/resource.py", line 111, in __repr__ 
       return '<Resource %r>' % (', '.join(reversed(path)))
   TypeError: sequence item 0: expected string, NoneType found
Jul  7 14:59:11 trac-test Trac[pagetopdf] DEBUG: --right 1.5cm --bottom 1.5cm --webpage  --top 1cm --format pdf14 --size a4 --charset iso-8859-1 --left 1cm
Jul  7 14:59:12 trac-test Trac[main] DEBUG: 384 unreachable objects found.

If I understand the use of ATTACHMENT_* permissions correctly, they should be translated to specific permissions for the requested realm, however that seems to be missing from the parameters to wiki_to_html?

See also #2240 for the same problem in the EclipseTracPlugin.

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by athomas

This plugin hasn't been ported to 0.11. Patches welcome, maintainers even more welcome.

comment:2 Changed 6 years ago by carl@…

I have the same problem, and it exists in TracWikiToPdfPlugin

comment:3 Changed 6 years ago by FilipeCorreia

  • Cc fcorreia@… added

Has anyone already came up with a patch to this issue?

comment:4 Changed 5 years ago by letezo

See #5856 for a somewhat cumbersome workaround.

comment:5 Changed 2 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

Deprecated, please see the TracWikiToPdfPlugin.

Add Comment

Modify Ticket

Action
as closed The owner will remain athomas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.