Filters:
Languages
Projects
Toughness
Just bugs labeled...
-
This patch implements part of bug 1372650. Sometimes a web client will send 2 instances of the same name: Cookie: mycookie=foo; mycookie=bar The specs listed here: http://wp.netscape.com/newsref/std/cookie_spec.html state that the first one is the one that should be used. The other cookies listed are the inherited ones from paths that a prefix of the current URL. When this is parsed by the Cookie module, mycookie gets set to bar when it should be foo. This patch changes Cookie.py to only use the first instance of duplicate cookies when parsing cookie strings.
-
· link
I want to use Python to script an existing application. So I was trying the code on http://docs.python.org/ext/pure-embedding.html and found it didn't work. I am using pkgsrc on NetBSD. I have run into two issues. First, PyDict_GetAttrString() does not exist. I have found this to be true for both Python 2.2 and 2.4, the two versions I currently have installed. I made the simple change to use PyObject_GetAttrString(), which looks right. Second, python can't find the module. I named the file multiply.py, and it wouldn't load. It turns out that I had to set PYTHONPATH in my envirnment to make it work. Setting it to '' (empty string) worked. The odd thing about the path issue is that if I ran the python interpreter, it was able to find the module w/o my changing the environment.
-
· link
Asking mimetypes to reload mime.types can cause guess_extension() to return a different result if multiple extensions are mapped to that mime type: >>> import mimetypes >>> mimetypes.guess_extension('image/jpeg') '.jpe' >>> mimetypes.init() >>> mimetypes.guess_extension('image/jpeg') '.jpeg' >>> This is because both the forward (extension to type) and inverse (type to extension) type mapping dicts are populated by iterating through the existing forward (extension to type) dict (types_map), then supplemented by reading from mime.types (or any other files given to init()). The fully populated forward dict becomes the new types_map. Initially, types_map is hard-coded, but when the type mapping dicts are repopulated, by explicitly or implicitly calling init() again, it is done by iterating over the types_map created by the first init() call, not the hard-coded one. If the iteration order for a set of extensions with the same type is different in these two versions of the forward dict, the order of extensions appearing for that type in the inverse dict will change. And so the behavior of guess_all_extensions() and hence guess_extension() will change.
-
· link
>>> from types import new_class >>> from datetime import datetime >>> new_class('tdatetime', (datetime, ), kwds={'foo':'bar'}) Traceback (most recent call last): File "<console>", line 1, in <module> File "/src/Python-3.3.0/Lib/types.py", line 52, in new_class return meta(name, bases, ns, **kwds) TypeError: type() takes 1 or 3 arguments I'm guessing ns and kwds should be combined before being passed through to meta? (meta is 'type' in this case)
-
The turtledemo is an on-ramp for younger programmers and we should make it easy to launch.
-
The urllib2 digest auth handler is totally broken. 1. It looks for an "Authorization" header instead of "WWW- Authenticate" (Authorization is the header you send back). 2. It thinks passwords in the URL are port names. 3. Even if you get around all that, it just doesn't work. It seems to encrypt the thing wrongly and get itself into an infinite loop sending the wrong answer back again and again, being rejected each time.
-
· link
The center footer in the source for the python man page, specifically the .th macro in Misc/python.man, contains an unexpanded $Date$ left over from the days of svn keyword expansions. Since hg does not support such expansions, either the source should be edited to remove the keyword or the date should be expanded during builds. One possibility would be to add sed edit steps to the altmaninstall makefile target and to "release.py --export".
-
Python supports ZIP64 extension since 2.5 (more 6 years ago). May be it is time to use it by default, leaving the option to disable it by specifying allowZip64=False.
-
· link
There are a couple references to an 'ndbm' variable/module in this function on Python 3.2 and above (and just one reference on default). It appears to be leftover from the 3.x reworking of this module
-
imaplib incorrectly chooses to quote some arguments. In particular, doing "UID FETCH # BODY.PEEK[]" results in the BODY.PEEK[] being quoted, and it should not (according to the RFC), which means the command fails. This is demonstrated below. It's possible (and likely) that other UID FETCH arguments are incorrectly quoted. This occurs with anon cvs python of 16/3/04, and 2.3.3. Windows XP SP1. I'm happy to provide more info if required, just let me know. I could try and work up a patch, but it would be better from someone really familiar with imaplib so that I don't screw up legitimate quoting. >>> import imaplib >>> i = imaplib.IMAP4("server") >>> i.login("username", "password") ('OK', ['LOGIN Ok.']) >>> i.select() ('OK', ['38']) >>> i.debug = 4 >>> i.uid("FETCH", "96", "BODY") 29:14.23 > GKGP7 UID FETCH 96 BODY 29:14.40 < * 31 FETCH (UID 96 BODY (("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 32 0)("text" "html" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 368 10) "alternative")) 29:14.40 < GKGP7 OK FETCH completed. ('OK', ['31 (UID 96 BODY (("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 32 0)("text" "html" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 368 10) "alternative"))']) >>> i.uid("FETCH", "96", "BODY.PEEK[]") 29:17.04 > GKGP8 UID FETCH 96 "BODY.PEEK[]" 29:17.21 < GKGP8 NO Error in IMAP command received by server. 29:17.21 NO response: Error in IMAP command received by server. ('NO', ['Error in IMAP command received by server.']) >>> i.logout() 29:31.26 > GKGP9 LOGOUT 29:31.42 < * BYE Courier-IMAP server shutting down 29:31.42 BYE response: Courier-IMAP server shutting down 29:31.42 < GKGP9 OK LOGOUT completed ('BYE', ['Courier-IMAP server shutting down']) >>>
