| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
(GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments. This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
|
| |
|
|
|
|
| |
possible. Patch is writen with Coccinelle.
|
|
|
|
|
|
|
|
|
|
|
| |
Replace
_PyObject_CallArg1(func, arg)
with
PyObject_CallFunctionObjArgs(func, arg, NULL)
Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
|
|
|
|
| |
UTF-8 represenatation of Unicode objects.
|
|
|
|
|
|
|
|
| |
Issue #27809:
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
|
|
|
|
|
| |
Issue #27128: PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the
creation of a temporary tuple.
|
|\ |
|
| |
| |
| |
| | |
Restore also errno value before calling PyErr_SetFromErrno().
|
|\ \
| |/
| |
| | |
imported at startup) now uses the backslashreplace error handler.
|
| |
| |
| |
| | |
imported at startup) now uses the backslashreplace error handler.
|
| | |
|
|/
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| |
| | |
error messages and comments.
|
| |
| |
| |
| | |
error messages and comments.
|
| |\
| | |
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | |
| | |
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | | |
|
|/ /
| |
| |
| | |
when result of PyLong_AsLong() narrowed to int without checks.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
This function is only by imp.find_module() which does return the filename in a
separated variable.
|
|
|
|
|
|
|
|
|
|
| |
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.
........
|
|
|
|
|
| |
PyUnicode_FromString() to support surrogates in the filename and use the right
encoding
|
|
|
|
|
| |
type of tp_compare in a separate commit, for ease of reversion
should things go wrong.
|
| |
|
| |
|
| |
|
|
|
|
| |
in intobject.h
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
PyString_FromString(). This is arguably more correct, even if it
shouldn't matter much (all the input is likely to be ASCII).
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|