# HG changeset patch # User Sebastian Ramacher # Date 1326933579 -3600 # Node ID 8162d69415db44fbfa0c5ad04c99e767fa89f77c # Parent 54f5753503b4ba687a46bfa21eff8d0a032e95a3 # Parent b49882bf57a15528fe1cc265df945fa6a8dcb4b4 Merging bugfixes from 0.10-bugfix. diff -r 54f5753503b4ba687a46bfa21eff8d0a032e95a3 -r 8162d69415db44fbfa0c5ad04c99e767fa89f77c bpython/cli.py --- a/bpython/cli.py Mon Jan 09 23:52:27 2012 +0100 +++ b/bpython/cli.py Thu Jan 19 01:39:39 2012 +0100 @@ -1575,6 +1575,9 @@ self.c = c if s: + if not py3 and isinstance(s, unicode): + s = s.encode(getpreferredencoding()) + if self.c: self.win.addstr(s, self.c) else: diff -r 54f5753503b4ba687a46bfa21eff8d0a032e95a3 -r 8162d69415db44fbfa0c5ad04c99e767fa89f77c bpython/inspection.py --- a/bpython/inspection.py Mon Jan 09 23:52:27 2012 +0100 +++ b/bpython/inspection.py Thu Jan 19 01:39:39 2012 +0100 @@ -228,9 +228,14 @@ # not take 'self', the latter would: func_name = getattr(f, '__name__', None) - is_bound_method = ((inspect.ismethod(f) and f.im_self is not None) + try: + is_bound_method = ((inspect.ismethod(f) and f.im_self is not None) or (func_name == '__init__' and not func.endswith('.__init__'))) + except: + # if f is a method from a xmlrpclib.Server instance, func_name == + # '__init__' throws xmlrpclib.Fault (see #202) + return None try: if py3: argspec = inspect.getfullargspec(f) diff -r 54f5753503b4ba687a46bfa21eff8d0a032e95a3 -r 8162d69415db44fbfa0c5ad04c99e767fa89f77c bpython/repl.py --- a/bpython/repl.py Mon Jan 09 23:52:27 2012 +0100 +++ b/bpython/repl.py Thu Jan 19 01:39:39 2012 +0100 @@ -749,7 +749,12 @@ self.interact.notify("Pastebin aborted") return - pasteservice = ServerProxy(self.config.pastebin_url) + try: + pasteservice = ServerProxy(self.config.pastebin_url) + except IOError, e: + self.interact.notify("Pastebin error for URL '%s': %s" % + (self.config.pastebin_url, str(e))) + return if s == self.prev_pastebin_content: self.interact.notify('Duplicate pastebin. Previous URL: ' + diff -r 54f5753503b4ba687a46bfa21eff8d0a032e95a3 -r 8162d69415db44fbfa0c5ad04c99e767fa89f77c setup.py --- a/setup.py Mon Jan 09 23:52:27 2012 +0100 +++ b/setup.py Thu Jan 19 01:39:39 2012 +0100 @@ -50,7 +50,7 @@ cmdclass['extract_messages'] = extract_messages -if platform.system() == 'FreeBSD': +if platform.system() in ['FreeBSD', 'OpenBSD']: man_dir = 'man' else: man_dir = 'share/man'