Tarantula schrieb:
> Hello, I've spent many hours with this problem and I want to share if
> someone have the samee, I don't know if this solution will be commited
> to some revision, by the way:
>
> I'm including a python file with:
>
> .. literalinclude:: file.py
>
> But the syntax highlight never worked, so I've seen on silent
> exception on (highlighting.py), on line 148:
>
> try:
> parser.suite(src)
> except parsing_exceptions, a:
> return False
> else:
> return True
>
> The parser was throwing an exception: "syntax error". But the source
> was not with any syntax error. So I took a look in the code.py to see
> how the file is open, and I saw:
>
> f = codecs.open(fn, 'r', encoding)
>
> The problem here, is that codecs.open will always open files in binary
> mode to avoid data loss, so the automatic "\n" conversion is never
> done on reading.
Thanks for the report! I believe just opening in universal newline mode
('rU') will fix this; I've made that change in the repo now.
cheers,
Georg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sphinx-dev" 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/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---