mirror of
https://github.com/python/cpython.git
synced 2025-10-25 10:44:55 +00:00
default mode="r" and add optional bufsize
This commit is contained in:
parent
27e177d005
commit
13c503e93b
1 changed files with 2 additions and 2 deletions
|
|
@ -76,9 +76,9 @@ def __del__(self):
|
||||||
#
|
#
|
||||||
# Initialization routines
|
# Initialization routines
|
||||||
#
|
#
|
||||||
def open(self, name, mode):
|
def open(self, name, mode='r', bufsize=-1):
|
||||||
import __builtin__
|
import __builtin__
|
||||||
return self.fileopen(__builtin__.open(name, mode))
|
return self.fileopen(__builtin__.open(name, mode, bufsize))
|
||||||
|
|
||||||
def fileopen(self, file):
|
def fileopen(self, file):
|
||||||
if `type(file)` != "<type 'file'>":
|
if `type(file)` != "<type 'file'>":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue