[issue23967] Make inspect.signature expression evaluation more powerful

2015-04-15 Thread Peter McCormick

Peter McCormick added the comment:

This definitely works for the _socket.listen use case!

In terms of generating such a signature using Argument Clinic, currently this 
is required:

backlog: int(py_default="builtins.min(SOMAXCONN, 128)", 
c_default="Py_MIN(SOMAXCONN, 128)") = 000


The attached patch lets Tools/clinic/clinic.py make an exception when both C 
and Python defaults are specified, simplifying the above to: 

backlog: int(py_default="builtins.min(SOMAXCONN, 128)", 
c_default="Py_MIN(SOMAXCONN, 128)")

--
keywords: +patch
Added file: 
http://bugs.python.org/file39066/pdm-argument_clinic-mixed_py_and_c_defaults-v1.patch

___
Python tracker 

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



[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread paul j3

paul j3 added the comment:

It'll take me a while to work through this proposed patch.  My first reaction 
is that I am uncomfortable with adding an attribute to all parsers just to 
implement this help feature.  For one thing it seems to cross functionality 
boundaries.

I need to review how subparser help is implemented.  A lot of the work is done 
in the subparsers action itself, not the HelpFormatter.  I have a vague memory 
of another bug issue involving this subparser help.  I'll have to look it up.

There are several bug issues related to formatting `choices`.  In some cases 
they are too long to display properly.  And this formatting adds an iterablity 
requirement.  I worked on consolidating choices formatting into a separate 
method.  In one version it was module level function, in another refactoring I 
made it an Action method.  If it was an Action method, then the 
subparsers_action class could implement its own version.

Another thought - the formatting of choices is closely linked to the metavar.

Anyways, at this point I have a bunch of random thoughts that need research and 
organizing.

--

___
Python tracker 

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



[issue23970] Update distutils.msvccompiler for VC14

2015-04-15 Thread Tim Golden

Tim Golden added the comment:

Adding Paul Moore as he's essentially the intersection between distutils & 
Windows

--
nosy: +paul.moore

___
Python tracker 

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



[issue6818] remove/delete method for zipfile/tarfile objects

2015-04-15 Thread Christian Heimes

Christian Heimes added the comment:

Around PyCon it might take a little longer than a week. IIRC Ewa does the paper 
work. She is also on the organizing committee of PyCon.

--

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

New patch looks good.

--

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Joel Taddei

Joel Taddei added the comment:

Put HeaderError back in and removed the extra XHDTYPE.

We can get more input on the type constants as well as the undocumented but 
exported items.  Could just be cleared up with some edits to documentation.

--
Added file: http://bugs.python.org/file39065/Issue23883_tarfile_all.patch

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Joel Taddei

Changes by Joel Taddei :


Removed file: http://bugs.python.org/file39064/Issue23883_tarfile_all.patch

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

Oh I see, TarIter is listed underneath a comment saying “Exported Classes”, and 
main() is listed underneath “exported functions”. If they are indeed meant to 
be exported, they should probably also be documented. Otherwise, maybe we can 
just add another comment clarifying that they are internal.

In the latest patch, I think HeaderError should be added back to __all__; it is 
just its subclasses that are not documented. Also XHDTYPE is listed twice in 
the test case.

If it were up to me, I would add the TarInfo.type constants (REGTYPE, AREGTYPE, 
LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, 
GNUTYPE_SPARSE). But I’m not sure if others would agree.

--

___
Python tracker 

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



[issue23354] Loading 2 GiLOC file which raises exception causes wrong traceback

2015-04-15 Thread Ethan Furman

Ethan Furman added the comment:

Considering how rare (hopefully!) files of that size are, I wouldn't be adverse 
to a "won't fix" resolution.

--
priority: normal -> low

___
Python tracker 

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




[issue23354] Loading 2 GiLOC file which raises exception causes wrong traceback

2015-04-15 Thread Ethan Furman

Ethan Furman added the comment:

Considering how rare (hopefully!) files of that size are, I wouldn't be adverse 
to a "won't fix" resolution.

--

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Joel Taddei

Joel Taddei added the comment:

Thanks for the feedback.  I was unsure how to proceed with the undocumented 
items that seemed to be categorized as exported.  Thanks for catching ENCODING 
& *_FORMAT.

--
Added file: http://bugs.python.org/file39064/Issue23883_tarfile_all.patch

___
Python tracker 

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



[issue23935] Clean up Clinic's type expressions of buffers

2015-04-15 Thread Larry Hastings

Larry Hastings added the comment:

While cleaning this up I noticed that es# and et# should both require 
"nullable".  Fixed that too.  I sure hope it's all correct now!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23935] Clean up Clinic's type expressions of buffers

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f74452a11e5 by Larry Hastings in branch 'default':
Issue #23935: Argument Clinic's understanding of format units
https://hg.python.org/cpython/rev/4f74452a11e5

--
nosy: +python-dev

___
Python tracker 

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



[issue6818] remove/delete method for zipfile/tarfile objects

2015-04-15 Thread Dave Sawyer

Dave Sawyer added the comment:

I can add some more tests to bring up the coverage, but wanted to get reviewer 
opinion on the direction of this before doing more work.

--
hgrepos: +305
Added file: http://bugs.python.org/file39063/zipfile_filter.patch

___
Python tracker 

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



[issue5038] urrlib2/httplib doesn't reset file position between requests

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

Actually, I do not think any “Expect: 100-continue” headers are explicitly sent 
by the Python standard library. The Python client does not support waiting for 
a “100 Continue” response; see Issue 1346874.

There is Issue 23740 opened about fixing or clarifying the various data types 
accepted by “http.client”.

On the other hand, the documentation for urlopen() says only bytes and 
iterables are supported. If mmap objects are being treated as file objects by 
urlopen() that is unexpected, and the documentation or implementation needs 
fixing there. Also, iterating a mmap() object is different from iterating 
either the equivalent bytearray() or file object, so there is something weird 
going on there.

--
nosy: +vadmium

___
Python tracker 

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



[issue23740] http.client request and send method have some datatype issues

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

The priority of file-like objects versus bytes-like and iterable objects should 
be well defined. See Issue 5038: mmap objects seem to satisfy all three 
interfaces, but the result may be different depending on the file position.

--

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-04-15 Thread Russell Keith-Magee

Russell Keith-Magee added the comment:

Hi Matthias:

 * The libffi situation on iOS is much the same as it is on OS/X - it needs to 
be pre-generated. This can't be driven by the existing build system - libffi's 
Makefile requires a separate pre-generation step. There's certainly potential 
for reuse between the OS/X and iOS generated files, though - there's no reason 
I couldn't merge the libffi_ios tree into the libffi_darwin tree - they reuse a 
lot of the same code for the x86-64 platform.

 * Regarding Setup.* - if shipping specific Setup.* files is a problem, I can 
certainly look at enhancing the makesetup process to generate these, rather 
than shipping generated files. 

 * I'll add a comment to the setup.py change. Essentially, it's an edge case of 
the current setup.py - if you don't have *any* external modules, the current 
logic breaks evaluating the size of the columns to use when displaying external 
modules that haven't been compiled - although it's displaying the list of 
*missing* modules, it uses the longest name in the *existent* extensions to 
determine the display column width.

 * The Plat_ios constants certainly appear to be the same for all platforms; 
admittedly, though, I haven't done a thorough audit of this. I'll put this on 
my todo list.

 * The build triples are "armv7-apple-ios" for older 32 bit iOS devices, 
"aarch64-apple-ios" for newer 64 bit devices, and "x86_64-apple-ios" on the 
simulator. Builds for "armv6-apple-ios" and "armv7s-apple-ios" are also 
plausible, but armv7 and aarch64 is what XCode supports as a default 
configuration at present.

--

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Joel Taddei

Changes by Joel Taddei :


Removed file: http://bugs.python.org/file39051/Issue23883_tarfile_all.patch

___
Python tracker 

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



[issue1346874] httplib simply ignores CONTINUE

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

This seems more like a new feature than a bug fix to me. Currently the 
behaviour is the same whether “Expect: 100-continue” is requested or not. 
According to , the client does not 
have to wait any specific length of time for the “100 Continue” response, so 
sending the body straight away is okay.

In current releases (2.7, 3.4), maybe it would be good enough to document that 
the body is always sent without waiting, even if “Expect: 100-continue” is 
requested.

Considering this as a new feature, the new exceptions don’t seem very flexible 
to me. What is the use case, or what would your code look like? If I wanted to 
use the expectation feature of HTTP, I think I would want to know the reason 
why “100 Continue” was not received, and the blanket ContinueExpected exception 
is not going to be very helpful with that. Maybe I am being redirected 
somewhere else first, or maybe I have to log in with some kind of 
authentication, etc, but there is no way to get the relevant Location, 
WWW-Authenticate, etc fields.

Some more comments specifically about issue1346874-273.patch:

* The documentation should say what the behaviour is when “Expect: 
100-continue” is requested. Point out that some sort of response is expected 
from the server before sending the body, and if the server does not send such a 
response the request will deadlock or time out.

* __all__ would need updating with the new exceptions

* “100 Continue” responses should still be read even when the expectation field 
is not in the request (and presumably, second and subsequent “100 Continue” 
responses should also be skipped even when the expectation is enabled). If 
there is not a test for this, one should probably be added.

--
nosy: +vadmium

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-04-15 Thread Matthias Klose

Matthias Klose added the comment:

not reviewing everything, but

 - libffi_ios* will be bitrot.  I understand that you'll
   need an unreleased version, however I would much
   prefer that any additional patches are added in the
   repo, and maybe then patching libffi from the iOS build
   system. This way the code will see updates when libffi
   is updated.

 - I don't like the copies of Setup.*. Again this will
   bitrot. Please see
   http://bazaar.launchpad.net/~doko/python/pkg3.4-debian/view/head:/rules
   search for "define __post_configure"
   Basically this patches Setup.dist to build a bunch
   of extensions statically.  Can you use something
   similar, or improve that?

 - the change to setup.py might deserve a comment.

 - are constants in plat-ios really the same for every
   architecture?

 - how is the gnu triplet / quadruplet called for iOS?

--

___
Python tracker 

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



[issue23971] dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio

2015-04-15 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-15 Thread Christie

Christie added the comment:

@r.david.murray and @flipmcf:

I've audited all test modules using sys.executable for a starting point, and 
these tests look like they could benefit from helper methods to invoke python 
(probably the ones in script_helper, but we may want to create others if the 
use cases don’t quite fit):
* _test_multiprocessing.py
* test_base64.py
* test_capi.py - some of this looks legitimate, but some of it could maybe 
benefit from the helpers
* test_cmd_line.py
* test_faulthandler.py
* test_file_eintr.py
* test_gc.py
* test_keyword.py
* test_pdb.py
* test_popen.py
* test_quopri.py
* test_site.py
* test_source_encoding.py
* test_sys.py
* test_sysconfig.py
* test_tcl.py - something complex is going on in here, not sure if it’s 
necessary or not
* test_threading.py
* test_pindent.py
* test_traceback.py
* test_unicodedata.py
* test_json/test_tool.py

@r.david.murray I'm going to start with test_unicodedata.py for a nice easy 
starting point so I'll create a separate issue for it.

@flipmcf should I start using your patch set as-is or is there more to come?

--

___
Python tracker 

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



[issue23969] please set a SOABI for MacOSX

2015-04-15 Thread Ned Deily

Ned Deily added the comment:

"what about iOS? isn't __APPLE__ there defined too?"

It is but we currently don't have any iOS-specific checks snywhere in CPython.  
I have an additional patch to handle iOS here but I didn't want to break builds 
until adding full support for iOS as part of Issue23670.

--

___
Python tracker 

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



[issue23969] please set a SOABI for MacOSX

2015-04-15 Thread Matthias Klose

Matthias Klose added the comment:

what about iOS? isn't __APPLE__ there defined too?

--

___
Python tracker 

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



[issue23903] Generate PC/python3.def by scraping headers

2015-04-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage: needs patch -> patch review

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 32c24eec035f by Ned Deily in branch 'default':
Issues #22980, 23969: For OS X, use PEP 3149-style file names for extension
https://hg.python.org/cpython/rev/32c24eec035f

--

___
Python tracker 

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



[issue23971] dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio

2015-04-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger
type: behavior -> performance

___
Python tracker 

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



[issue7159] Urllib2 authentication memory.

2015-04-15 Thread Akshit Khurana

Akshit Khurana added the comment:

Updated patch with review changes

--
Added file: http://bugs.python.org/file39062/auth10.patch

___
Python tracker 

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



[issue6818] remove/delete method for zipfile/tarfile objects

2015-04-15 Thread Dave Sawyer

Dave Sawyer added the comment:

The zipfile way to delete or rename would be to just change the index. It 
really doesn't want to be re-written as it is designed to span disks. Many old 
versions of files can be scattered within the zip. In addition self-extracting 
zip files will have executable code in the front of the zip. To make a zip 
smaller, it's desirable to have a filter function. There were points brought up 
about zip with overlapping data blocks (and you could envision saving space by 
having many identical files share the same compressed block... but this is not 
legal zip. A file info header block must precede EACH individual file data 
block. This is brought home by there being only a length field in the info 
header.

--
Added file: http://bugs.python.org/file39061/mywork.patch

___
Python tracker 

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



[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ofer Schwarz

Changes by Ofer Schwarz :


Added file: http://bugs.python.org/file39060/indexerror_all.patch

___
Python tracker 

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



[issue7159] Urllib2 authentication memory.

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

Added some review comments.

I think the urllib documentation does not really explain how to *use* these 
classes, and it should, but that is a separate issue.

--

___
Python tracker 

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



[issue23971] dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio

2015-04-15 Thread Larry Hastings

New submission from Larry Hastings:

Matt Mackall brought this over to me today.

If list "l" has one million pairs and you do
  dict(l)
it creates the dict, then resizes it to a million elements, then starts adding 
name/value pairs.  But since it's sized to a million elements, it gets beyond 
its "fill ratio" comfort level of 666k and resizes.  And when you're up to a 
million elements, the resize is quite slow.  It should have internally resized 
the dict correctly from the beginning such that no resize was necessary.

The same is true for dict.fromkeys--passed in a list of 1m elements, it uses an 
initial size of 1m, not 1.5m.

Attached is a sample patch to change the behavior of both these operations so 
no resizes are needed during the insertions.  I haven't checked that it 
actually fixes the behavior, I just made the change and ran the regression 
test.  (I'm oversubscribed here at the sprints, and am kind of rushing this 
diff out just to get the conversation rolling.)

Benjamin: what do you think?  Would it be appropriate to make a change like 
this in 2.7?

Python 3 (or at least 3.5 trunk) is fancy here.  It starts with the minimum 
size of a dict, then iterates until the new size is > 1.5*the  number of 
elements.  This means the dicts it creates are of the same size as they would 
be if we'd started with a minsize dict and inserted one element at a time.  
This might help minimize wear and tear on the small block allocator for smaller 
dicts.

BTW, the internal function _PyDict_NewPresize should really have taken the fill 
ratio into account too.  But, even though it's an internal-only function, it's 
probably too late to change its behavior.

--
components: Interpreter Core
messages: 241179
nosy: benjamin.peterson, larry, marmoute, mpm
priority: normal
severity: normal
stage: patch review
status: open
title: dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue23703] urljoin() with no directory segments duplicates filename

2015-04-15 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23703] urljoin() with no directory segments duplicates filename

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fc0e79387a3a by Berker Peksag in branch 'default':
Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
https://hg.python.org/cpython/rev/fc0e79387a3a

--
nosy: +python-dev

___
Python tracker 

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



[issue22278] urljoin duplicate slashes

2015-04-15 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Martin Panter

Martin Panter added the comment:

Regarding tarfile: Two of the extra errors are documented, so I agree they 
should be added:

* tarfile.StreamError
* tarfile.ExtractError

However I’m not so sure about main(), TarIter, and the HeaderError subclasses. 
They aren’t mentioned in the documentation. At least main() and TarIter are 
just implementation details I think.

There are other documented items that should be added in my opinion. These 
would not be picked up by the proposed test, although they would be picked up 
by making the test like in revision 10b0a8076be8.

* ENCODING
* USTAR/GNU/PAX/DEFAULT_FORMAT

--

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-04-15 Thread Neil Girdhar

Changes by Neil Girdhar :


Added file: http://bugs.python.org/file39059/starunpack41.diff

___
Python tracker 

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



[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Now the review button appears for the big patch.  Lets see if another 
submission makes it appear for the smaller version.

--

___
Python tracker 

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



[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-15 Thread Augie Fackler

Augie Fackler added the comment:

Changes to 3.4 aren't going to help Mercurial. Given that bytes formatting is 
new in 3.5, I won't be attempting a port that supports a version of Python 3 
any older than 3.5. At this point, just a difflib.diff_bytes method in 3.5 
would be sufficient to satisfy my needs.

--

___
Python tracker 

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



[issue23970] Update distutils.msvccompiler for VC14

2015-04-15 Thread Steve Dower

New submission from Steve Dower:

Because of the compiler change, we need to rework the detection of MSVC for 
Python 3.5. I took the opportunity to clean up the entire module and remove 
msvc9compiler, and updated the tests.

--
assignee: steve.dower
components: Windows
files: msvccompiler_1.patch
keywords: patch
messages: 241173
nosy: steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Update distutils.msvccompiler for VC14
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file39058/msvccompiler_1.patch

___
Python tracker 

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



[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I tried the [Create Patch] button.  Two problems: the result is about 90% 
concerned with other issues; it is not reviewable on Rietveld.  I will unlink 
it and upload a cut-down version.

Wtiht the test changes suggested by Berker, I agree that it is time to apply 
this, with whatever decision we make about 3.4.

I am sympathetic to the notion that there is a regression from 2.x.  There is 
precedent for adding a feature to fix a bug (in difflib, a new parameter for 
SequenceMatcher, for 2.7 3 (or thereabouts)).  However, doing so was 
contentious (discussed on pydev) and not meant to be routine.  The bug being 
fixed had been reported (as I remember) on four separate issues by four people 
and seconded by other people, so we really wanted the fix in 2.7.

Would the following compromise work for Mercurial?  The patch already adds a 
new private function _check_types.  For 3.4, also add _diff_bytes as a private 
function.  Merge both into 3.5.  Create a 3.5 patch that makes _diff_bytes 
public by renaming it to diff_bytes, adds the new tests, and documents the new 
feature.  The What's New entry could mention that the function was added 
privately in 3.4.4.

--
stage: patch review -> commit review
Added file: http://bugs.python.org/file39057/13161c1d9c5-difflibf.diff

___
Python tracker 

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



[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ofer Schwarz

Changes by Ofer Schwarz :


--
keywords: +patch
Added file: http://bugs.python.org/file39055/indexerror.patch

___
Python tracker 

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



[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ofer Schwarz

Changes by Ofer Schwarz :


Added file: http://bugs.python.org/file39056/indexerror.tests

___
Python tracker 

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2015-04-15 Thread Steve Dower

Steve Dower added the comment:

Arnon has signed the CLA at PyCon, it just hasn't been processed yet.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 132b5376bf34 by Steve Dower in branch 'default':
Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
https://hg.python.org/cpython/rev/132b5376bf34

--
nosy: +python-dev

___
Python tracker 

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



[issue22137] Test imaplib API on all methods specified in RFC 3501

2015-04-15 Thread Maciej Szulik

Maciej Szulik added the comment:

Milan one more thing to change in your patch, in all your TCs you're modifying 
client state, I mean this part:

# lets cheat a bit here:
client.state = 'SELECTED'

It's OK to do that on the mocked server, but this is not acceptable doing on 
the tested library. It's better to call client.login() to change the state to 
'AUTH' properly and only after that, call the actual method under test.

--

___
Python tracker 

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



[issue18128] pygettext: non-standard timestamp format in POT-Creation-Date

2015-04-15 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

@rdm: I'm pretty sure you're right about nobody noticing. :)  Make it so!

--

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 948745d0d9cf by doko in branch 'default':
#22980: fix triplet configure test for powerpc-linux-gnu
https://hg.python.org/cpython/rev/948745d0d9cf

--

___
Python tracker 

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



[issue22189] collections.UserString missing some str methods

2015-04-15 Thread Joe Jevnik

Joe Jevnik added the comment:

I have added a patch to add these to UserString. I also wrote a test case that 
would check the UserString, UserList, and UserDict's methods to make sure that 
new methods to str, list, or dict (or the removal of one of those methods from 
the User* version) will cause a test failure.

--
keywords: +patch
nosy: +ll
Added file: http://bugs.python.org/file39054/userobjectmethods.patch

___
Python tracker 

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



[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


Added file: http://bugs.python.org/file39053/13161c1d9c5f.diff

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-15 Thread Michael McFadden

Michael McFadden added the comment:

namespaces are a honkin' great idea

I don't have enough information to say that 'script_helper' is the right name 
for the namespace, tho.

--

___
Python tracker 

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2015-04-15 Thread Steve Dower

Steve Dower added the comment:

Arnon - we'll need you to fill out 
https://www.python.org/psf/contrib/contrib-form/ before we can merge this patch 
in. (The dev guide isn't clear on whether trivial patches are okay, but the 
advice I was given is that we should have a CLA for everything.)

--
nosy: +steve.dower

___
Python tracker 

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



[issue18128] pygettext: non-standard timestamp format in POT-Creation-Date

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

Oh, I forgot to say that the patch looks good to me.

--

___
Python tracker 

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



[issue18128] pygettext: non-standard timestamp format in POT-Creation-Date

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

Barry, would you be OK with just applying this to 3.5?  We can add a porting 
note to whatsnew.  My guess, though, is that no one is going to notice.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e55cc0834e9c by R David Murray in branch 'default':
#23949: Improve tuple unpacking error messages.
https://hg.python.org/cpython/rev/e55cc0834e9c

--
nosy: +python-dev

___
Python tracker 

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



[issue21250] sqlite3 doesn't have unit tests for 'insert or [algorithm]' functionality.

2015-04-15 Thread Alex Lord

Changes by Alex Lord :


--
components: +Library (Lib)

___
Python tracker 

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



[issue21250] sqlite3 doesn't have unit tests for 'insert or [algorithm]' functionality.

2015-04-15 Thread Alex Lord

Alex Lord added the comment:

I've added a set of tests which test the insert or [algorithm] branch of 
sqlite. It took some getting used to python.sqlite3's transaction model but I 
think I have a much better understanding now.

--
keywords: +patch
Added file: http://bugs.python.org/file39052/sqlite_tests.patch

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Matthias Klose

Matthias Klose added the comment:

now fixed on the trunk. opened a new issue #23969 for setting the SOABI on 
MacOSX.

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

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2015-04-15 Thread John Ehresman

John Ehresman added the comment:

Interesting -- I didn't know about removing the ignore flag in the child 
process.  The question is whether this is close enough to the kill w/ SIGINT 
behavior on unix to use the same name.  I think that there are enough 
differences to warrant a Windows specific function that calls 
GenerateConsoleCtrlEvent.

--

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2015-04-15 Thread Steve Dower

Steve Dower added the comment:

Closing this as fixed, as the discussions I've had at PyCon have largely 
suggested that the fix I've implemented is good.

In short:
* the default (obvious) install will be per-user only into 
%LocalAppData%\Programs\Python\Python35 - fully modifiable by whoever installed 
it but inaccessible by other users
* the default location for an all-users install will be %ProgramFiles%\Python 
3.5 (with redirection for 32-bit processes) - fully modifiable by 
administrators and usable by all users

Obviously users can customize the install location to reduce security, but we 
can't prevent that.

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

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2015-04-15 Thread eryksun

eryksun added the comment:

> Which python level signal handler will CTRL_BREAK_EVENT 
> trigger?

The CRT maps it to a non-standard signal, SIGBREAK (21). It's defined in the 
signal module.

> GenerateConsoleCtrlEvent has different limitations for 
> CTRL_BREAK_EVENT and CTRL_C_EVENT according to MSDN; 
> I was referring to the CTRL_C_EVENT limitations.  

When creating a process group, the ConsoleFlags value in the process parameters 
is set to ignore CTRL_C_EVENT. You'll still get a DBG_CONTROL_C exception if a 
debugger is attached, but otherwise kernel32!CtrlRoutine ignores Ctrl+C. As you 
say, the docs state that "[CTRL_C_EVENT] cannot be generated for process 
groups". But it *does* work if you remove the ignore flag. This flag gets 
set/unset by assigning/removing a NULL handler.

Here's a revised example to enable Ctrl+C in the child, disable Python's INT 
handler, and then generate CTRL_C_EVENT to kill the child and verify that the 
exit code is STATUS_CONTROL_C_EXIT.

import os
import sys
import signal
import subprocess
import threading

STATUS_CONTROL_C_EXIT = 0xC13A

p = subprocess.Popen([sys.executable, '-i', '-c',
  'import ctypes, signal;'
  'kernel32 = ctypes.windll.kernel32;'
  'kernel32.SetConsoleCtrlHandler(None, 0);'
  'signal.signal(signal.SIGINT, signal.SIG_DFL)'],
 stdin=subprocess.PIPE,
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
 creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
p.stderr.read(1) # poor man's WaitForInputIdle

os.kill(p.pid, signal.CTRL_C_EVENT)
watchdog = threading.Timer(5, p.terminate)
watchdog.start()
exitcode = p.wait()
watchdog.cancel()

if exitcode < 0:
exitcode += 2 ** 32
assert exitcode == STATUS_CONTROL_C_EXIT

--

___
Python tracker 

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



[issue22411] Embedding Python on Windows

2015-04-15 Thread Steve Dower

Steve Dower added the comment:

The 3.5 installer contains the option to install the debug binaries, so that 
side is solved and I'm closing this as fixed.

In the video at https://www.youtube.com/watch?v=D9RlT06a1EI I demonstrate how 
you can build a debug EXE against a release python34.dll without issues (though 
you lose a bit of debugging support) - in short, use the compiler option to 
link against the release runtime.

--
assignee:  -> steve.dower
resolution:  -> fixed
status: open -> closed
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-04-15 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

Can you try to see exactly *which* line of the function is segfaulting?

--

___
Python tracker 

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



[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ram Rachum

Ram Rachum added the comment:

Looking forward to your patch Ofer! Thanks for working on this!

--

___
Python tracker 

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



[issue19933] Round default argument for "ndigits"

2015-04-15 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
status: open -> closed
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue19933] Round default argument for "ndigits"

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e3cc75b1000b by Steve Dower in branch 'default':
Issue 19933: Provide default argument for ndigits in round. Patch by Vajrasky 
Kok.
https://hg.python.org/cpython/rev/e3cc75b1000b

--
nosy: +python-dev

___
Python tracker 

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



[issue23217] help() function incorrectly captures comment preceding a nested function

2015-04-15 Thread Raúl Cumplido

Raúl Cumplido added the comment:

I am not sure what the expected behavior is. Based on the code on pydoc.py we 
can find:
def getdoc(object):
"""Get the doc string or comments for an object."""
result = inspect.getdoc(object) or inspect.getcomments(object)

So if the doc string is not found it searches for the lines of comments 
immediately preceding the object's source code.

This is why the example from Anupama returns the preceding comment on both 
python2.7 and python3.5 (not only on python2.7).

@rhettinger this seems like a deliberate decision to add as help documentation 
the preceding comment if the docstring is not found. What were you expecting? 
Should this be changed?

--
nosy: +raulcd

___
Python tracker 

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



[issue15625] Support u and w codes in memoryview

2015-04-15 Thread Steve Dower

Steve Dower added the comment:

Closing sounds good to me

--
nosy: +steve.dower
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ofer Schwarz

Ofer Schwarz added the comment:

I'm working on this now (patch hopefully coming soon), and I've hit an 
interesting issue:
PySequence methods take care of negative indexes by adding +len before calling 
the subclass method (s.t. -1 becomes len-1 etc.). This means that if the 
subclass raises an exception with the index, it might be the wrong index.

This case only happens when index < -len, so when I talked it out with Larry he 
suggested just passing the original index to the subclass in this case. So for 
index >= 0 or index < -len the subclass will receive the actual index, and for 
-len <= index < 0 the subclass will get index+len.
That's a change in behavior, but I actually think it's a good one. The 
negative-index use case in PySequence is exactly intended for this [-len, 0) 
use case, and if some subclass wants to do something weird with negative 
indexes it'd probably want the actual argument anyway.

I'm writing my patch with this in it, but it might be worth discussing here if 
someone disagrees.

--
nosy: +blackfawn

___
Python tracker 

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



[issue15625] Support u and w codes in memoryview

2015-04-15 Thread Arnon Yaari

Arnon Yaari added the comment:

The documentation already specifies that 'u' is deprecated and doesn't mention 
the 'w' code. I think we can close this issue.

--
nosy: +wiggin15

___
Python tracker 

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



[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-15 Thread Joe Jevnik

Joe Jevnik added the comment:

I can look into rewriting the framework to use multiprocessing; however, should 
we split this into a separate issue or block this one until that work is done.

--

___
Python tracker 

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



[issue23969] please set a SOABI for MacOSX

2015-04-15 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> ned.deily
components: +Build, Macintosh
stage:  -> needs patch
versions: +Python 3.5

___
Python tracker 

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



[issue23969] please set a SOABI for MacOSX

2015-04-15 Thread Matthias Klose

New submission from Matthias Klose:

split out from

http://bugs.python.org/issue22980#msg232065

please consider setting the SOABI for MacOSX. Afaics MacOSX is now the only 
major platform not setting these, at least including the SOABI. The idea is 
that it would be possible to ship "fat" wheels, containing extensions for every 
OS.  Not sure what the PLATFORM_TRIPLET would be, maybe just something like 
macosx, or darwin, if the MacOSX extension itself is a fat build.

--
messages: 241146
nosy: doko, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: please set a SOABI for MacOSX

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-04-15 Thread Joel Taddei

Joel Taddei added the comment:

I took care of the tarfile module.

Added the following according to the first message:

tarfile.CompressionError
tarfile.HeaderError
tarfile.ReadError
tarfile.open


The following were included in __all__ that were not explicitly mentioned in 
the first message but were denoted as an exported function, exported class, or 
an exported error.

tarfile.main
tarfile.TarIter
tarfile.StreamError
tarfile.ExtractError
tarfile.SubsequentHeaderError
tarfile.InvalidHeaderError
tarfile.EmptyHeaderError
tarfile.EOFHeaderError
tarfile.TruncatedHeaderError

This is my first patch so feedback is highly appreciated.

--
keywords: +patch
nosy: +taddeimania
Added file: http://bugs.python.org/file39051/Issue23883_tarfile_all.patch

___
Python tracker 

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



[issue18128] pygettext: non-standard timestamp format in POT-Creation-Date

2015-04-15 Thread Michael McFadden

Michael McFadden added the comment:

Post-review - new patch

--
Added file: http://bugs.python.org/file39050/issue18128.patch

___
Python tracker 

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



[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2015-04-15 Thread Matthias Klose

New submission from Matthias Klose:

Currently there is only one platform directory for all linux architectures, 
there are two reasons to have a separate directory for each architecture:

 - the contents of the files in this directory differ
   (most prominent case are the RTLD_* constants on various
   architectures).

 - The _sysconfigdata.py module is installed in the platdir.
   A cross build of the extensions in the standard library
   is done by running the python interpreter for the build
   machine with the platdir for the host machine.  This
   currently works for cross builds targeting a different
   os, but not cross building from one linux architecture
   to another.

This would then remove Lib/plat-linux and introduce some 
Lib/plat-$(PLATFORM_TRIPLET) directories.

--
components: Installation
files: platdir.diff
keywords: patch
messages: 241143
nosy: doko, ncoghlan
priority: normal
severity: normal
status: open
title: rename the platform directory from plat-$(MACHDEP) to 
plat-$(PLATFORM_TRIPLET)
versions: Python 3.5
Added file: http://bugs.python.org/file39049/platdir.diff

___
Python tracker 

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2015-04-15 Thread Arnon Yaari

Arnon Yaari added the comment:

Adding a test that only calls the function.

--
Added file: http://bugs.python.org/file39048/issue4254-2.diff

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset df6c73f0e375 by doko in branch 'default':
- #22980: fix typo in Lib/test/test_sysconfig.py triplet test
https://hg.python.org/cpython/rev/df6c73f0e375

--

___
Python tracker 

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



[issue23967] Make inspect.signature expression evaluation more powerful

2015-04-15 Thread Larry Hastings

New submission from Larry Hastings:

Peter's working on converting socket to use Argument Clinic.  He had a default 
that really should look like this:

min(SOME_SOCKET_MODULE_CONSTANT, 128)

"min" wasn't something we'd needed before.  I thought about it and realized we 
could do a much better job of simulating the evaluation context of a shared 
module.

Initially I thought, all I needed was to bolster the environment we used for 
eval() to add the builtins.  (Which I've done.)  But this wasn't sufficient 
because we deliberately used ast.literal_eval(), which doesn't support function 
calls by design for superior security.  Or subscripting, or attribute access.  
We already worked around those I think.

But how concerned are we about security?  What is the attack vector here?  If 
the user is able to construct an object that has a villainous 
__text_signature__ on it... surely they could already do as they like?

So here's a first draft at modifying the __text_signature__ evaluation 
environment so it can handle much more sophisticated expressions.  It can use 
anything from builtins, or anything in sys.modules, or anything in the current 
module; it can call functions, and subscript, and access attributes, and 
everything.

To make this work I had to write an ast printer that produces evaluatable 
Python code.  Note that it's not complete, I know it's not complete, it's 
missing loads of operators.  Assume that if this is a good idea I will add all 
the missing operators.

Nick was worried that *in the future* we might expose a "turn this string into 
a signature" function.  That might make an easier attack vector.  So he asked 
that the "trusted=" keyword flag be added, and the full-on eval only happen if 
the string is trusted.

--
assignee: larry
components: Library (Lib)
files: larry.improved.signature.expressions.1.txt
messages: 241140
nosy: larry, ncoghlan, pdmccormick, serhiy.storchaka, yselivanov, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Make inspect.signature expression evaluation more powerful
type: enhancement
versions: Python 3.5
Added file: 
http://bugs.python.org/file39047/larry.improved.signature.expressions.1.txt

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 11c4f3f936e7 by doko in branch 'default':
- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
https://hg.python.org/cpython/rev/11c4f3f936e7

--

___
Python tracker 

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



[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari

Arnon Yaari added the comment:

Sorry, I got confused (which proves the point of the ticket :))
* the "need more than 3 values" error message wasn't wrong, just confusing.
* Including "into starred target" in the message was incorrect, I removed it.
* The message with "expected at least ..." (when there is a star target) didn't 
show if there weren't enough values to fill the arguments before the star 
argument. I fixed this now too and added a test.

--
Added file: http://bugs.python.org/file39046/issue23949-4.patch

___
Python tracker 

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



[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

Made some review comments.  There also needs to be a documentation change since 
the docs currently say it is set for insert only.  There should be a .. 
versionchanged directive.  This may be small enough not to pass the what's new 
threshold, but I'd rather add a note and let the person who does the final edit 
on that document decide, so please add that as well.

(You will note that I've changed this to enhancement...it is documented as 
*only* working for INSERT, so I believe it must be treated as an enhancement to 
make it work for REPLACE.)

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

___
Python tracker 

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



[issue7159] Urllib2 authentication memory.

2015-04-15 Thread Akshit Khurana

Akshit Khurana added the comment:

Adding a patch for Python 3+

Some notes:

* Adding a new password manager to handle this case
* The new handler added in issue 19494 had couple of issues
  * test passes even if we use the old handler in added test
  * uses `request.host` instead of `request.full_url` as key for password

* The new handler did assume realm = None before and still does.

I'm using the same logic for adding keys for adding authenticated urls/realm as 
for login credentials in basic auth handler.

--
keywords: +patch
Added file: http://bugs.python.org/file39045/auth.patch

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2015-04-15 Thread John Ehresman

John Ehresman added the comment:

GenerateConsoleCtrlEvent has different limitations for CTRL_BREAK_EVENT and 
CTRL_C_EVENT according to MSDN; I was referring to the CTRL_C_EVENT 
limitations.  Which python level signal handler will CTRL_BREAK_EVENT trigger?

--

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2015-04-15 Thread eryksun

eryksun added the comment:

> it only works if the the target process id is 0 and then it 
> generates the signal in all processes that share the console.

You can target a process group, which is a subset of the console's attached 
processes. That's why the console host, conhost.exe, routes dispatching the 
event through the session CSRSS.EXE, which handles bookkeeping of Windows 
processes and threads, including groups.

CSRSS creates a thread in each target, which starts at kernel32!CtrlRoutine. If 
a process is being debugged this routine raises a DBG_CONTROL_C or 
DBG_CONTROL_BREAK exception. Next it calls the registered handlers. The default 
handler, if called, exits the process with the exit code set to 
STATUS_CONTROL_C_EXIT (0xC13A):

0:000> u kernel32!DefaultHandler l3
kernel32!DefaultHandler:
`76f31290 4883ec28sub rsp,28h
`76f31294 b93a0100c0  mov ecx,0C13Ah
`76f31299 ff15e1bb0500callqword ptr
  [kernel32!
   _imp_RtlExitUserProcess 
   (`76f8ce80)]

Example:

import os
import sys
import signal
import subprocess
import threading

STATUS_CONTROL_C_EXIT = 0xC13A

p = subprocess.Popen([sys.executable, '-i'],
 stdin=subprocess.PIPE,
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
 creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
p.stderr.read(1) # poor man's WaitForInputIdle

os.kill(p.pid, signal.CTRL_BREAK_EVENT)
watchdog = threading.Timer(5, p.terminate)
watchdog.start()
exitcode = p.wait()
watchdog.cancel()

if exitcode < 0:
exitcode += 2 ** 32
assert exitcode == STATUS_CONTROL_C_EXIT

--
nosy: +eryksun

___
Python tracker 

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



[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

This patch looks good to me, but I did not go through the argparse logic fully. 
 Paul, can you review this and make sure itliteral_eval makes sense?  There is 
a small concern about user code that provides a Mapping for choices having an 
attribute collision on _is_help_suppressed, but I think it is probably small 
enough we can ignore it.  Or consider it an "undocumented feature".

--

___
Python tracker 

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2015-04-15 Thread Arnon Yaari

Arnon Yaari added the comment:

I'm adding patch without the update to Misc/NEWS.

I'm not sure why, but the curses doc refers to LINES and COLS as "environment 
variables". In the doc change I referred to them as just "variables" and used 
the notation that works for linking to them, using :envvar:

--
Added file: http://bugs.python.org/file39044/issue4254-1.diff

___
Python tracker 

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



[issue13940] imaplib: Mailbox names are not quoted

2015-04-15 Thread Maciej Szulik

Maciej Szulik added the comment:

Joe is correct, according to the spec the names containing special chars 
(atom-specials) require names to be quoted 
(https://tools.ietf.org/html/rfc3501#section-5.1): 

   1)Any character which is one of the atom-specials (see the Formal
 Syntax) will require that the mailbox name be represented as a
 quoted string or literal.

I'll be working on a patch for that.

--
nosy: +maciej.szulik

___
Python tracker 

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



[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari

Changes by Arnon Yaari :


Added file: http://bugs.python.org/file39043/issue23949-3.diff

___
Python tracker 

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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2015-04-15 Thread Larry Hastings

Larry Hastings added the comment:

If
  * the diff looks clean
  * it compiles without any *new* (sigh) errors, and
  * it passes the unit test suite without any *new* (sigh) failures,
then the Clinic conversion can generally be considered a success.

--

___
Python tracker 

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



[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari

Changes by Arnon Yaari :


Added file: http://bugs.python.org/file39042/issue23949-2.diff

___
Python tracker 

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



[issue23966] More clearly expose/explain native and cross-build target information

2015-04-15 Thread Nick Coghlan

New submission from Nick Coghlan:

Discussion of issue 22980 made it clear to me that part of the problem with the 
cross-build support is that the difference between the build time information 
exposed in sysconfig and the live system information exposed in the platform 
module isn't clear.

Debian's multiarch triplets (https://wiki.debian.org/Multiarch/Tuples) describe 
this information well, but it currently isn't readily exposed to Python code. 
sysconfig.get_config_var("MULTIARCH") only works on Debian & derivatives, and 
even issue 22980 only exposes the information in 
sysconfig.get_config_var("SOABI") on a subset of platforms.

It would be good to extend the triples to cover Windows, and also to expose the 
*current* system triple at runtime in the platform module (including 
appropriate normalisation)

--
messages: 241129
nosy: barry, bkabrda, doko, ncoghlan, rkuska
priority: normal
severity: normal
status: open
title: More clearly expose/explain native and cross-build target information
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari

Arnon Yaari added the comment:

I fixed the tests (that's important!) and changed the latter message to specify 
it is referring to the starred target (the term "starred target" appears in the 
docs in simple_stmts.rst). Looks like the number in that message was wrong 
before!
The test looked like this:

  >>> a, *b, c, d, e = 0, 1, 2
  ValueError: need more than 3 values to unpack

Need more than 3? Not exactly.

The new message looks like this:
  >>> a, *b, c, d, e = 0, 1, 2
  ValueError: not enough values to unpack into starred target (expected at 
least 4, got 3)

--
Added file: http://bugs.python.org/file39041/issue23949-1.diff

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-04-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Matthias's latest patch looks good to me - I'm filing a separate issue about 
the fact that the native and cross-platform build info isn't really exposed 
properly at the Python level, and is confusing in various ways.

--

___
Python tracker 

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



[issue17156] Tools/i18n/pygettext.py doesn't parse unicode string.

2015-04-15 Thread Michael McFadden

Michael McFadden added the comment:

Also fixes 19907?

--
nosy: +flipmcf

___
Python tracker 

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



[issue19907] gettext - Non ascii chars in header

2015-04-15 Thread Michael McFadden

Michael McFadden added the comment:

This might be fixed by issue17156, which would explain why I can't recreate it.

https://github.com/python/cpython/commit/f4273cfd16fa502f0eb8a0a8fd1c537ec63e47db

--

___
Python tracker 

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



[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread Matt Long

Matt Long added the comment:

Here's a patch for the proposal in my previous comment.

As Barry mentioned, it wasn't as straightforward as I had hoped due to parts of 
the usage text being generated by the state of both self._name_parser_map and 
self._choices_actions.

--
Added file: http://bugs.python.org/file39040/issue22484.patch

___
Python tracker 

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



[issue19907] gettext - Non ascii chars in header

2015-04-15 Thread Michael McFadden

Michael McFadden added the comment:

issue18128 is not related methinks.

This ticket: POT-Creation-Date 
issue18128: PO-Revision-Date

--

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

I actually originally wanted to do just that (move the script helpers routine 
into the old support.py) but I was in the minority.  test.support was turned 
into a package exactly so that script_helpers could become a sub-namespace.  As 
I remember, it was Nick Coghlan who championed the sub-namespace position :)

--

___
Python tracker 

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



[issue21642] "_ if 1else _" does not compile

2015-04-15 Thread R. David Murray

R. David Murray added the comment:

My impression is that it was fixed the way it was because it makes the internal 
tokenizer match the what the tokenize module does.  See also issue 3353.  As 
for changing it in a point release, it turns something that was an error into 
something that isn't, so it was unlikely to break existing working code.  Going 
the other way in the tokenize module *would* have been a backward compatibility 
issue.  If we wanted to change this, it would require a deprecation process, 
and it hardly seems worth it.  I hear you about other tokenizers, though, and 
that is indeed unfortunate.

--
nosy: +r.david.murray

___
Python tracker 

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



  1   2   >