Subject: [Tools-discuss] errors from xml2rfc trying to log errors

From: Michael Richardson <[email-masked]>
Date: Tue, 23 May 2017 11:22:36 -0400

My XML has grown some UTF-8 space characters, likely because of copy
and paste from etherpad.  I get:
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in
    position 148: ordinal not in range(128)

I was annoyed because it doesn't tell me the line number.  After staring at
the backtrace a bit, I see:

  File "/usr/local/lib/python2.7/dist-packages/xml2rfc/log.py", line 38, in
  warn
      write_err.write('WARNING: ' + ' '.join(args))

and I realize that actually I think that the error is occuring while
attempting to format the error message.  This is with xml2rfc 2.5.1.

(I haven't found my errant 0xa0 yet)

--
Michael Richardson <[email-masked]>, Sandelman Software Works
 -= IPv6 IoT consulting =-

---

From: Henrik Levkowetz <[email-masked]>
Date: Thu, 25 May 2017 16:27:29 +0200

Hi Michael,

> (I haven't found my errant 0xa0 yet)

Ugh.  Noted.  There are probably a number of places that can't deal with
non-ascii under Python2.7.  All those should be fixed in the vocabulary
v3 / unicode rewrite.  Till then a workaround could be to run xml2rfc
with python3.x; that should at least avoid barfing on non-ascii errors
and warnings.

	Henrik