From 50b513d30334fbc9a12261024cac20904a665b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Tue, 11 Jan 2011 13:16:05 +0300 Subject: [PATCH] Bugfix print help to file. --- pym/cl_opt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pym/cl_opt.py b/pym/cl_opt.py index bd8a83c..833677e 100644 --- a/pym/cl_opt.py +++ b/pym/cl_opt.py @@ -334,6 +334,12 @@ is used in conjunction with the option '-v --vars'") epilog=epilog) self.formatter._long_opt_fmt = "%s %s" + def _get_encoding(self, file): + encoding = getattr(file, "encoding", None) + if not encoding: + encoding = "UTF-8" + return encoding + def get_usage(self): """Replace standard help header""" if self.usage: