Index: /pykota/trunk/pykota/tool.py
===================================================================
--- /pykota/trunk/pykota/tool.py (revision 3489)
+++ /pykota/trunk/pykota/tool.py (revision 3545)
@@ -486,4 +486,5 @@
     def externalMailTo(self, cmd, action, user, printer, message) :
         """Warns the user with an external command."""
+        cmd = cmd.encode(self.charset, "replace")
         message = message.encode(self.charset, "replace")
         username = user.Name
Index: /pykota/trunk/pykota/version.py
===================================================================
--- /pykota/trunk/pykota/version.py (revision 3533)
+++ /pykota/trunk/pykota/version.py (revision 3545)
@@ -24,5 +24,5 @@
 import time
 
-__version__ = "1.27alpha10_unofficial"
+__version__ = "1.27alpha11_unofficial"
 
 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS."
Index: /pykota/trunk/bin/cupspykota
===================================================================
--- /pykota/trunk/bin/cupspykota (revision 3489)
+++ /pykota/trunk/bin/cupspykota (revision 3545)
@@ -380,5 +380,5 @@
             self.logdebug("Launching subprocess [%s] to ask for user confirmation." \
                                      % confirmationcommand)
-            inputfile = os.popen(confirmationcommand, "r")
+            inputfile = os.popen(confirmationcommand.encode(self.charset, "replace"), "r")
             try :
                 for answer in inputfile.xreadlines() :
@@ -402,5 +402,5 @@
             self.logdebug("Launching subprocess [%s] to overwrite the job ticket." \
                                      % jobticketcommand)
-            inputfile = os.popen(jobticketcommand, "r")
+            inputfile = os.popen(jobticketcommand.encode(self.charset, "replace"), "r")
             try :
                 for line in inputfile.xreadlines() :
@@ -620,5 +620,5 @@
         if prehook :
             self.logdebug("Executing pre-hook [%s]..." % prehook)
-            retcode = os.system(prehook)
+            retcode = os.system(prehook.encode(self.charset, "replace"))
             self.logdebug("pre-hook exited with status %s." % retcode)
 
@@ -628,5 +628,5 @@
         if posthook :
             self.logdebug("Executing post-hook [%s]..." % posthook)
-            retcode = os.system(posthook)
+            retcode = os.system(posthook.encode(self.charset, "replace"))
             self.logdebug("post-hook exited with status %s." % retcode)
 
@@ -672,5 +672,5 @@
                   not os.path.isfile(bannerfileorcommand) :
                 self.logdebug("Launching %s to generate a banner." % bannerfileorcommand)
-                child = popen2.Popen3(bannerfileorcommand, capturestderr=1)
+                child = popen2.Popen3(bannerfileorcommand.encode(self.charset, "replace"), capturestderr=1)
                 self.runOriginalBackend(child.fromchild, isBanner=1)
                 child.tochild.close()
@@ -808,5 +808,5 @@
                 if not userpquota.Exists :
                     self.printInfo(_("User %s doesn't have quota on printer %s in the PyKota system, applying external policy (%s) for printer %s") % (self.UserName, self.PrinterName, commandline, self.PrinterName))
-                if os.system(commandline) :
+                if os.system(commandline.encode(self.charset, "replace")) :
                     self.printInfo(_("External policy %s for printer %s produced an error. Job rejected. Please check PyKota's configuration files.") % (commandline, self.PrinterName), "error")
                     policy = "EXTERNALERROR"
@@ -863,5 +863,5 @@
                     if script is not None :
                         self.logdebug(msg + "launching subprocess [%s] to notify user." % script)
-                        os.system(script)
+                        os.system(script.encode(self.charset, "replace"))
         self.logdebug("Retrieval of billing code information done.")
 
@@ -894,5 +894,5 @@
                     # TODO : important, because usually duplicate jobs are sucessive.
                     msg = _("Job is a dupe")
-                    if denyduplicates == 1 :
+                    if denyduplicates is True :
                         self.printInfo("%s : %s." % (msg, _("Printing is denied by configuration")), "warn")
                         self.Action = "DENY"
@@ -900,5 +900,5 @@
                     else :
                         self.logdebug("Launching subprocess [%s] to see if duplicate jobs should be allowed or not." % denyduplicates)
-                        fanswer = os.popen(denyduplicates, "r")
+                        fanswer = os.popen(denyduplicates.encode(self.charset, "replace"), "r")
                         self.Action = fanswer.read().strip().upper()
                         fanswer.close()
