Problem with program in script editor

Problem with program in script editor

Anonymous
Not applicable
932 Views
1 Reply
Message 1 of 2

Problem with program in script editor

Anonymous
Not applicable

I want to ask, how to fix the problem in my program. I use python scripts and run scripts, but I have a problem like this

 

Error: line 0: IOError: file C: \ Program Files \ Autodesk \ Maya2019 \ bin \ python27.zip \ xml \ dom \ expatbuilder.py line 922: 2 #

 

and sometime like this

 

# Error: ExpatError: file C:\Program Files\Autodesk\Maya2019\bin\python27.zip\xml\dom\expatbuilder.py line 207: not well-formed (invalid token): line 73, column 26 #

 

when i executing it

 

and when i run a program with MEL this error will appear like this 

 

// Error: doc = xml.dom.minidom.parse ("C:\Users\MR\Downloads\Documents\Jakarta.osm")
//
// Error: Line 8.5: Syntax error // 

 

can anyone help me correct this program error? Thx Before 🙂

0 Likes
933 Views
1 Reply
Reply (1)
Message 2 of 2

RFlannery1
Collaborator
Collaborator

The first two errors look like there might be something wrong with the XML file itself.  Try looking at the file and make sure there aren't any missing closing tags or other weirdness.

 

As for the last error, I have a couple of guesses.

// Error: doc = xml.dom.minidom.parse ("C:\Users\MR\Downloads\Documents\Jakarta.osm")
//
// Error: Line 8.5: Syntax error // 

First, you said that you ran the script as MEL.  But the line shown above is not MEL; it is Python.  Second, if run as Python code, there is still a problem.  The file path as written may not work.  Either change all of the "\" to "/", or add "r" to the beginning of the path.  Like this: r"C:\Users\MR\Downloads\Documents\Jakarta.osm".  The "r" tells Python to treat the string as raw characters and not treat any of the backslashes as escape characters.  For example, if the path were something like "C:\Users\MR\Download\Documents\testDoc.osm", the "\t" would get converted to a TAB character.

0 Likes