[issue21652] Python 2.7.7 regression in mimetypes module on Windows

2014-06-13 Thread James Y Knight
James Y Knight added the comment: Reverting the incorrect commit which caused the regression would be a good start. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21652

[issue21652] Python 2.7.7 regression in mimetypes module on Windows

2014-06-03 Thread James Y Knight
New submission from James Y Knight: The change done for issue9291 in Python 2.7.7 caused the mimetypes.types_map dict to change to contain a mixture of str and unicode objects, rather than just str, as it always had before. This causes twisted.web to crash when serving static files on Windows

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-19 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: YAGNI. Nobody has needed sys.build_platform yet. (And no, sys.platform isn't it, since that's been fixed at linux2 approximately forever). Why do you think people would suddenly start needing to know the build-time kernel version now

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-19 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: configure_linux2.python3.2.patch It would probably be more future-proof to use linux*), not linux3) in the case expression. -- ___ Python tracker rep...@bugs.python.org http

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Well, except maybe if you plan to write applications working only on Python = 2.7.3? ... this version is not released yet. No, of course I don't plan on writing new code that checks sys.platform == 'linux2'. That's ridiculous. I

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: M.A., your comments do not make sense in the context of Linux. It does not actually require porting -- Linux 2.6.39 to Linux 3.0 is no more disruptive than Linux 2.6.38 to Linux 2.6.39. *Except* that python ill-advisedly exported

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Sure, you can compile and run Python on both versions of Linux, but what if your application uses features that are only present in Linux 3.0 and later ? This comment is making me think you've missed just how irrelevant kernel

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-17 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: I will backport the fix to 2.7 and 3.2. Uh, wait, so does that mean you're *not* going to do the compatibility-preserving thing and force sys.platform to stay linux2 even when python is built (BUILT! not run!) on a machine where

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-05 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Oh wow, so it depends on the *build* time major version? That's really not useful at all for linux 2.x and 3.x; there is nothing useful anyone can possibly do with the distinction between platform == linux2 and platform == linux3

[issue2650] re.escape should not escape underscore

2011-01-13 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Show your speed test? Looks 2.5x faster to me. But I'm running this on python 2.6, so I guess it's possible that the re module's speed was decimated in Py3k. python -m timeit -s $(printf import re\ndef escape(s):\n return re.sub

[issue2650] re.escape should not escape underscore

2011-01-13 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Right you are, it seems that python's regexp implementation is terribly slow when doing replacements with a substitution in them. (fixing the broken test, as you pointed out changed the timing to 97.6 usec vs the in-error-reported

[issue2650] re.escape should not escape underscore

2011-01-07 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: I just ran into the impl of escape after being surprised that '/' was being escaped, and then was completely amazed that it wasn't just implemented as a one-line re.subn. Come on, a loop for string replacement

[issue5154] OSX broken poll testing doesn't work

2010-07-29 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: The reason it's a problem is because a device is everything other than a socket, pipe, slave-side of tty, or file. That is, /dev/null, /dev/zero, /dev/tty, psuedo-tty masters from openpty (e.g. for running subprocesses), etc. I find

Re: [Python-Dev] PEP 384: Defining a Stable ABI

2009-05-17 Thread James Y Knight
On May 17, 2009, at 4:54 PM, Martin v. Löwis wrote: Currently, each feature release introduces a new name for the Python DLL on Windows, and may cause incompatibilities for extension modules on Unix. This PEP proposes to define a stable set of API functions which are guaranteed to be available

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread James Y Knight
On Apr 22, 2009, at 2:50 AM, Martin v. Löwis wrote: I'm proposing the following PEP for inclusion into Python 3.1. Please comment. +1. Even if some people still want a low-level bytes API, it's important that the easy case be easy. That is: the majority of Python applications should

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-15 Thread James Y Knight
On Apr 15, 2009, at 12:15 PM, M.-A. Lemburg wrote: The much more common use case is that of wanting to have a base package installation which optional add-ons that live in the same logical package namespace. The PEP provides a way to solve this use case by giving both developers and