Closed hargup closed 10 years ago
Could you please let me know which version of Tinkerer are you using and which input is causing this error?
1.3.0
[hargup blog (gh-pages) ]$tinker --version
Tinkerer version 1.3.0
What about input causing the exception?
I had the same problem and found the solution. In my case, the problem was due to an external hyperlink :
Multipath TCP in the Linux kernel <http://www.multipath-tcp.org>
_,
If the comma is immediately after the character, the bug appears. If there is a space after the character, everything works well
Oh, I see. Thanks for letting me know! I'll take a look.
I tried adding a RST link followed by a comma as you suggested but I couldn't repro this. I tried Python 2.7 and 3.3 under Windows and Linux. Build seemed to work fine for test like:
`Multipath TCP in the Linux kernel <http://www.multipath-tcp.org>`_, bla bla.
I'm not very surprised to see this issue because patch.py does use minidom to parse HTML as XML, which requires some hacks, but unfortunately I can't repro this particular issue. Any more details you could provide? Maybe a full RST file that I can use?
I have this error in one post where someone hid an easter egg, putting an </h3>
somewhere in the text.
It should just skip the generation, not completly abort. The error message also doesnt show which post causes the error, and the reporting is based on the HTML lines. I only fixed this by hacking into the expatbuilder.py and dump the string in the parse function to a file.
That would definitely do it. But yeah, I should at least handle exceptions a bit better.
Should be fixed with patch.py rewrite with pyquery
Looks like lxml is a pain to set up so I'm not 100% sure I want to take a dependency on it (via PyQuery) at this point. Reopening the issue for now so I don't forget about it if I revert the PyQuery change.
With pip installed tinkerer i get this error as well: https://gist.github.com/ceeram/ccd07a2dde141a3fcb3d
When using master i get another error: https://gist.github.com/ceeram/bc63506ae9f55425e48c
Im running tinker --build
on ~1100 files, manual sphinx-build on the same files builds without exceptions, just many warnings and errors.
https://github.com/vladris/tinkerer/blob/master/tinkerer/ext/patch.py#L106 adding check for != None on anchor.get('class') made the build succeed for me.
Thanks for the pointer! Do you by any chance have an input that can cause this error? I'd like to add a unit test and make sure I add the right check.
I will need to dig through the files, i will get back to this once i got it isolated to a single file causing this.
Was able to pin down the issue:
https://gist.github.com/ceeram/70e0ed74301e4391bd44
The build exception occurs when the file has an invalid link with a newline as shown in the gist
If you like i can try to provide a test and fix, if i am able to. I'm just a salesman doing some open source php development in my freetime, so i might need some guidance if i get stuck.
Hey, thanks a bunch for the detailed steps! It's OK, I'll implement a fix for this later today. Should be easy now that I have a repro case. Thanks again!
Here's the log file