[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-23 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Ah ok. I guess tuples.py then indeed demonstrates a saving. I'll apply the 
patch.

--

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-23 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I'm still skeptical that a new exception should be introduced in 2.7.x, or 3.3 
(might this break existing setups?). I suggest to ask the release manager for a 
decision.

But if this is done, then I propose to add the following text to ServerProxy:

versionchanged (2.7.6): Sending strings with characters that are ill-formed in 
XML (e.g. \x00) now raises ValueError.

--

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef037ad304c1 by Raymond Hettinger in branch '2.7':
Issue #18031:  %-formatting isn't dead yet and might pull through.
http://hg.python.org/cpython/rev/ef037ad304c1

--
nosy: +python-dev

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e1d6140b02f0 by Raymond Hettinger in branch '3.3':
Issue #18031:  %-formatting isn't dead yet and might pull through.
http://hg.python.org/cpython/rev/e1d6140b02f0

--

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-23 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Nick Coghlan

New submission from Nick Coghlan:

Another attempt at tackling the but I want to ensure my enum values are 
unique problem that PEP 435 deliberately chose not to handle. My previous 
suggestion (in issue 17959) was rightly rejected due to the other problems it 
caused, but this idea is much cleaner and simpler.

All we would need to do is provide the following class decorator in the enum 
module:

def unique(new_enum):
for name, member in new_enum.__members__.items():
if name != member.name:
msg = Alias {!r} for {!r} not permitted in unique Enum
raise TypeError(msg.format(name, member))
return new_enum

Used as so:

 @enum.unique
... class MyEnum(enum.Enum):
... a = 1
... b = 2
... c = 1
... 
Traceback (most recent call last):
  File stdin, line 2, in module
  File stdin, line 6, in unique
TypeError: Alias 'c' for MyEnum.a: 1 not permitted in unique Enum

--
components: Library (Lib)
messages: 189854
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Provide enum.unique class decorator
type: enhancement
versions: Python 3.4

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
dependencies: +Code, test, and doc review for PEP-0435 Enum
nosy: +eli.bendersky, ethan.furman

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



[issue17986] Alternative async subprocesses (pep 3145)

2013-05-23 Thread Charles-François Natali

Charles-François Natali added the comment:

I'm not familiar with windows, but if I understand the patch
correctly, you can only select from a single subprocess at a time,
which is IMO an important limitation.

Also, the fact that close() can fail with BlockingIOError is really a
pain, and makes writing portable code complicated, but I know you
can't do anything about it ;-)

In short, that would be nice, but Windows seems to make it so
limited/complicated that I'm not sure that would be really useful, but
once again I don't use Windows, so I can't make a call.

--

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 85e8414060b4 by Nick Coghlan in branch '3.3':
Issue 17844: Clarify meaning of different codec tables
http://hg.python.org/cpython/rev/85e8414060b4

New changeset 801567d6302c by Nick Coghlan in branch 'default':
Merge issue 17844 from 3.3
http://hg.python.org/cpython/rev/801567d6302c

--

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for initiating this Serhiy :)

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

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



[issue17839] base64 module should use memoryview

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

We now also need to update the new footnote that I added for issue 17844 in 
http://hg.python.org/cpython/rev/801567d6302c

--

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



[issue18043] No mention of `match.regs` in `re` documentation

2013-05-23 Thread Ram Rachum

New submission from Ram Rachum:

There's no mention of `match.regs` in the documentation of the `re` module.

--
assignee: docs@python
components: Documentation
messages: 189859
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: No mention of `match.regs` in `re` documentation
type: behavior
versions: Python 2.7

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



[issue17839] base64 module should use memoryview

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

The codec uses the old API that breaks the encoded output up into multiple 
lines.

The new patch:

1. Also changes the behaviour of the older de/encodebytes API
2. Checks that all the defined binary transform codecs actually support 
memoryview as input for both encoding and decoding (and that the data 
roundtrips correctly)

--
Added file: 
http://bugs.python.org/file30346/issue17839_base64_buffer_input_3.patch

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



[issue17839] base64 module should use memoryview

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Just adding a note for easier cross-referencing: the old behaviour of these 
functions was one of the culprits that led to the removal of the codec aliases 
as discussed in issue 7475

--

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



[issue18044] Email headers do not properly decode to unicode.

2013-05-23 Thread Tim Rawlinson

New submission from Tim Rawlinson:

In Python 3.3 decoding of headers to unicode is supposed to be automatic but 
fails in several cases, including one shown as successful in the documentation:

msg = message_from_string('Subject: =?utf-8?q?=C3=89ric?=\n\n', 
policy=default)
msg['Subject']
   '=?utf-8?q?=C3=89ric?='

msg = message_from_string('To: =?utf-8?q?=C3=89ric 
f...@example.com\n\n', policy=default)
msg['To']
   '=?utf-8?q?=C3=89ric?= f...@example.com'

Although the following works:

msg = message_from_string('Subject: =?utf-8?q?Eric?=\n\n', 
policy=default)
msg['Subject']
   'Eric'

Though this does not:

msg = message_from_string('To: =?utf-8?q?Eric?= f...@example.com\n\n', 
policy=default)
msg['To']
   '=?utf-8?q?Eric?= f...@example.com'

And just to prove some things are working as they should:

 msg = message_from_string(Subject: 
=?gb2312?b?1eLKx9bQzsSy4srUo6E=?=\n\n, policy=default)
 msg['Subject']
'这是中文测试!'

--
assignee: docs@python
components: Documentation, email
messages: 189862
nosy: Tim.Rawlinson, barry, docs@python, r.david.murray
priority: normal
severity: normal
status: open
title: Email headers do not properly decode to unicode.
type: behavior
versions: Python 3.3

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



[issue18007] CookieJar expects request objects with origin_req_host attribute instead of method

2013-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26ac5b9cffda by Senthil Kumaran in branch '3.3':
Fix #18007 : Document CookieJar.add_cookie_header request parameter changes in 
3.3
http://hg.python.org/cpython/rev/26ac5b9cffda

New changeset f7992397e98d by Senthil Kumaran in branch 'default':
merge from 3.3
http://hg.python.org/cpython/rev/f7992397e98d

--
nosy: +python-dev

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



[issue18007] CookieJar expects request objects with origin_req_host attribute instead of method

2013-05-23 Thread Senthil Kumaran

Senthil Kumaran added the comment:

This change is documented. Thanks for the report.

--
resolution:  - fixed
status: open - closed

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-23 Thread Eli Bendersky

Eli Bendersky added the comment:

How about this patch (not tested it too much - just as a proof of concept).

We're pretty free in the C API exported by pyexpat through a capsule to 
_elementtree, so we can also add a default handler there. This API already has 
some general utilities like ErrorString.

ET can then simply call the handler from pyexpat.

--
Added file: 
http://bugs.python.org/file30347/expat_et_share_unknown_handler.1.patch

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



[issue17454] ld_so_aix not used when linking c++ (scipy)

2013-05-23 Thread Delhallt

Delhallt added the comment:

proposed patch

--
keywords: +patch
nosy: +delhallt
Added file: http://bugs.python.org/file30348/Python-2.7.5-linkso.patch

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



[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3

paul j3 added the comment:

Here's another approach to the problem, using an iterative localized search. 
For simple cases it produces the same thing, but in complex cases it is more 
robust.

It is based on two ideas:

- if the action in consume_optional() is being 'greedy', use

slots = self._match_arguments_partial([action]+positionals, 
selected_patterns)

  to determine if this action can share arguments with any of the remaining 
positionals.  This is similar to how consume_positionals() allocates arguments 
to the set of positionals.

- try this 'sharing' with the last optional.  If that is not enough, try the 
penultimate optional as well, and continue working toward the start as needed.

Since the normal parsing is from left to right, figuring out when to start 
'sharing' requires some sort of search strategy.  I have moved the start_index 
loop into a consume_loop() function, and added a switch so it can parse the 
arguments without invoking take_action() (so arguments are not evaluated, and 
namespace is not changed).

If there is a suspected 'greed' problem, consume_loop() is called (in test 
mode) one or more times to determine the right-most optionals to use, and once 
more (with take_action) to parse and evaluate the arguments.

As in the previous patch this writes a log file for debugging purposes. 
test_argparse.py now has a number of tests for this issue.  

It is more robust than the previous patch, and does not need special handling 
for things like subparsers and explicit arguments.

--
Added file: http://bugs.python.org/file30349/argparse_7.py

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



[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3

Changes by paul j3 ajipa...@gmail.com:


Removed file: http://bugs.python.org/file30349/argparse_7.py

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



[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3

paul j3 added the comment:

Oops, I attached the wrong file.  Here's the correct one.

--
Added file: http://bugs.python.org/file30350/issue9338_7.patch

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



[issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml'

2013-05-23 Thread James Socol

Changes by James Socol me+pyb...@jamessocol.com:


--
nosy: +jamessocol

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



[issue17683] socket.getsockname() inconsistent return type with AF_UNIX

2013-05-23 Thread Charles-François Natali

Charles-François Natali added the comment:

 Shouldn't the surrogateescape error handler (PEP 383) prevent this?

Yes, it shoud (I just read PEP 383, I told you I didn't know anything
about encoding :-).

So basically, for the test failure, the issue is simply that the
platform's default encoding can't encode character '\xff'.

Should I simply remove the offending character from this test address?

Also, let's say I wanted to test that it can be passed and returned
properly, so I add '\0xff' to the adress passed to testBytesName:

s.bind(b\x00python\x00test\xff)

How should I check the string returned by getsockname()?

self.assertEquals(s.getsockname(), ???)

--

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



[issue17222] py_compile.compile() replaces target files, breaking special files and symlinks

2013-05-23 Thread Brett Cannon

Brett Cannon added the comment:

If someone wants to submit a patch to make the change that's fine, but they are 
going to have the same issue when they simply execute an import that 
byte-compiles as a side-effect so you will have to decide if you are only 
worried about py_compile.

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-23 Thread Oscar Benjamin

Oscar Benjamin added the comment:

I have written a function that can be used to determine if the gcc
that distutils will use is from Cygwin or MinGW:

def is_cygwingcc():
'''Try to determine if the gcc that would be used is from cygwin.'''
out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout
try:
out_string = out.read()
finally:
out.close()
# out_string is the target triplet cpu-vendor-os
# Cygwin's gcc sets the os to 'cygwin'
return out_string.strip().endswith('cygwin')

The idea is that 'gcc -dumpmachine' emits a string that always ends in
'cygwin' for the Cygwin gcc (please let me know if I'm wrong about
that). Earnie Boyd at mingw-users described this method for
distinguishing MinGW and Cygwin gcc as not being a bad idea:
http://permalink.gmane.org/gmane.comp.gnu.mingw.user/42137

With this the Mingw32CCompiler.__init__ method can be modified to do:

if self.gcc_version  '4' or is_cygwingcc():
no_cygwin = ' -mno-cygwin'
else:
no_cygwin = ''

self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
 compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
 compiler_cxx='g++%s -O -Wall' % no_cygwin,
 linker_exe='gcc%s' % no_cygwin,
 linker_so='%s%s %s %s'
% (self.linker_dll, no_cygwin,
   shared_option, entry_point))

This will fix the problem for MinGW, should not break existing
no-cygwin/gcc 3.x setups and preserves the error message currently
seen for no-cygwin with gcc 4.x. In other words it should satisfy
users in all three groups A, B and C referred to above. In particular
the is_cygwingcc() function hopefully addresses Martin's concern for
users in group C.

Is this approach acceptable?

Thanks,
Oscar

--

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



[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-23 Thread Brett Cannon

Brett Cannon added the comment:

The line raising the exception is 
http://hg.python.org/cpython/file/f7992397e98d/Lib/importlib/_bootstrap.py#l1518
 .

If you're sure it's a regression feel free to change what exception is raised.

--
assignee:  - flox

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-05-23 Thread Thom Nichols

Thom Nichols added the comment:

Is there any chance of this being backported to Python 2.7?  Given NIST's 
complete deprecation of SHA1 and TLS 1.0 by end of 2013, I imagine there are at 
least a few folks who can't upgrade to Python 3.x, but need TLS 1.2 support.  I 
think Ruby just recently implemented TLS 1.2 in 2.0, and backported it to the 
1.9.3 tree.  Thanks.

--
nosy: +Thom.Nichols

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-23 Thread Roumen Petrov

Roumen Petrov added the comment:

Oscar Benjamin wrote:
 Oscar Benjamin added the comment:

 I have written a function that can be used to determine if the gcc
 that distutils will use is from Cygwin or MinGW:

 def is_cygwingcc():
  '''Try to determine if the gcc that would be used is from cygwin.'''
  out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout
  try:
  out_string = out.read()
  finally:
  out.close()
  # out_string is the target triplet cpu-vendor-os
  # Cygwin's gcc sets the os to 'cygwin'
  return out_string.strip().endswith('cygwin')

 The idea is that 'gcc -dumpmachine' emits a string that always ends in
 'cygwin' for the Cygwin gcc (please let me know if I'm wrong about
 that). Earnie Boyd at mingw-users described this method for
 distinguishing MinGW and Cygwin gcc as not being a bad idea:
 http://permalink.gmane.org/gmane.comp.gnu.mingw.user/42137

 With this the Mingw32CCompiler.__init__ method can be modified to do:

 if self.gcc_version  '4' or is_cygwingcc():

It seems to me you try to find another method to detect support of some 
options.
Where is written that compiler is gcc ? Yes this is current distutils 
code but please review my set of patches

  no_cygwin = ' -mno-cygwin'
 else:
  no_cygwin = ''

 self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
   compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
   compiler_cxx='g++%s -O -Wall' % no_cygwin,
   linker_exe='gcc%s' % no_cygwin,
   linker_so='%s%s %s %s'
  % (self.linker_dll, no_cygwin,
 shared_option, entry_point))

This will not work in new cygwin (1.7) environment  with true 
cross-compilers.
Reason is simple - executable is not gcc.

 This will fix the problem for MinGW, should not break existing
 no-cygwin/gcc 3.x setups and preserves the error message currently
 seen for no-cygwin with gcc 4.x. In other words it should satisfy
 users in all three groups A, B and C referred to above. In particular
 the is_cygwingcc() function hopefully addresses Martin's concern for
 users in group C.

 Is this approach acceptable?
It is not enough.

 Thanks,
 Oscar

 --


Roumen

--

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



[issue16895] Batch file to mimic 'make' on Windows

2013-05-23 Thread Zachary Ware

Zachary Ware added the comment:

Here's a new version of the patch, which is a major rewrite.  Among the changes:

- Switch from using 'goto' to execute the right subroutine to 'call' and end 
every subroutine with 'exit /B' (thank you Richard for making me aware of that 
possibility).  This makes the :end label useless, so it's removed.  Every 
subroutine now expects to start in the root of the source tree, and is expected 
to return there before exiting.

- Changed the argument parsing magic to a different flavor of magic.  Setting 
variables on the command line is now much more like it is using Unix make, no 
more required double quotes around the whole assignment, and you can now 
specify multiple targets in a single command.  This method can be quite a bit 
slower if you give a huge command, as it steps through the command line a 
character at a time (on the order of several seconds if you're appending 
something to PATH, for instance.  The delay is not noticeable if you're just 
giving targets), but at least all the magic is self-contained.

- Add '--no-externals' and '--interactive' options to configure.bat to ignore 
the presence or absence of the external libs and to allow questions to be asked 
of the user, respectively.  I've waffled back and forth on whether it is better 
for the '--interactive' option to be on or off by default, currently it is off.

- On 64 bit machines, default to Win32 platform if vcvarsx86_amd64.bat can't be 
found.

- Give some nicer output just about everywhere.  This includes making 
configure.bat die early in case %VS100COMNTOOLS% is not defined with a message 
to install MSVC++ 2010 Express, a warning if NASM is not available, and tagging 
all output with the name of the script.  Also, add a message at the end of 
building Python giving the best estimate of the outcome.

- Another part of giving a nice message at the end of building Python: if the 
expected executable file exists at the end, exit code 0 is returned.  This is 
for the buildbots, so that even if the build had errors, the tests are still 
run so we can see what is actually broken.  This ties in with the new 
'--no-externals' option on configure.bat, which would allow a buildbot to build 
with '--no-externals' and still be able to test everything else.

- List and use specific exit codes.  If anyone has advice on better numbers to 
use (more standard numbers, perhaps), please let me know :).

- Use absolute relative paths (paths that always start with %~dp0, but may 
include '..') to avoid some directory changing magic just to make a relative 
path point to the right place.

- 'clobber' target builds the clean target of Win32 configuration, then x64 
config if the environment can be set up to do so.

- 'importlib' will clean up after itself if there wasn't a build already done.

- Some refactoring and cleanup to put things in places that make more sense and 
look better.  This includes major changes to :external and :tcltk to use a 
couple of loops to be more DRY.

- Change Tools/scripts/run_tests.py (used by the test targets in make.bat and 
Makefile) to use subprocess.call instead of os.execv on win32.  Since execv 
creates a new process on Windows, control was handed back to the console as 
soon as the execv call was made, but the test output still came to the terminal 
so the prompt was lost in the test output and did not automatically come up at 
the end of the test.  Using subprocess.call keeps control in the parent 
python(_d) process and doesn't release back to the console until the test is 
done.

- Added better documentation of make.bat usage to PCbuild\readme.txt, and took 
out unrelated changes to that file (which will be posted to another issue).

Everything works as expected for me, but I do only have a 32bit machine 
available to me currently.  I hope to be able to test on a 64bit machine soon, 
but have no guarantees.  For anyone testing this, I would suggest to run the 
command prompt $+%PROMPT% before testing; this will add a + to the 
beginning of your prompt for every dir on the pushd/popd stack.  Neither 
configure.bat nor make.bat should ever remove dirs from that stack, and should 
not leave any extras when they're done (unless forcibly killed in the middle of 
running).

--
Added file: http://bugs.python.org/file30351/win_configure-make.v2.diff

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-23 Thread STINNER Victor

STINNER Victor added the comment:

Set also issue #3329 which proposes an API to define memory allocators.

--
nosy: +haypo

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



[issue17326] Windows build docs still referring to VS 2008 in 3.3

2013-05-23 Thread Zachary Ware

Zachary Ware added the comment:

Here's a simple patch to clear up the first paragraph of PCbuild/readme.txt, 
applicable to 3.3 and default.

--
keywords: +patch
nosy: +zach.ware
Added file: http://bugs.python.org/file30352/issue17326.diff

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-23 Thread Paul Moore

Paul Moore added the comment:

On 23 May 2013 20:11, Roumen Petrov rep...@bugs.python.org wrote:

  Is this approach acceptable?
 It is not enough.


Support for compilers other than gcc (including cross-compilers) is a
separate issue, and one which is much less likely to get accepted.

--

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Is there any chance of this being backported to Python 2.7?  Given
 NIST's complete deprecation of SHA1 and TLS 1.0 by end of 2013, I
 imagine there are at least a few folks who can't upgrade to Python
 3.x, but need TLS 1.2 support.  I think Ruby just recently implemented
 TLS 1.2 in 2.0, and backported it to the 1.9.3 tree.  Thanks.

No, sorry. 2.7 only gets bug fixes.

--

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2013-05-23 Thread Zachary Ware

Zachary Ware added the comment:

Terry, I just tested your 2.7 patch, and it does work, but the workaround that 
(I think) we have both been using on 3.x to find the Tcl/Tk .dlls (copying them 
into PCbuild) doesn't work on 2.7 for some reason.  However, if you add 
..\tcltk\bin to PATH, which the PCbuild\rt.bat script (called by 
Tools\buildbot\test(-amd64).bat) does, your patch allows all of the test 
modules to run properly.

I wonder if this has anything to do with issue17883's buildbot problems?

--

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



[issue17701] Improving strftime documentation

2013-05-23 Thread David Wolever

Changes by David Wolever wole...@cs.toronto.edu:


Added file: http://bugs.python.org/file30353/102b3e257dca.diff

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



[issue17701] Improving strftime documentation

2013-05-23 Thread David Wolever

Changes by David Wolever wole...@cs.toronto.edu:


Removed file: http://bugs.python.org/file30353/102b3e257dca.diff

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



[issue17701] Improving strftime documentation

2013-05-23 Thread David Wolever

Changes by David Wolever wole...@cs.toronto.edu:


Added file: http://bugs.python.org/file30354/0f4d971b0cee.diff

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



[issue7940] re.finditer and re.findall should support negative end positions

2013-05-23 Thread Mark Lawrence

Mark Lawrence added the comment:

Has this been fixed in the regex module?

--
nosy: +BreamoreBoy

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman

Ethan Furman added the comment:

This is certainly an effective method, but it places safety off by default.  I 
would rather have a system that was from duplicates by default but had an easy 
override.

The method I had in place in my original code was something like:

class Color(Enum, options=DUPLICATES):
red = 1
green = 2
blue = 3
grene = 2

Without the DUPLICATES option, the above class would raise an error.  Safe(r) 
by default, easy override.

If my suggestion doesn't fly, we should definitely put Nick's in.

--

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

I take Guido's acceptance of the PEP (and the discussion in the previous
issue) as meaning the default behaviour (allowing aliases) is no longer up
for debate. Hence this suggestion to offer a self-documenting way to opt in
to the more restrictive variant.

--

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman

Ethan Furman added the comment:

I'm not giving up hope yet.  Plenty of Python features no longer work the way 
they did when their PEP was accepted.  ;)

--

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



[issue7940] re.finditer and re.findall should support negative end positions

2013-05-23 Thread Matthew Barnett

Matthew Barnett added the comment:

Yes. As msg99456 suggests, I fixed it the my source code before posting.

Compare re in Python 3.3.2:

 re.compile('x').findall('', 1, 3)
['x', 'x']
 re.compile('x').findall('', 1, -1)
[]

with regex:

 regex.compile('x').findall('', 1, 3)
['x', 'x']
 regex.compile('x').findall('', 1, -1)
['x', 'x']

--

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



[issue7760] use_errno=True does not work

2013-05-23 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Matt, I believe in that case it's still a documentation issue, because then the 
documentation probably should say that using absolute paths to libraries is a 
bad idea in general.

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-23 Thread Renato Silva

Renato Silva added the comment:

I must note that GCC 4.x *does* support -mno-cygwin, at least until 4.4, and at 
least the MinGW version. I have used it myself for building Pidgin under 
Windows, which requires that option. See [1] where a Pidgin developer confirms 
that.

[1] http://pidgin.im/pipermail/support/2011-December/011159.html

--
nosy: +renatosilva

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



[issue18045] get_python_version is not import in bdist_rpm.py

2013-05-23 Thread Matt Mao

New submission from Matt Mao:

Python version : 2.7.5
OS : CentOS 6.3

When I tried to build a rpm with python ./setup.py bdist_rpm, I get the 
following error :

Traceback (most recent call last):
  File setup.py, line 221, in module
...  and much more ;)
  File /usr/local/python2.7/lib/python2.7/distutils/core.py, line 152, in 
setup
dist.run_commands()
  File /usr/local/python2.7/lib/python2.7/distutils/dist.py, line 953, in 
run_commands
self.run_command(cmd)
  File /usr/local/python2.7/lib/python2.7/distutils/dist.py, line 972, in 
run_command
cmd_obj.run()
  File 
/usr/local/python2.7/lib/python2.7/python2.7/distutils/command/bdist_rpm.py, 
line 383, in run
pyversion = get_python_version()
NameError: global name 'get_python_version' is not defined


I find that we do not import function get_python_version in 
python2.7/distutils/command/bdist_rpm.py.
I think we need to add “from distutils.sysconfig import get_python_version” in 
this file.

--
assignee: eric.araujo
components: Distutils
messages: 189888
nosy: eric.araujo, maoliping455, tarek
priority: normal
severity: normal
status: open
title: get_python_version is not import in bdist_rpm.py
versions: Python 2.7

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



[issue18046] Simplify and clarify logging internals

2013-05-23 Thread Alex Gaynor

New submission from Alex Gaynor:

This patch splits a dictionary that maps integer and string representations of 
levels to each other out into two dictionaries, one which goes int - string, 
and the other which is string - int. This makes it easier to reason about what 
a variable contains.

--
components: Library (Lib)
files: log-simple.diff
keywords: needs review, patch
messages: 189889
nosy: alex
priority: normal
severity: normal
stage: patch review
status: open
title: Simplify and clarify logging internals
versions: Python 3.4
Added file: http://bugs.python.org/file30355/log-simple.diff

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



[issue18046] Simplify and clarify logging internals

2013-05-23 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +vinay.sajip

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

You don't generally see reversals of decisions where Guido has made an explicit 
choice based on consistency with the rest of the language. The fact that 
aliases are permitted in enumerations by default is consistent with the normal 
behaviour of namespaces and dictionaries in general, so providing a way to opt 
in to the stricter checks is a better solution.

The idea of passing flags or other configuration options to the metaclass is 
also rather ugly. Offering permissive behaviour by default with an easy way to 
opt in to additional restrictions is far more in keeping with the general 
consenting adults ethos of the language.

--

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Eric Snow added the comment:

It's worth noting that issue10977 is pretty closely related to this isssue.

--

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman

Ethan Furman added the comment:

Oh.  Well, I like your decorator. :)

--

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Eric Snow added the comment:

 I just looked at the test-collections patch and don't want it
 committed.  It is full of trivial edits that make it hard to
 review and doesn't make the test suite better.

Thanks for the feedback, Raymond.  I agree that there are a number of trivial 
edits there that shouldn't be there.  I'll fix those.

--

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



[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Don't worry, compared to some of the ideas I've had (and rightfully had shot 
down) over the years, that one was positively sensible :)

--

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Eric Snow added the comment:

Raymond, do you have any objections to splitting the OrderedDict-related tests 
into their own module.  Doing so allows for testing all the those test classes 
at once, which is handy when working on OrderedDict.  This is more relevant now 
with the extra PEP-399-motivated tests.

--

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



[issue18047] Descriptors get invoked in old-style objects and classes

2013-05-23 Thread Arnaud Porterie

New submission from Arnaud Porterie:

In the Data Model section of the documentation regarding descriptors 
invokations 
(http://docs.python.org/2/reference/datamodel.html#invoking-descriptors), it is 
said:

Note that descriptors are only invoked for new style objects or classes 
(ones that subclass object() or type()).

However, it seems this restriction isn't enforced in practice:

Python 2.7.4 (default, May 16 2013, 13:28:03)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on 
darwin
Type help, copyright, credits or license for more information.
 class Desc(object):
... def __get__(self, obj, cls):
... return 'test'
...
 class A:  # Not inheriting object here
... desc = Desc()
...
 A().desc
'test'

I dived into CPython's code and saw no trace of a test for new-style classes in 
the descriptor invokation code path (down in classobject.c / instance_getattr2).

Unfortunately, fixing this behavior doesn't seem trivial as class methods 
appear to be implemented as descriptor themselves. In other words, and from my 
understanding, restricting descriptor invokation to new-style objects and 
classes would prevent method calls on old-style classes.

--
components: Interpreter Core
files: desc.py
messages: 189896
nosy: icecrime
priority: normal
severity: normal
status: open
title: Descriptors get invoked in old-style objects and classes
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file30356/desc.py

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Eric Snow added the comment:

I finally had some time so here's an updated patch (including O(1) deletions).  
I've also added a bunch of notes at the top of odictobject.c.  Some notable 
things left to do:

* address two recently failing tests due to r83881 (issue 17900)
* check for any reference cycles (should be fine)
* validate reentrancy (make sure everything is thread-safe around calls into 
Python)
* make sure subclassing is okay
* compare performance to dict, pure Python OrderedDict

My goal here is to get an effective OrderedDict that we are happy with, while 
recognizing that there is room for optimization.  However, I won't be okay with 
faultiness, so the implementation must be complete.  This has been my mindset 
throughout.

--
Added file: http://bugs.python.org/file30357/cOrderedDict.diff

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Removed file: http://bugs.python.org/file29077/cleanup-test-collections.diff

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



[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Removed file: http://bugs.python.org/file29078/odict.diff

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