trentm / jirash

CLI and (light) shell for Jira
Other
79 stars 13 forks source link

Failures With Listing Issues: "ExpatError: reference to invalid character number" #27

Closed qdzlug closed 4 years ago

qdzlug commented 9 years ago

Hi Trent,

Hitting this failure when trying to list out issues - the full run with both the numeric filter ID and the actual filter name are below.

Jay

 jschmidt@scrat  ~/repos/jirash/bin   master  ./jirash issues -f 10938

Traceback (most recent call last):
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 1297, in <module>
    retval = main(sys.argv)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 1292, in main
    return shell.main(argv, loop=cmdln.LOOP_IF_EMPTY)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 259, in main
    return self.cmd(args)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 277, in cmd
    retval = self.onecmd(argv)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 1115, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 721, in do_issues
    issues = self.jira.issues_from_filter(opts.filter)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 278, in issues_from_filter
    return self.server.jira1.getIssuesFromFilter(self.auth, filterObj["id"])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1313, in single_request
    return self.parse_response(response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1484, in parse_response
    p.feed(data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 558, in feed
    self._parser.Parse(data, 0)
ExpatError: reference to invalid character number: line 1771, column 0

Python: 2.7.10 (default, Aug 22 2015, 20:33:39)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)]
OS: Darwin-15.0.0-x86_64-i386-64bit

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If this is obviously not user error, please log a bug at  *
*    https://github.com/trentm/jirash/issues                *
* to report this error. Thanks!                             *
* -- Trent                                                  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 ✘ jschmidt@scrat  ~/repos/jirash/bin   master 
 ✘ jschmidt@scrat  ~/repos/jirash/bin   master  ./jirash issues -f "On-Prem Issues"

Traceback (most recent call last):
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 1297, in <module>
    retval = main(sys.argv)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 1292, in main
    return shell.main(argv, loop=cmdln.LOOP_IF_EMPTY)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 259, in main
    return self.cmd(args)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 277, in cmd
    retval = self.onecmd(argv)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/Users/jschmidt/repos/jirash/lib/cmdln.py", line 1115, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 721, in do_issues
    issues = self.jira.issues_from_filter(opts.filter)
  File "/Users/jschmidt/repos/jirash/lib/jirashell.py", line 278, in issues_from_filter
    return self.server.jira1.getIssuesFromFilter(self.auth, filterObj["id"])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1313, in single_request
    return self.parse_response(response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1484, in parse_response
    p.feed(data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 558, in feed
    self._parser.Parse(data, 0)
ExpatError: reference to invalid character number: line 1771, column 0

Python: 2.7.10 (default, Aug 22 2015, 20:33:39)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)]
OS: Darwin-15.0.0-x86_64-i386-64bit

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If this is obviously not user error, please log a bug at  *
*    https://github.com/trentm/jirash/issues                *
* to report this error. Thanks!                             *
* -- Trent                                                  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
trentm commented 9 years ago

yah.. I've seen that before. IIRC it was because Jira's API returns invalid XML if there is a non-ascii char in a ticket title or some other field... in some cases. I remember trying to get jirash to be more defensive here but failed initially. Good to keep this here for now. I need to get jirash to spit out relevant context.

trentm commented 8 years ago

Commonly see it as the terminal escape character, which in the verbose xmlrpc dump (change verbose=False to verbose=True in jirashell.py) is &#27;.

trentm commented 8 years ago

^^^ that change allows one to more easily see the xmlrpc output that is causing the parse failure at least.

trentm commented 4 years ago

jirash v2 (first released 2017-11-10) was re-written in node.js. This issue is for jirash v1, which is no longer supported so I'm closing this as "won't fix".