← Back to team overview

sikuli-driver team mailing list archive

[Bug 1009596] [NEW] AttributeError on formatting XML log

 

Public bug reported:

Version: X-1.0rc3
OS: Mac OSX 10.7.3 (bug)

Non-String types can be passed in to minidom.py class's
"_write_data(writer, data)" method within the sikuli-script.jar package.
At runtime, this will result in an AttributeError being thrown. In our
case, the log file that was being formatted to "pretty xml" was lost.

As a workaround/fix, we altered lines 306 & 307 in this file from:

    data = data.replace("&", "&amp;").replace("<", "&lt;")
    data = data.replace("\"", "&quot;").replace(">", "&gt;")

to the following:

    data = str(data).replace("&", "&amp;").replace("<", "&lt;")
    data = str(data).replace("\"", "&quot;").replace(">", "&gt;")

This fixed the runtime exception we noticed when "data" was somehow cast
to an "int" at the time this method was being called. Seemed like a
decent fix, so I thought I'd file a bug to see what other people thought
and maybe help others avoid a similar issue in the future.

Strangely enough, we were not able to reproduce this bug on Windows7
64-bit OS - running the same Sikuli code/automation.

** Affects: sikuli
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1009596

Title:
  AttributeError on formatting XML log

Status in Sikuli:
  New

Bug description:
  Version: X-1.0rc3
  OS: Mac OSX 10.7.3 (bug)

  Non-String types can be passed in to minidom.py class's
  "_write_data(writer, data)" method within the sikuli-script.jar
  package. At runtime, this will result in an AttributeError being
  thrown. In our case, the log file that was being formatted to "pretty
  xml" was lost.

  As a workaround/fix, we altered lines 306 & 307 in this file from:

      data = data.replace("&", "&amp;").replace("<", "&lt;")
      data = data.replace("\"", "&quot;").replace(">", "&gt;")

  to the following:

      data = str(data).replace("&", "&amp;").replace("<", "&lt;")
      data = str(data).replace("\"", "&quot;").replace(">", "&gt;")

  This fixed the runtime exception we noticed when "data" was somehow
  cast to an "int" at the time this method was being called. Seemed like
  a decent fix, so I thought I'd file a bug to see what other people
  thought and maybe help others avoid a similar issue in the future.

  Strangely enough, we were not able to reproduce this bug on Windows7
  64-bit OS - running the same Sikuli code/automation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1009596/+subscriptions


Follow ups

References