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.

classification
Title: f=open fails with TypeError
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, gibholio
Priority: normal Keywords:

Created on 2006-11-26 20:08 by gibholio, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
BatchGen.py gibholio, 2006-11-26 20:08 Script to generate batch file to automate ImageMagick conversions
Messages (3)
msg30678 - (view) Author: Gibholio (gibholio) Date: 2006-11-26 20:08
I've found that Python 2.5 halts, giving a TypeError, when opening a file to write to.  This is the error (path is shortened for compactness):

Traceback (most recent call last):
  File "C:\...\BatchGen.py", line 32, in <module>
    f=open('ImGen.bat', 'w')
TypeError: an integer is required

I noticed that calling an external command via os.system() would always make the error occur, but now it is happening all the time.  I've tried this on two machines, both running Windows XP SP2.
msg30679 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-11-26 20:47
This looks a bit fishy to me.

Are you sure that "open" isn't bound to something else in your script?
(Try replacing it with "file" for a start)
msg30680 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-11-27 07:31
Sorry, didn't see the attached file.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44279
2006-11-26 20:08:47gibholiocreate