Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: invalid syntax #25

Closed
sviter opened this issue Jan 22, 2016 · 5 comments
Closed

SyntaxError: invalid syntax #25

sviter opened this issue Jan 22, 2016 · 5 comments

Comments

@sviter
Copy link

sviter commented Jan 22, 2016

In this request
I'v got an error:
Traceback (most recent call last): File "/data/project/copyvios/www/python/src/app.py", line 38, in inner return func(*args, **kwargs) File "/data/project/copyvios/www/python/src/app.py", line 104, in index query = do_check() File "./copyvios/checker.py", line 38, in do_check _get_results(query, follow=not _coerce_bool(query.noredirect)) File "./copyvios/checker.py", line 74, in _get_results query.turnitin_result = search_turnitin(query.title, query.lang) File "./copyvios/turnitin.py", line 22, in search_turnitin return TurnitinResult(_make_api_request(page_title, lang)) File "./copyvios/turnitin.py", line 35, in _make_api_request parsed_api_result = literal_eval(result.text) File "/usr/lib/python2.7/ast.py", line 49, in literal_eval node_or_string = parse(node_or_string, mode='eval') File "/usr/lib/python2.7/ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "<unknown>", line 1 <body bgcolor="#f0f0f8"> ^ SyntaxError: invalid syntax

@earwig
Copy link
Owner

earwig commented Jan 23, 2016

@fhocutt ?

@fhocutt
Copy link

fhocutt commented Jan 26, 2016

Whoa, that's interesting. I'll take a look at it. At a first glance, looks like an issue with literal_eval.

@fhocutt
Copy link

fhocutt commented Jan 26, 2016

Right: looks like it's causing a UnicodeDecodeError on the Plagiabot end, and instead of handling that internally or serving an error message, the server is providing an HTML page with stack trace details:

http://tools.wmflabs.org/eranbot/plagiabot/api.py?action=suspected_diffs&page_title=%D0%9D%D0%B8%D0%BA%D0%BE%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9%20%D0%9D%D0%B8%D0%BA%D0%BE%D0%BB%D0%B0%D0%B9%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&report=1

I'll see about adding a check for that this week.

@earwig
Copy link
Owner

earwig commented Jan 26, 2016

Ah-hah, so it's not technically our fault. A bit disappointing to see Unicode problems on their end, though...

@earwig
Copy link
Owner

earwig commented Jan 27, 2016

Looks to be fixed upstream: valhallasw/plagiabot/issues/3

@earwig earwig closed this as completed Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants