This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: exception traceback sometimes slow
Type: Stage:
Components: Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, ocean-city, pitrou
Priority: normal Keywords:

Created on 2008-12-03 10:31 by ocean-city, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg76823 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-12-03 10:31
Please try this code.

import zipfile

I'm not sure this is problematic or not.
msg76824 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-03 11:23
What do you mean by "slow"? I can't reproduce under Linux.
msg76826 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-12-03 12:48
Traceback (most recent call last):
  File "", line 4, in <module>
  File "e:\python-dev\py3k\lib\", line 683, in __init__
    self.fp =, modeDict[mode])
  File "e:\python-dev\py3k\lib\", line 222, in open
  File "e:\python-dev\py3k\lib\", line 615, in __init__
    _fileio._FileIO.__init__(self, name, mode, closefd)
IOError: [Errno 2] No such file or directory: 'foobar'
[33393 refs]

For example, some delay after

   File "e:\python-dev\py3k\lib\", line 683, in __init__

this line. I don't know why, but maybe because current io module is not
written in C.
msg76827 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-12-03 13:54
Is "e:" a network drive? This could explain the delay.

But it's true that the code that displays the exception has to call
readline() 683 times, and this code is written in python. There is a
project to rewrite in C...

Also, you are using a debug build. Is the slowdown still noticeable with
a release build?
msg76836 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-12-03 17:59
No, e: is not netword drive. It's another partition on hard drive. But
my machine is pretty slow.

>Also, you are using a debug build. Is the slowdown still noticeable with
>a release build?

I tried release build(VC6), and was much faster.
msg83548 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-03-13 23:56
I suppose we can close this now, it should be solved with the IO-C
rewrite in 3.1, and won't be backported to 3.0.
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48753
2009-03-13 23:56:38pitrousetstatus: open -> closed
resolution: fixed
messages: + msg83548
2008-12-03 17:59:08ocean-citysetmessages: + msg76836
2008-12-03 13:54:20amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg76827
2008-12-03 12:48:43ocean-citysetmessages: + msg76826
2008-12-03 11:23:47pitrousetnosy: + pitrou
messages: + msg76824
2008-12-03 10:31:50ocean-citycreate