mercurial/dispatch.py
changeset 24163 bb11081562d7
parent 24039 2ee35b6ee4fb
parent 24152 97a548aeb749
child 24221 4e240d6ab898
equal deleted inserted replaced
24162:758dd85b6ad6 24163:bb11081562d7
   225             try: # usually it is in the form (errno, strerror)
   225             try: # usually it is in the form (errno, strerror)
   226                 reason = inst.reason.args[1]
   226                 reason = inst.reason.args[1]
   227             except (AttributeError, IndexError):
   227             except (AttributeError, IndexError):
   228                 # it might be anything, for example a string
   228                 # it might be anything, for example a string
   229                 reason = inst.reason
   229                 reason = inst.reason
       
   230             if isinstance(reason, unicode):
       
   231                 # SSLError of Python 2.7.9 contains a unicode
       
   232                 reason = reason.encode(encoding.encoding, 'replace')
   230             ui.warn(_("abort: error: %s\n") % reason)
   233             ui.warn(_("abort: error: %s\n") % reason)
   231         elif (util.safehasattr(inst, "args")
   234         elif (util.safehasattr(inst, "args")
   232               and inst.args and inst.args[0] == errno.EPIPE):
   235               and inst.args and inst.args[0] == errno.EPIPE):
   233             if ui.debugflag:
   236             if ui.debugflag:
   234                 ui.warn(_("broken pipe\n"))
   237                 ui.warn(_("broken pipe\n"))