summaryrefslogtreecommitdiffstats
path: root/Include/fileobject.h
Commit message (Collapse)AuthorAgeFilesLines
* Issue #5677: Explicitly forbid write operations on read-only file objects,Antoine Pitrou2010-02-051-0/+2
| | | | | | and read operations on write-only file objects. On Windows, the system C library would return a bogus result; on Solaris, it was possible to crash the interpreter. Patch by Stefan Krah.
* Issue #5204: Define _PyVerify_fd on VC6 to makeHirokazu Yamamoto2009-02-111-0/+3
| | | | test_fdopen (test_os.py) pass.
* Issue 4804. Add a function to test the validity of file descriptors on ↵Kristján Valur Jónsson2009-02-101-0/+11
| | | | Windows, and stop using global runtime settings to silence the warnings / assertions.
* New environment variable PYTHONIOENCODING.Martin v. Löwis2008-06-011-0/+2
|
* Make file objects as thread safe as the underlying libc FILE* implementation.Gregory P. Smith2008-04-061-0/+4
| | | | | | | | | | | close() will now raise an IOError if any operations on the file object are currently in progress in other threads. Most code was written by Antoine Pitrou (pitrou). Additional testing, documentation and test suite cleanup done by me (gregory.p.smith). Fixes issue 815646 and 595601 (as well as many other bugs and references to this problem dating back to the dawn of Python).
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-1/+1
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Export function sanitize_the_mode from fileobject.c as ↵Kristján Valur Jónsson2007-04-261-0/+5
| | | | _PyFile_SanitizeMode(). Use this function in posixmodule.c when implementing fdopen(). This fixes test_subprocess.py for a VisualStudio 2005 compile.
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-0/+1
|
* Remove support for --without-universal-newlines (see PEP 11).Skip Montanaro2004-02-071-9/+1
|
* Patch #788249: Pass an explicit buffer to setvbuf in PyFile_SetBufSize().Martin v. Löwis2003-09-041-0/+1
| | | | Fixes #603724. Will backport to 2.3.
* Patch #612627: Add encoding attribute to file objects, and determineMartin v. Löwis2003-05-101-0/+2
| | | | the terminal encoding on Windows and Unix.
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-12/+12
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* SF patch 580331 by Oren Tirosh: make file objects their own iterator.Guido van Rossum2002-08-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | 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().)
* Add missing \ to macro definition only used when universal newlinesGuido van Rossum2002-05-241-1/+1
| | | | are disabled.
* Py_UniversalNewlineFread(): Many changes.Tim Peters2002-04-211-5/+5
| | | | | | | | | | | | | | | | | | | | + Continued looping until n bytes in the buffer have been filled, not just when n bytes have been read from the file. This repairs the bug that f.readlines() only sucked up the first 8192 bytes of the file on Windows when universal newlines was enabled and f was opened in U mode (see Python-Dev -- this was the ultimate cause of the test_inspect.py failure). + Changed prototye to take a char* buffer (void* doesn't make much sense). + Squashed size_t vs int mismatches (in particular, besides the unsigned vs signed distinction, size_t may be larger than int). + Gets out under all error conditions now (it's possible for fread() to suffer an error even if it returns a number larger than 0 -- any "short read" is an error or EOF condition). + Rearranged and simplified declarations.
* Mass checkin of universal newline support.Jack Jansen2002-04-141-1/+19
| | | | | | | | Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
* Patch #530105: Allow file object may to be subtypedMartin v. Löwis2002-03-151-0/+11
|
* PyFile_WriteString(): change prototype so that the string arg isTim Peters2001-11-281-1/+1
| | | | | | const char* instead of char*. The change is conceptually correct, and indirectly fixes a compiler wng introduced when somebody else innocently passed a const char* to this function.
* SF bug [#460467] file objects should be subclassable.Tim Peters2001-09-131-1/+2
| | | | Preliminary support. What's here works, but needs fine-tuning.
* Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a ↵Mark Hammond2001-05-141-0/+5
| | | | fileobject.h, and initialize it in bltinmodule.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Added PyObject_AsFileDescriptor, which checks for integer, long integer,Andrew M. Kuchling2000-07-131-0/+1
| | | | or .fileno() method
* ANSI-fication and Py_PROTO extermination.Fred Drake2000-07-091-16/+16
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum1998-12-041-9/+9
|
* flushline and writestring can now return an errorGuido van Rossum1997-05-221-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Added PyFile_decls for PyFile_WriteObject, PyFile_SoftSpace,Guido van Rossum1996-05-221-0/+3
| | | | PyFile_WriteString.
* make the type a parameter of the DL_IMPORT macro, for Borland CGuido van Rossum1995-02-271-1/+1
|
* new names for lots of new functionsGuido van Rossum1995-01-171-2/+2
|
* The great renaming, phase two: all header files have been updated toGuido van Rossum1995-01-121-9/+9
| | | | | | | use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
* Added 1995 copyright.Guido van Rossum1995-01-041-2/+2
| | | | | | object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
* Changes for dynamic linking under NTGuido van Rossum1994-08-181-1/+1
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-1/+2
|
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-181-0/+1
| | | | | | | * Grammar: add exec statement; allow testlist in expr statement. * ceval.c, compile.c, opcode.h: support exec statement; avoid optimizing locals when it is used * fileobject.{c,h}: add getfilename() internal function.
* * Added support for X11 modules.Guido van Rossum1993-07-281-0/+11
| | | | | | | * Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* Add "close" function parameter to newopenfileobject().Guido van Rossum1991-06-071-1/+2
|
* Added external interface to readline, for raw_input().Guido van Rossum1991-04-041-0/+1
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* Initial revisionGuido van Rossum1990-10-141-0/+9