[Python-bugs-list] [ python-Bugs-446049 ] file type is callable but crashes

noreply@sourceforge.net noreply@sourceforge.net
Mon, 30 Jul 2001 11:57:13 -0700


Bugs item #446049, was opened at 2001-07-30 11:51
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=446049&group_id=5470

Category: type/class unification
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Guido van Rossum (gvanrossum)
Summary: file type is callable but crashes

Initial Comment:
Calling the type of a file object results
in a crash.  More details to follow.


----------------------------------------------------------------------

>Comment By: Gregory H. Ball (greg_ball)
Date: 2001-07-30 11:57

Message:
Logged In: YES 
user_id=11365

Python 2.2a1 (#2, Jul 26 2001, 11:50:01) 
[GCC 2.95.3 19991030 (prerelease)] on linux2
Type "copyright", "credits" or "license" for more
information.
>>> f = open('README')
>>> type(f)()
Segmentation fault (core dumped)

Seems to me that it would be nice if FileType
worked like the 'open' builtin.
You could have a 'file' builtin and alias it to open.
Wild speculation: I guess open could be eventually
deprecated.  At which point you could safely do 
from os import *  ;-)


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=446049&group_id=5470