delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/09/15:34:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Chris Herborth <cherborth AT qnx DOT com>
Subject: Re: Bug in python's tempfile : returning wrong object type
Date: Wed, 09 Feb 2005 15:33:37 -0500
Organization: QNX Software Systems Ltd.
Lines: 24
Message-ID: <cuds03$5jo$1@sea.gmane.org>
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0502091740270 DOT 2277-100000 AT localhost DOT localdomain>
Reply-To: cherborth AT qnx DOT com
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: entropy.qnx.com
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
In-Reply-To: <Pine.LNX.4.44.0502091740270.2277-100000@localhost.localdomain>
X-Gmane-MailScanner: Found to be clean
X-Gmane-MailScanner: Found to be clean
X-MailScanner-From: goc-cygwin AT m DOT gmane DOT org
X-MailScanner-To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

Nick Burch wrote:
> With cygwin distributed python (2.4, dec 4 2004), there's a bug in 
> tempfile.
> 
> import tempfile
> fo = tempfile.TemporaryFile()
> type(fo)
> 
> This should return <type 'file'>, but is currently returning 
> <type 'instance'>
> 
> This also seems broken on python 2.3.4

This isn't a Cygwin problem or feature.  The Windows-native Python 2.4 
(Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on 
win32) gives the same result.

I suspect the tempfile module's docs are misleading... it you look at 
the code, the returned object is an instance of 
tempfile._TemporaryFileWrapper.

-- 
Chris Herborth (cherborth AT qnx DOT com)
Never send a monster to do the work of an evil scientist.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019