summaryrefslogtreecommitdiff
path: root/Objects/fileobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-221-1/+1
| | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* PyFile_WriteObject() now uses fast callVictor Stinner2016-08-201-9/+2
| | | | | Issue #27128: PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the creation of a temporary tuple.
* (Merge 3.4) Issue #25182: Fix compilation on WindowsVictor Stinner2015-09-301-3/+6
|\
| * Issue #25182: Fix compilation on WindowsVictor Stinner2015-09-301-3/+6
| | | | | | | | Restore also errno value before calling PyErr_SetFromErrno().
* | Issue #25182: The stdprinter (used as sys.stderr before the io module isSerhiy Storchaka2015-09-301-4/+21
|\ \ | |/ | | | | imported at startup) now uses the backslashreplace error handler.
| * Issue #25182: The stdprinter (used as sys.stderr before the io module isSerhiy Storchaka2015-09-301-6/+22
| | | | | | | | imported at startup) now uses the backslashreplace error handler.
* | stdprinter_write(): mention the encodingVictor Stinner2015-03-241-3/+4
| |
* | Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handleVictor Stinner2015-03-191-17/+6
|/ | | | | | | | EINTR error and special cases for Windows. These functions now truncate the length to PY_SSIZE_T_MAX to have a portable and reliable behaviour. For example, read() result is undefined if counter is greater than PY_SSIZE_T_MAX on Linux.
* Issue #1772673: The type of `char*` arguments now changed to `const char*`.Serhiy Storchaka2013-10-191-2/+2
|
* Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-2/+2
|\ | | | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-2/+2
| | | | | | | | error messages and comments.
| * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-2/+2
| |\ | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
| | * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-2/+2
| | | | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* | | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-251-1/+1
| | |
* | | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-151-2/+2
|/ / | | | | | | when result of PyLong_AsLong() narrowed to int without checks.
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-4/+4
| |
* | Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-3/+7
| |
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-1/+2
| | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* | Implement PEP 393.Martin v. Löwis2011-09-281-11/+6
| |
* | Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon2011-02-221-2/+2
|/
* Issue #9015, #9611: stdprinter.write() clamps the length to 2^31-1 on WindowsVictor Stinner2011-01-041-2/+8
|
* Issue #9425: PyFile_FromFd() ignores the name argumentVictor Stinner2010-08-131-11/+3
| | | | | This function is only by imp.find_module() which does return the filename in a separated variable.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-372/+372
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead ofVictor Stinner2010-04-301-1/+1
| | | | | PyUnicode_FromString() to support surrogates in the filename and use the right encoding
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Make stdprinter_write static.Martin v. Löwis2008-06-131-1/+1
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-6/+6
|
* Add an errors parameter to open() and TextIOWrapper() to specify error handling.Guido van Rossum2007-12-031-3/+4
|
* Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases ↵Christian Heimes2007-12-021-1/+1
| | | | in intobject.h
* Fix for #1415 pythonw.exe fails because std streams a missingChristian Heimes2007-11-131-1/+1
| | | | | | After a long discussion about the problem with Windows GUI apps Guido decided that sys.stdin, stdout and stderr should be None when the C runtime library returns invalid file descriptors for the standard streams. So far the only known cases are Windows GUI apps and scripts started with pythonw on Windows. The OS restrictions are tight enough to catch the problem on other OSes.
* Let's do as Guido says and return None instead of -1Christian Heimes2007-11-121-3/+2
|
* Stop Python code from instantiating a new stdprinter with sys.stderr.__class__()Christian Heimes2007-11-121-11/+90
| | | | Added some more methods and attributes to stdprinter to ease up debugging #1415 on Windows. It also makes the object more file like. Now it can be used as a working replacement for an io instance.
* Bug #1415Christian Heimes2007-11-101-2/+2
| | | | | | On Windows fileno(stdout) and fileno(stderr) can return an invalid file descriptor number (-2 on my machine). It happens only for pythonw.exe but not for python.exe. Catch the problem ASAP in PyFile_NewStdPrinter(). I've also removed the call to PyErr_BadInternalCall(). It was causing a seg fault because the exceptions aren't available yet.
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-1/+1
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
* Minor correction to the stdprinter object.Guido van Rossum2007-10-301-2/+4
|
* Patch 1352 (continued in issue 1329) by Christian Heimes.Guido van Rossum2007-10-301-0/+118
| | | | | | Before sys.stderr is set to the proper thing, set it to a really simple file-like object that can print tracebacks using direct file descriptor I/O. This is handy for debugging.
* Patch 1329 (partial) by Christian Heimes.Guido van Rossum2007-10-301-3/+3
| | | | | | | | Add a closefd flag to open() which can be set to False to prevent closing the file descriptor when close() is called or when the object is destroyed. Useful to ensure that sys.std{in,out,err} keep their file descriptors open when Python is uninitialized. (This was always a feature in 2.x, it just wasn't implemented in 3.0 yet.)
* Remove redundant PyInt/PyLong checks.Georg Brandl2007-10-231-9/+2
|
* Issue 1267, continued.Guido van Rossum2007-10-221-11/+5
| | | | | | Additional patch by Christian Heimes to deal more cleanly with the FILE* vs file-descriptor issues. I cleaned up his code a bit, and moved the lseek() call into import.c.
* Patch 1267 by Christian Heimes.Guido van Rossum2007-10-191-9/+19
| | | | | | Move the initialization of sys.std{in,out,err} and __builtin__.open to C code. This solves the problem that "python -S" wouldn't work.
* PyFile_WriteObject() should use PyObject_Repr(), not _ReprStr8().Guido van Rossum2007-10-091-1/+1
|
* Kill execfile(), use exec() insteadNeal Norwitz2007-08-121-1/+1
|
* In PyFile_WriteString(), call PyUnicode_FromString() instead ofGuido van Rossum2007-08-091-1/+1
| | | | | PyString_FromString(). This is arguably more correct, even if it shouldn't matter much (all the input is likely to be ASCII).
* Make test_descr.py pass. Had to disable a few tests, remove referencesGuido van Rossum2007-07-111-6/+2
| | | | | | to 'file', and fix a bunch of subtleties in the behavior of objects related to overriding __str__. Also disabled a few tests that I couldn't see how to fix but that seemed to be checking silly stuff only.
* Rip out the file object's implementation.Guido van Rossum2007-06-121-2121/+20
| | | | | | | | | | | Fixed test_import.py while I was at it. However, there's still a problem in import.c -- get_file() can leak a FILE struct (not a file descriptor though). I'm not sure how to fix this; closing the FILE* closes the file descriptor, and that's the wrong thing to do when there's still a Python file object keeping the file descriptor open. I also would rather not mess with dup(), as it won't port to Windows.
* Minimal changes to make the "freeze" tool work again.Guido van Rossum2007-06-121-17/+12
| | | | There are other issues left, but these were basics (e.g. keys().sort()).
* Enable new I/O. Disable creation of old files.Guido van Rossum2007-05-241-0/+8
| | | | Lots of stuff fails now, including -S and -m command line flags.
* Add functions PyUnicode_Append() and PyUnicode_AppendAndDel() that mirrorWalter Dörwald2007-05-181-3/+3
| | | | | | | | | | | | | | | PyString_Concat() and PyString_ConcatAndDel() (the name PyUnicode_Concat() was already taken). Change PyObject_Repr() to always return a unicode object. Update all repr implementations to return unicode objects. Add a function PyObject_ReprStr8() that calls PyObject_Repr() and converts the result to an 8bit string. Use PyObject_ReprStr8() where using PyObject_Repr() can't be done straightforward.
* Merged revisions 55270-55324 via svnmerge fromGuido van Rossum2007-05-141-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55271 | fred.drake | 2007-05-11 10:14:47 -0700 (Fri, 11 May 2007) | 3 lines remove jpeg, panel libraries for SGI; there is more IRIX stuff left over, I guess that should be removed too, but will leave for someone who is sure ........ r55280 | fred.drake | 2007-05-11 19:11:37 -0700 (Fri, 11 May 2007) | 1 line remove mention of file that has been removed ........ r55301 | brett.cannon | 2007-05-13 17:38:05 -0700 (Sun, 13 May 2007) | 4 lines Remove rexec and Bastion from the stdlib. This also eliminates the need for f_restricted on frames. This in turn negates the need for PyEval_GetRestricted() and PyFrame_IsRestricted(). ........ r55303 | brett.cannon | 2007-05-13 19:22:22 -0700 (Sun, 13 May 2007) | 2 lines Remove the md5 and sha modules. ........ r55305 | george.yoshida | 2007-05-13 19:45:55 -0700 (Sun, 13 May 2007) | 2 lines fix markup ........ r55306 | neal.norwitz | 2007-05-13 19:47:57 -0700 (Sun, 13 May 2007) | 1 line Get the doc building again after some removals. ........ r55307 | neal.norwitz | 2007-05-13 19:50:45 -0700 (Sun, 13 May 2007) | 1 line Get test_pyclbr passing again after getstatus was removed from commands. This "test case" was weird since it was just importing a seemingly random module. Remove the import ........ r55322 | brett.cannon | 2007-05-14 14:09:20 -0700 (Mon, 14 May 2007) | 3 lines Remove the compiler package. Will eventually need a mechanism to byte compile an AST. ........
* Get rid of all #ifdef Py_USING_UNICODE (it is always present now).Guido van Rossum2007-05-031-10/+0
| | | | (With the help of unifdef from freshmeat.)