| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262
2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162
2002/08/11 12:23:03 lemburg Misc/NEWS 1.461
2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65
2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39
Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.
u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.
Closes SF bug #593581.
|
| |
|
|
|
|
|
|
|
|
|
| |
revision 2.265 of bltinmodule.c
date: 2002/08/27 16:58:00; author: nowonder; state: Exp; lines: +1 -1
execfile should call PyErr_SetFromErrnoWithFilename instead of
simply PyErr_SetFromErrno
This closes bug 599163.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repair widespread misuse of _PyString_Resize. Since it's clear people
don't understand how this function works, also beefed up the docs. The
most common usage error is of this form (often spread out across gotos):
if (_PyString_Resize(&s, n) < 0) {
Py_DECREF(s);
s = NULL;
goto outtahere;
}
The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL. So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s): s is already
NULL! A correct way to write the above is the simpler (and intended)
if (_PyString_Resize(&s, n) < 0)
goto outtahere;
Bugfix candidate.
Original patch(es):
python/dist/src/Python/bltinmodule.c:2.253
|
| | |
|
| |
|
|
|
|
|
|
| |
revision 2.248 of bltinmodule.c
Docstring for filter(): Someone on the Tutor list reasonably complained
that it didn't tell enough of the truth.
Bugfix candidate (I guess -- it helps and it's harmless).
|
| | |
|
| |
|
|
|
|
|
|
| |
Based on the patch from Danny Yoo. The fix is in exec_statement() in
ceval.c.
There are also changes to introduce use of PyCode_GetNumFree() in
several places.
|
| | |
|
| |
|
|
| |
Changes enabling Python to compile under OS/2 Visual Age C++.
|
| | |
|
| | |
|
| |
|
|
| |
masks any exception, not just AttributeError. Fix this.
|
| |
|
|
|
| |
not other sequences (then we'd have to except strings, and we'd still
be susceptible to recursive attacks).
|
| |
|
|
|
| |
builtin function); Guido pointed out that it could be just another
name in the __builtin__ dict for the file constructor now.
|
| | |
|
| |
|
|
| |
Preliminary support. What's here works, but needs fine-tuning.
|
| | |
|
| |
|
|
| |
found it necessary to warn about.
|
| |
|
|
| |
__builtin__.dir(). Moved the guts from bltinmodule.c to object.c.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
of PyMapping_Keys because we know we have a real dict. Tolerate that
objects may have an attr named "__dict__" that's not a dict (Py_None
popped up during testing).
test_descr.py, test_dir(): Test the new classic-class behavior; beef up
the new-style class test similarly.
test_pyclbr.py, checkModule(): dir(C) is no longer a synonym for
C.__dict__.keys() when C is a classic class (looks like the same thing
that burned distutils! -- should it be *made* a synoym again? Then it
would be inconsistent with new-style class behavior.).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bag. It's clearly wrong for classic classes, at heart because a classic
class doesn't have a __class__ attribute, and I'm unclear on whether
that's feature or bug. I'll repair this once I find out (in the
meantime, dir() applied to classic classes won't find the base classes,
while dir() applied to a classic-class instance *will* find the base
classes but not *their* base classes).
Please give the new dir() a try and see whether you love it or hate it.
The new dir([]) behavior is something I could come to love. Here's
something to hate:
>>> class C:
... pass
...
>>> c = C()
>>> dir(c)
['__doc__', '__module__']
>>>
The idea that an instance has a __doc__ attribute is jarring (of course
it's really c.__class__.__doc__ == C.__doc__; likewise for __module__).
OTOH, the code already has too many special cases, and dir(x) doesn't
have a compelling or clear purpose when x isn't a module.
|
| | |
|
| |
|
|
| |
This implements the 'getset' class from test_binop.py.
|
| |
|
|
|
|
|
| |
builtin_eval wasn't merging in the compiler flags from the current frame;
I suppose we never noticed this before because future division is the
first future-feature that can affect expressions (nested_scopes and
generators had only statement-level effects).
|
| |
|
|
|
| |
#449043 supporting __future__ in simulated shells
which implements PEP 264.
|
| |
|
|
|
|
|
|
| |
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
|
| | |
|
| | |
|
| |
|
|
|
| |
Somebody else should feel free to repair this a different way; see Python-
Dev for discussion.
|
| | |
|
| | |
|
| |
|
|
|
| |
Namely, an exception is raised if the second arg to hasattr() is not a
string or Unicode.
|
| |
|
|
|
|
|
| |
Fix suggested by Michael Hudson: Raise TypeError if attribute name
passed to getattr() is not a string or Unicode. There is some
unfortunate duplication of code between builtin_getattr() and
PyObject_GetAttr(), but it appears to be unavoidable.
|
| |
|
|
| |
If the code object has free variables, raise TypeError.
|
| |
|
|
|
| |
surrogates for Unicode code points outside range(0x10000) on narrow
Python builds.
|
| |
|
|
|
|
|
|
|
|
| |
that info to code dynamically compiled *by* code compiled with generators
enabled. Doesn't yet work because there's still no way to tell the parser
that "yield" is OK (unlike nested_scopes, the parser has its fingers in
this too).
Replaced PyEval_GetNestedScopes by a more-general
PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was
*intended* to be part of the public API, so just did.
|
| |
|
|
|
| |
on python-dev. The features will still vanish, however, just one release
later.
|
| |
|
|
| |
fewer arguments.
|
| |
|
|
| |
tests.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- the correct range for the error message is range(0x110000);
- put the 4-byte Unicode-size code inside the same else branch as the
2-byte code, rather generating unreachable code in the 2-byte case.
- Don't hide the 'else' behine the '}'.
(I would prefer that in 4-byte mode, any value should be accepted, but
reasonable people can argue about that, so I'll put that off.)
|
| |
|
|
|
|
|
|
|
|
| |
Add configure option --enable-unicode.
Add config.h macros Py_USING_UNICODE, PY_UNICODE_TYPE, Py_UNICODE_SIZE,
SIZEOF_WCHAR_T.
Define Py_UCS2.
Encode and decode large UTF-8 characters into single Py_UNICODE values
for wide Unicode types; likewise for UTF-16.
Remove test whether sizeof Py_UNICODE is two.
|
| |
|
|
| |
wrt surrogates. (this extends the valid range from 65535 to 1114111)
|
| |
|
|
| |
HAVE_USABLE_WCHAR_T
|
| |
|
|
| |
_PyTuple_Resize().
|
| |
|
|
|
| |
Mark Hammond claimed that the iterized filter() forgot to decref the
iterator upon return. He was right!
|
| |
|
|
| |
fileobject.h, and initialize it in bltinmodule.
|
| |
|
|
| |
dealing with the file system. As discussed on python-dev and in patch 410465.
|
| |
|
|
|
|
|
|
| |
NEEDS DOC CHANGES.
More AttributeErrors transmuted into TypeErrors, in test_b2.py, and,
again, this strikes me as a good thing.
This checkin completes the iterator generalization work that obviously
needed to be done. Can anyone think of others that should be changed?
|
| |
|
|
| |
internals) so clients can be a lot dumber (wrt their knowledge).
|
| |
|
|
| |
NEEDS DOC CHANGES.
|