Hello,
Álvaro J. Iradier wrote:
> Hi,
>
> I'm developing the WikiPrint[1] (PDF conversion plugin), and I found a
> problem I cannot address when converting the wiki page to HTML.
>
> The error trace (below) is confusing. As was able to locate the line
> raising the error. The call to wiki_to_html fails when there's an
> attachment with format [attachment:filename], but it works perfectly
> when using [attachment:wiki:PageName:filename].
>
> An example. When doing:
>
> ------------------
> from trac.wiki.formatter import wiki_to_html
> ...
> #Value of variable text can be as simple as: u'[attachment:file.txt]\r\n'
> page = wiki_to_html(text, env, req)
> ------------------
>
> I get this output in the browser:
>
> -----------------------
> Traceback (most recent call last):
> ...\trac\resource.py",
> line 111, in __repr__
> return '<Resource %r>' % (', '.join(reversed(path)))
> TypeError: sequence item 0: expected string, NoneType found
> -----------------------
>
> My guess is Trac is trying to display an error, but it fails?
>
> Is this a bug I should report, or is there a problem with my plugin?
>
> Thanks very much, tell me if you need more info.
>
The req object has been wrongly initialized, you need to specify a
resource (here, Resource('wiki', 'PageName')). Otherwise, how would you
know which page is the one containing the attachment when you're talking
about attachment:file.txt?
-- Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---