[Python-Dev] cpython: Issue #14200: Idle shell crash on printing non-BMP unicode character.

Georg Brandl g.brandl at gmx.net
Wed Mar 14 21:52:44 CET 2012


On 14.03.2012 21:46, andrew.svetlov wrote:

> diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
> --- a/Lib/idlelib/rpc.py
> +++ b/Lib/idlelib/rpc.py
> @@ -196,8 +196,12 @@
>                   return ("ERROR", "Unsupported message type: %s" % how)
>           except SystemExit:
>               raise
> +        except KeyboardInterrupt:
> +            raise
>           except socket.error:
>               raise
> +        except Exception as ex:
> +            return ("CALLEXC", ex)
>           except:
>               msg = "*** Internal Error: rpc.py:SocketIO.localcall()\n\n"\
>                     " Object: %s \n Method: %s \n Args: %s\n"

It appears that this would be better written as

except socket.error:
     raise
except Exception:
     return ("CALLEXC", ex)
except:  # BaseException, i.e. SystemExit, KeyboardInterrupt, GeneratorExit
     raise

Georg



More information about the Python-Dev mailing list