[issue29768] Fix expact version check

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +473

___
Python tracker 

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



[issue29768] Fix expact version check

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +474

___
Python tracker 

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



[issue29768] Fix expact version check

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +475

___
Python tracker 

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



[issue29768] Fix expact version check

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread STINNER Victor

STINNER Victor added the comment:

Which function raises this exception? Add the traceback place. It may be a
bug in your code.

--

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

OK, a further clue. First, a little more detail on how my project is arranged 
(to re-iterate, this works without complaint in Python 3.5):

Rather than use my SWIG output directly, I've created a further wrapper layer 
in Python to add functions/syntactic sugar that would be difficult to achieve 
in SWIG, add a bit of extra documentation, and bury some classes that may be 
occasionally useful but don't really need to be in the primary API. The SWIG 
output Python library I name clipper_core, and I use the following class 
decorators for classes in the front-end API to reduce the amount of code 
(Python and SWIG) needed:

def mappedclass(old_cls):
'''
Ensures that objects returned from functions in the clipper_core
library are instantiated in Python as the derived class with the
extra functionality. 
'''
def decorator(cls):
def __newnew__(thiscls, *args, **kwargs):
if thiscls == old_cls:
return object.__new__(cls)
return object.__new__(thiscls)
old_cls.__new__ = __newnew__

return cls
return decorator
 
def getters_to_properties(*funcs):
'''
Class decorator. Add the names of any getter functions with void 
arguments (e.g. Coord_grid.u()) to convert them to properties. If
you want the property name to be different from the function name,
add the desired name and the function name as a tuple 
(e.g. ('uvw', '_get_uvw'))
'''
def property_factory(func):
def getter(self):
return getattr(super(self.__class__, self), func)()
prop = property(getter)
return prop

def decorator(cls):
for func in funcs:
if type(func) == tuple:
setattr(cls, func[0], property_factory(func[1]))
else:
setattr(cls, func, property_factory(func)) 
return cls
return decorator

def format_to_string(cls):
'''
Class decorator to redirect the Clipper format() function to __str__,
to provide pretty printing of the object.
'''
def format(self):
return super(self.__class__,self).format()
def __str__(self):
return self.format
setattr(cls, 'format', property(format))
setattr(cls, '__str__', __str__)
return cls

Experimenting this morning with the following two classes:

@format_to_string
@mappedclass(clipper_core.Cell_descr)
class Cell_descr(clipper_core.Cell_descr):
def __init__(self, abc, angles):
'''
__init__(self, abc, angles) -> Cell_descr

Args:
abc ([float*3]): cell dimensions in Angstroms
angles ([float*3]): alpha, beta and gamma angles in degrees
'''
clipper_core.Cell_descr.__init__(self, *abc, *angles)

@format_to_string
@getters_to_properties('cell_descr', 'matrix_frac', 'matrix_orth', 
   'metric_real', 'metric_reci', 'volume')
@mappedclass(clipper_core.Cell)
class Cell(clipper_core.Cell):
'''
Define a crystallographic unit cell using the lengths of the three
sides a, b, c (in Angstroms) and the three angles alpha, beta, gamma
(in degrees). 
'''
def __init__(self, abc, angles):
'''
__init__(self, abc, angles) -> Cell

Args:
abc ([float*3]): cell dimensions in Angstroms
angles ([float*3]): alpha, beta and gamma angles in degrees
'''
cell_descr = Cell_descr(abc, angles)
#cell_descr = clipper_core.Cell_descr(*abc, *angles)
clipper_core.Cell.__init__(self, cell_descr)

def __eq__(self, other):
return self.equals(other)

Then:
import clipper
cell = clipper.cell([100,100,100],[90,90,90])
cell.cell_descr

SystemError   Traceback (most recent call last)
 in ()
> 1 c.cell_descr

/home/tic20/apps/chimerax/lib/python3.6/site-packages/chimerax/clipper/clipper_decorators.py
 in getter(self)
 87 def property_factory(func):
 88 def getter(self):
---> 89 return getattr(super(self.__class__, self), func)()
 90 prop = property(getter)
 91 return prop

/home/tic20/apps/chimerax/lib/python3.6/site-packages/chimerax/clipper/lib/clipper_python_core/clipper.py
 in cell_descr(self)
   8249 
   8250 """
-> 8251 return _clipper.Cell_cell_descr(self)
   8252 
   8253 __swig_destroy__ = _clipper.delete_Cell

SystemError: Objects/tupleobject.c:81: bad argument to internal function

... but if I comment out the derived Cell_descr class and switch to the 
alternate cell_descr constructor in Cell.__init__(), then it works as expected. 
I have tried commenting out the other class decorators, with no effect - so it 
would seem it's what's happening in the @mappedclass decorator that is causing 
my troubles.

--

___
Python tracker 


[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 09.03.2017 08:15, Benjamin Peterson wrote:
> 
> "eo_XX" is just something that appears in the X11 locale.alias file. My 
> change doesn't add that; it was already there. (for Esperanto, which I 
> suppose explains the "XX")

Yes, I know. That was an example of a bug in the X.org list.

> Most of the changes you identify the glibc aliases taking precedence over the 
> X11 ones. e.g., glibc has "fi_FI ISO-8859-1" while the X11 locale list has 
> "fi_FI.ISO8859-15". That seems correct to me as far as the intent of this 
> change is concerned.

No, it's not correct. ISO-8859-1 is the older version of Latin-1
without the Euro sign. ISO8859-15 adds it.

> How do you propose to pick and choose what we use from the X11 locale alias 
> list?

We have to go through the list one by one to check whether
the mapping update makes sense and is correct.

This will be difficult in a few cases where the glibc mapping
switches to UTF-8 from an ISO encoding. We'll have to find
evidence that this change does indeed make sense.

My take on this is that the X.org folks know better than the
glibc folks, since the former have to deal with end users that
rely on the locale settings a lot more than applications
using glibc for getting an initial locale setting right.

Also note that you are parsing the SUPPORTED file from
glibc (in slightly processed form):

https://github.com/bminor/glibc/blob/master/localedata/SUPPORTED

This file does not provide a locale alias mapping as
the routine in makelocalealias.py suggests. Instead it's
a list of locales to install by default:

https://github.com/bminor/glibc/blob/73dfd088936b9237599e4ab737c7ae2ea7d710e1/localedata/Makefile

In glibc you can define both the locale and the encoding separately
when creating a locale using localedef and the file simply provides
the default parameters to pass to this tool.

As such, I don't see how you can derive a default alias
meaning from the file.

It's simply an indication of what glibc would have installed
in case it were installed from source, but that's hardly ever
the case. On today's systems only a bare subset of locales
is installed and more added as necessary, so you rarely have
all the locales defined in SUPPORTED installed on a system.

So the file doesn't even provide a hint at what could
be installed on the system ("locale -a" gives you that list).

Here's the history:

https://github.com/bminor/glibc/commits/master/localedata/SUPPORTED

It's merely a list of additions and removals from the
default set. Nothing more. It does provide a list of
known and supported locales, but no usable or authoritative
encoding information (locales are defined using Unicode, so
the encoding is a parameter and not predefined).

Overall, I believe the file is pretty useless to use as
basis for an alias table providing encoding information.
It may provide some ideas for corrections, but should not
override the X.org one by default.

On the other hand, you have the local.alias master file:

https://cgit.freedesktop.org/xorg/lib/libX11/tree/nls/locale.alias.pre

together with the history of why changes were made and when.
This is an authoritative resource and people are making changes
against it from the user perspective.

I'd suggest to make the override optional in makelocalealias.py
via a command line switch and to use this for manually adding
or fixing X.org entries.

If you absolutely want to parse the glibc file per default as
well, please only let it add new entries, not override existing
ones. As we've seen in the patch, those overrides need to be
carefully reviewed.

--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Why is the X11 locale alias map used at all? It seems like it can only create 
> confusion with libc.

Originally only the X11 locale alias map was used. The support of the glibc 
locale alias map was added 2.5 years ago (issue20079).

--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The SUPPORTED file from glibc is used for determining the default encoding  for 
locales that don't include it explicitly. For example en_IN uses UTF-8 rather 
than ISO8859-1.

--

___
Python tracker 

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



[issue29769] pkgutil._iter_file_finder_modules should not be fooled by *.py folders

2017-03-09 Thread Wolfgang Maier

New submission from Wolfgang Maier:

The current implementation of _iter_file_finder_modules parses folders with a 
valid Python module extension as modules (e.g. it would report a *folder* xy.py 
as a module xy).
As a result, e.g., pydoc.apropos('') fails if such a folder is found anywhere 
on sys.path.

I'm attaching a patch that fixes this and also brings a few minor improvements 
(like using a set instead of a dict with 1 values and reusing the function in 
ImpImporter).

However, I have a question about it (which is also the reason why I didn't turn 
this into a PR right away): in addition to checking that an item detected as a 
module is not a directory, I think it would be good to also check that an 
__init__ module inside a possible package really is a file. If I uncomment the 
respective check in the patch though, I'm getting a test_pydoc failure because 
the test creates a package directory with no access to contained file 
attributes. So even though there is an __init__.py file in the package dir the 
isfile() check fails. I think that should, in fact, happen and the pydoc test 
is wrong, but apparently whoever wrote the test had a different opinion.
Any thoughts?

--
components: Library (Lib)
files: pkgutil.patch
keywords: patch
messages: 289285
nosy: ncoghlan, wolma
priority: normal
severity: normal
status: open
title: pkgutil._iter_file_finder_modules should not be fooled by *.py folders
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file46714/pkgutil.patch

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 09.03.2017 11:47, Serhiy Storchaka wrote:
> 
> The SUPPORTED file from glibc is used for determining the default encoding  
> for locales that don't include it explicitly. For example en_IN uses UTF-8 
> rather than ISO8859-1.

No, the glibc locales don't say anything about default encodings
used in a locale:

http://manpages.ubuntu.com/manpages/wily/en/man5/locale.5.html

These encodings are just used for determining the default
set of locale.encoding variants to install on the system,
nothing more:

https://github.com/bminor/glibc/blob/73dfd088936b9237599e4ab737c7ae2ea7d710e1/localedata/Makefile#L204

glibc does have a locale.alias file:

https://github.com/bminor/glibc/blob/73dfd088936b9237599e4ab737c7ae2ea7d710e1/intl/locale.alias

which uses the X.org format, but this is completely out of
date and declared obsolete.

Serhiy: If you believe that there's anything authoritative about
the glibc SUPPORTED file in terms of defining the commonly
used encoding in a locale, please provide references. These
should also clarify why the glibc encoding is the correct one
compared to the X.org mapping.

It doesn't help, trying to interpret things into such build
files. We need a database that is being actively maintained
and has a track record of representing what people actually
use in their locales. The only one I know is the X.org one.

--

___
Python tracker 

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



[issue29770] Executable help output (--help) at commandline is wrong for option -B

2017-03-09 Thread Wolfgang Langner

New submission from Wolfgang Langner:

The output for "python --help" for the option -B is wrong.
It contains also the old pyo files. But they were removed.

Output is:

-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x

should be:

-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x

--
assignee: docs@python
components: Documentation
messages: 289287
nosy: docs@python, tds333
priority: normal
severity: normal
status: open
title: Executable help output (--help) at commandline is wrong for option -B
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat

2017-03-09 Thread Mba

Mba added the comment:

> I don't think that a filesystem produce inodes larger than 2^63-1

The problem is real: the large inode number was assigned to a file created by 
MacOS on a share exported via CIFS, and then stated by Linux using NFS export.

--

___
Python tracker 

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



[issue26744] print() function hangs on MS-Windows 10

2017-03-09 Thread Ma Lin

Ma Lin added the comment:

This is an invalid issue, very sorry for waste your time! Especially apologize 
to Stinner.

After enabling `QuickEdit Mode`, then click the console will suspend the 
program.

--
resolution:  -> not a bug
stage:  -> 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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The original issue is issue29571. The locale module returned encoding ISO8859-1 
for locale en_IN (as in the X11 locale alias map), but glibc uses UTF-8 (as in 
glibc SUPPORT file).

--

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

New submission from Jack:

Currently using the package we can only define emails in the 'TO'
as shown here:
https://docs.python.org/2/library/email-examples.html#email-examples

There is no support for email to be sent as CC or BCC which is useful quality 
in many emails. Please see if this can be added.

--
messages: 289291
nosy: Nonickname
priority: normal
severity: normal
status: open
title: An email and MIME handling package - Add support to send CC of email
type: enhancement
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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Eric V. Smith

Eric V. Smith added the comment:

The examples don't cover it, but look at the documentation for setting 
arbitrary mail headers such as CC.

And look at smtplib.SMTP.sendmail() on sending a message to arbitrary 
recipients (to, cc, or bcc are all the same):
https://docs.python.org/2/library/smtplib.html#smtplib.SMTP.sendmail

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> 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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-09 Thread Oren Milman

Changes by Oren Milman :


--
pull_requests: +476

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

Jack added the comment:

But this is what I mean.. It shouldn't be arbitrary.
When you define CC you want him as CC not as another one in the TO.
This is why I said this is enhancement request.

--

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

Changes by Jack :


--
status: closed -> open

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Eric V. Smith

Eric V. Smith added the comment:

So, you want to improve the examples? I wouldn't be opposed to that. I don't 
see that there's any code to change.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

Jack added the comment:

I think you missundersttod. I showed the example page just so you would 
understand what I am talking about.
Let me explain it better:
msg['Subject'] = 'The contents of %s' % textfile
msg['From'] = me
msg['To'] = you

Works.

msg['Subject'] = 'The contents of %s' % textfile
msg['From'] = me
msg['To'] = you
msg['CC'] = x
msg['BCC'] = y

won't work. It doesn't know what is CC and BCC.
This is why I opened this request to modify the package to support it.

--

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

Jack added the comment:

Please see the stack overflow question:
http://stackoverflow.com/questions/42696100/python-smtp-send-email-with-cc

--

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +email
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Eric V. Smith

Eric V. Smith added the comment:

You need to review how SMTP works. The contents of the mail message have no 
bearing on where messages are sent. That's exactly how BCC works: there's 
nothing in the message telling you who is BCC'd, but the mail is still sent to 
the BCC recipients, via SMTP.

Similarly, you could have the message say that some...@example.com is in the 
To: header, but not send it to them via SMTP.

I'm on the fence about including this in the examples.

In any event, this bug tracker is not a place for an email tutorial. From your 
SO link, there's a reference (by user xyref) to another question which explains 
this in detail: 
http://stackoverflow.com/questions/1546367/python-how-to-send-mail-with-to-cc-and-bcc.
 This completely explains the issue.

--

___
Python tracker 

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



[issue29769] pkgutil._iter_file_finder_modules should not be fooled by *.py folders

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread Jack

Jack added the comment:

"I'm on the fence about including this in the examples."

Think of it this way.. Including it in the docs would have prevented this 
question.
It can be just a side note it doesn't have to be a whole example.

Thx.

--
status: open -> closed

___
Python tracker 

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



[issue29770] Executable help output (--help) at commandline is wrong for option -B

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue29771] An email and MIME handling package - Add support to send CC of email

2017-03-09 Thread R. David Murray

R. David Murray added the comment:

If you use smtplib.send_message in python3, it will do what you want (including 
stripping BCC headers before sending the message).

If someone wants to create a PR to add an example of what Eric is talking about 
(specifying additional senders in smtplib.sendmail to match what is in the CC 
headers) please open a new issue with a PR (which may or may not get accepted 
:). I don't think it is worth doing, myself, but I won't object if others think 
it enhances the docs.

--

___
Python tracker 

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



[issue29772] Unintentionally deleted line on library/collections.rst

2017-03-09 Thread Kinebuchi Tomohiko

New submission from Kinebuchi Tomohiko:

The last part of "Counter objects" section has a strange line: "in Smalltalk."

https://docs.python.org/2.7/library/collections.html#counter-objects

The line just before "in Smalltalk" might be deleted by accident.
Related issue is bpo-25910 [1]_ and the applied patch is this [2]_, although an 
intended patch might looks like this [3]_.

.. [1] http://bugs.python.org/issue25910

.. [2] https://hg.python.org/cpython/rev/14e00e7e4d51#l15.7
   patch for the 2.7 branch

.. [3] https://hg.python.org/cpython/rev/ce5ef48b5140#l21.7
   patch for the 3.5 branch

I will create a pull request.

--
assignee: docs@python
components: Documentation
messages: 289300
nosy: cocoatomo, docs@python
priority: normal
severity: normal
status: open
title: Unintentionally deleted line on library/collections.rst
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



[issue29773] Additional float-from-string tests

2017-03-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Following PR adds more corner cases in the test for calling float() with 
invalid string.

--
components: Tests
messages: 289301
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Additional float-from-string tests
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29773] Additional float-from-string tests

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +477

___
Python tracker 

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



[issue29772] Unintentionally deleted line on library/collections.rst

2017-03-09 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +478

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2017-03-09 Thread Elliot Gorokhovsky

Changes by Elliot Gorokhovsky :


--
pull_requests: +479

___
Python tracker 

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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The zipfile module can raise struct.error when process corrupted extra field. 
This issue was partially resolved by issue14315. Following PR converts 
struct.error to BadZipFile in other case.

--
components: Library (Lib)
messages: 289302
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Improve zipfile handling of corrupted extra field
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +480

___
Python tracker 

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



[issue29772] Unintentionally deleted line on library/collections.rst

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29772] Unintentionally deleted line on library/collections.rst

2017-03-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Nice catch.

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-09 Thread Paul Moore

Paul Moore added the comment:

Confirmed that 3.6.1rc1 fixes the issue in my original use case.

--

___
Python tracker 

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



[issue29775] There appears to be a spurious ^0 in sys.version for 3.6.1rc1

2017-03-09 Thread Paul Moore

New submission from Paul Moore:

The 3.6.1rc1 build seems to have a spurious "^0" at the end of the version, 
before the VCS ID - 3.6.1rc1^0):

>py -3.6
Python 3.6.1rc1 (v3.6.1rc1^0:e0fbe5feee4f9c00f09eb9659c2182183036261a, Mar  4 
2017, 20:00:12) [MSC v.1900 64 bit (AMD64)] on win32
>>> sys.version
'3.6.1rc1 (v3.6.1rc1^0:e0fbe5feee4f9c00f09eb9659c2182183036261a, Mar  4 2017, 
20:00:12) [MSC v.1900 64 bit (AMD64)]'

It's not showing in sys.version_info, so it's probably only cosmetic. Also, I 
don't think this is really a release blocker - just marking it as such so it 
gets checked (I wonder if it's an artifact of the github migration, I think git 
uses ^0 to mean something specific in relation to commit IDs?)

I've only checked on Windows. I don't know if it's the same on Unix.

If it's deemed cosmetic, I'm happy for it to be downgraded to non-blocking, or 
even closed as not an issue. Just wanted to flag it up in case it's a symptom 
of something deeper.

--
assignee: ned.deily
components: Interpreter Core
messages: 289305
nosy: ned.deily, paul.moore, steve.dower
priority: release blocker
severity: normal
status: open
title: There appears to be a spurious ^0 in sys.version for 3.6.1rc1
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat

2017-03-09 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +481

___
Python tracker 

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



[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-09 Thread Ethan Furman

Ethan Furman added the comment:

Thank you, Josh, that's a very good point.

One can be expected to have the correct spelling when using attribute access.

So the two accesses that make sense for a _missing_ call would then be:

- by-value lookup (e.g. Label(1))

- by-name lookup (e.g. Label['redapple'])

Sound reasonable?

--

___
Python tracker 

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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread STINNER Victor

STINNER Victor added the comment:

I merged your PR, thanks!

I don't think that this minor enhancement on error message is worth it to be 
backported. It only impacts corrupted ZIP files, and 3.6 and older already 
raise an error message.

I updated manually the PR status, it seems like the GitHub bot is still broken.

--
nosy: +haypo

___
Python tracker 

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



[issue29674] Use GCC __attribute__((alloc_size(x, y))) on PyMem_Malloc() functions

2017-03-09 Thread svelankar

svelankar added the comment:

So once these functions are decorated with this attribute, what kind of 
testing/validation you have in mind, please let me know.

--
nosy: +svelankar

___
Python tracker 

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



[issue29776] Modernize properties

2017-03-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Following PR updates Python sources to use new shiny syntax for properties. It 
replaces the old code

def _foo(self):
...

def _set_foo(self, value):
...

foo = property(_foo, _set_foo)

with the new code

@property
def foo(self):
...

@foo.setter
def foo(self, value):
...

New syntax was added in Python 2.4.

--
components: Library (Lib)
messages: 289309
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Modernize properties
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29776] Modernize properties

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +482

___
Python tracker 

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



[issue29674] Use GCC __attribute__((alloc_size(x, y))) on PyMem_Malloc() functions

2017-03-09 Thread STINNER Victor

STINNER Victor added the comment:

> So once these functions are decorated with this attribute, what kind of 
> testing/validation you have in mind, please let me know.

Call PyMem_Malloc(Py_ssize_t) for example: it must emit a warning on GCC 7, 
since casting negative values to size_t overflows.

Not sure how to test the attribute on GCC 6. Maybe some GCC related static 
analyzers are able to detect memory leaks like:

void test(void)
{
   void *ptr = PyMem_Malloc(16);
   /* don't free ptr */
}

--

___
Python tracker 

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



[issue29774] Improve zipfile handling of corrupted extra field

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think the same.

--

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

OK, this seems to narrow down the problem. The following was legal in Python 
3.5.1, but in 3.5.3 and 3.6.1rc1 returns:

'TypeError: must be type, not classobj'

class Foo_Base:
pass

class Bar_Base:
def get_foo(self):
f = Foo_Base()
return f

class Foo(Foo_Base):
pass

class Bar(Bar_Base):
def get_foo2(self):
return super(Bar, self).get_foo()

bar = Bar()
b = bar.get_foo2()

Is this a deliberate and permanent change? If so, it looks like I have a lot of 
work on my hands.

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



[issue29776] Modernize properties

2017-03-09 Thread Ethan Furman

Ethan Furman added the comment:

Have you made sure nothing calls the replaced functions manually?

Such as:

...
self._set_foo(9)
...

--
nosy: +ethan.furman

___
Python tracker 

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



[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

2017-03-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> Case (c) sidesteps the above questions.

I like the (c) option. I don't think we should use logging/warnings here, as 
they can produce unwanted noise that few know how to silence.

When the list of errors is passed as a second argument to the exception, how is 
it rendered?  Would it make sense to concatenate all error messages:


  if errs:
  errors_msg = '  \n'.join(str(e) for e in errs)
  raise error(f"connection failed:\n{errors_msg}", errs)

Or maybe we should track which addr caused which exception?

  for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  af, socktype, proto, canonname, sa = res
  try:
  ...
  except error as e:
  errs.append((canonname, e))
  ...

  if errs:
  error_msg = '  \n'.join(f'{addr}: {e}' for addr, e in errs)
  raise error('connection failed:\n{error_msg}', errs)

--
nosy: +yselivanov

___
Python tracker 

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



[issue29776] Modernize properties

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I replaced only private getters and setters. All tests passed.

--

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

Nope - belay that. Checking through the SWIG-generated Python code, all the 
classes correctly inherit from object, which negates that issue.

--

___
Python tracker 

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



[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

2017-03-09 Thread Yury Selivanov

Yury Selivanov added the comment:

This is a new feature, so we can only push it to 3.7.

--
nosy: +brett.cannon, haypo
versions:  -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread STINNER Victor

STINNER Victor added the comment:

The code in msg289314 doesn't emit any warning. I tested 3.5, 3.6 and master 
development branches and system Python 3.5.2.

--

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread STINNER Victor

STINNER Victor added the comment:

"Nope - belay that. Checking through the SWIG-generated Python code, all the 
classes correctly inherit from object, which negates that issue."

I don't understand your comment, on Python 3, any class inherit from object be 
default. There is no more old and new classes.


haypo@selma$ cat y.py 
class A: pass
class B(object): pass

print(A.__bases__)
print(B.__bases__)


haypo@selma$ python3 y.py 
(,)
(,)

--

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

Sorry - ignore that. Brain-fart at the end of a (very) long day.

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



[issue29769] pkgutil._iter_file_finder_modules should not be fooled by *.py folders

2017-03-09 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue29773] Additional float-from-string tests

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +483

___
Python tracker 

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



[issue26744] print() function hangs on MS-Windows 10

2017-03-09 Thread Eryk Sun

Eryk Sun added the comment:

> After enabling `QuickEdit Mode`, then click the console will 
> suspend the program.

That's not suspending the entire process. It's blocking the thread that writes 
to the console. The user-mode WriteConsole function is implemented by a 
synchronous NtDeviceIoControlFile system call. The console (i.e. conhost.exe) 
is on the other end of the call. It has at least 2 threads -- an input thread 
that's basically a standard message loop and an output thread for updating and 
rendering the contents of its active screen buffer. It's a feature that 
clicking on the console window to copy text causes its output thread to block. 
This in turn prevents WriteFile in python.exe from completing.

That said, I've seen random hangs in the console that are unrelated to the 
above (e.g. hanging while reflowing text), but not often enough that I bothered 
to investigate it. There's a lot of new code in the 2nd generation console 
implementation (ConhostV2.dll) in Windows 10, and the developers are making 
significant improvements with each update. I'm waiting for the dust to settle.

--

___
Python tracker 

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



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-09 Thread Brett Cannon

Changes by Brett Cannon :


--
title: PyLong_FromString fails on decimals with leading zero and base=0 -> 
PyLong_FromString documentation wrong on numbers with leading zero and base=0

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Brett Cannon

Brett Cannon added the comment:

Since it sounds like everything on the Python side is fine I'm closing this.

--
nosy: +brett.cannon
resolution:  -> not a bug
stage:  -> 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



[issue29773] Additional float-from-string tests

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +484

___
Python tracker 

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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

I don't agree that it should be closed yet. I still have the issue that an 
approach that was perfectly legal in Python 3.5 now no longer works in Python 
3.6, and I don't know why. The description in msg289281 stands, and is a real 
problem. Nothing has changed in my code - I compile against Python 3.5 and it 
works, against 3.6 it doesn't.

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-09 Thread Oren Milman

Changes by Oren Milman :


--
pull_requests: +485

___
Python tracker 

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



[issue29773] Additional float-from-string tests

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29758] Previously-working SWIG code fails in Python 3.6

2017-03-09 Thread Tristan Croll

Tristan Croll added the comment:

I've cross-posted the following to the SWIG bug tracker. Hopefully someone can 
find an answer, because I'm getting nowhere.

If I have two classes Foo and Bar (where Bar has a function get_foo() that 
returns a Foo object) defined in the SWIG-generated library foobar, and wrap 
them as follows:

```
def mappedclass(old_cls):
'''
Ensures that objects returned from functions in the clipper_core
library are instantiated in Python as the derived class with the
extra functionality. 
'''
def decorator(cls):
def __newnew__(thiscls, *args, **kwargs):
if thiscls == old_cls:
return object.__new__(cls)
return object.__new__(thiscls)
old_cls.__new__ = __newnew__

return cls
return decorator

@mappedclass(foobar.Foo)
class Foo(foobar.Foo):
pass

@mappedclass(foobar.Bar)
class Bar(foobar.Bar):
def get_foo(self):
return super(Bar, self).get_foo()

```

then in Python 3.5:
```
f = Foo()
b = Bar()
b.get_foo()
```
all work. In Python 3.6:

```
f = Foo()
b = Bar()
```
... both work, but
`b.get_foo()`
yields the error as per my OP. Real-world examples:

Constructor (works without trouble in both versions)
```
SWIGINTERN PyObject *_wrap_new_Cell_descr__SWIG_0(PyObject 
*SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  clipper::Cell_descr *result = 0 ;
  
  if(!PyArg_UnpackTuple(args,(char *)"new_Cell_descr",0,0)) SWIG_fail;
  {
try
{
  result = (clipper::Cell_descr *)new clipper::Cell_descr();
} catch (clipper::Message_fatal m)
{
  SWIG_exception(SWIG_RuntimeError, m.text().c_str() );
  SWIG_fail;
} catch (std::out_of_range e)
{
  const char *errString;
  if ( !strcmp(e.what(), "" ) ) {
errString = "Index out of range!";
  } else {
errString = e.what();
  }
  SWIG_exception(SWIG_IndexError, errString );
  SWIG_fail;
} catch (std::length_error e)
{
  SWIG_exception(SWIG_ValueError, e.what() );
  SWIG_fail;
} catch (std::invalid_argument e)
{
  SWIG_exception(SWIG_ValueError, e.what() );
  SWIG_fail;
} catch (std::exception e)
{
  SWIG_exception(SWIG_UnknownError, e.what() );
  SWIG_fail;
} catch (...)
{
  SWIG_exception(SWIG_UnknownError, "Unknown error" );
  SWIG_fail;
}

  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), 
SWIGTYPE_p_clipper__Cell_descr, SWIG_POINTER_NEW |  0 );
  return resultobj;
fail:
  return NULL;
}
```

Getter (fails under the above conditions):
```
SWIGINTERN PyObject *_wrap_Cell_cell_descr(PyObject *SWIGUNUSEDPARM(self), 
PyObject *args) {
  PyObject *resultobj = 0;
  clipper::Cell *arg1 = (clipper::Cell *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  clipper::Cell_descr result;
  
  if(!PyArg_UnpackTuple(args,(char *)"Cell_cell_descr",1,1,&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_clipper__Cell, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cell_cell_descr" 
"', argument " "1"" of type '" "clipper::Cell *""'"); 
  }
  arg1 = reinterpret_cast< clipper::Cell * >(argp1);
  {
try
{
  result = clipper_Cell_cell_descr(arg1);
} catch (clipper::Message_fatal m)
{
  SWIG_exception(SWIG_RuntimeError, m.text().c_str() );
  SWIG_fail;
} catch (std::out_of_range e)
{
  const char *errString;
  if ( !strcmp(e.what(), "" ) ) {
errString = "Index out of range!";
  } else {
errString = e.what();
  }
  SWIG_exception(SWIG_IndexError, errString );
  SWIG_fail;
} catch (std::length_error e)
{
  SWIG_exception(SWIG_ValueError, e.what() );
  SWIG_fail;
} catch (std::invalid_argument e)
{
  SWIG_exception(SWIG_ValueError, e.what() );
  SWIG_fail;
} catch (std::exception e)
{
  SWIG_exception(SWIG_UnknownError, e.what() );
  SWIG_fail;
} catch (...)
{
  SWIG_exception(SWIG_UnknownError, "Unknown error" );
  SWIG_fail;
}

  }
  resultobj = SWIG_NewPointerObj((new clipper::Cell_descr(static_cast< const 
clipper::Cell_descr& >(result))), SWIGTYPE_p_clipper__Cell_descr, 
SWIG_POINTER_OWN |  0 );
  return resultobj;
fail:
  return NULL;
}
```

--

___
Python tracker 

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



[issue29776] Modernize properties

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have checked and none from replaced function is used. But just for the case I 
reverted changes for Lib/xml/dom/. Here used more complex logic for generating 
other properties.

--

___
Python tracker 

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



[issue29775] There appears to be a spurious ^0 in sys.version for 3.6.1rc1

2017-03-09 Thread Ned Deily

Ned Deily added the comment:

Thanks, Paul, we are aware of the spurious ^0.  It will be resolved under Issue 
25793.

--
priority: release blocker -> 
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate sys._mercurial and create sys._git

___
Python tracker 

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



[issue29777] argparse arguments in main parser hide an argument in subparser

2017-03-09 Thread Alan Evangelista

New submission from Alan Evangelista:

If you have a argument named -- in a subparser and two arguments named 
-- in the main parser and call the Python executable with

python  --

argparse fails with:

error: ambiguous option: -- could match --, 
--

This probably happens due to how the argument abbreviation parsing is 
implemented. Is it possible to support disabling argument abbreviation in 
Python 2.7, as it is done in Python 3?

--
components: Library (Lib)
messages: 289327
nosy: Alan Evangelista
priority: normal
severity: normal
status: open
title: argparse arguments in main parser hide an argument in subparser
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



[issue29777] argparse arguments in main parser hide an argument in subparser

2017-03-09 Thread Eric V. Smith

Eric V. Smith added the comment:

No, we won't be adding new features to 2.7. Sorry.

--
nosy: +eric.smith
resolution:  -> rejected
stage:  -> resolved
type:  -> enhancement

___
Python tracker 

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



[issue29765] 2.7.12 compile error from ssl related

2017-03-09 Thread Christian Heimes

Christian Heimes added the comment:

/usr/local looks wrong. Did you install a custom build of OpenSSL? What's the 
output of

rpm -qf /usr/local/include/openssl/asn1.h

?

--

___
Python tracker 

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



[issue19974] tarfile doesn't overwrite symlink by directory

2017-03-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2017-03-09 Thread STINNER Victor

Changes by STINNER Victor :


--
priority: critical -> release blocker

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2017-03-09 Thread Larry Hastings

Larry Hastings added the comment:

I've accepted PR 224.  I don't plan an emergency release of 3.4 to get this 
change out into the world.  Unless there's any other business, we can now close 
this issue.

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



[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-09 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Yeah, that sounds fine.

--

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Issue 29723 is a follow up issue to this one, where these changes revealed some 
latent defects in how sys.path[0] was being initialised in general for 
directory and zipfile execution (those defects mean the change committed here 
adds an extra directory to sys.path when *not* running in isolated mode).

Paul, are you in a position to rebuild 3.6 with the changes from 
https://github.com/python/cpython/pull/575 and indicate whether or not that 
still fixes the original problem?

--

___
Python tracker 

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



[issue29769] pkgutil._iter_file_finder_modules should not be fooled by *.py folders

2017-03-09 Thread Nick Coghlan

Nick Coghlan added the comment:

I think there's an open issue somewhere pointing out that _iter_file_finder 
doesn't handle PEP 420 namespace packages correctly, precisely because it's 
still looking for an __init__.py file.

So I'd suggest not worry about changing the __init__.py handling here, and 
instead just add a new test case to test_pkgutil that fails with the old 
traversal code and passes with the new code.

--

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2017-03-09 Thread Tibor Csonka

New submission from Tibor Csonka:

When Py_SetPath is used to set up module path at initialization, the Py_SetPath 
causes getpathp.c::calculate_path not to be called. However, calculate path is 
the only function calling getpathp.c::get_progpath which initializes the local 
dllpath static variable.

Later the interpreter tries to load python3.dll and uses dllpath which is empty 
by default. This empty path gets joined with \python3.dll and \DLLs\python3.dll 
which is used in the LoadLibraryExW resulting in loading python3.dll from the 
root location of the windows drive the application is running from.

The behavior was reproduced using PyInstaller but it is present in any 
embedding application which uses Py_SetPath.

--
components: Windows
messages: 289334
nosy: Tibor Csonka, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: _Py_CheckPython3 uses uninitialized dllpath when embedder sets module 
path with Py_SetPath
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



[issue29770] Executable help output (--help) at commandline is wrong for option -B

2017-03-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +486

___
Python tracker 

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



[issue29679] Add @contextlib.asynccontextmanager

2017-03-09 Thread Nick Coghlan

Nick Coghlan added the comment:

For anyone interested in the question of backports, I moved that discussion 
over to the contextlib2 tracker: 
https://github.com/jazzband/contextlib2/issues/12

--

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Oren.

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch no longer applied cleanly (in particular to arraymodule.c). Oren, 
could you please update it?

--

___
Python tracker 

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



[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +487

___
Python tracker 

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



[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi, I updated the documentation mentioning that f-strings cannot be used as 
docstring. Please review it.
Thanks.

--
nosy: +Mariatta

___
Python tracker 

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




[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2017-03-09 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2017-03-09 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue19821] pydoc.ispackage() could be more accurate

2017-03-09 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2017-03-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The issue shouldn't be closed until it resolved or rejected.

I like the idea, and benchmarking results for randomized lists look nice. But 
could you please run benchmarks for already sorted lists?

--
nosy: +serhiy.storchaka
stage: resolved -> patch review
status: closed -> open

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Do you believe this program should work?

import locale, os
for l in open("/usr/share/i18n/SUPPORTED"):
alias, encoding = l.strip().split()
locale.setlocale(locale.LC_ALL, alias)
try:
enc = locale.getlocale()[1]
except ValueError:
continue # not in table
normalized = enc.replace("ISO", "ISO-"). \
 replace("_", "-"). \
 replace("euc", "EUC-"). \
 replace("big5", "big5-").upper()
assert normalized == locale.nl_langinfo(locale.CODESET)

After my change it does—the encoding returned from getlocale() is the one 
actually being used by glibc. It fails dramatically on earlier versions of 
Python (for example on the en_IN example from #29571.) I don't understand why 
Python needs to editorialize whatever choices libc or the system administrator 
has made.

Is getlocale() expected to return something different from the underlying C 
locale?

In fact, why have this table at all instead of using nl_langinfo to return the 
encoding for the current locale?

--

___
Python tracker 

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



[issue29779] New environment variable PYTHONHISTORY

2017-03-09 Thread Levi Sabah

Changes by Levi Sabah <0xl...@gmail.com>:


--
nosy: 0xl3vi
priority: normal
pull_requests: 488
severity: normal
status: open
title: New environment variable PYTHONHISTORY
versions: Python 3.7

___
Python tracker 

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