Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

xml.etree.ElementTree.ParseError: syntax error #2

Open
goldie83 opened this issue Jun 13, 2018 · 3 comments
Open

xml.etree.ElementTree.ParseError: syntax error #2

goldie83 opened this issue Jun 13, 2018 · 3 comments

Comments

@goldie83
Copy link

Hi,
trying to test if it works:

192.168.20.3 None output.jpg
Traceback (most recent call last):
  File "./WSD.py", line 54, in <module>
    jobid = submit_job()
  File "./WSD.py", line 36, in submit_job
    xml = ET.fromstring(ret)
  File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 1325, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: syntax error: line 1, column 48
pi@ap-goldie:~/WSDolefuls $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
@al42and
Copy link
Owner

al42and commented Jun 17, 2018

Hi,

It seems there's something wrong with the printer's response.

What is the model of your printer?

Can you try adding the following line right after line 35 in WSD.py:
open('tmp.xml','w').write(ret),
and them examining the content of tmp.xml file after running the program again?

@goldie83
Copy link
Author

goldie83 commented Jul 3, 2018

Its a XEROX WorkCentre 3225, rest will follow....
The reuslt:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Invalid Request</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<CENTER>
<FONT SIZE="+2" COLOR="#FFFFFF" ALIGN="Center">
</FONT>
<B>Invalid Request. Some Error</B>
</BODY>

</HTML>

Not very helping :)

@goldie83
Copy link
Author

goldie83 commented Jul 3, 2018

Found something. The URL is not correct in my case. After changing the URL to

URL='http://{}:8018/wsd/scan'.format(host)

Now, at least I receive a xml reply with a fault.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants