1. 10 Mar, 2006 1 kayıt (commit)
  2. 28 Şub, 2006 1 kayıt (commit)
    • Guido van Rossum's avatar
      Updates to the with-statement: · 1a5e21e0
      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.
      1a5e21e0
  3. 27 Şub, 2006 1 kayıt (commit)
  4. 15 Şub, 2006 1 kayıt (commit)
  5. 12 Şub, 2006 1 kayıt (commit)
    • Thomas Wouters's avatar
      SF patch #1397960: When mixing file-iteration and · c45251a4
      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.
      c45251a4
  6. 08 Ock, 2006 1 kayıt (commit)
  7. 15 Ara, 2005 1 kayıt (commit)
  8. 13 Ara, 2005 1 kayıt (commit)
  9. 10 Ara, 2005 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Add const to several API functions that take char *. · af68c874
      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 *.
      af68c874
  10. 20 May, 2005 1 kayıt (commit)
  11. 07 Kas, 2004 1 kayıt (commit)
  12. 11 Haz, 2004 1 kayıt (commit)
  13. 31 May, 2004 1 kayıt (commit)
  14. 04 Nis, 2004 1 kayıt (commit)
  15. 21 Mar, 2004 1 kayıt (commit)
  16. 19 Mar, 2004 1 kayıt (commit)
  17. 07 Şub, 2004 1 kayıt (commit)
  18. 19 Kas, 2003 1 kayıt (commit)
  19. 18 Eki, 2003 1 kayıt (commit)
  20. 12 Eki, 2003 1 kayıt (commit)
  21. 07 Eyl, 2003 2 kayıt (commit)
    • Martin v. Löwis's avatar
      Only release buffer after file has been closed. Fixes #800824. · 7bbcde70
      Martin v. Löwis yazdı
      Will backport to 2.2.
      7bbcde70
    • Tim Peters's avatar
      SF bug 801631: file.truncate fault on windows. · f1827cfa
      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.
      f1827cfa
  22. 04 Eyl, 2003 1 kayıt (commit)
  23. 15 Agu, 2003 1 kayıt (commit)
  24. 18 May, 2003 1 kayıt (commit)
  25. 10 May, 2003 1 kayıt (commit)
  26. 04 May, 2003 1 kayıt (commit)
  27. 09 Şub, 2003 1 kayıt (commit)
  28. 03 Ock, 2003 1 kayıt (commit)
  29. 29 Ara, 2002 1 kayıt (commit)
  30. 17 Ara, 2002 1 kayıt (commit)
    • Gustavo Niemeyer's avatar
      * Objects/fileobject.c · a080be8b
      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.
      a080be8b
  31. 16 Ara, 2002 1 kayıt (commit)
    • Gustavo Niemeyer's avatar
      Fixed bug · 786ddb29
      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.
      786ddb29
  32. 11 Ara, 2002 1 kayıt (commit)
  33. 21 Kas, 2002 1 kayıt (commit)
  34. 03 Eki, 2002 1 kayıt (commit)
  35. 14 Agu, 2002 1 kayıt (commit)
  36. 06 Agu, 2002 2 kayıt (commit)
    • Neal Norwitz's avatar
      Make readahead functions static · d8b995f5
      Neal Norwitz yazdı
      d8b995f5
    • Guido van Rossum's avatar
      SF patch 580331 by Oren Tirosh: make file objects their own iterator. · 7a6e9594
      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().)
      7a6e9594
  37. 14 Tem, 2002 1 kayıt (commit)
  38. 30 Haz, 2002 1 kayıt (commit)