| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Constants from stat module were imported using "import *";
don't access them via stat.ST_*!
Reported by that other vR. ;-)
|
| |
|
| |
|
|
|
|
|
|
| |
for gotonext() pushing self.pos past the end of the string. This can
happen if the message has a To field like "To: :" and you call
msg.getaddrlist('to').
|
| |
|
| |
|
|
|
|
| |
module distributions that contain platform-specific files.
|
|
|
|
| |
Added DistutilsPlatformError.
|
|
|
|
| |
The text is condensed from the library manual.
|
| |
|
|
|
|
|
|
| |
In splithost, accept empty host part in URLs. This is required for
file URLs that can have an empty host part. For such URLs, we should
not return the initial 2 slashes as part of the file name.
|
| |
|
|
|
|
|
|
|
| |
exceptions.
When raising NotANumber, pass the string that failed as the exception
value.
|
|
|
|
| |
to 4.
|
| |
|
|
|
|
|
| |
Make argument names equal to what is used in the documentation of the
file object, since chunks are supposedly file-like.
|
|
|
|
|
| |
I just noticed that the changes below also apply to cmpcache.py, which
is virtually identical to cmp.py.
|
|
|
|
|
|
|
|
|
|
| |
1. Fix incorrect file open mode on Win32 platforms (use "rb" instead
of "r").
2. Add shallow parameter to cmp.cmp(). If false, deep file
comparisons are made.
The module should be 100 percent backwards compatible.
|
|
|
|
|
|
|
|
|
|
|
| |
Urllib makes the URL of the opened file available through the geturl
method of the returned object. For local files, this consists of
file: plus the name of the file. This results in an invalid URL if
the file name was relative. This patch fixes this so that the
returned URL is just a relative URL in that case. When the file name
is absolute, the URL returned is of the form file:///absolute/path.
[I guess that a URL of the form "file:foo.html" is illegal... GvR]
|
|
|
|
| |
be using self.maxdict.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new builtin exception, UnboundLocalError, raised when ceval.c
tries to retrieve or delete a local name that isn't bound to a value.
Currently raises NameError, which makes this behavior a FAQ since the same
error is raised for "missing" global names too: when the user has a global
of the same name as the unbound local, NameError makes no sense to them.
Even in the absence of shadowing, knowing whether a bogus name is local or
global is a real aid to quick understanding.
Example:
D:\src\PCbuild>type local.py
x = 42
def f():
print x
x = 13
return x
f()
D:\src\PCbuild>python local.py
Traceback (innermost last):
File "local.py", line 8, in ?
f()
File "local.py", line 4, in f
print x
UnboundLocalError: x
D:\src\PCbuild>
Note that UnboundLocalError is a subclass of NameError, for compatibility
with existing class-exception code that may be trying to catch this as a
NameError. Unfortunately, I see no way to make this wholly compatible
with -X (see comments in bltinmodule.c): under -X, [UnboundLocalError
is an alias for NameError --GvR].
[The ceval.c patch differs slightly from the second version that Tim
submitted; I decided not to raise UnboundLocalError for DELETE_NAME,
only for DELETE_LOCAL. DELETE_NAME is only generated at the module
level, and since at that level a NameError is raised for referencing
an undefined name, it should also be raised for deleting one.]
|
|
|
|
| |
mark_previous().
|
| |
|
|
|
|
|
|
| |
always lowercasing the option name, call a method optionxform() which
can be overridden. Also make the regexps SECTRE and OPTRE non-private
variables so they can also be overridden.
|
|
|
|
|
| |
may raise an exception (when there are no children). Reported by
Andy Dustman.
|
|
|
|
|
|
|
|
| |
mode attribute of the file object (if it has one), otherwise
use 'rb'.
The documentation should still show this as required until
there's a new release.
|
|
|
|
| |
confusing to end users of IDEs.
|
|
|
|
|
|
|
| |
Added support for unseekable files.
(I use unqualified excepts since we don't know why the seek/tell might
fail. In my case it was because of an AttributeError.)
|
|
|
|
|
| |
and suggests putting a try/except around the get_request() call in
handle_request(). (All in class TCPServer.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: rfc822.py in 1.5.2 final loses the quotes around
quoted local-part names.
The fix is to preserve the quotes around a local-part
name in an address.
Test:
import rfc822
a = rfc822.AddrlistClass('(Comment stuff) "Quoted
name"@somewhere.com')
a.getaddrlist()
The correct result is:
[('Comment stuff', '"Quoted name"@somewhere.com')]
|
|
|
|
|
| |
Also added a short circuit for the regression test suite since CVS
insisted on putting this file in the main branch. :(
|
| |
|
|
|
|
| |
empty list instead of None. (Guido's request.)
|
|
|
|
|
| |
*missing* content-type at the outer level of a POST defaults to
urlencoded. In all other circumstances, the default is read_singe().
|
| |
|
|
|
|
|
|
| |
in the string module.
Add a bunch of new tests for extended startswith/endswith arguments.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Hammond: record top-level functions (as Function instances, a simple
subclass of Class). You must use the new interface readmodule_ex() to
get these, though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__init__.py it isn't read. (Sjoerd just came up with this, so it's
not heavily tested.)
Other (yet unsolved) package problems noted by Sjoerd:
- If you have a package and a module inside that or another package
with the same name, module caching doesn't work properly since the
key is the base name of the module/package.
- The only entry that is returned when you readmodule a package is a
__path__ whose value is a list which confuses certain class browsers
that I wrote. (Hm, this could be construed as a feature.)
|
|
|
|
| |
and quote_plus() can be optimized tenfold.
|
|
|
|
|
|
|
| |
I've found two places where smtplib.py sends an extra trailing space
on command lines to the SMTP server. I don't know if this ever causes
any problems, but I'd prefer to be on the safe side. The enclosed
patch removes the extra space.
|
|
|
|
| |
timestamp from GMT tuple.
|
|
|
|
| |
unreachable -- but fall back to using whatever hostname we have.
|
|
|
|
| |
math in the Chunk class.
|