[issue10401] Globals / builtins cache

2010-11-12 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-12 Thread Georg Brandl

Changes by Georg Brandl :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Consider here:
> http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/engine/base.py?rev=6884:b181f1e53603#L1329
> the py3k code uses the "raise ... from" syntax which isn't legal in Python 2. 

In this case, I would write

   error = exc.DBAPIError.instance(statement,
parameters,
e,
connection_invalidated=is_disconnect)
   if sys.version_info < (3,):
   raise error, None, sys.exc_info()[2]
   else:
   error.__cause__ = e
   raise error

You don't *have* to use the from syntax to set the cause.

> Approach B isn't a general solution because it requires you to replace entire 
> functions at a time. 

I don't claim that. However, I claim that there will be always an
appropriate solution using existing techniques, so that such a macro
processing wouldn't be necessary. IOW, I'm not aware of a case where
using such preprocessing would be appropriate and better than what
you can do without.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-11-12 Thread Georg Brandl

Georg Brandl  added the comment:

Same for a4.

--
priority: release blocker -> deferred blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10366] Remove unneeded '(object)' from 3.x class examples

2010-11-12 Thread Xuanji Li

Xuanji Li  added the comment:

Attached a patch to implement the suggested changes on 3.2. If the patch is ok 
I can do the same for 3.1.

--
keywords: +patch
nosy: +xuanji
Added file: 
http://bugs.python.org/file19591/issue10366_remove_unneeded_object_py3.2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Alex

Alex  added the comment:

Just a thought: it's possible to cover all the cases properly with inlining 
(locals, globals (even with cross module inlining), tracebacks, 
sys._getframe(), etc.), however I think you're going to find that manually 
managing all of those is going to quickly drive you up a tree if you want to 
also get meaningful speedups (from removing frame allocation, argument parsing, 
etc.).

My 2¢.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread Brad Greenlee

Brad Greenlee  added the comment:

Yes, but if I actually passed mode=None in, the behavior would be the same, no?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread R. David Murray

R. David Murray  added the comment:

No, the __init__ argument default value is the standard way of indicating "this 
argument was not specified".  It is not in any way a value for 'mode'.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread Brad Greenlee

Brad Greenlee  added the comment:

GzipFile.__init__ considers mode == None to be the equivalent of undefined, and 
sets it to the default of 'rb'. I see fileobj.mode == None as the same thing.

That said, it is probably a bug in Django as well; I'll look into that. I still 
think that GzipFile should handle this gracefully.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10403] Use "member" consistently

2010-11-12 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. :


--
keywords: +easy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10403] Use "member" consistently

2010-11-12 Thread Fred L. Drake, Jr.

New submission from Fred L. Drake, Jr. :

Some portions of the documentation are using the term "member" to mean "data 
attribute".  This appears to be an aberration at this time, but occurrences 
should be identified and corrected, and "Documenting Python" updated to note 
correct usage.

Example use:

http://docs.python.org/dev/py3k/library/xmlrpc.client.html#fault-objects

http://docs.python.org/dev/py3k/library/urllib.request.html#basehandler-objects
(paragraph starting "The following members and methods should")

"Members and methods" should just be "attributes".

--
assignee: d...@python
components: Documentation
messages: 121110
nosy: d...@python, fdrake
priority: normal
severity: normal
status: open
title: Use "member" consistently

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-12 Thread R. David Murray

R. David Murray  added the comment:

This is a duplicate of issue 2571.  If after reading that discussion you have 
ideas about and interest in working on the feature request as suggested, you 
may either comment on that one or open a new feature request, whichever seems 
clearer to you.

Note that the pdb docs direct you the cmd docs, which clearly document the need 
to set use_rawinput, so this is not even a doc bug.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
superseder:  -> cmd.py always uses raw_input, even when another stdin is 
specified

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8332] regrtest single TestClass/test_method

2010-11-12 Thread R. David Murray

R. David Murray  added the comment:

I'm -1 on your second case.  That syntax is too magical, especially since a 
test method can appear on more than one test case.  

The additional pattern matching suggestion is more interesting, but it would be 
necessary to implement that in unittest, since test classes and methods can be 
created on the fly. I suggest opening a new issue against unittest to extend 
pattern matching to test case and test method names if you think that feature 
is valuable enough to add.

I agree with Sandro, I think the valid part of this request is satisfied by the 
unittest CLI.  It is true that more work needs to be done before all Python 
tests can be run successfully in this fashion, since some depend on regrtest 
features.  But making those fixes (moving useful regrtest features to unittest 
and eliminating the non-useful regrtest dependencies) is a better investment of 
resources than adding run-single-test support directly to regrtest, IMO.

If you want to submit a patch for first case, though, feel free to reopen this. 
 I doubt we'd reject it if you want to do the work.

--
nosy: +r.david.murray
resolution: fixed -> works for me
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.2 -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread R. David Murray

R. David Murray  added the comment:

Why do you consider this a bug in GZipFile rather than a bug in Django?  
GZipFile is already careful to consider mode only when it is defined as an 
attribute.  It seems to me that if it is defined, it should be meaningful.

--
nosy: +pitrou, r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> pending
type: crash -> behavior
versions:  -Python 2.5, Python 2.6, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10395] new os.path function to extract common prefix based on path components

2010-11-12 Thread R. David Murray

R. David Murray  added the comment:

Indeed, as I remember it there are people using commonprefix as a string 
function in situations having nothing to do with os paths.

I'm changing the title to reflect the fact that this is really a feature 
request for a new function.  IMO it is a reasonable feature request.  Finding a 
name for it ought to be an interesting exercise.

I think that this should only be accepted if there is also a windows 
implementation.

--
nosy: +r.david.murray
stage:  -> needs patch
title: os.path.commonprefix broken by design -> new os.path function to extract 
common prefix based on path components
type:  -> feature request

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10401] Globals / builtins cache

2010-11-12 Thread Skip Montanaro

Skip Montanaro  added the comment:

Might such a cache lay the groundwork for more aggressive optimizations
by JITs like Unladen Swallow?

--
nosy: +skip.montanaro

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Bobby Impollonia

Bobby Impollonia  added the comment:

Consider here:
http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/engine/base.py?rev=6884:b181f1e53603#L1329
the py3k code uses the "raise ... from" syntax which isn't legal in Python 2. 
Using either  "Approach A" or "Approach B" would prevent the program from 
working in py2k due to syntax errors.

I agree that the markup hrufu proposed didn't solve that problem either. SQLA's 
trick of having the py3k code commented out is the critical part that they add.

Additionally, the runtime cost prevents Approach A from being general solution 
for libraries like SQLA who have put a lot of work into reducing the number of 
function calls and checks in their critical paths.

Approach B isn't a general solution because it requires you to replace entire 
functions at a time. If you have a 25 line function where only 1 line needs to 
be changed for py3k, you either end up with 24 duplicated lines of code, or you 
have to factor that single line out into its own function, confusing the flow 
of the code and incurring runtime cost.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10387] ConfigParser's getboolean method is broken

2010-11-12 Thread Łukasz Langa

Łukasz Langa  added the comment:

You think wrong. Try it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10387] ConfigParser's getboolean method is broken

2010-11-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Fri, Nov 12, 2010 at 12:35:49AM +, Łukasz Langa wrote:
> This is unfortunately a backwards compatibility concern. Originally
> it wasn't made so that set() converts to string or accepts only
> strings and when the developers realized this mistake, it was too
> late (there were programs using this misfeature). That's one of the

Where would coercing to str() for set methods result in failures or
backward compatibility problems? I think get() methods always return
strings.

--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10377] cProfile incorrectly labels its output

2010-11-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Tue, Nov 09, 2010 at 07:15:57PM +, Jean-Paul Calderone wrote:
> >>> cProfile.run("import time; time.sleep(1)")
>  4 function calls in 1.012 CPU seconds
> 
> It is not the case that the profiled code uses >1 CPU seconds.  It
> spends the entire time sleeping.  The default timer for cProfile is
> a wallclock timer.  The output should reflect this.

So, It should just be 1.012 seconds, instead of 1.012 CPU seconds. Correct?
Or is there any other technically more accurate way to say?

--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10402] sporadic test_bsddb3 failures

2010-11-12 Thread Antoine Pitrou

New submission from Antoine Pitrou :

test_bsddb3 often produces the following failure under the Windows buildbots. 
It could probably be solved by choosing a larger timeout (time.time() on 
Windows is rather imprecise):

test test_bsddb3 failed -- Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\bsddb\test\test_lock.py",
 line 139, in test04_lock_timeout2
self.assertTrue((end_time-start_time) >= 0.0999)
AssertionError: False is not True

--
assignee: jcea
components: Library (Lib), Tests
keywords: buildbot
messages: 121100
nosy: jcea, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: sporadic test_bsddb3 failures
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

> but the very very first thing that has to happen - before any of this
> work is begun - is for the distutils freeze to be lifted, or for 
> someone to come up with a _sensible_ alternative solution.

Tarek's approach looks right to me: mingw32 support in distutils should take 
the form of an external module that subclasses (when possible) or monkeypatches 
(on last resort) the standard distutils behavior.

The current patch makes too many changes in core distutils functions; it cannot 
be accepted in this form.  I'm sure that most of the needed changes can be made 
in a subclass of the present Mingw32CCompiler.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> For example, starting on line 152 we have,
> # Py3K
> #return unicode(self.compile())
> # Py2K
> return unicode(self.compile()).\
> encode('ascii', 'backslashreplace')
> # end Py2K

Ok, I can propose two different spellings of this without any
macro processor:

A. conditionally encode for 2.x

   def __str__(self):
   res = unicode(self.compile())
   if sys.version_info < (3,):
   res = res.encode('ascii', 'backslashreplace')
   return res

B. (if A is deemed to incur too much per-call cost, due to
   the version test)

   if sys.version_info >= (3,):
   def __str__(self):
   return unicode(self.compile())
   else:
   def __str__(self):
   return unicode(self.compile()). \
  encode('ascii', 'backslashreplace')

In addition, I fail to see how the markup hfuru proposed can be
used to express this case. IIUC, he asks for markup that can tell
2to3 to leave a certain piece of code alone, i.e. unmodified. I
fail to see how this would help in this sqlalchemy example.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2010-11-12 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg121090

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2010-11-12 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg121089

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

I understand your frustration, but I can't lift the freeze because any change 
to distutils potentially break third party projects out there. We suffered from 
that in the past and we decided to proceed on a new version and freeze this one.

Having this compiler released on its own project is absolutely possible and 
acceptable and can be done in a way that works with distutils1 and distutils2, 
and I'd happily integrate it to distutils2 today once we manage to review it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Bobby Impollonia

Bobby Impollonia  added the comment:

> Can you please post an example Python module that has this markup you are 
> asking for, so I can show you how to achieve what you want without the markup?

Hi, Martin. Here's a real-world example:
http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/types.py?rev=6884:b181f1e53603

The syntax is:
# Py3K
# 
# Py2K

# end Py2K

For example, starting on line 152 we have,
# Py3K
#return unicode(self.compile())
# Py2K
return unicode(self.compile()).\
encode('ascii', 'backslashreplace')
# end Py2K

When the code is converted with 2to3, the py3k code on line 153 will be 
uncommented and used to replace the py2k code on lines 155-156. Having the py3k 
version commented before conversion resolves the issue that "you must not use 
syntax that is exclusively Python 3 in an if-python3 block".

Here is their modified version of 2to3 to support this syntax:
http://www.sqlalchemy.org/trac/browser/sa2to3.py

Their explanation is:
"This tool monkeypatches a preprocessor onto lib2to3.refactor.RefactoringTool, 
so that conditional sections can replace non-fixable Python 2 code sections for 
the appropriate Python 3 version before 2to3 is run."

--
nosy: +bobbyi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10401] Globals / builtins cache

2010-11-12 Thread Eric Smith

Changes by Eric Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

> I'm trying to read the patch. It contains many interesting things (and 
> others I have no opinon about), but it is very large, and makes it
> difficult to comment or find why some change were made etc.

amaury: unfortunately, the development on adding mingw32 as a platform has been 
ongoing for well over three years, with absolute silence and rejection of its 
existence.  it was only when a fourth person showed interest in it (LRN) that 
it became "accepted" - but that was... only two months ago!

basically, this situation should never have been allowed to get this
far: the very first patch that was created, three nearly four years ago, should 
have been accepted, and then an incremental process could have been taken, 
_and_ the silly situation in which distutils gets frozen during the time when 
people have been completely ignoring this ongoing work would never have 
occurred.

but, that's the situation: the bed has been made, and now developers have to 
lie in it.  sorry to be the one that's pointing this out, but...

anyway.

your idea to split this into a series has merit: personally i much prefer git, 
because of git-format-patch, but i have to say i've never done "patch 
regeneration" based on a "review / change-patch-in-middle-of-series / 
regenerate git-format-patch" cycle.  should be fun! :)

but the very very first thing that has to happen - before any of this work is 
begun - is for the distutils freeze to be lifted, or for someone to come up 
with a _sensible_ alternative solution.

if that cannot be done, then roumen and LRN won't _stop_ working on 
python-mingw32: the end result will be that they just... continue to create a 
single patch file that will just get larger and larger.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10395] os.path.commonprefix broken by design

2010-11-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10384] SyntaxError should contain exact location of the invalid character in identifier

2010-11-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

We don't punish anyone here. We try to avoid breaking distutils because it's 
really easy to get broken and get people upset. (you ask me)

This bug has been opened for years and no one commited it because it's very 
very hard to review. it involves many parts, many people.

I am not sure how we should do this, but here's my proposal for distutils2 at 
least:

- make this new feature a standalone package that patches distutils
- release it for 2.x
- let's add your work in distutils2 as well, so it's back in the stdlib in 3.x

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10385] Mark up "subprocess" as module in its doc

2010-11-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think that using e.g. :mod:`subprocess` in the subprocess page is redundant 
because there's no need to add a link to the page you are already reading. I'm 
also not sure that it looks too nice in the headers (iirc the font is 
different), but I haven't tried to apply the patch and see how it looks.

--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10284] NNTP should accept bytestrings for username and password

2010-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hello Julien,

> That's one of the reasons why AUTHINFO SASL is better than AUTHINFO
> USER.  It also allows whitespaces (a few news servers do not parse
> well whitespaces in user names or passwords after AUTHINFO USER/PASS
> -- imagine " test" with a leading space).  Solved with SASL.

If you want to contribute SASL auth for NNTP, it might make sense to
have a dedicated module to provide SASL mechanisms (and then let imaplib
reuse that module). Of course, not all mechanisms need to be provided at
the start.

(FWIW, I had written a patch providing generic SASL support for Twisted
years ago: http://twistedmatrix.com/trac/ticket/2015 )

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10351] Add autocompletion for keys in dictionaries

2010-11-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

erik, i'm really sorry, but the freeze on distutils simply cannot be accepted: 
there really is no other way, as you can see from the previous walkthrough 
analysis, and is reinforced by the further analysis below.

simply put: if the freeze on distutils is not lifted, then this entire set of 
work, which has been going on for years and _precedes_ the distutils freeze by 
at least 18 months, is completely, utterly and totally wasted.

let's walk through the situation where distutils2 is forced to be used.

what you're asking for is, basically, that every single third party package, of 
which there must be tens of thousands, must be patched for compilation on 
mingw32... _just_ so that it says "if sys.platform == 'mingw32': from 
distutils2.core import setup else: from distutils.core import setup", is that 
correct?

does that strike you as being completely and utterly unreasonable an 
expectation, to ask third parties to modify setup.py scripts which have worked 
perfectly well for years, many of which are likely to no longer even have a 
maintainer?

that leaves patching - which should be nothing more than _adding_ to - not 
"changing existing compilers" - ADDING an extra compiler - distutils as the 
only option.

now, that can be done monkey-patch style (i.e. at runtime, by adding in code 
very early on in python startup, or perhaps by patching the import system to 
replace the word "distutils" with "distutilsmingw32") or it can be done... by 
lifting the distutils freeze.

perhaps i should ask: what _exactly_ is the problem, and why do several teams 
complete and utter failure to do the correct thing by making changes to 
_existing_ compile platforms have anything to do with _this_ team's patches 
which add a new totally separate platform that has absolutely nothing to do 
with any of the other platforms?

i could say more, but i believe the point is clear: none of the people involved 
in seeing mingw32 added as a platform had _anything_ to do with the past 
failures, so why "punish" and mis-trust the python-mingw32 for other peoples' 
failures?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2010-11-12 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

NUTS.  many apologies: my comments should have gone to issue 3871 not 3781.  
arse!  is it possible to delete comments? :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2010-11-12 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

erik, i'm really sorry, but the freeze on distutils simply cannot be accepted: 
there really is no other way, as you can see from the previous walkthrough 
analysis, and is reinforced by the further analysis below.

simply put: if the freeze on distutils is not lifted, then this entire set of 
work, which has been going on for years and _precedes_ the distutils freeze by 
at least 18 months, is completely, utterly and totally wasted.

let's walk through the situation where distutils2 is forced to be used.

what you're asking for is, basically, that every single third party package, of 
which there must be tens of thousands, must be patched for compilation on 
mingw32... _just_ so that it says "if sys.platform == 'mingw32': from 
distutils2.core import setup else: from distutils.core import setup", is that 
correct?

does that strike you as being completely and utterly unreasonable an 
expectation, to ask third parties to modify setup.py scripts which have worked 
perfectly well for years, many of which are likely to no longer even have a 
maintainer?

that leaves patching - which should be nothing more than _adding_ to - not 
"changing existing compilers" - ADDING an extra compiler - distutils as the 
only option.

now, that can be done monkey-patch style (i.e. at runtime, by adding in code 
very early on in python startup, or perhaps by patching the import system to 
replace the word "distutils" with "distutilsmingw32") or it can be done... by 
lifting the distutils freeze.

perhaps i should ask: what _exactly_ is the problem, and why do several teams 
complete and utter failure to do the correct thing by making changes to 
_existing_ compile platforms have anything to do with _this_ team's patches 
which add a new totally separate platform that has absolutely nothing to do 
with any of the other platforms?

i could say more, but i believe the point is clear: none of the people involved 
in seeing mingw32 added as a platform had _anything_ to do with the past 
failures, so why "punish" and mis-trust the python-mingw32 for other peoples' 
failures?

--
nosy: +lkcl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10284] NNTP should accept bytestrings for username and password

2010-11-12 Thread Julien ÉLIE

Julien ÉLIE  added the comment:

RFC 4616 about SASL PLAIN:

   The mechanism consists of a single message, a string of [UTF-8]
   encoded [Unicode] characters, from the client to the server.  The
   client presents the authorization identity (identity to act as),
   followed by a NUL (U+) character, followed by the authentication
   identity (identity whose password will be used), followed by a NUL
   (U+) character, followed by the clear-text password.  As with
   other SASL mechanisms, the client does not provide an authorization
   identity when it wishes the server to derive an identity from the
   credentials and use that as the authorization identity.
[...]
   The authorization identity (authzid), authentication identity
   (authcid), password (passwd), and NUL character deliminators SHALL be
   transferred as [UTF-8] encoded strings of [Unicode] characters.


That's one of the reasons why AUTHINFO SASL is better than AUTHINFO USER.  It 
also allows whitespaces (a few news servers do not parse well whitespaces in 
user names or passwords after AUTHINFO USER/PASS -- imagine " test" with a 
leading space).  Solved with SASL.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Éric Araujo

Éric Araujo  added the comment:

Let’s try again.  The current situation is that building with mingw32 is not 
supported.  Adding support for mingw32 is by definition a new feature.  You 
seem to agree on that: “a NEW compiler and linker type - an ADDITIONAL compiler 
and linker type”.

Second, distutils is frozen.  That’s the policy decided by Tarek, who’s spent 
literal months working on PEPs to move the situation forward.  It’s just not 
possible to fix things in distutils, so it’s frozen and new work happens in 
distutils2, at the suggestion of Python creator Guido van Rossum.  Please 
accept the feature freeze.

In conclusion, such pervasive changes will not happen in distutils.

--
assignee:  -> tarek
components: +Distutils2
versions: +3rd party, Python 3.3 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I'm trying to read the patch. It contains many interesting things (and others I 
have no opinon about), but it is very large, and makes it difficult to comment 
or find why some change were made etc.

I do believe that better supporting the mingw32 platform is a worthy goal, but 
a single large patch, even after review, is something difficult to trust.

I suggest to present this work in another form. Maybe something like a 
Mercurial Patch Queue?  This would give us a collection of smaller patches, 
each with its own interest.  Each one can be discussed, modified, reviewed 
separately and by different people. Large easy tasks (like a massive rename) 
are distinct from small-but-hard changes. And when something is updated, the 
reviewers don't have to parse the whole file again; they just look at the 
recent patches.

As an example: among the many changes, you had to handle the Modules/getpath.c 
vs. PC/getpathp.c inconsistency.  You chose to have both filenames in the 
Makefile, but in my opinion it would be better to try to merge the files.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10252] Fix resource warnings in distutils

2010-11-12 Thread Éric Araujo

Éric Araujo  added the comment:

No file object was created for stdin, so my patch was buggy.  Fixed in r86438, 
r86439, r86440.  Thanks to Antoine and Brian.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10373] Setup Script example incorrect

2010-11-12 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution: rejected -> invalid
stage:  -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10373] Setup Script example incorrect

2010-11-12 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr.  added the comment:

> perhaps the web page should be checked for an incorrect link.

The link from the Python documentation to the Python bug tracker is fine.

If you were using distutils directly, it would be an issue for the Python 
tracker.

You're not.  setuptools is a separate project; you should refer to it's 
documentation and it's tracker.

--
nosy: +fdrake
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10373] Setup Script example incorrect

2010-11-12 Thread Kirk Clendinning

Kirk Clendinning  added the comment:

Interesting... the link at the bottom of the page for reporting bugs went to 
the python bug tracker.. perhaps the web page should be checked for an 
incorrect link.

-k-

On Nov 12, 2010, at 18:22 , Éric Araujo wrote:

> 
> Éric Araujo  added the comment:
> 
> Thanks for the report.  Setuptools is not a part of Python, and distutils 
> docs don’t mention issues specific to third-party tools.  I think I will 
> reject this bug.
> 
> --
> assignee: d...@python -> eric.araujo
> nosy: +eric.araujo
> status: open -> pending
> 
> ___
> Python tracker 
> 
> ___

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Globals cache patch posted on issue10401.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10401] Globals / builtins cache

2010-11-12 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Here is the Nth patch for a globals/builtins cache. As other caches at the same 
kind, it shows very small to no gain on non-micro benchmarks, showing that 
contrary to popular belief, globals/builtins lookup are not a major roadblock 
in today's Python performance.

However, this patch could be useful in combination with other optimizations 
such as issue10399.  Indeed, using the globals/builtins version id, it is easy 
and very cheap to detect whether the function pointed to by a global name has 
changed or not.

As for micro-benchmarks, they show that there is indeed a good improvement on 
builtins lookups:

$ ./python -m timeit 
"x=len;x=len;x=len;x=len;x=len;x=len;x=len;x=len;x=len;x=len;"
-> without patch:
100 loops, best of 3: 0.282 usec per loop
-> with patch:
1000 loops, best of 3: 0.183 usec per loop

--
components: Interpreter Core
files: globcache5.patch
keywords: patch
messages: 121081
nosy: alex, belopolsky, benjamin.peterson, dmalcolm, jhylton, nnorwitz, pitrou, 
rhettinger, sdahlbac, thomas.lee, titanstar
priority: low
severity: normal
stage: patch review
status: open
title: Globals / builtins cache
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file19590/globcache5.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2657] Curses sometimes fails to initialize terminal

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

That should be, for 2.7 or 3.2, as 3.1 is nearly finished.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2986] difflib.SequenceMatcher not matching long sequences

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

r86437 - correct and replicate version-added message

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Roumen Petrov

Roumen Petrov  added the comment:

And the patch for py3k (future 3.2) . Note require 
python-py3k-20101112-CROSS.patch from issue 3754 to be applied first.

--
Added file: http://bugs.python.org/file19589/python-py3k-20101112-MINGW.patch

___
Python tracker 
<http://bugs.python.org/issue3871>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1665333] Documentation missing for OptionGroup class in optparse

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1483] xml.sax.saxutils.prepare_input_source ignores character stream in InputSource

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3754] cross-compilation support for python build

2010-11-12 Thread Roumen Petrov

Changes by Roumen Petrov :


Added file: http://bugs.python.org/file19588/python-py3k-20101112-CROSS.patch

___
Python tracker 
<http://bugs.python.org/issue3754>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1028088] Cookies without values are silently ignored (by design?)

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2124] xml.sax and xml.dom fetch DTDs by default

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Roumen Petrov

Changes by Roumen Petrov :


Added file: http://bugs.python.org/file19587/python-2.7-20101112-MINGW.patch

___
Python tracker 
<http://bugs.python.org/issue3871>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3754] cross-compilation support for python build

2010-11-12 Thread Roumen Petrov

Changes by Roumen Petrov :


Added file: http://bugs.python.org/file19586/python-2.7-20101112-CROSS.patch

___
Python tracker 
<http://bugs.python.org/issue3754>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10400] updating unicodedata to Unicode 6

2010-11-12 Thread Vlastimil Brom

Vlastimil Brom  added the comment:

Thanks for the clarification;
I obviously looked in an inappropriate branch before.
Sorry for the noise...
vbr

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

As I understand it, functions are "name-resolved" before the arguments are 
evaluated,

There is no difference between resolution of function names and of other names. 
For example, global names (LOAD_GLOBAL) are resolved entirely at runtime (just 
before the function gets called).

The specialization issue means this would cooperate well with a globals cache 
(I've got a lingering patch for this, will post in a separate issue).

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1488934] file.write + closed pipe = no error

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1599254] mailbox: other programs' messages can vanish without trace

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1751519] curses - new window methods: addchstr and addchnstr

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1671676] test_mailbox is hanging while doing gmake test on HP-UX v3

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1745108] 2.5.1 curses panel segfault in new_panel on aix 5.3

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1512163] mailbox (2.5b1): locking doesn't work (esp. on FreeBSD)

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1723038] Curses Menu

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9557] test_mailbox failure under a Windows VM

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4254] _cursesmodule.c callable update_lines_cols()

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1687125] cannot catch KeyboardInterrupt when using curses getkey()

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3786] _curses, _curses_panel & _multiprocessing can't be build in 2.6b3 w/ SunStudio 12

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2657] Curses sometimes fails to initialize terminal

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2209] mailbox module doesn't support compressed mbox

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2212] Cookie.BaseCookie has ambiguous unicode handling

2010-11-12 Thread A.M. Kuchling

Changes by A.M. Kuchling :


--
assignee: akuchling -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1376292] Write user's version of the reference guide

2010-11-12 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Not likely to be worked on, and whether to write such a guide is a question for 
the docs editor (or the Doc-SIG).

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10397] Unified Benchmark Suite fails on py3k with --track-memory

2010-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Please note that some benchmarks are now natively py3k-compatible, you don't 
have to run make_perf3.sh.
Anyway, the patch is now pushed to 
http://hg.python.org/benchmarks/rev/7c7dc1c4d8d4, thank you!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2010-11-12 Thread William Barr

William Barr  added the comment:

Ok.  I'll see if I can get some protection around that then.  

I did test the issue with 2.7, and I didn't find it.  The window didn't open, 
but it didn't generate an exception that would kill the IDLE process.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10252] Fix resource warnings in distutils

2010-11-12 Thread Éric Araujo

Éric Araujo  added the comment:

Ported to 3.1 and 2.7 in r86433 and r86434.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10400] updating unicodedata to Unicode 6

2010-11-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The database had been updated already in r85371. Backporting this change to 
maintenance branches is not allowed by policy.

--
nosy: +loewis
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10400] updating unicodedata to Unicode 6

2010-11-12 Thread Vlastimil Brom

New submission from Vlastimil Brom :

I'd like to suggest updating the unicodedata module according to the recent 
Unicode standard 6.0
http://www.unicode.org/versions/Unicode6.0.0/
I'm sorry to bother, in case this is planned automatically, I just wasn't able 
to find the respective information.
Would it be possible to apply such update also for the upcomming python 2.7.1, 
or are there some showstoppers/incompatibilities... with regard to the new 
unicode version?
  regards,
  vbr

--
components: Unicode
messages: 121070
nosy: vbr
priority: normal
severity: normal
status: open
title: updating unicodedata to Unicode 6
type: feature request
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10385] Mark up "subprocess" as module in its doc

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

>http://docs.python.org/dev/contents.html
The only thing I see there is the bold-facing of *PEP 3101*.
Is that what you are referring to?

In any case, with Georg's concurrence go ahead with this and any other modules 
you care about.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Dave Malcolm

Changes by Dave Malcolm :


Added file: http://bugs.python.org/file19585/after.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Dave Malcolm

Changes by Dave Malcolm :


Added file: http://bugs.python.org/file19584/before.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10399] AST Optimization: inlining of function calls

2010-11-12 Thread Dave Malcolm

New submission from Dave Malcolm :

In msg#120541 of issue#1346238 Raymond suggested to "aim high", so here goes...

I'm opening this as a separate bug as it's a very different approach to the 
patches in that bug; adding those on the nosy list for that bug.  Sorry in 
advance about the epic length of this comment.

I've been experimenting with AST optimizations, and have a (very) primitive 
implementation of function-call inlining.  As is, it's deeply flawed, but in a 
spirit of "Release Early, Release Often" I though I'd post what I have so far, 
and try to enumerate the rest of the work that would need doing to get this 
into, say Python 3.3

The attached patch adds an AST optimization pass to Python/compiler.c.  It does 
this by adding an __optimizer__.py module: the compiler converts the AST to a 
Python representation using ast2mod, and calls out to 
__optimizer__.optimize_ast().  This can then (potentially) apply a series of 
manipulations to the tree.  The result is then converted back from python to 
ast objects, and compilation proceeds as normal on the modified AST tree.

I initially was experimenting with a .c implementation, but moving to .py makes 
things _much_ easier to develop and debug.  In particular, I'm using graphviz's 
"dot" tool to generate before/after visualizations of the AST.

The optimizer doesn't try to optimize itself (or anything that it imports), to 
avoid infinite recursion when we have a cold .pyo cache.

Currently I'm doing the AST optimization before symbol table generation.  This 
means that the inlining is deeply flawed, as it has no knowledge of the scope 
of names.  A robust implementation would compare the scopes of the callsite and 
that of the function body, and remap locals accordingly.  The current 
implementation renames all name references in the function body, which is 
clearly wrong for e.g. references to globals.  See below for notes on that.

Here's my test code::
def function_to_be_inlined(x, y, z):
return (2 * x * y) + z
print(function_to_be_inlined(3, 4, 5))

Here's what it compiles to after going through the inliner (clearly, line 
numbering needs some work).  Note the removal of the CALL_FUNCTION of our 
target call site; the remaining CALL_FUNCTION is to "print":
  2   0 LOAD_CONST   0 (", line 2>) 
  3 MAKE_FUNCTION0 
  6 STORE_NAME   0 (function_to_be_inlined) 

  4   9 LOAD_CONST   1 (3) 
 12 STORE_NAME   1 (__inline1f22840__x) 
 15 LOAD_CONST   2 (4) 
 18 STORE_NAME   2 (__inline1f22840__y) 
 21 LOAD_CONST   3 (5) 
 24 STORE_NAME   3 (__inline1f22840__z) 

259  27 LOAD_CONST   4 (2) 
 30 LOAD_NAME1 (__inline1f22840__x) 
 33 BINARY_MULTIPLY  
 34 LOAD_NAME2 (__inline1f22840__y) 
 37 BINARY_MULTIPLY  
 38 LOAD_NAME3 (__inline1f22840__z) 
 41 BINARY_ADD   
 42 STORE_NAME   4 (__inline1f22840returnval__) 

260  45 LOAD_NAME5 (print) 
 48 LOAD_NAME4 (__inline1f22840returnval__) 
 51 CALL_FUNCTION1 
 54 POP_TOP  
 55 LOAD_CONST   5 (None) 
 58 RETURN_VALUE 

The idea is that a further optimization pass would go through and ellide the 
unnecessary store-to-local/load-from-local instructions, followed by const 
folding, getting this down to:
   LOAD_CONST ()
   MAKE_FUNCTION
   STORE_NAME (function_to_be_inlined)
; inlined callsite:
   LOAD_NAME  (print)
   LOAD_CONST (29)
   CALL_FUNCTION 1


The biggest issue here is dealing with runtime differences between which 
function was inlined, and which function is being called, either via 
monkeypatching, or in method calls - we can inline intra-method calls within 
one class, but we have to cope with overriding of those methods in subclasses.

Thinking aloud of a way of solving this (this isn't implemented yet):
   add to AST:
 Specialize(expr name,
stmt* specialized,
stmt* generalized)

where you have some interpretation of name (e.g. "self.do_something"), and 
carry two different implementations.

  so that e.g.
  class Something:
 def foo(self, x, y, z):
   ... # some code
   self.bar(x, y, z)
   ... # more code
  the:
 Call(Attribute(Name(id='self'), id='bar'), args=[etc])
  becomes
 Specialize(name=Attribute(Name(id='self'), id='bar'),
specialized=[inlined implementation of Something.bar for 
"self"],
generalized=[Call(Attribute(Name(id='self'), id='bar'), 
args=[etc])])

Similarly, would need a new bytecode, say "JUMP_IF_SPECIALIZABLE"

  LOAD_NAME 

[issue10342] trace module cannot produce coverage reports for zipped modules

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

>Line iterator does not carry the information about source encoding
which may be important for annotating the source code.

I would pass around both encoding and lines, possibly as a tuple.

A person heavily into OO might define a _Source class and turn the private 
functions into methods. But that would not play well with the deprecation 
process until it is done with.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10385] Mark up "subprocess" as module in its doc

2010-11-12 Thread Georg Brandl

Georg Brandl  added the comment:

Eric: any :mod: role never affects the index.  Only the module directive does.

Otherwise, I concur that it's not mandatory to mark up every occurrence of the 
module name, but it's nice in section headings.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10398] errors in docs re module initialization vs self arg to functions

2010-11-12 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, done in r86432.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10398] errors in docs re module initialization vs self arg to functions

2010-11-12 Thread Jani Poikela

New submission from Jani Poikela :

Copy of issue 6421
Affects 2.7 too...

--
assignee: d...@python
components: Documentation
messages: 121064
nosy: Jani.Poikela, aleax, d...@python, georg.brandl
priority: normal
severity: normal
status: open
title: errors in docs re module initialization vs self arg to functions
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10395] os.path.commonprefix broken by design

2010-11-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This goes back to issue400788 and

http://mail.python.org/pipermail/python-dev/2000-July/005897.html
http://mail.python.org/pipermail/python-dev/2000-August/008385.html

Skip changed it to do something meaningful (more than ten years ago), Mark 
Hammond complained that it was backwards incompatible, Tim Peters argued that 
you shouldn't change a function if the documented behavior matches the 
implementation, and Skip reverted the change and added more documentation to 
make the actual behavior more explicit.

It may be useless, but it's certainly not broken. In addition, it's very likely 
that applications of it rely on the very semantics that it has.

In any case, anybody proposing a change should go back and re-read the old 
threads.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10350] errno is read too late

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This stuff is hard to write automated tests for, hence there are none.

The patch is mostly straightforward: capture errno with new variable err at 
point of possible error when intervening calculation is needed before testing 
the value of errno. This seems like a good idea.

There is one relocation of memory freeing and the additions of
+if (res >= 0)
+break;
which I cannot evaluate.

--
nosy: +terry.reedy
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10385] Mark up "subprocess" as module in its doc

2010-11-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Fri, Nov 12, 2010 at 2:09 PM, Terry J. Reedy  wrote:
..
> 1. Does the markup make any visual difference?

It does on my browser.  (I wouldn't have noticed it otherwise.) See
http://docs.python.org/dev/contents.html

> 2. Does the markup affect the index?

I don't think so because module names are already in the index.

This is either holdover or title-case.  In either case it should be
fixed.  Note that in some section titles it is lower case and marked
up properly.

> 'Turtle' also appears in several section headers. That could be interpreted
> as a reference to the class rather than the module.

In "Turtle graphics" it is neither -- just part of the name of the
graphics framework.  When it is a name of the class, as in " Overview
of available Turtle and Screen methods," is should be marked up with
:class: IMO.  In "Tell Turtle’s state", I think "turtle" should be
lower-cased.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10397] Unified Benchmark Suite fails on py3k with --track-memory

2010-11-12 Thread Bobby Impollonia

New submission from Bobby Impollonia :

Steps to reproduce (requires linux because the --track-memory (-m) option to 
perf.py is linux-only):
hg clone http://hg.python.org/benchmarks/ py2benchmarks
mkdir py3benchmarks
cd py3benchmarks
../py2benchmarks/make_perf3.sh ../py2benchmarks
py3k perf.py -f -m -b normal_startup old_py3k new_py3k

With --track-memory, the normal_startup benchmark (which is part of the py3k 
benchmark group) invokes the interpreter under test as:
py3k -c 'for _ in xrange(20): pass'

This fails on py3k due to the use of xrange, which is not caught by 2to3 since 
it appears inside a quoted string (the command line argument).

A patch is attached that resolves the issue by changing the for loop with 
xrange into a while loop.

--
assignee: collinwinter
components: Benchmarks
files: perf.patch
keywords: patch
messages: 121060
nosy: bobbyi, collinwinter, pitrou
priority: normal
severity: normal
status: open
title: Unified Benchmark Suite fails on py3k with --track-memory
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file19582/perf.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10384] SyntaxError should contain exact location of the invalid character in identifier

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I see the marker pointing to the space after '=', which is *really* not 
helpful. If '5' were instead an identifier, one might be really misdirected. So 
best would be "Invalid char '0x' at position n in identifier 'something'"
+1 to any improvement in SyntaxError reports.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I don't understand the example, either. If I run 2to3 on it, I get, as the only 
change

 if sys.version_info[0] < 3: # Python 2
-from urllib   import quote, unquote
-from urlparse import urlparse, urlunparse
-from BaseHTTPServer   import HTTPServer
-from SimpleHTTPServer import SimpleHTTPRequestHandler
+from urllib.parse import quote, unquote
+from urllib.parse import urlparse, urlunparse
+from http.server   import HTTPServer
+from http.server import SimpleHTTPRequestHandler
 def str2data(s, is_nonascii=re.compile("[^\0-\x7F]").search):

As this code is in a Python 2.x block: why does this change cause problems to 
you? You are supposed to run the 2to3 result in Python 3, and this conversion 
result will run correctly in Python 3.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10385] Mark up "subprocess" as module in its doc

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

1. Does the markup make any visual difference?
2. Does the markup affect the index?
3. What do other module docs do?

I notice that 'Tkinter' appears in several section headings. Is it marked? (Is 
the upper case a holdover that should be lowercased?)

'Turtle' also appears in several section headers. That could be interpreted as 
a reference to the class rather than the module.

--
nosy: +georg.brandl, terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10342] trace module cannot produce coverage reports for zipped modules

2010-11-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Fri, Nov 12, 2010 at 12:54 PM, Terry J. Reedy  wrote:
..
>>What is the best way to pass around source code?
>> - file-like objects, line iterators, readline-like function?
>
> Line iterator (list of lines) as returned by open().readlines.
> Memory should not be an issue. Read disk once and close.
>
> with open('file', ...) as f:
>  src = f.readlines()

Line iterator does not carry the information about source encoding
which may be important for annotating the source code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-11-12 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10375] 2to3 print(single argument)

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

>[Copied from Issue10070.]
which is to say (for the benefit of other reviewers):
This was a minor sub-issue mentioned there in passing and independent of the 
main issue and ignored in the extensive discussion thereof.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2010-11-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

That suggests that the last statement needs to be guarded somehow.
I re-versioned to 3.2 because 3.1.final will be out very soon.
I expect 3.2 and 2.7 should have same problem.

--
nosy: +terry.reedy
versions: +Python 3.2 -Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4471] IMAP4 missing support for starttls

2010-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The starttls patch has been committed in r86431. Thank you very much for 
writing the initial patch.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >