2018-12-10 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in the 'pypad_udp.py' script that threw an exception
	when processing multi-byte UTF-8 characters.
This commit is contained in:
Fred Gleason 2018-12-10 14:09:33 -05:00
parent 66d0d465c1
commit e2a313a07d
2 changed files with 7 additions and 4 deletions

View File

@ -18159,3 +18159,6 @@
'pypad_udp.py' script.
* Added support for the log selection directives in the
'pypad_udp.py' script.
2018-12-10 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in the 'pypad_udp.py' script that threw an exception
when processing multi-byte UTF-8 characters.

View File

@ -20,15 +20,15 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
from __future__ import print_function
#from __future__ import print_function
import sys
import socket
import ConfigParser
import PyPAD
def eprint(*args,**kwargs):
print(*args,file=sys.stderr,**kwargs)
#def eprint(*args,**kwargs):
# print(*args,file=sys.stderr,**kwargs)
def processUpdate(update,section):
if config.get(section,'ProcessNullUpdates')=='0':
@ -60,7 +60,7 @@ def ProcessPad(update):
try:
if processUpdate(update,section):
fmtstr=config.get(section,'FormatString')
send_sock.sendto(update.resolvePadFields(fmtstr,int(config.get(section,'Encoding'))),
send_sock.sendto(update.resolvePadFields(fmtstr,int(config.get(section,'Encoding'))).encode('utf-8'),
(config.get(section,'IpAddress'),int(config.get(section,'UdpPort'))))
n=n+1
except ConfigParser.NoSectionError: