{"action":"created","issue":{"url":"https://api.github.com/repos/kbandla/dpkt/issues/62","labels_url":"https://api.github.com/repos/kbandla/dpkt/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/kbandla/dpkt/issues/62/comments","events_url":"https://api.github.com/repos/kbandla/dpkt/issues/62/events","html_url":"https://github.com/kbandla/dpkt/issues/62","id":84852202,"number":62,"title":"python 2.6: RuntimeError: dictionary changed size during iteration","user":{"login":"kbandla","id":200847,"avatar_url":"https://avatars.githubusercontent.com/u/200847?v=3","gravatar_id":"","url":"https://api.github.com/users/kbandla","html_url":"https://github.com/kbandla","followers_url":"https://api.github.com/users/kbandla/followers","following_url":"https://api.github.com/users/kbandla/following{/other_user}","gists_url":"https://api.github.com/users/kbandla/gists{/gist_id}","starred_url":"https://api.github.com/users/kbandla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbandla/subscriptions","organizations_url":"https://api.github.com/users/kbandla/orgs","repos_url":"https://api.github.com/users/kbandla/repos","events_url":"https://api.github.com/users/kbandla/events{/privacy}","received_events_url":"https://api.github.com/users/kbandla/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kbandla/dpkt/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/kbandla/dpkt/labels/imported","name":"imported","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-04T01:33:36Z","updated_at":"2015-06-04T01:33:47Z","closed_at":null,"body":"_From [y.dmi...@gmail.com](https://code.google.com/u/109555380157880117328/) on July 06, 2010 12:00:21_\n\nPython 2.6.5 (release26-maint, Jun 23 2010, 10:41:00) \r\n[GCC 4.3.4] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\\>>> import dpkt\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in \\<module>\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/__init__.py\", line 24, in \\<module>\r\n    import ethernet\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/ethernet.py\", line 128, in \\<module>\r\n    __load_types()\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/ethernet.py\", line 122, in __load_types\r\n    mod = __import__(modname, g)\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/ip6.py\", line 95, in \\<module>\r\n    import ip\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/ip.py\", line 255, in \\<module>\r\n    __load_protos()\r\n  File \"/usr/lib/python2.6/site-packages/dpkt/ip.py\", line 245, in __load_protos\r\n    for k, v in g.iteritems():\r\nRuntimeError: dictionary changed size during iteration\r\n\r\n\r\nQuick fix:\r\n--- /usr/lib/python2.6/site-packages/dpkt/ip.py~        2010-03-26 04:53:51.000000000 +0200\r\n+++ /usr/lib/python2.6/site-packages/dpkt/ip.py 2010-07-06 18:54:05.013117134 +0300\r\n@@ -242,7 +242,7 @@\r\n \\# XXX - auto-load IP dispatch table from IP_PROTO_* definitions\r\n def __load_protos():\r\n     g = globals()\r\n-    for k, v in g.iteritems():\r\n+    for k, v in list(g.iteritems()):\r\n         if k.startswith('IP_PROTO_'):\r\n             name = k[9:].lower()\r\n             try:\n\n_Original issue: http://code.google.com/p/dpkt/issues/detail?id=35_"},"comment":{"url":"https://api.github.com/repos/kbandla/dpkt/issues/comments/108672812","html_url":"https://github.com/kbandla/dpkt/issues/62#issuecomment-108672812","issue_url":"https://api.github.com/repos/kbandla/dpkt/issues/62","id":108672812,"user":{"login":"kbandla","id":200847,"avatar_url":"https://avatars.githubusercontent.com/u/200847?v=3","gravatar_id":"","url":"https://api.github.com/users/kbandla","html_url":"https://github.com/kbandla","followers_url":"https://api.github.com/users/kbandla/followers","following_url":"https://api.github.com/users/kbandla/following{/other_user}","gists_url":"https://api.github.com/users/kbandla/gists{/gist_id}","starred_url":"https://api.github.com/users/kbandla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbandla/subscriptions","organizations_url":"https://api.github.com/users/kbandla/orgs","repos_url":"https://api.github.com/users/kbandla/repos","events_url":"https://api.github.com/users/kbandla/events{/privacy}","received_events_url":"https://api.github.com/users/kbandla/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T01:33:47Z","updated_at":"2015-06-04T01:33:47Z","body":"_From [joed...@gmail.com](https://code.google.com/u/100727848663132448266/) on September 12, 2012 13:53:26_\n\nAlternate fix: \r\n\r\n--- dpkt/ip.py\t( revision 84 )\r\n+++ dpkt/ip.py\t(working copy)\r\n@@ -2,6 +2,7 @@\r\n \r\n \"\"\"Internet Protocol.\"\"\"\r\n \r\n+import copy\r\n import dpkt\r\n \r\n class IP(dpkt.Packet):\r\n@@ -241,7 +242,7 @@\r\n \r\n \\# XXX - auto-load IP dispatch table from IP_PROTO_* definitions\r\n def __load_protos():\r\n-    g = globals()\r\n+    g = copy.copy(globals())\r\n     for k, v in g.iteritems():\r\n         if k.startswith('IP_PROTO_'):\r\n             name = k[9:].lower()"}}