Python-Dev
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
March 2008
- 142 participants
- 168 discussions
As I'm digging into packaging issues here at PyCon, a couple of Python 3000
related matters occur to me. As I'm new to the Python 3000 development, if
these have already been addressed in prior discussions, I apologize for your time.
1. What is the plan for PyPI when Python 3.0 comes out and
dependencies start getting satisfied from distribution
across the great divide, e.g. a 3.0-specific package
pulls from PyPI a 2.x-specific package to meet some
need? Are there plans to fork PyPI, apply special
tags to uploads or what? While binary distributions
are tagged with the Python version, source distributions
are not. And of course a dependency expression as
it stands today for "SomePackage > 2.4" may pull 3.0
to satisfy it.
2. There have been attempts over the years to fix distutils,
with the last one being in 2006 by Anthony Baxter. He
stated that a major hurdle was the strong demand to
respect backward compatibility and he finally gave up.
One of the purposes of Python 3.0 was the freedom to
break backward compatibility for the sake of "doing
the right thing". So is it now permissible to give
distutils a good reworking and stop letting
compatibility issues hold us back?
-Jeff
12
23
I noticed that http://www.python.org/dev/faq/#how-do-i-apply-a-patch
...does not contain instruction for Windows user willing to apply a
patch starting from a .diff file.
Since Tortoise SVN is the most common choice I tried to describe the
steps to apply a patch by using it.
This could be added in the same section (5.2) righ after the UNIX
instructions.
--- snippet ---
If you're using Windows make sure you have TortoiseSVN installed.
Right-click on the folder containing the trunk source code, expand the
TortoiseSVN submenu and select 'Apply Patch...'. Browse to the patch
file and select it, then right click on the file appearing in the
'File Patches' window and click on 'Patch selected'. After you're
done, close the TortoiseMerge window.
--- /snippet ---
Hope this helps.
4
5

March 22, 2008
At 08:34 PM 3/20/2008 +0000, Paul Moore wrote:
>I then went on to say that putting dependency information in setup.exe
>and expecting users to use automatic dependency resolution encourages
>developers to omit dependency details from documentation (to an extent
>I can't quantify, but I believe is non-zero). That lack of
>documentation "forces" me to rely on the automatic process. THAT is
>the thing that removes my choice, not easy_install's ability to skip
>dependency checking.
Ah. Fair enough. So, if we get PyPI to display that information,
that should fix this problem for you?
>People are starting to omit distributing
>bdist_wininst installers in favour of eggs only.
You mean, they're shipping a .win32.egg, but not an .exe?
> And you cannot (to my
>knowledge) convert an egg into a bdist_wininst installer,
Not at the moment, no. It seems like it ought to be *possible*,
though, since the reverse translation can be done. Eggs are more
restrictive in what they can include, so the reverse step actually
ought to be relatively easy. Indeed, I would think that it could be
done by a standalone tool without even using setuptools. All that
really needs to happen (I believe) is that the zipfile directory
needs all its names prepended with PURELIB or PLATLIB, and then add
the appropriate prefix .exe and bdist_wininst extra data on the front
of the restructured zip file.
In fact, it should probably be possible to write such a tool by
subclassing the distutils bdist_wininst command and overriding the
run() and get_inidata() methods, using the existing create_exe()
method to do that part of the magic.
The other tool that would be handy to have, would be one that unpacks
eggs into standard distutils-style installation.
> > Personally, I'm not very thrilled with the number of complaints on
> > this thread that could be resolved by RTFMing.
>...
>Honestly, I'm trying to help improve (by my measure of improvement,
>certainly) setuptools. I've done as much (more!) homework as I feel is
>appropriate (no, I haven't studied the whole manual all the way
>through). Being treated as if it's my fault, and I haven't done
>enough, is both discouraging and to be honest, somewhat offensive.
My comment wasn't aimed specifically at you; you're only one of many
people today who have appeared to state that something or other
wasn't possible or documented, described optional behavior as
required, etc. Addressing each and every one point by point looks
petty, but then lumping them together like that makes it look like
I'm picking on you specifically. Sorry about that.
In any event, I'm not saying that anyone hasn't done enough or that
it's their fault. The fact that I'm not thrilled about some of the
things said in the thread doesn't somehow magically invalidate other
people's frustrations, nor was it my intent to accuse you (or anyone)
of making up their problems. I'm just expressing *my* frustration.
4
4
Can someone set me up with a build slave for an x86 FreeBSD box (6.2-STABLE, although we'll be migrating to 7.x in a week or so)? Thanks.
[Suggestion: perhaps we could set up a python-buildbots(a)python.org list for discussing buildbot administrative minutiae, rather than polluting python-dev?]
Trent.
2
1

March 21, 2008
At 12:33 PM 3/21/2008 +0000, Paul Moore wrote:
>On 21/03/2008, Terry Reedy <tjreedy(a)udel.edu> wrote:
> > The standard (and to me, preferable) way of dealing with such
> things is to
> > have an 'installation manager' that can reinstall as well as delete and
> > that has a check box for various things to delete. This is what Python
> > needs.
>
>I'd dispute strongly that this is a "standard". It may be preferable,
>but I'm not sure where you see evidence of it being a standard.
I presume he means that there are a lot of entries in his Add/Remove
Programs that work like that, and that it's an emerging standard for
Windows. (Certainly I've seen quite a few entries like that in mine,
although more often than not they only have one checkbox!)
>Could I also point out that *if* such a standard is set up for Python,
>bdist_wininst and bdist_msi should be modified to follow it.
>Otherwise, it's not a standard, more of competing approach.
The best thing to do would be to get a standard (ala PEP 262, but
modified by the benefit of experience now) for tracking installed
Python package distributions. Then we can standardize on platform
tools for managing this data, and include them in the relevant
platform distributions. (And that would include making bdist_wininst
and bdist_msi follow this installation DB standard.)
2
1
ACTIVITY SUMMARY (03/14/08 - 03/21/08)
Tracker at http://bugs.python.org/
To view or respond to any of the issues listed below, click on the issue
number. Do NOT respond to this message.
1795 open (+106) / 12476 closed (+50) / 14271 total (+156)
Open issues with patches: 529
Average duration of open issues: 714 days.
Median duration of open issues: 1217 days.
Open Issues Breakdown
open 1773 (+106)
pending 22 ( +0)
Issues Created Or Reopened (157)
________________________________
Add a factorial function 03/18/08
http://bugs.python.org/issue2138 reopened rhettinger
os.path.normpath over-normalizes 03/14/08
CLOSED http://bugs.python.org/issue2289 created eljay451
[PATCH] Update Lib/distutils/sysconfig.py to handle x64 Windows 03/14/08
CLOSED http://bugs.python.org/issue2290 created Trent.Nelson
patch
Raise a Py3K warning for catching non-BaseException exceptions 03/14/08
CLOSED http://bugs.python.org/issue2291 created zotbar1234
Missing *-unpacking generalizations 03/15/08
http://bugs.python.org/issue2292 created twouters
patch, patch
Missing case / switch / evaluate 03/15/08
CLOSED http://bugs.python.org/issue2293 created dbodin
Bug in Pickle protocol involving __setstate__ 03/15/08
CLOSED http://bugs.python.org/issue2294 created gpk
cPickle corner case - docs or bug? 03/15/08
http://bugs.python.org/issue2295 created gpk
[PATCH] Tcl/Tk 8.4.16 patches needed to get an x64 Windows build 03/15/08
http://bugs.python.org/issue2296 created Trent.Nelson
patch, 64bit
Patch for fatal stack overflow in Windows caused by -v 03/16/08
CLOSED http://bugs.python.org/issue2297 created dgreiman
patch
Patch for "string without null bytes" check in getargs.c 03/16/08
http://bugs.python.org/issue2298 created dgreiman
patch
Minor typos in newtypes.rst 03/16/08
CLOSED http://bugs.python.org/issue2299 created dgreiman
patch
make html fails 03/16/08
http://bugs.python.org/issue2300 created tiran
[Py3k] No text shown when SyntaxError (when not UTF8) 03/16/08
CLOSED http://bugs.python.org/issue2301 created ocean-city
Uses of SocketServer.BaseServer.shutdown have a race 03/16/08
http://bugs.python.org/issue2302 created jyasskin
patch, patch
isinstance is 4x as slow as in 2.5 because the common case raise 03/16/08
http://bugs.python.org/issue2303 created jyasskin
patch
subprocess under windows fails to quote properly when shell=True 03/16/08
http://bugs.python.org/issue2304 created tim.golden
patch
Update What's new in 2.6 03/16/08
http://bugs.python.org/issue2305 created gvanrossum
Update What's new in 3.0 03/16/08
http://bugs.python.org/issue2306 created gvanrossum
Decide what to do with bytes/str when transferring pickles betwe 03/16/08
CLOSED http://bugs.python.org/issue2307 created gvanrossum
Make structseq more like collections.namedtuple 03/16/08
http://bugs.python.org/issue2308 created gvanrossum
Add xturtle to the standard library? 03/16/08
CLOSED http://bugs.python.org/issue2309 created gvanrossum
Reorganize the 3.0 Misc/NEWS file 03/16/08
http://bugs.python.org/issue2310 created gvanrossum
Update the ACKS file 03/16/08
http://bugs.python.org/issue2311 created gvanrossum
Update PEP 3135 (super()) 03/16/08
http://bugs.python.org/issue2312 created gvanrossum
correct int / long object type casts 03/16/08
CLOSED http://bugs.python.org/issue2313 created JosephArmbruster
patch
Test issue 03/16/08
CLOSED http://bugs.python.org/issue2314 created loewis
TimedRotatingFileHandler does not account for daylight savings t 03/17/08
http://bugs.python.org/issue2315 created ceder
TimedRotatingFileHandler names files incorrectly if nothing is l 03/17/08
http://bugs.python.org/issue2316 created ceder
TimedRotatingFileHandler logic for removing files wrong 03/17/08
http://bugs.python.org/issue2317 created ceder
TimedRotatingFileHandler: rotate every month, or every year 03/17/08
http://bugs.python.org/issue2318 created ceder
abc.py:ABCMeta.__instancecheck__ broken for old style classes 03/17/08
CLOSED http://bugs.python.org/issue2319 created schmir
Race condition in subprocess using stdin 03/17/08
http://bugs.python.org/issue2320 created Pankrat
return more memory from unicode objects to system 03/17/08
CLOSED http://bugs.python.org/issue2321 created nnorwitz
patch, patch
Clean up getargs.c and its formatting possibilities 03/17/08
http://bugs.python.org/issue2322 created brett.cannon
Make structseq's API look more like a nametuple. 03/17/08
CLOSED http://bugs.python.org/issue2323 created brett.cannon
Document that 2.6 pickles of strings turn into pickles of unicod 03/17/08
CLOSED http://bugs.python.org/issue2324 created brett.cannon
isinstance(anything, MetaclassThatDefinesInstancecheck) raises i 03/17/08
http://bugs.python.org/issue2325 created jyasskin
Doc isnumeric and isdecimal for the unicode object 03/17/08
CLOSED http://bugs.python.org/issue2326 created brett.cannon
patch
Backport keyword-only arguments to 2.6 03/17/08
http://bugs.python.org/issue2327 created brett.cannon
26backport
Class **kwds broken (PEP 3115) 03/17/08
CLOSED http://bugs.python.org/issue2328 created jackdied
ImportError: No module named _bsddb 03/17/08
CLOSED http://bugs.python.org/issue2329 created ddk
Update PEP 3000 with new release schedule 03/17/08
http://bugs.python.org/issue2330 created gvanrossum
Backport parameter annotations 03/17/08
http://bugs.python.org/issue2331 created brett.cannon
26backport
Renaming of attributes on functions need to be backported. 03/17/08
CLOSED http://bugs.python.org/issue2332 created brett.cannon
26backport
Backport dict comprehensions 03/17/08
http://bugs.python.org/issue2333 created brett.cannon
26backport
Backport set comprehensions 03/17/08
http://bugs.python.org/issue2334 created brett.cannon
26backport
Backport set literals 03/17/08
http://bugs.python.org/issue2335 created brett.cannon
26backport
Backport PEP 3114 (__next__) 03/17/08
http://bugs.python.org/issue2336 created brett.cannon
26backport
Backport oct() and hex() to use __index__ 03/17/08
http://bugs.python.org/issue2337 created brett.cannon
26backport
Backport reload() moving to imp.reload() 03/17/08
http://bugs.python.org/issue2338 created brett.cannon
26backport
Backport intern() -> sys.intern() 03/17/08
CLOSED http://bugs.python.org/issue2339 created brett.cannon
patch, 26backport
Backport PEP 3132 (extended iterable unpacking) 03/17/08
http://bugs.python.org/issue2340 created brett.cannon
26backport
Raise a Py3K warning when raise non-BaseException exceptions 03/17/08
CLOSED http://bugs.python.org/issue2341 created brett.cannon
patch, 26backport
Comparing between disparate types should raise a Py3K warning 03/17/08
CLOSED http://bugs.python.org/issue2342 created brett.cannon
patch, 26backport
Raise a Py3K warning when using a float where an int is expected 03/17/08
http://bugs.python.org/issue2343 created brett.cannon
26backport
Using an iteration variable outside a list comprehension needs a 03/17/08
http://bugs.python.org/issue2344 created brett.cannon
26backport
Using an exception variable outside an 'except' clause should ra 03/17/08
http://bugs.python.org/issue2345 created brett.cannon
26backport
Py3K warn against using __members__ 03/17/08
http://bugs.python.org/issue2346 created brett.cannon
patch, 26backport
Py3K warn for using __methods__ 03/17/08
http://bugs.python.org/issue2347 created brett.cannon
26backport
Py3K warn using file.softspace 03/17/08
http://bugs.python.org/issue2348 created brett.cannon
patch, 26backport
Py3K warn against assigning to True/False 03/17/08
http://bugs.python.org/issue2349 created brett.cannon
patch, 26backport
Warn against importing 'exceptions' 03/17/08
http://bugs.python.org/issue2350 created brett.cannon
26backport
Using __(get|set|del)slice__ needs a Py3K warning 03/17/08
http://bugs.python.org/issue2351 created brett.cannon
26backport
Use of __oct__/__hex__ should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2352 created brett.cannon
26backport
Use of file.xreadlines() should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2353 created brett.cannon
patch, 26backport
cmp argument to list.sort()/sorted() should raise a Py3K warning 03/19/08
http://bugs.python.org/issue2354 reopened rhettinger
patch, 26backport
Using buffer() should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2355 created brett.cannon
patch, 26backport
sys.exitfunc should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2356 created brett.cannon
26backport
sys.exc_{type,values,traceback} should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2357 created brett.cannon
patch, 26backport
Using sys.exc_clear should raise a Py3K warning 03/17/08
http://bugs.python.org/issue2358 created brett.cannon
patch, 26backport
A Py3K warning for array.array.{read,write} is needed 03/17/08
http://bugs.python.org/issue2359 created brett.cannon
patch, 26backport
Fixer for itertools.imap() -> map() 03/17/08
CLOSED http://bugs.python.org/issue2360 created brett.cannon
26backport
Fixer for itertools.ifilter() -> filter() 03/17/08
CLOSED http://bugs.python.org/issue2361 created brett.cannon
26backport
Fixer for itertools.izip() -> zip() 03/17/08
CLOSED http://bugs.python.org/issue2362 created brett.cannon
26backport
Fixer for itertools.ifilterfalse() -> itertools.filterfalse() 03/17/08
CLOSED http://bugs.python.org/issue2363 created brett.cannon
26backport
Patch to make 2to3 testing easier 03/17/08
CLOSED http://bugs.python.org/issue2364 created David Wolever
patch
Fixer for filter(None, ...) -> filter(bool, ...) 03/17/08
CLOSED http://bugs.python.org/issue2365 created brett.cannon
26backport
Fixer for new metaclass syntax is needed 03/17/08
http://bugs.python.org/issue2366 created brett.cannon
patch, 26backport
Fixer to handle new places where parentheses are needed 03/17/08
http://bugs.python.org/issue2367 created brett.cannon
patch, 26backport
Fixer needed to change __builtin__ -> builtins 03/17/08
http://bugs.python.org/issue2368 created brett.cannon
26backport
Fixer for new integer literals are needed 03/17/08
http://bugs.python.org/issue2369 created brett.cannon
26backport
operator.{isCallable,sequenceIncludes} needs a fixer 03/17/08
http://bugs.python.org/issue2370 created brett.cannon
patch, 26backport
Patch for catching exceptions that do not inherit from BaseExcep 03/17/08
CLOSED http://bugs.python.org/issue2371 created taicki
patch
Pubkey 03/17/08
CLOSED http://bugs.python.org/issue2372 created David Wolever
Raise Py3K warnings for comparisons that changed 03/17/08
http://bugs.python.org/issue2373 created bethard
patch, 26backport
Use of builtin file should give Py3k warning 03/18/08
CLOSED http://bugs.python.org/issue2374 created benjamin.peterson
patch
PYTHON3PATH environment variable to supersede PYTHONPATH for mul 03/18/08
http://bugs.python.org/issue2375 created glyph
Set up "supported"-only buildbot waterfall view 03/18/08
http://bugs.python.org/issue2376 created exarkun
Replace import.c with a pure Python implementation 03/18/08
http://bugs.python.org/issue2377 created brett.cannon
UnboundLocalError when trying to raise exceptions inside execfil 03/18/08
http://bugs.python.org/issue2378 created jseutter
Raise a Py3K warning for __getitem__ or __getslice__ on exceptio 03/18/08
CLOSED http://bugs.python.org/issue2379 created belopolsky
patch
Raise a Py3K warning for catching nested tuples with non-BaseExc 03/18/08
http://bugs.python.org/issue2380 created belopolsky
patch, easy, 26backport
test_subprocess fails if your sys.executable is on a path with a 03/18/08
http://bugs.python.org/issue2381 created lanny
patch, easy
[Py3k] SyntaxError cursor shifted if multibyte character is in l 03/18/08
http://bugs.python.org/issue2382 created ocean-city
patch
Remove old XXX comment in stat.py 03/18/08
CLOSED http://bugs.python.org/issue2383 created jseutter
patch
[Py3k] line number is wrong after encoding declaration 03/18/08
http://bugs.python.org/issue2384 created ocean-city
run_setup can fail if the setup script uses __file__ 03/18/08
http://bugs.python.org/issue2385 created tarek
patch
os.strerror missing/HAVE_STRERROR not defined 03/18/08
CLOSED http://bugs.python.org/issue2386 created schmir
patch
cStringIO and unicode 03/18/08
CLOSED http://bugs.python.org/issue2387 created vdupras
patch
Compiler warnings when using UCS4 03/18/08
http://bugs.python.org/issue2388 created benjamin.peterson
Array pickling exposes internal memory representation of element 03/18/08
http://bugs.python.org/issue2389 created hniksic
Merge 2.6 ACKS with 3.0 ACKS 03/18/08
http://bugs.python.org/issue2390 created gvanrossum
easy
Sean is testing tracker bug. 03/18/08
CLOSED http://bugs.python.org/issue2392 created jafo
Backport buffer interface in Python 3.0 to Python 2.6 03/18/08
http://bugs.python.org/issue2393 created teoliphant
[Py3k] Finish the memoryview object implementation 03/18/08
http://bugs.python.org/issue2394 created teoliphant
[Py3k] struct module changes of PEP 3118 03/18/08
http://bugs.python.org/issue2395 created teoliphant
Backport memoryview object to Python 2.6 03/18/08
http://bugs.python.org/issue2396 created teoliphant
Backport 3.0 struct module changes to 2.6 03/18/08
http://bugs.python.org/issue2397 created teoliphant
test_errno fails with unexpected error value EREMOTEIO 03/18/08
CLOSED http://bugs.python.org/issue2398 created andybalaam
patch
Patches for Tools/msi 03/18/08
http://bugs.python.org/issue2399 created teoliphant
patch
from .foo import * should work 03/18/08
CLOSED http://bugs.python.org/issue2400 created nnorwitz
Solaris: ctypes tests being skipped despite following #1516 03/18/08
http://bugs.python.org/issue2401 created jafo
get rid of warnings in regrtest with -3 03/18/08
http://bugs.python.org/issue2402 created bethard
Add figleaf coverage metrics 03/18/08
http://bugs.python.org/issue2403 created jseutter
patch, patch
Backport ctypes support for buffer protocol to Python 2.6 (ref i 03/18/08
http://bugs.python.org/issue2404 created teoliphant
Drop w9xpopen and all dependencies 03/18/08
http://bugs.python.org/issue2405 created Trent.Nelson
Improvement suggestions for the gzip module documentation 03/18/08
http://bugs.python.org/issue2406 created madarche
warnings.filterwarnings() not isolated between tests 03/18/08
CLOSED http://bugs.python.org/issue2407 created jseutter
patch, patch
types module can be implemented only in Python 03/18/08
http://bugs.python.org/issue2408 created benjamin.peterson
patch
regrtest should not just skip imports that fail 03/18/08
http://bugs.python.org/issue2409 created nnorwitz
patch
absolute import doesn't work for standard python modules 03/18/08
http://bugs.python.org/issue2410 created dangyogi
test_nis.py fails if NIS is not configured or used 03/18/08
CLOSED http://bugs.python.org/issue2411 created MichaelBishop
patch
Check 2to3 for support of print function. 03/18/08
http://bugs.python.org/issue2412 created eric.smith
os.strerror does not check for out of range argument 03/19/08
http://bugs.python.org/issue2413 created belopolsky
patch
Fix implicit relative imports 03/19/08
CLOSED http://bugs.python.org/issue2414 created loewis
bytes() should respect __bytes__ 03/19/08
http://bugs.python.org/issue2415 created barry
% string formatting does not support %b 03/19/08
http://bugs.python.org/issue2416 created eric.smith
[py3k] Integer floor division (//): small int check omitted 03/19/08
http://bugs.python.org/issue2417 created tjreedy
patch
Incorrect LaTeX generated (Python 2.6a1) 03/19/08
CLOSED http://bugs.python.org/issue2418 created vmanis1
Remove all IRIX dependant modules from aifc module 03/19/08
http://bugs.python.org/issue2419 created MichaelBishop
Faq 4.28 -- Trailing comas 03/19/08
http://bugs.python.org/issue2420 created dubiel
doc\make.bat fails for htmlhelp because of hardcoded filename 03/19/08
http://bugs.python.org/issue2421 created tim.golden
patch
Automatically disable pymalloc when running under valgrind 03/19/08
http://bugs.python.org/issue2422 created jamesh
patch
test_smtplib.py no longer butt slow 03/19/08
http://bugs.python.org/issue2423 created jseutter
patch, patch
Logging module hides user code errors (bare except) 03/19/08
http://bugs.python.org/issue2424 created bradallen
test_py3kwarn doesn't use sys.py3kwarning 03/19/08
CLOSED http://bugs.python.org/issue2425 created jeff.balogh
patch
pysqlite provides no interface for database SQL dump 03/19/08
http://bugs.python.org/issue2426 created kippesp
patch
2to3 should translate itertools.imap into generator expression, 03/19/08
CLOSED http://bugs.python.org/issue2427 created dangyogi
2to3 deletes # comments before "from __future__ import with_stat 03/19/08
CLOSED http://bugs.python.org/issue2428 created dangyogi
Patch for test_urllib2_net moving tests to use a local server 03/19/08
http://bugs.python.org/issue2429 created fuzzyman
patch
Stop test_format.py from executing as side effect of import 03/20/08
http://bugs.python.org/issue2430 created jseutter
patch, patch
2to3 is rather slow 03/20/08
http://bugs.python.org/issue2431 created David Wolever
patch
DictReader does not suport line_num 03/20/08
http://bugs.python.org/issue2432 created ivanoe
Merge audio modules 03/20/08
http://bugs.python.org/issue2433 created MichaelBishop
Improve platform.win32_ver() support for Python installations wi 03/20/08
CLOSED http://bugs.python.org/issue2434 created lemburg
pybench does not run anymore 03/20/08
CLOSED http://bugs.python.org/issue2435 created pitrou
Should __future__ print_function be valid in 3.0? 03/20/08
CLOSED http://bugs.python.org/issue2436 created eric.smith
Distutils runtime_library_dirs broken on Windows 03/20/08
http://bugs.python.org/issue2437 created janssen
subprocess.Popen with wildcard arguments 03/20/08
CLOSED http://bugs.python.org/issue2438 created pbrandt
Patch to add a get_data function to pkgutil 03/20/08
http://bugs.python.org/issue2439 created pmoore
patch
Issues with getargs_n(), PyNumber_Index and PyLong_AsSize_t. 03/20/08
http://bugs.python.org/issue2440 created Trent.Nelson
patch, patch
Mac build_install.py script fetches unavailable SQLite version 03/20/08
http://bugs.python.org/issue2441 created carlosedp
patch
Undocumented features added to 2.6 03/21/08
http://bugs.python.org/issue2442 created akuchling
uninitialized access to va_list 03/21/08
http://bugs.python.org/issue2443 created rolland
Adding __iter__ to class Values of module optparse 03/21/08
http://bugs.python.org/issue2444 created gpolo
patch
Use The CygwinCCompiler Under Cygwin 03/21/08
http://bugs.python.org/issue2445 created dstanek
patch
Issues Now Closed (98)
______________________
zlib.crc32() and adler32() return value 174 days
http://bugs.python.org/issue1202 gregory.p.smith
64bit, easy
doctest EXCEPTION_RE can't handle preceding output 147 days
http://bugs.python.org/issue1312 jafo
patch
XML codec 132 days
http://bugs.python.org/issue1399 jafo
patch
func alloca inside ctypes lib needs #include <alloca.h> on solar 112 days
http://bugs.python.org/issue1506 theller
patch
os.system() fails for commands with multiple quoted file names 112 days
http://bugs.python.org/issue1524 jafo
IDLE installation problems and no message errors 106 days
http://bugs.python.org/issue1544 jafo
Backport PEP 3141 to 2.6 85 days
http://bugs.python.org/issue1689 jyasskin
VC6 build patch for release-maint25 78 days
http://bugs.python.org/issue1720 ocean-city
patch
.pypirc not found on windows 74 days
http://bugs.python.org/issue1741 jafo
easy
ZIP files with archive comments longer than 4k not recognized as 71 days
http://bugs.python.org/issue1746 jafo
OptionMenu class is defined both in Tkinter and Tix 38 days
http://bugs.python.org/issue2059 jafo
pprint._safe_repr() unsafe on ordering differently types objects 36 days
http://bugs.python.org/issue2074 percivall
patch
__import__ with fromlist=[''] causes double initialization of mo 36 days
http://bugs.python.org/issue2090 hauser
Blocking sockets take entirely too long to timeout 31 days
http://bugs.python.org/issue2132 jafo
Pydoc interactive browser misses some docs 32 days
http://bugs.python.org/issue2141 ping
smtplib.SSLFakeFile hangs forever if "\n" is not encountered 29 days
http://bugs.python.org/issue2143 jafo
patch
pydistutils.cfg won't be found on Windows 25 days
http://bugs.python.org/issue2166 jafo
Add map, filter, zip to future_builtins 24 days
http://bugs.python.org/issue2171 David Wolever
code objects should conserve memory 20 days
http://bugs.python.org/issue2185 nnorwitz
patch, patch
[patch] urllib2 hint - disabled ProxyHandler() 24 days
http://bugs.python.org/issue2188 jafo
urllib.quote() throws KeyError when passed an iterator 24 days
http://bugs.python.org/issue2189 jafo
Further simplify dict literal bytecode 22 days
http://bugs.python.org/issue2197 jafo
patch
code_hash() can be the same for different code objects 19 days
http://bugs.python.org/issue2198 jyasskin
ssl module getpeercert returns empty dict when cert_reqs=ssl.CER 20 days
http://bugs.python.org/issue2203 jafo
Problems using logging module with idle 14 days
http://bugs.python.org/issue2216 vsajip
patch
Py30a3: Possibly confusing message when module detection fails 18 days
http://bugs.python.org/issue2219 jafo
Search in 2.6 docs does not work 17 days
http://bugs.python.org/issue2229 jafo
TypeError instead of SyntaxError for syntactically invalid gen e 16 days
http://bugs.python.org/issue2238 jafo
empty specifier for float.__format__ does not always print at le 7 days
http://bugs.python.org/issue2264 eric.smith
[Py30a3] xml.parsers.expat recognizes encoding="utf-8" but not e 5 days
http://bugs.python.org/issue2278 georg.brandl
TextIOWrapper.seekable() always returns False 5 days
http://bugs.python.org/issue2282 ping
patch
Stack overflow exception caused by test_marshal on Windows x64 4 days
http://bugs.python.org/issue2286 Trent.Nelson
64bit
Problems using logging module with logging.basicConfig(level=log 2 days
http://bugs.python.org/issue2287 vsajip
Confusing documentation for urllib.urlopen 0 days
http://bugs.python.org/issue2288 georg.brandl
os.path.normpath over-normalizes 2 days
http://bugs.python.org/issue2289 georg.brandl
[PATCH] Update Lib/distutils/sysconfig.py to handle x64 Windows 4 days
http://bugs.python.org/issue2290 Trent.Nelson
patch
Raise a Py3K warning for catching non-BaseException exceptions 3 days
http://bugs.python.org/issue2291 gvanrossum
Missing case / switch / evaluate 0 days
http://bugs.python.org/issue2293 tiran
Bug in Pickle protocol involving __setstate__ 0 days
http://bugs.python.org/issue2294 georg.brandl
Patch for fatal stack overflow in Windows caused by -v 3 days
http://bugs.python.org/issue2297 Trent.Nelson
patch
Minor typos in newtypes.rst 0 days
http://bugs.python.org/issue2299 georg.brandl
patch
[Py3k] No text shown when SyntaxError (when not UTF8) 1 days
http://bugs.python.org/issue2301 loewis
Decide what to do with bytes/str when transferring pickles betwe 1 days
http://bugs.python.org/issue2307 gvanrossum
Add xturtle to the standard library? 1 days
http://bugs.python.org/issue2309 georg.brandl
correct int / long object type casts 1 days
http://bugs.python.org/issue2313 jyasskin
patch
Test issue 1 days
http://bugs.python.org/issue2314 loewis
abc.py:ABCMeta.__instancecheck__ broken for old style classes 0 days
http://bugs.python.org/issue2319 jyasskin
return more memory from unicode objects to system 1 days
http://bugs.python.org/issue2321 nnorwitz
patch, patch
Make structseq's API look more like a nametuple. 0 days
http://bugs.python.org/issue2323 rhettinger
Document that 2.6 pickles of strings turn into pickles of unicod 0 days
http://bugs.python.org/issue2324 gvanrossum
Doc isnumeric and isdecimal for the unicode object 0 days
http://bugs.python.org/issue2326 bethard
patch
Class **kwds broken (PEP 3115) 0 days
http://bugs.python.org/issue2328 jackdied
ImportError: No module named _bsddb 3 days
http://bugs.python.org/issue2329 gregory.p.smith
Renaming of attributes on functions need to be backported. 0 days
http://bugs.python.org/issue2332 nnorwitz
26backport
Backport intern() -> sys.intern() 0 days
http://bugs.python.org/issue2339 rhettinger
patch, 26backport
Raise a Py3K warning when raise non-BaseException exceptions 0 days
http://bugs.python.org/issue2341 gvanrossum
patch, 26backport
Comparing between disparate types should raise a Py3K warning 1 days
http://bugs.python.org/issue2342 bethard
patch, 26backport
Fixer for itertools.imap() -> map() 0 days
http://bugs.python.org/issue2360 David Wolever
26backport
Fixer for itertools.ifilter() -> filter() 0 days
http://bugs.python.org/issue2361 David Wolever
26backport
Fixer for itertools.izip() -> zip() 0 days
http://bugs.python.org/issue2362 David Wolever
26backport
Fixer for itertools.ifilterfalse() -> itertools.filterfalse() 0 days
http://bugs.python.org/issue2363 David Wolever
26backport
Patch to make 2to3 testing easier 0 days
http://bugs.python.org/issue2364 loewis
patch
Fixer for filter(None, ...) -> filter(bool, ...) 0 days
http://bugs.python.org/issue2365 rhettinger
26backport
Patch for catching exceptions that do not inherit from BaseExcep 0 days
http://bugs.python.org/issue2371 belopolsky
patch
Pubkey 0 days
http://bugs.python.org/issue2372 loewis
Use of builtin file should give Py3k warning 0 days
http://bugs.python.org/issue2374 benjamin.peterson
patch
Raise a Py3K warning for __getitem__ or __getslice__ on exceptio 0 days
http://bugs.python.org/issue2379 gvanrossum
patch
Remove old XXX comment in stat.py 2 days
http://bugs.python.org/issue2383 georg.brandl
patch
os.strerror missing/HAVE_STRERROR not defined 0 days
http://bugs.python.org/issue2386 belopolsky
patch
cStringIO and unicode 0 days
http://bugs.python.org/issue2387 georg.brandl
patch
Sean is testing tracker bug. 0 days
http://bugs.python.org/issue2392 loewis
test_errno fails with unexpected error value EREMOTEIO 0 days
http://bugs.python.org/issue2398 andybalaam
patch
from .foo import * should work 0 days
http://bugs.python.org/issue2400 loewis
warnings.filterwarnings() not isolated between tests 1 days
http://bugs.python.org/issue2407 brett.cannon
patch, patch
test_nis.py fails if NIS is not configured or used 1 days
http://bugs.python.org/issue2411 brett.cannon
patch
Fix implicit relative imports 1 days
http://bugs.python.org/issue2414 David Wolever
Incorrect LaTeX generated (Python 2.6a1) 0 days
http://bugs.python.org/issue2418 vmanis1
test_py3kwarn doesn't use sys.py3kwarning 0 days
http://bugs.python.org/issue2425 brett.cannon
patch
2to3 should translate itertools.imap into generator expression, 0 days
http://bugs.python.org/issue2427 rhettinger
2to3 deletes # comments before "from __future__ import with_stat 0 days
http://bugs.python.org/issue2428 David Wolever
Improve platform.win32_ver() support for Python installations wi 0 days
http://bugs.python.org/issue2434 lemburg
pybench does not run anymore 0 days
http://bugs.python.org/issue2435 amaury.forgeotdarc
Should __future__ print_function be valid in 3.0? 0 days
http://bugs.python.org/issue2436 eric.smith
subprocess.Popen with wildcard arguments 0 days
http://bugs.python.org/issue2438 skip.montanaro
pydoc needs readline completion 2414 days
http://bugs.python.org/issue448736 georg.brandl
long double causes compiler warnings 2205 days
http://bugs.python.org/issue525481 jyasskin
Deprecate PyNumber_Check 1973 days
http://bugs.python.org/issue628842 nascheme
Mach-O gcc optimisation flag can boost performance up to 10% 1774 days
http://bugs.python.org/issue735110 jvr
test_coercion failing on Panther 1700 days
http://bugs.python.org/issue775892 jyasskin
sys.exec_prefix does not work 1529 days
http://bugs.python.org/issue871747 georg.brandl
TclError not a subclass of StandardError 1218 days
http://bugs.python.org/issue1068881 nnorwitz
add server.shutdown() method to SocketServer 1050 days
http://bugs.python.org/issue1193577 jyasskin
patch
Elemental Security contribution - pgen2 package 874 days
http://bugs.python.org/issue1337696 gvanrossum
patch
Python build fails for gcc 4.x from Gnu 730 days
http://bugs.python.org/issue1450807 jyasskin
from __future__ import print_function 432 days
http://bugs.python.org/issue1633807 eric.smith
patch
VC6 build patch for trunk 341 days
http://bugs.python.org/issue1700463 ocean-city
patch
chown broken on 64bit 258 days
http://bugs.python.org/issue1747858 gregory.p.smith
64bit
Make python build with gcc-4.2 on OS X 10.4.9 208 days
http://bugs.python.org/issue1779871 jyasskin
patch
Top Issues Most Discussed (10)
______________________________
16 Py3K warn against assigning to True/False 4 days
open http://bugs.python.org/issue2349
15 tokenize module w/ coding cookie 1806 days
open http://bugs.python.org/issue719888
14 Raise a Py3K warning for catching non-BaseException exceptions 3 days
closed http://bugs.python.org/issue2291
14 improved allocation of PyUnicode objects 55 days
open http://bugs.python.org/issue1943
12 Patch to add a get_data function to pkgutil 1 days
open http://bugs.python.org/issue2439
9 [py3k] Integer floor division (//): small int check omitted 3 days
open http://bugs.python.org/issue2417
8 Raise Py3K warnings for comparisons that changed 4 days
open http://bugs.python.org/issue2373
8 [Py3k] No text shown when SyntaxError (when not UTF8) 1 days
closed http://bugs.python.org/issue2301
8 Missing *-unpacking generalizations 6 days
open http://bugs.python.org/issue2292
8 Add a factorial function 4 days
open http://bugs.python.org/issue2138
1
0

Re: [Python-Dev] [Python-checkins] r45510 - python/trunk/Lib/pkgutil.py python/trunk/Lib/pydoc.py
by M.-A. Lemburg March 21, 2008
by M.-A. Lemburg March 21, 2008
March 21, 2008
Phillip.eby wrote:
> Author: phillip.eby
> Date: Tue Apr 18 02:59:55 2006
> New Revision: 45510
>
> Modified:
> python/trunk/Lib/pkgutil.py
> python/trunk/Lib/pydoc.py
> Log:
> Second phase of refactoring for runpy, pkgutil, pydoc, and setuptools
> to share common PEP 302 support code, as described here:
>
> http://mail.python.org/pipermail/python-dev/2006-April/063724.html
Shouldn't this new module be named "pkglib" to be in line with
the naming scheme used for all the other utility modules, e.g. httplib,
imaplib, poplib, etc. ?
> pydoc now supports PEP 302 importers, by way of utility functions in
> pkgutil, such as 'walk_packages()'. It will properly document
> modules that are in zip files, and is backward compatible to Python
> 2.3 (setuptools installs for Python <2.5 will bundle it so pydoc
> doesn't break when used with eggs.)
Are you saying that the installation of setuptools in Python 2.3
and 2.4 will then overwrite the standard pydoc included with
those versions ?
I think that's the wrong way to go if not made an explicit
option in the installation process or a separate installation
altogether.
I bothered by the fact that installing setuptools actually changes
the standard Python installation by either overriding stdlib modules
or monkey-patching them at setuptools import time.
> What has not changed is that pydoc command line options do not support
> zip paths or other importer paths, and the webserver index does not
> support sys.meta_path. Those are probably okay as limitations.
>
> Tasks remaining: write docs and Misc/NEWS for pkgutil/pydoc changes,
> and update setuptools to use pkgutil wherever possible, then add it
> to the stdlib.
Add setuptools to the stdlib ? I'm still missing the PEP for this
along with the needed discussion touching among other things,
the change of the distutils standard "python setup.py install"
to install an egg instead of a site package.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Apr 18 2006)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
14
51
At 10:08 PM 3/20/2008 +0000, glyph(a)divmod.com wrote (off-list):
>No, but in no situation, except one (where I was extremely pressed
>for time) was I actually attempting to use setuptools to use any of
>its features. My experience of it is: "If a project uses distutils
>or apt, installation probably works. If it uses setuptools, it
>probably throws a traceback or a wall of text explaining why my
>environment is inadequate to perform the installation." Other
>people chose to use it and in so doing broke my setup. Manually
>copying a few files in these cases was a _lot_ easier than
>attempting to diagnose and repair software that I didn't even want to use.
>
>I am not interesting in packaging or distribution. Far from it: I
>run all of my software out of an SVN checkout and I _detest_ being
>involved in discussions of deployment or installation.
...
>However, the general message of the negative subjective experience I
>have had while using setuptools is not FUD. It's an accurate
>portrayal of a great deal of frustration. setuptools has, to this
>date, not solved a single problem for *me*, personally or
>professionally, but it has caused many. distutils, despite its many
>flaws, has actually solved quite a few.
Actually, this information is VERY helpful. It makes it blindingly
obvious to me now that the difference between loving and hating
setuptools is whether you're *intentionally* using it, or whether it
shows up in your ecosystem uninvited. It also makes the difference
in whether you get involved: with no investment in the tool itself,
you have minimal motivation to RTFM, ask questions, or fix bugs. And
when people in this scenario *do* communicate to me or the
distutils-sig, they are much more likely to be impatient and hostile,
and more likely to view the system as "fundamentally broken".
This makes total sense to me now. I don't have any *solutions* to
the problem, mind you, but at least now I understand what before
seemed like some sort of bizarre anomaly where literally thousands of
people use setuptools and many dozens actually express their
happiness with or even love for the system, and then others hate it
like they hate Microsoft, or worse. ;-)
Meanwhile, from the "outsiders" point of view, setuptools looks like
the Matrix or the Borg, happily assimilating the masses, who then
start coming to you and say, "But you'll be so much happier once you
join us..." ...and off in the distance, you hear a quiet rumbling of
zombies chanting "eeeeggs.... eeeeggggs.... mussst havve eggggssss!" :)
Hm. So it seems to me that maybe one thing that would help is a
"Setuptools Haters' Guide To Setuptools" -- that is, *short*
documentation specifically written for people who don't want to use
setuptools and want to minimize its impact on their systems. I could
probably write something like that fairly easily, now that I have
some idea of what to go in it, more than, "the existing documentation
sucks". :)
Can I count on some non-assimilated persons' help in critiquing such
a document and suggesting any topics I miss?
5
4

March 21, 2008
At 10:48 AM 3/19/2008 -0700, Guido van Rossum wrote:
>I don't understand PyPI all that well; it seems poor design that the
>browsing via keywords is emphasized but there is no easy way to
>*search* for a keyword (the list of all packages is not emphasized
>enough on the main page -- it occurs in the side bar but not in the
>main text). I assume there's a programmatic API (XML-RPC?) but I
>haven't found it yet.
http://wiki.python.org/moin/CheeseShopXmlRpc
There's also a REST API that setuptools uses:
http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api
The API was originally designed for screen-scraping an older version
of PyPI, but that has been replaced with a "lite" version served from:
http://pypi.python.org/simple/
The "lite" version is intended for tools such as easy_install to
process, as it consists strictly of links and can be statically
cached. Zope Corp., for example, maintains a static mirror of this
API, to guard themselves against PyPI outages and slowdowns, since
their buildouts can involve huge numbers of eggs, both their own and
external dependencies.
>I'd love it if you could write or point me to code that takes a
>package name and optional version and returns the URL for the source
>archive, and the type (in case it can't be guessed from the filename
>or the Content-type header).
You can probably do that with the XML-RPC API. There's a function to
get the versions of a package, given a (case-sensitive) name, and
there's a function to get information for uploaded archives, given a
name and a version. I originally intended to use it for the PEP 365
approach, but you can get the necessary information in just one
static roundtrip using the REST (/simple) HTML API, if you're willing
to parse the URLs for version information. (The catch of course
being that distutils source distributions don't have unambiguously
parseable filenames.)
>Hm. Why not just use the existing convention for running setup.py
>after unpacking? This works great in my experience, and has the
>advantage of having an easy fallback if you end up having to do this
>manually for whatever reason.
Because I want bootstrap-ees to be able to use the bootstrap
mechanism. For example, I expect at some point that setuptools will
use other, non-self-contained packages, and other package managers
such as zc.buildout et al also want to depend on setuptools without
bundling it.
> > * calling the bootstrap module 'bootstrap', as in 'python -m
> > bootstrap projectname optionalversion'. The module would expose an
> > API to allow it to be used programmatically as well as the command
> > line, so that bootstrapped packages can use the bootstrap process to
> > locate dependencies if they so desire. (Today's package management
> > tools, at least, are all based on setuptools, so if it's not present
> > they'll need to download that before beginning their own
> > bootstrapping process.)
>
>This sounds like going beyond bootstrapping. My vision is that you use
>the bootstrap module (with the command line you suggest above) once to
>install setuptools or the alternate package manager of your choice,
>and then you can use easy_install (or whatever alternative) to install
>the rest.
Well, I noticed that the other package managers were writing
bootstrap scripts that then download setuptools' bootstrap script and
run it as part of *their* bootstrap process... and then I got to
thinking that it sure would be nice for setuptools to not have to be
a giant monolithic download if I wanted to start using other packages
in it... and that it sure would be nice to get rid of all these
bootstrap scripts downloading other bootstrap scripts... and then I
wrote PEP 365. :)
One other thing that PEP 365 does for these use cases that your
approach doesn't, is that pkg_resources could detect whether a
desired package of a usable version was *already* installed, and skip
it if so. So, we've already scaled back the intended use cases quite
a bit, as people will have to write their own "is it already there?"
and "is it the right version?" checks.
> > Without one or the other, the bootstrap tool would have to grow a
> > version parsing scheme of some type, and play guessing games with
> > file extensions. (Which is one reason I limited PEP 365's scope to
> > downloading eggs actually *uploaded* to PyPI, rather than arbitrary
> > packages *linked* from PyPI.)
>
>There are two version parsers in distutils, referenced by PEP 345, the
>PyPI 1.2 metadata standard.
Yes, and StrictVersion doesn't parse release candidates. And neither
LooseVersion nor StrictVersion supports handling multiple
pre/post-release tags correctly. (E.g. "1.1a1dev-r2753")
> > So, if I had to propose something right now, I would be inclined
> to propose:
> >
> > * using setuptools' version parsing semantics for interpretation of
> > alpha/beta/dev/etc. releases
>
>Can you point me to the code for this? What is its advantage over
>distutils.version?
It implements version comparison semantics that are closer to
programmer expectations. It has also been far more widely used and
exposed to more feedback. distutils.version, as far as I know, is
really only used by the PEP 345 metadata standard -- which isn't used
by *any* automated tools as far as I know, and I'm not sure how many
packages bother declaring it.
In addition to alpha/beta/candidate/dev versions, it also supports
post-release (patchlevel) tags such as svn revision or date-based tags.
Here is the code; the docstring is actually longer than the bits that
do anything:
def parse_version(s):
"""Convert a version string to a chronologically-sortable key
This is a rough cross between distutils' StrictVersion and LooseVersion;
if you give it versions that would work with StrictVersion, then
it behaves
the same; otherwise it acts like a slightly-smarter LooseVersion. It is
*possible* to create pathological version coding schemes that will fool
this parser, but they should be very rare in practice.
The returned value will be a tuple of strings. Numeric portions of the
version are padded to 8 digits so they will compare numerically, but
without relying on how numbers compare relative to strings. Dots are
dropped, but dashes are retained. Trailing zeros between alpha segments
or dashes are suppressed, so that e.g. "2.4.0" is considered the same as
"2.4". Alphanumeric parts are lower-cased.
The algorithm assumes that strings like "-" and any alpha string that
alphabetically follows "final" represents a "patch level". So, "2.4-1"
is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is
considered newer than "2.4-1", which in turn is newer than "2.4".
Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that
come before "final" alphabetically) are assumed to be
pre-release versions,
so that the version "2.4" is considered newer than "2.4a1".
Finally, to handle miscellaneous cases, the strings "pre", "preview", and
"rc" are treated as if they were "c", i.e. as though they were release
candidates, and therefore are not as new as a version string that does not
contain them, and "dev" is replaced with an '@' so that it sorts
lower than
than any other pre-release tag.
"""
parts = []
for part in _parse_version_parts(s.lower()):
if part.startswith('*'):
if part<'*final': # remove '-' before a prerelease tag
while parts and parts[-1]=='*final-': parts.pop()
# remove trailing zeros from each series of numeric parts
while parts and parts[-1]=='00000000':
parts.pop()
parts.append(part)
return tuple(parts)
component_re = re.compile(r'(\d+ | [a-z]+ | \.| -)', re.VERBOSE)
replace = {'pre':'c', 'preview':'c','-':'final-','rc':'c','dev':'@'}.get
def _parse_version_parts(s):
for part in component_re.split(s):
part = replace(part,part)
if not part or part=='.':
continue
if part[:1] in '0123456789':
yield part.zfill(8) # pad for numeric comparison
else:
yield '*'+part
yield '*final' # ensure that alpha/beta/candidate are before final
To check a parse_version() value for stability, you can just loop
over it looking for any part <"*foo" where "foo" is the desired
minimum stability. That is, if you find a '*a' and you don't want
alphas, then this version's no good. This lets you also distinguish
between a beta that you might accept, from an in-development snapshot
of a beta, that you wouldn't.
>What's wrong with just running "setup.py install"? I'd rather continue
>existing standards / conventions. Of course, it won't work when
>setup.py requires setuptools;
Actually, it will, if the setup script uses the current ez_setup
bootstrapping method for setuptools.
However, I'd like to get *rid* of that bootstrapping method, and
replace it with this one. That's why I'd prefer that the bootstrap
approach use a different entry point for launching, and why I want
the module to expose an API, and why I don't really want the
bootstrapper to actually "install" anything.
For one thing, it means dealing with installation *options*. Your
prototype doesn't pass through any command-line options to the
script, so people would have to use a ~/.pydistutils.cfg file in
order to control the installation options, for example. (Which then
can break if the packager included a setup.cfg that was supposed to
be overridden on the command line...)
Probably this seems a lot more messy to me, because I've had my face
directly planted in the mess for a number of years now, and I know
that, for example, people bitched and moaned excessively about not
being able to use --prefix with easy_install, the way they could with
'setup.py install'.
And maybe my experiences aren't all relevant here; I'm just not very
good at turning them off. My skepticism for the setup.py-based
approach is at close to "new scheme for removing the GIL" level,
because I've gone through a lot of pain to get easy_install from the
stage where it looked a lot like your bootstrap prototype, to
something that actually works, most of the time, for arbitrary
distutils packages. :)
And unfortunately, some of the hurdles will require a few release
cycles to show up. And hey, if you're okay with that, cool. I just
think that as soon as it gets out in the field, people will use it
far outside anything we expect it to be used for, and if there's not
a bright line for the *packager* to cross, I think we'll have people
unhappy with the tool.
If you have to do a special step to make something bootstrappable,
then when the tool doesn't work, the user will ask the packager to
take the special step. However, if the tool allows the user to
*point* it at any package, and it randomly (from the user's POV)
fails, then the tool (and Python) will be blamed for the failure.
Because even though the bootstrap tool is "not a package manager", if
it's close enough to look like "a simpler easy_install", people will
try to use it as one, and blog about how bootstrap is broken and
should support installation options, etc.
(I suppose at this point easy_install is something of a
counter-example to this worry; people can and do now give packagers
patches to make their setup scripts more compatible with
easy_install, in cases where the package does extensive distutils
modification. OTOH, easy_install is a de facto standard, where
bootstrap will be de jure. What does that mean in practice? Heck if
I know. :) I guess people will hate on you instead of me, then, so
maybe I should view that as an improvement. :) (It also makes it
easier to understand your reluctance to be in any way associated with
eggs, but there's a big difference between eggs and easy_install, and
IMO your approach leans more towards the relative vices of
easy_install than the relative virtues of eggs. But oh well.))
18
27
We can't backport the __prepare__ syntax without requiring metaclass
definition on the 'class' line. Because the __metaclass__ definition
can be at the end of the class in 2.6 we can't find it until after we
execute the class and that is too late to use a custom dictionary.
I wish I had thought of that yesterday,
-Jack
2
1