{"action":"closed","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/7590","labels_url":"https://api.github.com/repos/pydata/pandas/issues/7590/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/7590/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/7590/events","html_url":"https://github.com/pydata/pandas/issues/7590","id":36672814,"number":7590,"title":"Pandas 14.0 Dataframe Clears sys.exc_info() When pprinted","user":{"login":"keeganmccallum","id":3915058,"avatar_url":"https://avatars.githubusercontent.com/u/3915058?v=3","gravatar_id":"","url":"https://api.github.com/users/keeganmccallum","html_url":"https://github.com/keeganmccallum","followers_url":"https://api.github.com/users/keeganmccallum/followers","following_url":"https://api.github.com/users/keeganmccallum/following{/other_user}","gists_url":"https://api.github.com/users/keeganmccallum/gists{/gist_id}","starred_url":"https://api.github.com/users/keeganmccallum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keeganmccallum/subscriptions","organizations_url":"https://api.github.com/users/keeganmccallum/orgs","repos_url":"https://api.github.com/users/keeganmccallum/repos","events_url":"https://api.github.com/users/keeganmccallum/events{/privacy}","received_events_url":"https://api.github.com/users/keeganmccallum/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-06-27T15:03:38Z","updated_at":"2015-10-20T22:26:37Z","closed_at":"2015-10-20T22:26:37Z","body":"I am running into an issue with error handing in my current project after upgrading to pandas 14.0. The issue is that when I use pprint to render the dataframe as part of the traceback message, it for some reason silently clobbers the sys.exc_info(), which makes it impossible to re-raise the error after my processing using a 'raise' command with no arguments. To reproduce (using the iris.csv from tests/data):\r\n    \r\n    import pandas as pd\r\n    import sys\r\n    from pprint import pprint\r\n\r\n    df = pd.DataFrame.from_csv(\"./data/iris.csv\")\r\n\r\n    try:\r\n        raise KeyError()\r\n    except:\r\n        # info is populated correctly here\r\n        print sys.exc_info()\r\n        pprint(df)\r\n        # info is now (None, None, None)\r\n        print sys.exc_info()\r\n        # trying to re-raise error causes TypeError as it is trying to raise 'None'\r\n        raise\r\n\r\n\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 2.7.6.final.0\r\npython-bits: 32\r\nOS: Windows\r\nOS-release: 7\r\nmachine: AMD64\r\nprocessor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: None\r\n\r\npandas: 0.14.0\r\nnose: 1.3.3\r\nCython: None\r\nnumpy: 1.8.1\r\nscipy: 0.14.0\r\nstatsmodels: 0.5.0\r\nIPython: 2.1.0\r\nsphinx: 1.2.2\r\npatsy: 0.2.1\r\nscikits.timeseries: 0.91.3\r\ndateutil: 2.2\r\npytz: 2014.3\r\nbottleneck: 0.8.0\r\ntables: 3.1.1\r\nnumexpr: 2.4\r\nmatplotlib: 1.3.1\r\nopenpyxl: 1.8.6\r\nxlrd: 0.9.3\r\nxlwt: 0.7.5\r\nxlsxwriter: 0.5.5\r\nlxml: 3.3.5\r\nbs4: 4.3.2\r\nhtml5lib: 0.999\r\nbq: None\r\napiclient: None\r\nrpy2: None\r\nsqlalchemy: 0.9.4\r\npymysql: None\r\npsycopg2: None"}}