- 10 Mar, 2006 1 kayıt (commit)
-
-
Guido van Rossum yazdı
Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
-
- 28 Şub, 2006 1 kayıt (commit)
-
-
Guido van Rossum yazdı
- New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
-
- 27 Şub, 2006 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 15 Şub, 2006 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 12 Şub, 2006 1 kayıt (commit)
-
-
Thomas Wouters yazdı
readline/readlines/read/readinto, loudly break by raising ValueError, rather than silently deliver data out of order or hitting EOF prematurely. Probably not a bugfix candidate, even though it affects no 'working' code.
-
- 08 Ock, 2006 1 kayıt (commit)
-
-
Neal Norwitz yazdı
-
- 15 Ara, 2005 1 kayıt (commit)
-
-
Neal Norwitz yazdı
(calling ftell(stdin) doesn't seem defined). So we won't test errors from ftell unless we can do it portably.
-
- 13 Ara, 2005 1 kayıt (commit)
-
-
Hye-Shik Chang yazdı
ftell(3) on BSD doesn't set errno even for ttys and returns useless values.
-
- 10 Ara, 2005 1 kayıt (commit)
-
-
Jeremy Hylton yazdı
In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
-
- 20 May, 2005 1 kayıt (commit)
-
-
Skip Montanaro yazdı
278. Closes bug 967182.
-
- 07 Kas, 2004 1 kayıt (commit)
-
-
Peter Astrand yazdı
stderr. close() can fail if the user is out-of-quota, for example. Fixes #959379.
-
- 11 Haz, 2004 1 kayıt (commit)
-
-
Skip Montanaro yazdı
-
- 31 May, 2004 1 kayıt (commit)
-
-
Raymond Hettinger yazdı
-
- 04 Nis, 2004 1 kayıt (commit)
-
-
Andrew MacIntyre yazdı
close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak.
-
- 21 Mar, 2004 1 kayıt (commit)
-
-
Nicholas Bastin yazdı
Fixes SF Bug #773356
-
- 19 Mar, 2004 1 kayıt (commit)
-
-
Fred Drake yazdı
Py_USING_UNICODE is defined
-
- 07 Şub, 2004 1 kayıt (commit)
-
-
Skip Montanaro yazdı
-
- 19 Kas, 2003 1 kayıt (commit)
-
-
Jack Jansen yazdı
-
- 18 Eki, 2003 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 12 Eki, 2003 1 kayıt (commit)
-
-
Raymond Hettinger yazdı
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
-
- 07 Eyl, 2003 2 kayıt (commit)
-
-
Martin v. Löwis yazdı
Will backport to 2.2.
-
Tim Peters yazdı
file_truncate(): C doesn't define what fflush(fp) does if fp is open for update, and the preceding I/O operation on fp was input. On Windows, fflush() actually changes the current file position then. Because Windows doesn't support ftruncate() directly, this not only caused Python's file.truncate() to change the file position (contra our docs), it also caused the file not to change size. Repaired by getting the initial file position at the start, restoring it at the end, and tossing all the complicated micro-efficiency checks trying to avoid "provably unnecessary" seeks. file.truncate() can't be a frequent operation, and seeking to the current file position has got to be cheap anyway. Bugfix candidate.
-
- 04 Eyl, 2003 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
Fixes #603724. Will backport to 2.3.
-
- 15 Agu, 2003 1 kayıt (commit)
-
-
Neal Norwitz yazdı
If opening a directory, the exception would leak.
-
- 18 May, 2003 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 10 May, 2003 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
the terminal encoding on Windows and Unix.
-
- 04 May, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
only. Repaired, and added new tests to test_file.py.
-
- 09 Şub, 2003 1 kayıt (commit)
-
-
Neal Norwitz yazdı
-
- 03 Ock, 2003 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 29 Ara, 2002 1 kayıt (commit)
-
-
Raymond Hettinger yazdı
Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
-
- 17 Ara, 2002 1 kayıt (commit)
-
-
Gustavo Niemeyer yazdı
(file_read): Replaced assertion with mixed sign operation by a simple comment (thank you Raymond). The algorithm is clear enough in that point.
-
- 16 Ara, 2002 1 kayıt (commit)
-
-
Gustavo Niemeyer yazdı
[#521782] unreliable file.read() error handling * Objects/fileobject.c (file_read): Clear errors before leaving the loop in all situations, and also check if some data was read before exiting the loop with an EWOULDBLOCK exception. * Doc/lib/libstdtypes.tex * Objects/fileobject.c Document that sometimes a read() operation can return less data than what the user asked, if running in non-blocking mode. * Misc/NEWS Document the fix.
-
- 11 Ara, 2002 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 21 Kas, 2002 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
-
- 03 Eki, 2002 1 kayıt (commit)
-
-
Mark Hammond yazdı
-
- 14 Agu, 2002 1 kayıt (commit)
-
-
Jeremy Hylton yazdı
-
- 06 Agu, 2002 2 kayıt (commit)
-
-
Neal Norwitz yazdı
-
Guido van Rossum yazdı
For a file f, iter(f) now returns f (unless f is closed), and f.next() is similar to f.readline() when EOF is not reached; however, f.next() uses a readahead buffer that messes up the file position, so mixing f.next() and f.readline() (or other methods) doesn't work right. Calling f.seek() drops the readahead buffer, but other operations don't. The real purpose of this change is to reduce the confusion between objects and their iterators. By making a file its own iterator, it's made clearer that using the iterator modifies the file object's state (in particular the current position). A nice side effect is that this speeds up "for line in f:" by not having to use the xreadlines module. The f.xreadlines() method is still supported for backwards compatibility, though it is the same as iter(f) now. (I made some cosmetic changes to Oren's code, and added a test for "file closed" to file_iternext() and file_iter().)
-
- 14 Tem, 2002 1 kayıt (commit)
-
-
Tim Peters yazdı
MSDN sample programs use it, apparently in error. The correct name is WIN32_LEAN_AND_MEAN. After switching to the correct name, in two cases more was needed because the code actually relied on things that disappear when WIN32_LEAN_AND_MEAN is defined.
-
- 30 Haz, 2002 1 kayıt (commit)
-
-
Martin v. Löwis yazdı
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
-