Re: [Trac] Problem "character in input" in files with browser Trac

21 views
Skip to first unread message

Randy Witlicki

unread,
Oct 20, 2012, 4:02:28 PM10/20/12
to trac-...@googlegroups.com, bygord
At 11:53 AM -0700 10/20/12, bygord wrote:
I have this error message:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in Unknown on line 0
on all source files in the browser Trac.

  Can you show us more of your error logs?
  What is your operating system, Trac version, and python version?

  I plugged the above error line into a web search engine and the references returned were almost all about PHP errors.  Trac is written in Python.

  - Randy

Randy Witlicki

unread,
Oct 20, 2012, 5:39:49 PM10/20/12
to trac-...@googlegroups.com
  Hello,

  Comments below your text.

At 5:05 PM -0400 10/20/12, Pierre-Henry Soria wrote:
Hello,
Thank you for your answer.
The OS is CentOS, Python version is 2.7 and the version of Trac is 0.12

You can see this error message directly on my site here: http://trac.hizup.com/browser/pH7DatingCms/_protected/framework/Layout/Tpl/Engine/PH7Tpl/PH7Tpl.class.php


  I am not totally expert in Trac, but this seems to be output from the Browse Source menu item in Trac.
  The contents in the URL above I think are what Trac is fetching from the source code repository.  I think Trac is just displaying the text it has fetched from the source code repository and is not a Trac problem, the repository seems to have have the text with error code uploaded to it.
  Perhaps some other Trac person could give their opinion here...

  - Randy

bygord

unread,
Oct 20, 2012, 6:17:27 PM10/20/12
to trac-...@googlegroups.com
Hello,
Thank you for your answer.
The OS is CentOS, Python version is 2.7 and the version of Trac is 0.12


Thank you!

Le samedi 20 octobre 2012 14:53:44 UTC-4, bygord a écrit :
Hello,

I have this error message:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in Unknown on line 0
on all source files in the browser Trac.

Do you know how it is due, and can you help me solve this error?
Thank you!

Peter Suter

unread,
Oct 21, 2012, 2:30:36 AM10/21/12
to trac-...@googlegroups.com
Hello

Your trac.ini probably contains something like:

[components]
tracopt.mimeview.php.* = enabled
or
tracopt.mimeview.php.PHPRenderer = enabled

and

[mimeviewer]
php_path=/some/path/to/php

to configure Trac for PHP syntax highlighting using an old PHP 5.2.

If so, Trac calls "/some/path/to/php -sn PH7Tpl.class.php" to generate
the syntax highlighting. I just tested this with your file and PHP
5.2.17, getting the same errors.

Either point that php_path to a newer version of PHP or disable the
tracopt.mimeview.php,PHPRenderer component and let
trac.mimeview.pygments.PygmentsRenderer handle PHP files.

-- Peter

On 21.10.2012 00:17, bygord wrote:
> Hello,
> Thank you for your answer.
> The OS is CentOS, Python version is 2.7 and the version of Trac is 0.12
>
> You can see this error message directly on my site here:
> http://trac.hizup.com/browser/pH7DatingCms/_protected/framework/Layout/Tpl/Engine/PH7Tpl/PH7Tpl.class.php
> <http://trac.hizup.com/browser/pH7DatingCms/_protected/framework/Layout/Tpl/Engine/PH7Tpl/PH7Tpl.class.php>
>
> Thank you!
>
> Le samedi 20 octobre 2012 14:53:44 UTC-4, bygord a �crit :
>
> Hello,
>
> I have this error message:
> *Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
> Unknown on line 0*
> on all source files in the browser Trac.
>
> Do you know how it is due, and can you help me solve this error?
> Thank you!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Trac Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/trac-users/-/PNBWjq0n4OIJ.
> To post to this group, send email to trac-...@googlegroups.com.
> To unsubscribe from this group, send email to
> trac-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.

bygord

unread,
Oct 21, 2012, 8:35:09 AM10/21/12
to trac-...@googlegroups.com
Thank you for your help!

@Peter Suter It is from there that had the problem.
Now I use PHP 5.4 and it works well.
> Le samedi 20 octobre 2012 14:53:44 UTC-4, bygord a �crit :
Reply all
Reply to author
Forward
0 new messages