[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-10-11 Thread Kevin Walzer

Changes by Kevin Walzer :


Added file: http://bugs.python.org/file27539/configDialog.diff

___
Python tracker 

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-10-11 Thread Kevin Walzer

Changes by Kevin Walzer :


Removed file: http://bugs.python.org/file27538/configDialog.diff

___
Python tracker 

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



[issue16205] update :class:`str` references to link to the str type section

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The documentation seems to take a similar approach with dict:

http://docs.python.org/dev/library/stdtypes.html#dict
http://docs.python.org/dev/library/functions.html#func-dict

--

___
Python tracker 

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



[issue13538] Improve doc for str(bytesobject)

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This may have been addressed to some extent by issue 14783:

http://hg.python.org/cpython/rev/3773c98d9da8

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-10-11 Thread Kevin Walzer

Kevin Walzer added the comment:

The attached patch works around the crash for me on Python 2.7.3, Tk-Cocoa  
8.5.12 (tip), on Lion.

--
keywords: +patch
nosy: +wordtech
Added file: http://bugs.python.org/file27538/configDialog.diff

___
Python tracker 

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



[issue16205] update :class:`str` references to link to the str type section

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I'm not sure if Sphinx would allow it, but it would be nice if references to 
the function str() could link to the built-in function documentation, and 
references to the class str could link to the section on the str type.

--

___
Python tracker 

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



[issue16205] update :class:`str` references to link to the str type section

2012-10-11 Thread Chris Jerdonek

New submission from Chris Jerdonek:

3.3 added a dedicated section to the docs for the str type.  However, 
references to :class:`str` still link to the documentation of the built-in 
function str().

This issue is to update references to the str class to point to the new section 
on the str type.

We could use :ref:`str `, but it would be nice to have a solution that 
makes "str" have the code-style font instead of italics.

--
assignee: docs@python
components: Documentation
messages: 172713
nosy: chris.jerdonek, docs@python, ezio.melotti, ncoghlan
priority: normal
severity: normal
status: open
title: update :class:`str` references to link to the str type section
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2

2012-10-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +3.3regression
nosy: +skrah
versions: +Python 3.4

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16199] 2to3 very minor doc change

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Fixed.  Thanks for the report, Mark!

--
resolution:  -> fixed
stage:  -> 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



[issue16199] 2to3 very minor doc change

2012-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7f11e450c31 by Chris Jerdonek in branch '3.2':
Issue #16199: Fix typo in 2to3 docs. Thanks to Mark Lawrence for the report.
http://hg.python.org/cpython/rev/c7f11e450c31

New changeset d83dfa6a381a by Chris Jerdonek in branch '3.3':
Issue #16199: Merge 2to3 typo fix from 3.2.
http://hg.python.org/cpython/rev/d83dfa6a381a

New changeset 880e62fa7770 by Chris Jerdonek in branch 'default':
Issue #16199: Merge 2to3 typo fix from 3.3 (and resolve previous merge).
http://hg.python.org/cpython/rev/880e62fa7770

New changeset c0a2294de787 by Chris Jerdonek in branch '2.7':
Issue #16199: Backport 2to3 typo fix from 3.2.
http://hg.python.org/cpython/rev/c0a2294de787

--
nosy: +python-dev

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2012-10-11 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2

2012-10-11 Thread Daniele Varrazzo

New submission from Daniele Varrazzo:

Definitely related to this change in Python 3.3:

Accessing a memoryview element with format ‘B’ (unsigned bytes) now 
returns an integer (in accordance with the struct module syntax). 
For returning a bytes object the view must be cast to ‘c’ first.

The object returned by PyBuffer_FillInfo is 'B' format: this means that python 
code finds itself dealing in Py 3.3 with a different object respect to what 
returned in Py 3.1 and 3.2. Is this change in the behavior wanted? Wouldn't 
have been better having FillInfo return a 'c' buffer instead?

I'm adding support to Py 3.3 to psycopg2 and the B buffers make the test suite 
fail. I want psycopg to return consistent objects across 3.x. Is the change in 
this commit correct?

https://github.com/dvarrazzo/psycopg/commit/469b6f8aff4cafe203d851b19bedfab0128e795a

Is this a good way to return a 'c' buffer?

--
messages: 172710
nosy: piro
priority: normal
severity: normal
status: open
title: PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 
3.1/3.2
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Robert Bradshaw

Robert Bradshaw added the comment:

Alternatively, one could fix distutils.util.byte_compile() to execute the 
script in safe, empty temp directory.  Running scripts in /tmp remains, as it 
has always been, a bad idea.

Trying to determine if an import is "safe" can be arbitrarily complicated (e.g. 
what if the group-write bit is set, but you're the only member of that group, 
or there are special allow or deny ACLs for other users that aren't detected 
here).  What notion of safeness belongs in the spec?

--
nosy: +robertwb

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

The OPs description is pretty clear. There's no good reason to ask for IPv6 
addresses if IPv6 is disabled. The create_connection will try them all, and if 
connections to IPv4 addresses fail, you'll end up with a TypeError.

--

___
Python tracker 

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



[issue16199] 2to3 very minor doc change

2012-10-11 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
assignee: docs@python -> chris.jerdonek
nosy: +chris.jerdonek

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Why do you think I'm disabling IPv6 because I have a "system level
> problem"?

So please explain the problem you're having.

--

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

Why do you think I'm disabling IPv6 because I have a "system level problem"? I 
am not recompiling python to workaround system level problems. And I don't 
recompile any other program.

The problem is in python, it can be fixed with a one line patch. but you prefer 
to insult me instead of admitting that there is a problem.

--

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Telling me to disable IPv6 in my system configuration is just
> arrogant.

No, it's perfectly reasonable. On the other hand, recompiling Python
without IPv6 to workaround a system-level problem with IPv6 is totally
silly. Do you recompile all other programs which might attempt IPv6
communications?

--

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-11 Thread Tim Peters

Tim Peters added the comment:

Antoine, that's certainly the conceptual intent here.  Can't say whether your 
attempt works in all cases.  The docs don't guarantee it.  For example, if the 
original regexp started with (?x), the docs explicitly say the effect of (?x) 
is undefined "if there are non-whitespace characters before the [inline (?x)] 
flag".

Sure, you could parse the regexp is user code too, and move an initial 
(?...x...) before your non-capturing group.  For that matter, you could write 
your own regexp engine in user code too ;-)

The point is that it should be easy for the regexp engine to implement the 
desired functionality - and user attempts to "fake it" have pitfalls (even 
Guido didn't get it right - LOL ;-) ).

--

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

The fact is I have disabled IPv6 with python's --disable-ipv6 switch. If you 
think that this switch shouldn't be supported anymore, either remove it or 
document it as obsolete. 

Telling me to disable IPv6 in my system configuration is just arrogant. I may 
not be able to do so and I might have had good reasons to disable IPv6 support 
in python. It might even be the case that IPv6 support is working on my 
machine. So, that's a bad argument.

And the fact that I may be able to disable IPv6, won't change the value of 
socket.has_ipv6 magically for me.

--

___
Python tracker 

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



[issue16198] IDLE - tabbing in a string always brings up file completion window

2012-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On windows, one tab brings up the box and in 3.2.3 and 2.7.3 also. Perhaps they 
should be revised also.

The difference is that in those latter two,  dismisses the box whereas 
in 3.3.0, it does not, making it even more obnoxious. Two more tabs inserts 
something. Tab within a comment just enters a tab converted to spaces.

I think that maybe tabs within strings should always do the same as within 
comments. Perhaps one way is enough. (I am guessing that other editors use 
 for this, so I can see the desire to use it.) There needs to be a way to 
get tabbing within multiline strings. I did not see 'file completion' in 
Options/Configure/Keys. Is it there under a different name?

I was puzzled by the example path d:/Biblioteca/Técnica/informática/Python from 
#14937 until I retried in 3.2.3. In 3.3.0, a / disables filename completion. I 
reopened this issue.

If one types 'd:\' and there is no d:,  inserts spaces and ^space is 
ignored. I do not like this kind of inconsistency (or magical behavior shift). 
If you ask for file names, better to bring up a blank box, or a one-line box 
[].

--

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would suggest closing as won't fix. The way I understand it, --disable-ipv6 
simply allows building on systems without IPv6 support. It's not meant to 
disable IPv6 requests on an IPv6-compliant system.

If your IPv6 connectivity doesn't work properly, you should disable it in your 
system configuration, not try to recompile Python!

--
nosy: +pitrou
resolution:  -> wont fix
stage: test needed -> committed/rejected

___
Python tracker 

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-11 Thread Santoso Wijaya

Santoso Wijaya added the comment:

Attaching patch to trim leading and trailing whitespaces prior to processing.

Incidentally, this also means:

>>> socket.gethostbyname('')
'0.0.0.0'
>>> socket.gethostbyname(' ')
Traceback (most recent call last):
  File "", line 1, in 
socket.gaierror: [Errno -5] No address associated with hostname


But I'm not sure if we're okay with changing that semantics, so I left it be in 
this patch.

--
keywords: +patch
Added file: http://bugs.python.org/file27537/gethostbyname_whitespace.patch

___
Python tracker 

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This patch (I suspect it is this one) disabled the use of '/' in filenames on 
windows when using filename completion.

'c:\in 3.2.3 and 3.3.0>
(If there is no 'r' prefix, it really should require '\\' to be safe.)

"c:/   ditto for 3.2.3.
In 3.3.0, (and, I presume, 3.2.4 if not changed) tab inserts spaces to next tab 
stop, while ^space is ignored.

Since using '/' is recommended over unsafe '\', this is an undesireable 
regression.

--
resolution: fixed -> 
stage: patch review -> needs patch
status: closed -> open
versions: +Python 3.3, Python 3.4

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Note that this really can't be done in user-level code.

Well, how about:

def fullmatch(regex, input, flags=0):
return re.match("(:?" + regex + ")$", input, flags)

--
nosy: +pitrou

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What will be with non-greedy qualifiers? Should '.*?' full match any string?

>>> re.match('.*?$', 'abc').group()
'abc'
>>> re.match('.*?', 'abc').group()
''

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-11 Thread Tim Peters

Tim Peters added the comment:

+1.  Note that this really can't be done in user-level code.  For example, 
consider matching the pattern

a|ab

against the string

ab

Without being _forced_ to consider the "ab" branch, the regexp will match just 
the "a" branch.  So, e.g., the example code you posted will say "nope, it 
didn't match (the whole thing)".

--
nosy: +tim_one

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-11 Thread Guido van Rossum

New submission from Guido van Rossum:

I've noticed a subtle bug in some of our internal code.  Someone wants to 
ensure that a certain string (e.g. a URL path) matches a certain pattern in its 
entirety.  They use re.match() with a regex ending in $.  Fine.  Now someone 
else comes along and modifies the pattern.  Somehow the $ gets lost, or the 
pattern develops a set of toplevel choices that don't all end in $.  And now 
things that have a valid *prefix* suddenly (and unintentionally) start matching.

I think this is a common enough issue and propose a new API: a fullmatch() 
function and method that work just like the existing match() function and 
method but also check that the whole input string matches.  This can be 
implemented slightly awkwardly as follows in user code:

def fullmatch(regex, input, flags=0):
  m = re.match(regex, input, flags)
  if m is not None and m.end() == len(input):
return m
  return None

(The corresponding method will have to be somewhat more complex because the 
underlying match() method takes optional pos and endpos arguments.)

--
keywords: easy
messages: 172695
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Proposal: add re.fullmatch() method
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16176] platform.platform() identifies Windows 8 as post2008Server

2012-10-11 Thread Brian Curtin

Changes by Brian Curtin :


--
resolution:  -> fixed
stage:  -> 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



[issue16176] platform.platform() identifies Windows 8 as post2008Server

2012-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e3acc945f0cb by Brian Curtin in branch '2.7':
Fix #16176. Properly identify Windows 8 via platform.platform()
http://hg.python.org/cpython/rev/e3acc945f0cb

--

___
Python tracker 

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



[issue16176] platform.platform() identifies Windows 8 as post2008Server

2012-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8245333db1e5 by Brian Curtin in branch '3.2':
Fix #16176. Properly identify Windows 8 via platform.platform()
http://hg.python.org/cpython/rev/8245333db1e5

--
nosy: +python-dev

___
Python tracker 

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



[issue8492] Addition to readline module to get dictionary of keystrokes and commands

2012-10-11 Thread anand jeyahar

anand jeyahar added the comment:

Here's what the original maintainer chet romney had to say about this 
functionality not being a part of readline, and should be implemented by the 
calling application. From Chet Ramey:
--
The answer is that this is very similar to the operate-and-get-next
feature bash adds to the readline interface. I am not inclined to add this to
readline in its current form because it manipulates state managed by
the calling application (rl_startup_hook) and requires that state to be
kept between calls to readline(). It's a feature that should be provided
by the calling application -- it's implementation is not complicated.

--

___
Python tracker 

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-11 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
components: +Extension Modules
nosy: +santa4nt
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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2012-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> You can hybridize them. First just compare chars and if not match then use
> memcmp(). This speed up the case of repeated chars.

Oh, you're patch is simple and it's amazing fast! I compare unicode with
Python 2.7, 3.2, 3.4 and 3.4 patched, and bytes with 2.7. Using your patch,
Python 3.4 is the fastest implemented in most cases.

Common platform:
CPU model: Intel(R) Core(TM) i5 CPU 661 @ 3.33GHz
Bits: int=32, long=32, long long=64, pointer=32
Platform: Linux-3.2.0-31-generic-pae-i686-with-debian-wheezy-sid

Platform of campaign 2.7-bytes:
Python unicode implementation: UTF-16
Python version: 2.7.3+ (2.7:19d37c8d1882+, Oct 9 2012, 14:37:36) [GCC 4.6.3]
CFLAGS: -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes
SCM: hg revision=ad51ed93377c tag=tip branch=default date="2012-10-11 00:11
-0700"
Date: 2012-10-11 14:41:49

Platform of campaign 2.7-unicode:
Python unicode implementation: UTF-16
Python version: 2.7.3+ (2.7:19d37c8d1882+, Oct 9 2012, 14:37:36) [GCC 4.6.3]
CFLAGS: -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes
SCM: hg revision=ad51ed93377c tag=tip branch=default date="2012-10-11 00:11
-0700"
Date: 2012-10-11 14:42:55

Platform of campaign 3.2-wide:
Python unicode implementation: UCS-4
Python version: 3.2.3+ (3.2:f7615ee43318, Sep 27 2012, 15:00:15) [GCC 4.6.3]
CFLAGS: -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
SCM: hg revision=ad51ed93377c tag=tip branch=default date="2012-10-11 00:11
-0700"
Date: 2012-10-11 14:41:30

Platform of campaign 3.4:
Python unicode implementation: PEP 393
Python version: 3.4.0a0 (default:ad51ed93377c, Oct 11 2012, 14:40:51) [GCC
4.6.3]
CFLAGS: -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
SCM: hg revision=ad51ed93377c tag=tip branch=default date="2012-10-11 00:11
-0700"
Date: 2012-10-11 14:40:52

Platform of campaign 3.4-patch:
Date: 2012-10-11 14:40:25
Python version: 3.4.0a0 (default:ad51ed93377c+, Oct 11 2012, 14:33:04) [GCC
4.6.3]
CFLAGS: -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
SCM: hg revision=ad51ed93377c+ tag=tip branch=default date="2012-10-11
00:11 -0700"
Python unicode implementation: PEP 393

+-+-+-+-+
Tests | 2.7-bytes | 2.7-unicode | 3.2-wide | 3.4 | 3.4-patch
+-+-+-+-+
all | 7.83 ms (+552%) | 2.05 ms (+71%) | 3.45 ms (+188%) | 15 ms (+1152%) |
1.2 ms (*)
replace 50% | 4.14 ms (+135%) | 1.76 ms (*) | 3.17 ms (+81%) | 7.76 ms
(+342%) | 4.18 ms (+138%)
replace 10% | 1.21 ms (*) | 1.52 ms (+26%) | 3.01 ms (+150%) | 2.01 ms
(+67%) | 1.23 ms
replace 1% | 490 us | 1.55 ms (+217%) | 2.94 ms (+501%) | 589 us (+20%) |
489 us (*)
replace 2 chars | 398 us | 1.47 ms (+271%) | 2.89 ms (+632%) | 398 us | 395
us (*)
+-+-+-+-+
Total | 14.1 ms (+88%) | 8.34 ms (+11%) | 15.5 ms (+106%) | 25.8 ms (+244%)
| 7.49 ms (*)
+-+-+-+-+

**

Compare 3.2, 3.4 and 3.4 patched:

+-+-+---
Tests | 3.2-wide | 3.4 | 3.4-patch
+-+-+---
all | 3.45 ms (*) | 15 ms (+335%) | 1.2 ms (-65%)
replace 50% | 3.17 ms (*) | 7.76 ms (+145%) | 4.18 ms (+32%)
replace 10% | 3.01 ms (*) | 2.01 ms (-33%) | 1.23 ms (-59%)
replace 1% | 2.94 ms (*) | 589 us (-80%) | 489 us (-83%)
replace 2 chars | 2.89 ms (*) | 398 us (-86%) | 395 us (-86%)
+-+-+---
Total | 15.5 ms (*) | 25.8 ms (+67%) | 7.49 ms (-52%)
+-+-+---

The patch should be completed to optimize also other Unicode kinds.

--

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, the fact that memoryview + bytes wouldn't return you a memoryview object 
might be a good reason to disallow it. Compare with:

>>> bytearray(b"x") + b"y"
bytearray(b'xy')
>>> b"x" + bytearray(b"y")
b'xy'

--

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

Yes, it would be *possible* to fix it with that alone, but that still makes it 
a pointless 'gotcha' in differing behavior between memoryview and buffer, 
especially given that bytes+memoryview does something semantically different 
than memoryview+bytes for no reason.

--

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Alan WiIliams

Changes by Alan WiIliams :


--
nosy: +Alan.WiIliams

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The case where copies are avoided is documented here

... which would be handled nicely by issue15958.

--

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

Le Oct 11, 2012 à 12:13 PM, Antoine Pitrou  a écrit :

> 
> Antoine Pitrou added the comment:
> 
> I'm not sure what you're talking about since:
> 
 b = buffer("abc")
 b + "xyz"
> 'abcxyz'
 (b + "xyz") is b
> False
> 
> ... doesn't look like it avoid copies to me.

The case where copies are avoided is documented here:



--

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2012-10-11 Thread Jeroen Demeyer

New submission from Jeroen Demeyer:

There is a serious security problem with Python's default sys.path.  If I 
execute

$ python /tmp/somescript.py

then Python will add /tmp as sys.path[0], such that an "import foobar" will 
cause Python to read /tmp/foobar (or variations).  This vulnerability exists in 
particular in distutils.util.byte_compile() with direct=False.  Since the 
Python test suite calls this function, users running the Python test suite are 
vulnerable.

I think the root of this issue should be fixed: Python should not simply add 
stuff to sys.path without checking.  In prepared a patch for CPython-2.7 which 
only adds sys.path[0] if it seems secure to do so, by looking at file/directory 
permissions and ownership.  In particular, it would never add /tmp to sys.path, 
but it would still keep the current behaviour when running a script in a 
directory owned by the current user with 0755 permissions.  See the patch for 
details.

I realize this goes against documented Python behaviour, but I think that a 
broken spec needs to be fixed.  I also think that in most use cases, nothing is 
going to change because normally one doesn't need to import from /tmp.  In any 
case, users can still manipulate sys.path directly.

Feel free to fix this issue in a different way than my patch, but I hope you at 
least implement the spirit of my patch.  The patch has only been tested on 
Linux systems.

Credit goes to Volker Braun for first discovering this issue in Sage, see 
http://trac.sagemath.org/sage_trac/ticket/13579

--
components: Interpreter Core
files: sys_path_security.patch
keywords: patch
messages: 172686
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: sys.path[0] security issues
type: security
versions: Python 2.7
Added file: http://bugs.python.org/file27536/sys_path_security.patch

___
Python tracker 

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



[issue9290] IDLE and Command line present different behavior for sys.stdin

2012-10-11 Thread Roger Serwy

Roger Serwy added the comment:

I tried the patch for 3.3 and it works for me on Linux. It correctly handles 
prior issues like #13532, #15318, #15319, and #7163, as well as providing good 
support for .read, .readline, .readlines. Each of those methods respond 
correctly to Ctrl+C and Ctrl+D.

On Windows 7, with 2.7.3, Ctrl+D is still needed to indicate end-of-file, 
instead of Ctrl+Z. This may or may not be significant, but it is related to 
issue14735.

--
nosy: +serwy

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

yes, mingw. it may have some problems and this is one of them!

--

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-11 Thread Petri Lehtinen

Petri Lehtinen added the comment:

On MinGW? I'm not a Windows user, but IIRC building extensions with gcc on 
MinGW has many problems and isn't officially supported.

--
components: +Windows -None
nosy: +brian.curtin, loewis, tim.golden

___
Python tracker 

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-11 Thread Michele Orrù

New submission from Michele Orrù:

Buggy due to the use of scanf at Modueles/socketmodule.c:868
Broken from python2.7 to tip on my machine (GNU/Linux)

>>> import socket
[64481 refs]
>>> socket.gethostbyname('4294967306.4294967296.4294967296.1')
'10.0.0.1'
[67764 refs]
>>> socket.gethostbyname('192.168.1.1  ')
'192.168.1.1'
[67764 refs]
>>> socket.gethostbyname('  192.168.1.1')
'192.168.1.1'
[67764 refs]
>>> socket.gethostbyname('  192.168.1.1  ')
Traceback (most recent call last):
  File "", line 1, in 
socket.gaierror: [Errno -2] Name or service not known
[67805 refs]

--
components: Library (Lib)
messages: 172682
nosy: maker
priority: normal
severity: normal
status: open
title: socket.gethostbyname incorrectly parses ip
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue16186] shlex bug?

2012-10-11 Thread Roger Serwy

Roger Serwy added the comment:

The .posix = True bug is a separate issue, now in #16200.

--

___
Python tracker 

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



[issue16200] Setting .posix=True for shlex object causes infinite loop in __next__

2012-10-11 Thread Roger Serwy

Roger Serwy added the comment:

Attached is a patch to make the .posix property read-only, along with a test. 
The patch is against 3.4.

--
keywords: +patch
Added file: http://bugs.python.org/file27535/shlex_posix_readonly.patch

___
Python tracker 

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



[issue7735] python creates IPv6 DNS requests even when built with --disable-ipv6

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

they are noticeable! If the sock.connect fails with the IPv4 address,
it will then try to connect to an IPv6 address (which fails with an
TypeError then). The original error is hidden!

--

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm not sure what you're talking about since:

>>> b = buffer("abc")
>>> b + "xyz"
'abcxyz'
>>> (b + "xyz") is b
False

... doesn't look like it avoid copies to me.

--

___
Python tracker 

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



[issue16200] Setting .posix=True for shlex object causes infinite loop in __next__

2012-10-11 Thread Roger Serwy

New submission from Roger Serwy:

The documentation for shlex does not prohibit the user from setting .posix=True 
after creating a shlex object. When doing so, the .eof attribute is 
inconsistent, creating an infinite loop in the __next__ method.

Here's some sample code to recreate the issue:

import shlex
s = shlex.shlex(r"", posix=False)
s.posix = True
list(s)

One possible solution is to make .posix a read-only property. Another is to 
make .posix a property which sets .eof correctly.

--
components: Library (Lib)
messages: 172677
nosy: serwy
priority: normal
severity: normal
status: open
title: Setting .posix=True for shlex object causes infinite loop in __next__
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue15945] memoryview + bytes fails

2012-10-11 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

It's worth noting that the "buffer()" built-in in Python2 had this behavior, 
and it enabled a copy-reduction optimization within Twisted's outgoing 
transport buffer.

There are of course other ways to do this, but it seems like it would be nice 
to restore this handy optimization; it seems like a bug, or at least an 
oversight, that the convenience 'bytes+memoryview' (which cannot provide a 
useful optimization) works, but 'memoryview+bytes' (which would be equally 
helpful from a convenience perspective _could_ provide a reduction in copying) 
doesn't.

Despite the bytes.join optimization (which, don't get me wrong, is also very 
helpful, almost necessary) this remains very useful.

--
nosy: +glyph

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-11 Thread Ralf Schmitt

Ralf Schmitt added the comment:

Sorry, if I haven't been clear enough. This happens on windows when compiling 
extensions with "g++ -std=gnu++0x ..."

--
status: pending -> open

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-11 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Cannot reproduce, and cannot find the define in pyconfig.h. It's in 
PC/pyconfig.h, but shouldn't affect compiling with gcc.

--
nosy: +petri.lehtinen
status: open -> pending

___
Python tracker 

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



[issue16199] 2to3 very minor doc change

2012-10-11 Thread Mark Lawrence

New submission from Mark Lawrence:

http://docs.python.org/library/2to3.html#using-2to3 second paragraph second 
sentence reads "The directories are to recursively traversed for Python 
sources."  The "to" is not needed.

--
assignee: docs@python
components: Documentation
messages: 172673
nosy: BreamoreBoy, docs@python
priority: normal
severity: normal
status: open
title: 2to3 very minor doc change
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16197] Several small errors in winreg documentation

2012-10-11 Thread Zachary Ware

Zachary Ware added the comment:

Here's the patch against 3.2, hopefully I caught everything I meant to :)

Unfortunately, I can't build Python or the docs on this machine, so I can't 
guarantee I didn't break anything.  I tried to be careful though, especially 
with changing linebreaks in the docstrings.

The changes for 3.3+ that don't apply to 3.2 are:
- in PC\winreg.c
  - Change all occurrences of "a WindowsError" to "an OSError"
- in Doc\library\winreg.rst
  - Change "a" to "an" in all occurrences of "a :exc:`OSError`"
  - Consolidate all the ..versionchanged:: 3.3 notes into one at the top (like 
in Doc\library\msvcrt.rst)

Also, I did make a couple of non-cosmetic informational changes other than on 
'res' and 'sam', such as listing the correct default 'access' parameter on a 
couple of functions (judging by my reading of said functions).

Thanks,

Zach

--
Added file: http://bugs.python.org/file27534/winreg_3.2.patch

___
Python tracker 

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



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> FTR there were a few actual errors that I fixed (mostly about bytes vs 
> string).

Great!  Note that for the others, I was just trying to make the files parseable 
rather than passing.  Currently, doctest aborts out on the files I fixed 
without even attempting to run the examples.

> That can be done for 3.4+ only though.

Well, yes and no.  If there is a helper script to check documentation, it could 
be run on any branch regardless of whether the script is in source control.  
For example, I was planning to write such a script (from the regrtest patch I 
put together before) to help me when checking people's patches to code snippets 
in the documentation.

--

___
Python tracker 

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



[issue16198] IDLE - tabbing in a string always brings up file completion window

2012-10-11 Thread Roger Serwy

Roger Serwy added the comment:

Attached is a preliminary patch. It checks to see if the cursor is on a line 
within a multiline string in order to avoid displaying the ACW. As a last 
resort, it checks to make sure that a valid match exists before opening the ACW 
when mode == COMPLETE_FILES.

A test is still needed. See issue15392.

--
keywords: +patch
Added file: http://bugs.python.org/file27533/issue16198_check_matches.patch

___
Python tracker 

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



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

> A way to do it could be to register new doctest directives that skip
> the marked test based on the value of sys.platform.

That can be done for 3.4+ only though.

> If we remove the directives, we lose that information and won't
> be able to do it anymore.

It actually seems quite easy to distinguish them.  At the beginning 'libc' is 
created either using cdll.msvcrt (on windows) or CDLL("libc.so.6") (on Linux).  
There are examples that use windll and other Windows- or Linux-specific 
functions later on but it's usually quite evident.  If we get lost we can 
always dig in the history or just run the tests and see where they fail.

FTR there were a few actual errors that I fixed (mostly about bytes vs string). 
 I also removed unnecessary prints and added a few doctest directives to make 
some of the tests pass.  'from ctypes import *' is used quite frequently, and 
it would be better to change it, but I left it unchanged for now.  I also 
removed an obsolete warning about the doctest directives in the example because 
Sphinx hides them.

--

___
Python tracker 

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



[issue16193] display full e-mail name in hg.python.org annotate pages

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This is the suggested change in the bug report I linked to above (providing we 
are using 2.3 or later):

> If you'd like the latter in hgweb, you can get it by editing '|user' [to 
> '|emailuser'] in the templates.

(from http://bz.selenic.com/show_bug.cgi?id=2276#c7 )

--

___
Python tracker 

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



[issue16193] display full e-mail name in hg.python.org annotate pages

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

I usually don't care about the author, but about the changeset.
The 'name@rev' provides an easy way to distinguish chunks of code that got 
changed in the same commit, and usually gives you enough information to figure 
out who the author is.  Once I identified the interesting chunk I usually click 
on it to see the full diff, commit message, and related issue in the tracker.

--

___
Python tracker 

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



[issue16193] display full e-mail name in hg.python.org annotate pages

2012-10-11 Thread Georg Brandl

Georg Brandl added the comment:

AFAIU, the current behavior would be to shorten "g.bra...@gmx.net" to "g", if I 
used my other email address for committing.  That's a little short and not at 
all illuminating :)

--

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2012-10-11 Thread Santoso Wijaya

Santoso Wijaya added the comment:

OTOH, xml.etree.cElementTree.Element in Python 3.2 and earlier has never been 
pickleable, either.

Python 3.2.3+ (3.2:24499eebbc2f, Oct 10 2012, 13:54:45) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree.cElementTree import Element
>>> repr(Element)
''
>>> import pickle
>>> pickle.dumps(Element('foo'))
Traceback (most recent call last):
  File "", line 1, in 
_pickle.PicklingError: Can't pickle : attribute lookup 
builtins.Element failed

--
components: +Library (Lib)
versions: +Python 3.2

___
Python tracker 

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



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> Either there's another way to run those tests on selected platforms that can 
> be used instead

A way to do it could be to register new doctest directives that skip the marked 
test based on the value of sys.platform.  If we remove the directives, we lose 
that information and won't be able to do it anymore.

--

___
Python tracker 

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



[issue16198] IDLE - tabbing in a string always brings up file completion window

2012-10-11 Thread Roger Serwy

New submission from Roger Serwy:

Pressing  while the cursor is in a string will bring up the file 
completion dialog rather than inserting a tab (or 4 spaces). This behavior is 
rather annoying in a text editor especially when editing multiline doc strings.

This behavior is new to the 3.3 series as a consequence of issue14937. 
Arguably, it is a regression.

The logic for bringing up the file completion window when pressing Tab in a 
string needs to be revised. If the string already contains a partial match, 
then bring up the window when pressing Tab, otherwise insert a Tab character or 
spaces.

Alternatively, the Ctrl+Space key sequence will already bring up the file 
completion dialog, so having an automatic Tab completion behavior is not 
absolutely necessary.

This issue can also be triggered in the shell. Start a string and then press 
tab twice.

--
components: IDLE
keywords: 3.3regression
messages: 172663
nosy: serwy, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE - tabbing in a string always brings up file completion window
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon

Brett Cannon added the comment:

The new functional equivalent is importlib.machinery.ExtensionFileLoader 
(http://docs.python.org/dev/py3k/library/importlib.html#importlib.machinery.ExtensionFileLoader),
 but underneath the hood it uses the same code as imp.load_dynamic() did.

--

___
Python tracker 

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



[issue16197] Several small errors in winreg documentation

2012-10-11 Thread Zachary Ware

Zachary Ware added the comment:

Okie doke.  I'll try to have a patch ready for review later this afternoon.

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-10-11 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Looks good. Thank you.

--

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer

Václav Šmilauer added the comment:

I did not notice it was not documented in python 3.3 anymore -- my fault, sorry.

In case there is no functional replacement for it, I will try to raise it on 
the ML. I am currently writing some code in 2.7 which relies on it (I don't see 
another way of packing multiple compiled modules into one file without using 
symlinks, which won't work under windows; it saves me lots of trouble with 
cross-module symbol dependencies and such, avoids RTLD_GLOBAL, rpath and such 
nasty stuff), and don't want to throw it away with future migration to 3k.

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c3c188a0325a by Vinay Sajip in branch 'default':
Closes #15776: pyvenv now works with existing directories.
http://hg.python.org/cpython/rev/c3c188a0325a

--
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



[issue16197] Several small errors in winreg documentation

2012-10-11 Thread Brian Curtin

Brian Curtin added the comment:

The patch looks alright, but I would remove the lining up of definitions.
It's probably easiest to do a patch against 3.2 and I can handle the porting on 
commit.

--
assignee: docs@python -> brian.curtin
components: +Windows
type:  -> behavior

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer

Václav Šmilauer added the comment:

I found the cause of the behavior (perhaps it is common knowledge, but I am new 
to python source); imp.load_dynamic calls the following functions

 Python/import.c: imp_load_dynamic 
(http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l1777)
 Python/importdl.c: _PyImport_LoadDynamicModule 
(http://hg.python.org/cpython/file/ad51ed93377c/Python/importdl.c#l23)
 Python/import.c: _PyImport_FindExtensionObject 
(http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l525)

where the last one uses the extensions object 
(http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l32), which is 
explained at http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l449

   Magic for extension modules (built-in as well as dynamically
   loaded).  To prevent initializing an extension module more than
   once, we keep a static dictionary 'extensions' keyed by module name
   (for built-in modules) or by filename (for dynamically loaded
   modules), containing these modules. A copy of the module's
   dictionary is stored by calling _PyImport_FixupExtensionObject()
   immediately after the module initialization function succeeds.  A
   copy can be retrieved from there by calling
   _PyImport_FindExtensionObject().



The fact that extensions are keyed by file name explains why opening the .so 
through symlink does not return the old extension object:

 # foo.so
 # bar.so -> foo.so (works for both symlinks and hardlinks)
 imp.load_dynamic("foo","foo.so")
 imp.load_dynamic("bar","bar.so") # will return the bar module

I will investigate whether marking the module as capable of multiple 
initialization could be a workaround for the issue -- since the quoted comment 
further says 
(http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l459):

   Modules which do support multiple initialization set their m_size
   field to a non-negative number (indicating the size of the
   module-specific state). They are still recorded in the extensions
   dictionary, to avoid loading shared libraries twice.

To fix the issue, I suggest that the *extensions* dict is keyed by 
(filename,modulename) tuple for dynamically loaded modules. This would avoid 
any ambiguity. Grepping through the code shows that the *extensions* object is 
only accessed from Python/import.c, therefore regressions should be unlikely. 
What do you think?

--

___
Python tracker 

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



[issue16197] Several small errors in winreg documentation

2012-10-11 Thread Zachary Ware

New submission from Zachary Ware:

There are several small inconsistencies in the winreg module documentation 
(docstrings and winreg.rst).  Mostly these are discrepancies between "res" and 
"reserved", "sam" and "access", and whether or not those two are keyword 
arguments, but there are some other missing pieces as well.

I'm happy to provide a patch to correct everything, but I'd like a little 
guidance beforehand.  I have no experience with docstrings in C code, so I've 
attached a patch that attempts to correct just the CreateKeyEx() docstring.  If 
it turns out to be ok, I'll go ahead and create a patch fixing the other ones.  
I'm comfortable enough with ReST changes that I'll just include those with the 
final docstring patch.

Also, some of the changes are specific to 3.3+ (due to the WindowsError => 
OSError change).  Should I provide one patch against default, two against 3.2 
and 3.3 (including the 3.2 changes), or two against 3.2 and 3.3 (after a local 
commit of the 3.2 changes)?  Any of the above is perfectly doable :)

Thanks,

Zach

--
assignee: docs@python
components: Documentation
files: winreg_example.patch
keywords: patch
messages: 172655
nosy: brian.curtin, docs@python, stutzbach, zach.ware
priority: normal
severity: normal
status: open
title: Several small errors in winreg documentation
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27532/winreg_example.patch

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon

Brett Cannon added the comment:

Before this gets out of control I want to clarify that it is not "quite absurd" 
to label this a documentation bug and that is the proper classification for 
this bug. The documentation was not clear enough for you to understand what the 
behavior would be, so it should be clarified. But the semantics of the function 
are not going to change at this point since Python 2.7 is only accepting bug 
fixes and imp.load_dynamic() is no longer documented as of Python 3.2 and thus 
not strictly considered a public API any longer.

--
components: +Documentation -Library (Lib)

___
Python tracker 

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



[issue15452] Improve the security model for logging listener()

2012-10-11 Thread Vinay Sajip

Changes by Vinay Sajip :


--
keywords: +patch
Added file: http://bugs.python.org/file27531/3d0ca1e82c46.diff

___
Python tracker 

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



[issue15452] Improve the security model for logging listener()

2012-10-11 Thread Vinay Sajip

Changes by Vinay Sajip :


--
hgrepos: +154

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer

Václav Šmilauer added the comment:

While I understand that this behavior went unnoticed for ages and can be seen 
therefore as unimportant, designating this as documentation bug is quite 
absurd; perhaps the following wording would be appropriate:

.. note::

If this function is called multiple times on the same file (in terms of 
inode; symlink pointing to same file is fine), it will return the module which 
was first imported via `load_dynamic` instead of the requested module, without 
reporting any error. The previous call to `load_dynamic` may not be in the same 
part of the code, but it must happen within the same interpreter instance.

--
components: +Library (Lib) -Documentation
nosy: +ncoghlan

___
Python tracker 

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



[issue9720] zipfile writes incorrect local file header for large files in zip64

2012-10-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'd write the extended header when the current file size is larger than the 
zip64 limit (that is, when 'st.st_size > ZIP64_LIMIT' in the write method.

That way the minimal header size is used whenever possible.

As you noted this can cause problems when the file grows beyond the limit while 
it is stored in the zipfile, but IMHO storing data while it is modified is 
asking for problems anyway.

BTW. I haven't actually review the patch yet.

--

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon

Brett Cannon added the comment:

It's actually a documentation bug.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer

Václav Šmilauer added the comment:

No, it is an old bug, since the behavior does something else than documented 
(http://docs.python.org/library/imp.html#imp.load_dynamic) and reasonably 
expected -- imp.load_dynamic("baz","foo.so") imports the "foo" module under 
some circumstances.

--
type: enhancement -> behavior
versions: +Python 2.7 -Python 3.4

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread R. David Murray

R. David Murray added the comment:

This is an enhancement request, then.

--
nosy: +r.david.murray
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue9720] zipfile writes incorrect local file header for large files in zip64

2012-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What the conclusion about the patches? Which variant I should backport for 
older versions?

--
versions: +Python 3.4

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer

Václav Šmilauer added the comment:

I tried with python 2.4.5 and 2.5.2 in chroot (using ubuntu hardy, which 
packaged both of them) and the result is exactly the same for both. I doubt I 
am able to install anything older in a sensible manner.

--
status: pending -> open

___
Python tracker 

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



[issue1634034] Show "expected" token on syntax error

2012-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm attaching a new version of the patch, based on Dave's (from 2.5 years ago). 
This patch is against the 3.4.

Previous patches contained an error in the message formatting. "buf" variable 
out of scope before "msg" used. Appending '\0' to the format string isn't 
guaranteed to NUL-terminate the string. Actually it do nothing (except 
producing a warning).

--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.2
Added file: http://bugs.python.org/file27530/syntax-error-hints-3.4.patch

___
Python tracker 

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



[issue16178] atexit._run_exitfuncs should be a public API

2012-10-11 Thread Philip Mountifield

Changes by Philip Mountifield :


--
nosy: +Philip.Mountifield

___
Python tracker 

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



[issue15650] PEP 3121, 384 refactoring applied to dbm module

2012-10-11 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Robin, after thinking I would to agree with your decision to hold reference to 
type into type instance.

Please, can you describe your check like:

if((void *)type->tp_dealloc == (void *)dbm_dealloc) {
Py_DECREF(type);
}

Why you decref only if type->tp_dealloc points to module's dealloc? What are 
you protected from? What other values also possible?

--

___
Python tracker 

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



[issue16196] Typo in devguide stdlibchanges.html

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed in 291342c08dd6.  Thanks for the report!

--
assignee:  -> ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

The attached patch fixes the doctests in Doc/library/ctypes.rst.

--
stage:  -> patch review
versions: +Python 3.4
Added file: http://bugs.python.org/file27529/issue15939-ctypes.diff

___
Python tracker 

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



[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2012-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think Cython is wrong here. The only thing to do is to call 
PyObject_ClearWeakRefs() in the deallocator. Everything else is handled by the 
interpreter.

Agreed improving the documentation would be good.

--
nosy: +pitrou, scoder
stage:  -> needs patch
type:  -> behavior
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2012-10-11 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue1634774] locale 1251 does not convert to upper case properly

2012-10-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core -Library (Lib)
versions: +Python 2.7 -Python 2.6, Python 3.0

___
Python tracker 

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



[issue1634774] locale 1251 does not convert to upper case properly

2012-10-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Windows

___
Python tracker 

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



[issue16196] Typo in devguide stdlibchanges.html

2012-10-11 Thread Mike Hoy

New submission from Mike Hoy:

Typo in: http://docs.python.org/devguide/stdlibchanges.html#adding-to-the-stdlib

Reads:
This document it meant to explain...

Should read:
This document is meant to explain...

--
components: Devguide
messages: 172640
nosy: ezio.melotti, mikehoy
priority: normal
severity: normal
status: open
title: Typo in devguide stdlibchanges.html

___
Python tracker 

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



[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2012-10-11 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

There appears to be very little, if any, documentation about how to handle the 
list at tp_weaklistoffset for types supporting being weak referenced, 
particularly with respect to garbage collection.

Who owns the list?  Who owns the objects in the list?  Should the list be 
traversed by the extension type's tp_traverse?  Should it ever be INCREF'd or 
DECREF'd?  Does tp_dealloc have any responsibilities with respect to it?

>From looking at CPython's own source, it appears that tp_traverse should not 
>touch it (Yhg1s confirmed this on #python).  Cython, at least, appears to have 
>come to an alternate conclusion though - it generates tp_traverse functions 
>which visit the list (and provoke gc assertions to fail on Python 2.7 in debug 
>mode).

Some documentation about what is correct to do would be excellent, and would 
make it easier to explain to Cython developers what they're doing wrong (or 
confirm that they're doing something right, in which case there are some more 
bugs to file against the CPython stdlib, since they do something different from 
Cython).

--
assignee: docs@python
components: Documentation
messages: 172639
nosy: docs@python, exarkun
priority: normal
severity: normal
status: open
title: Difficult or impossible to figure out how garbage collector and weak 
references should interact for user-defined extension types

___
Python tracker 

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



[issue13440] Explain the "status quo wins a stalemate" principle in the devguide

2012-10-11 Thread Nick Coghlan

Nick Coghlan added the comment:

I'd suggest two things:

Clearly separate "Essential Reading" and "Additional Resources" headings on
the main page.

Add "Tips & Tricks" and "Design Philosophy" sections somewhere.

--

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon

Brett Cannon added the comment:

Did this actually work in a previous version of Python, and if so what version?

--
nosy: +brett.cannon
status: open -> pending

___
Python tracker 

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



[issue16190] Misleading warning in random module docs

2012-10-11 Thread STINNER Victor

STINNER Victor added the comment:

See also the issue #15213 (and the issue #12754).

--

___
Python tracker 

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



[issue8402] glob returns empty list with "[" character in the folder name

2012-10-11 Thread a1abhishek

a1abhishek added the comment:

i m agree with answer number 6. the resolution mentioned is quite easy and very 
effectve

thanks
http://www.packersmoversdirectory.net/

--
nosy: +a1abhishek

___
Python tracker 

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



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

If they don't work I see no reasons to leave them there.
Either there's another way to run those tests on selected platforms that can be 
used instead, of if there's no way the tests should just be skipped.

--

___
Python tracker 

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



  1   2   >