Modify ↓
Opened 9 years ago
Closed 7 years ago
#12438 closed defect (worksforme)
Encoding Error: Not well formed for server.ticket.putAttachment()
Reported by: | anonymous | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | XmlRpcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
The error: <Fault -32700: 'not well-formed (invalid token): line 15, column 15'>
occurs when putAttachment()
is used.
# Read file and write to Trac ticketNum = 97 imageFile = "Tick_97_TracAttach_0_.png" with open(imageFile, "rb") as image: data = image.read() fileName = p.ticket.putAttachment(ticketNum, imageFile, "Image from D2D", data, True)
There are no problems with the getAttachment()
function
Attachments (0)
Change History (2)
comment:1 Changed 9 years ago by
comment:2 Changed 7 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
You can't put raw binary data into an XML stream. It is bound to cause errors when parsing.
The spec says that the data is Binary, and in this case that means
xmlrpclib.Binary
type: