[issue31216] Add ensure_ascii argument to json.tool

2017-08-15 Thread TaoQingyun

New submission from TaoQingyun:

Sometimes I want this
```
$ echo -e '"\xe4\xbd\xa0\xe5\xa5\xbd"' | ./python -m json.tool --no-escape  
   
"你好"
```

not just 
```
$ echo -e '"\xe4\xbd\xa0\xe5\xa5\xbd"' | ./python -m json.tool
"\u4f60\u597d" 
```

--
components: Library (Lib)
files: jsontool.patch
keywords: patch
messages: 300327
nosy: qingyunha
priority: normal
severity: normal
status: open
title: Add ensure_ascii argument to  json.tool
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file47083/jsontool.patch

___
Python tracker 

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



[issue31215] Add version changed notes for OpenSSL 1.1.0 compatibility

2017-08-15 Thread Nick Coghlan

New submission from Nick Coghlan:

https://bugs.python.org/issue26470 updated the ssl and hashlib modules in 2.7 
and 3.5+ to be compatible with OpenSSL 1.1.0.

However, it's currently unclear what the *minimum* versions actually are for 
platforms that want to drop support for OpenSSL 1.0.x, and it's particularly 
unclear in 2.7, as that lacks the deprecation warning for OpenSSL 0.9.8, 1.0.0 
and 1.0.1 that was introduced in Python 3.6.

This doesn't rise to the level of something to be documented as a new feature 
in the 2.7 What's New, but I think a version changed note in the opening 
section of the `ssl` module documentation would be appropriate:

2.7 branch:

.. versionchanged: 2.7.13
   Updated to support linking with OpenSSL 1.1.0

3.6 and master branches (immediately before the 3.6 deprecation notice):

.. versionchanged: 3.5.3
   Updated to support linking with OpenSSL 1.1.0

--
assignee: docs@python
components: Documentation
messages: 300326
nosy: christian.heimes, docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Add version changed notes for OpenSSL 1.1.0 compatibility
type: enhancement
versions: Python 2.7, 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



[issue31212] min date can't be converted to timestamp

2017-08-15 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> haypo
nosy: +haypo

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-15 Thread Steve Dower

Steve Dower added the comment:

Burn bundles are part of Wix, but it's the part you don't like :)

If you just want a single MSI, you won't want a bundle. But you will have to 
leave out nearly half of the features I listed because they simply are not 
possible without it.

--

___
Python tracker 

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



[issue31209] MappingProxyType can not be pickled

2017-08-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

What would be the point of pickling a MappingProxy?  Do you have use case or is 
it just a curiosity?

--
nosy: +rhettinger

___
Python tracker 

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



Re: Python's method-resolution algorithm: An implementation question

2017-08-15 Thread Evan Aad
Thanks!

On Tue, Aug 15, 2017 at 10:41 PM, Ian Kelly  wrote:
>
> On Tue, Aug 15, 2017 at 12:57 PM, Evan Aad  wrote:
> > I don't see how, since the L(B*)'s are listed in order in the argument
> > list: L(B1), L(B2), ..., and each L(B*) starts with B*: L(B1) =  > ...>, L(B2) = , ...
> >
> > Could you please give a counter-example?
>
> Sure.
>
> merge(, )  ->  
>
> vs:
>
> merge(, , )  ->  TypeError
>
> Or in Python:
>
> >>> class A1: pass
> >>> class A2: pass
> >>> class B1(A1): pass
> >>> class B2(A2, B1): pass
> >>> class C(B1, B2): pass
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: Cannot create a consistent method resolution order (MRO)
> for bases B1, B2
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue6090] zipfile: Bad error message when zipping a file with timestamp before 1980

2017-08-15 Thread Craig McQueen

Craig McQueen added the comment:

One ongoing weakness I see with this situation is that it's difficult to code a 
suitable work-around if a user wants to zip files that have a date < 1980 (e.g. 
to zip it with a datestamp of 1-Jan-1980).
https://stackoverflow.com/q/45703747/60075

I am trying to create a zip file with Python 3.5.2 zipfile, on Linux. Some of 
the files I'm trying to add have timestamps of 1-Jan-1970 (embedded system 
without a real-time clock module). So zipfile gives an exception:

ValueError: ZIP does not support timestamps before 1980

My goal then is to implement a work-around to add these files to the zip file 
with a timestamp of 1-Jan-1980. However, I am finding it difficult to find a 
suitable work-around.

At first I thought I can do this:

def zinfo_from_file(fullname, arcname):
st = os.stat(fullname)
mtime = time.localtime(st.st_mtime)
date_time = mtime[0:6]
if date_time[0] < 1980:
date_time = (1980, 1, 1, 0, 0, 0)
zinfo = zipfile.ZipInfo(arcname, date_time)
return zinfo

...
zinfo = zinfo_from_file(fullname, arcname)
chunksize=512
with open(fullname, 'rb') as src, myzipfile.open(zinfo, 'w') as dest:
while True:
data = src.read(chunksize)
if not data:
break
dest.write(data)
...

However, it turns out that myzipfile.open(zinfo, 'w') is not supported until 
Python 3.6. (I'm using Yocto to build embedded Linux, which currently only 
supports Python 3.5.x.)

I guess I could try doing myzipfile.writestr(...), although then it appears 
that I have to load the entire file data into memory.

--
nosy: +cmcqueen1975

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-15 Thread D Gentry

D Gentry added the comment:

Thank you for the information. That will definitely be helpful.

Also, thank you for being so detailed with your explanation.

Even though it will be difficult and may take more time than I was
initially intending, I believe its within the realm of possibility.

Therefore, I will be trying my hand at crafting the MSI, though like you
said earlier, it's not nearly as easy as the msdn article made it appear.

The toolset you offered should help out a lot.

Thank you for all of your expert advice.

I have one last question before I begin on my journey.

You mentioned "burn bundles" at the end of the message. Are these something
I would have to build myself or is there a repository where I can download
the files?

On Mon, Aug 14, 2017 at 12:55 PM, Steve Dower 
wrote:

>
> Steve Dower added the comment:
>
> The general requirements of an installer are:
> * runs without any preinstalled prerequisites
> * does not install anything permanent until the user says so (Visual
> Studio breaks this rule :( )
> * installs all required prerequisites
> * install on all supported operating systems
> * allow users to [de]select optional components
> * correctly uninstall previous compatible versions
> * correctly do *not* uninstall previous identical versions
> * update user environment settings (registry, environment, etc.)
> * create Start Menu shortcuts
> * create file associations
> * create context menus
> * install files into customizable location with correct security settings
> * correctly roll back when installation fails, including restoring
> previously uninstalled components and attempting to execute installed tools
> that may not be installed correctly
> * attempt to execute just-installed components that may not be installed
> correctly (e.g. ensurepip, compileall, trigger environment variable reload)
> * detect and abort when installation is going to fail, and explain to the
> user how to solve the problem
> * provide live progress feedback and information about what operations are
> occurring
> * provide detailed log files to help offer user support post-installation,
> and help users find those logs
> * provide registration information so the operating system can help users
> modify or remove the installation
> * allow users to modify, repair and upgrade the installation without
> corrupting it (or any others) or forcing them to remove/reinstall
> * allow users to choose whether to install just for themselves or for the
> entire machine, and request correct permissions based on this choice
> * allow administrators to script an entire installation and have it run
> silently and/or with progress (and cancellation) only
> * allow users to minimize download size by deselecting optional components
> * allow users to obtain all optional components to allow full installation
> without public internet access
> * install without executing arbitrary third-party code that may have been
> maliciously placed in a user's download directory
> * automatically include new files added by developers who have not
> explicitly modified the installer
>
> These are all the features of our current installer, and nearly all of
> them work for basically every user. Many of these are literally not
> achievable with just an MSI, or require significantly more complicated
> commands to be run by the end user, rather than providing options in a user
> interface.
>
> If you're still interested in giving it a go, visit http://wixtoolset.org/
> and have a look at their tools. These are the gold-standard right now for
> building MSIs (and Burn bundles, which is what we currently have).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset de36ba065e933648f5687998021175cf21d4564b by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-30928: Update idlelib/NEWS.txt to 2017-08-15. (GH-3098) (#3099)
https://github.com/python/cpython/commit/de36ba065e933648f5687998021175cf21d4564b


--

___
Python tracker 

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



Re: Proposed new syntax

2017-08-15 Thread Ben Finney
Gregory Ewing  writes:

> The whole reason to write something as a comprehension is because you
> want to express it declaratively. You're saying "this is the list I
> want, I don't care how you compute it."

That's certainly a strong reason for my choosing comprehension
expressions: when I don't want to write a sequence of statements in a
loop, an expression communicates the intent (“this is one expression
with one output; think of it as one operation”).

> Likewise, the reader should be able to read it as "this is the list
> produced, and you *don't have to care* how it gets computed."

So I find the ‘while’ proposed addition to be counter to that purpose,
and describe it as confounding the ability of the reader to reason about
the expression.

> Introducing procedural elements such as "while" into a comprehension
> messes that up, because suddenly the reader *does* have to care about
> details of how it gets computed.

Thanks for stating it so well, Greg.

-- 
 \  “The good thing about science is that it's true whether or not |
  `\  you believe in it.” —Neil deGrasse Tyson, 2011-02-04 |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31214] os.walk has a bug on Windows

2017-08-15 Thread Chris Lovett

Chris Lovett added the comment:

Oh, my bad then. Apologies for the noise in your system.

--

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The configdialog diff for #31205 was so jumbled that it did not apply correctly 
to 3.6.  Let's do this in 2 PRs.  First adds the class to how we think it 
should be.  The second deletes the old code, makes any edits needed for the new 
class, and redirects the tests.

--

___
Python tracker 

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



[issue31211] distutils/util.py get_platform() does not identify linux-i686 platforms

2017-08-15 Thread Éric Araujo

Éric Araujo added the comment:

Hello!  Your analysis sounds right, but this is the wrong place.  distutils 
doesn’t know about wheels, it’s setuptools and/or the wheel module that 
generate them, and pip and others who consumes them.  Please report the issue 
to the setuptools and/or wheel bug trackers (see 
https://packaging.python.org/key_projects/ ) and I’ll close this one.

--
resolution:  -> third party
status: open -> pending
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3138

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 7f066844a79ea201a28b9555baf4bceded90484f by Terry Jan Reedy in 
branch 'master':
bpo-30928: Update idlelib/NEWS.txt to 2017-08-15. (#3098)
https://github.com/python/cpython/commit/7f066844a79ea201a28b9555baf4bceded90484f


--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The change to configdialog is basically a block move with a few edits.  The 
resulting diff is so complicated that git could not apply it cleanly to the 
identical code in 3.6.  We should do multiple PRs for the highlight group.

--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset ff4b222b029f9977a4509d8697ba2b82c09b477a by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31205: IDLE: Factor KeysPage class from ConfigDialog (GH-3096) (#3097)
https://github.com/python/cpython/commit/ff4b222b029f9977a4509d8697ba2b82c09b477a


--

___
Python tracker 

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



[issue31214] os.walk has a bug on Windows

2017-08-15 Thread R. David Murray

Changes by R. David Murray :


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



[issue31214] os.walk has a bug on Windows

2017-08-15 Thread Peter Otten

Peter Otten added the comment:

Read the documentation of os.walk() again. It already walks the complete 
directory tree starting with src. 

When you invoke it again by calling your copy_dir() method recursively you will 
of course see once more the files and directories in the respective 
subdirectory.

--
nosy: +peter.otten

___
Python tracker 

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



Re: Proposed new syntax

2017-08-15 Thread Gregory Ewing

Steve D'Aprano wrote:
I take issue with your statement that relying on order of evaluation is always 
"a very bad idea".


Perhaps what I should say is that relying on side effects in
an expression occurring in a particular order is a bad idea.
Boolean operators are a well-understood special case that
doesn't extend to other expression elements. If you saw

   x = foo(y) + bar(z)

you wouldn't immediately assume it relied critically on
foo being called before bar -- would you?


And especially now that print is a regular function instead of a
statement, it is incredibly useful to stick a print or two in the middle of an
expression for debugging.


That's fine as a temporary hack, but I would never use that
for something the program needs to do as part of its normal
operation.


# paraphrase, not an actual quote
"Comprehensions might actually have well-defined semantics in terms
of for-loops, just as they are documented to have, but we should
pretend that they don't because some really complicated expressions
with side-effects can be confusing or buggy."


That's pretty much it, except I would delete "really
complicated". Any reliance on side effects in an expression
is confusing and bug-prone, IMO.

The whole reason to write something as a comprehension is
because you want to express it declaratively. You're saying
"this is the list I want, I don't care how you compute it."

Likewise, the reader should be able to read it as "this is
the list produced, and you *don't have to care* how it
gets computed."

Introducing procedural elements such as "while" into a
comprehension messes that up, because suddenly the reader
*does* have to care about details of how it gets computed.

And those details can be tricky. We've already seen how a
subtle error can creep in when you get a "while" and an
"if" in the wrong order!

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3137

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3136

___
Python tracker 

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



[issue31214] os.walk has a bug on Windows

2017-08-15 Thread Chris Lovett

New submission from Chris Lovett:

When I walk a directory recursively, it is tacking on an additional 
non-existant file from one of the subdirectories.  Here's the code:

def copy_dir(self, src, dest):
result = sftp.mkdir(dest)
for dirname, dirnames, filenames in os.walk(src):
for subdirname in dirnames:
print("entering dir:" + subdirname)
self.copy_dir(os.path.join(src, subdirname), os.path.join(dest, 
subdirname))
for filename in filenames:
print("copying:" + filename)

Here's the output:

entering dir:include
copying:CallbackInterface.h
copying:ClockInterface.h
entering dir:tcc
copying:CallbackInterface.tcc
copying:CMakeLists.txt
copying:darknet.i
copying:darknet.i.h
copying:darknet.obj
copying:darknet.py
copying:darknetImageNetLabels.txt
copying:darknetPYTHON_wrap.cxx
copying:darknetPYTHON_wrap.h
copying:darknet_config.json
copying:demo.py
copying:demoHelper.py
copying:OpenBLASSetup.cmake
copying:runtest.sh
copying:schoolbus.png
copying:CallbackInterface.h
copying:ClockInterface.h
copying:CallbackInterface.tcc

The last 3 files listed here doesn't exist, they are a repeat of the files 
found in the subdirectories.

--
components: Windows
messages: 300313
nosy: clovett, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.walk has a bug on Windows
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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset e36d9f5568093b3885da62a0bf0fdfbe3771672b by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-31205: IDLE: Factor KeysPage class from ConfigDialog (#3096)
https://github.com/python/cpython/commit/e36d9f5568093b3885da62a0bf0fdfbe3771672b


--

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Lines not yet covered in keys group, other than deactivate_current_config and 
activate_config_changes functions:

def save_new_key_set
if not idleConf.userCfg['keys'].has_section(keyset_name):
# never false - minor issue

def delete_custom_keys
if not item_list:
# never false hence following never executed
else: self.customlist.SetMenu(item_list, item_list[0])

--

___
Python tracker 

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



Re: numpy not working any more

2017-08-15 Thread breamoreboy
On Tuesday, August 15, 2017 at 8:13:19 PM UTC+1, Poul Riis wrote:
> Den tirsdag den 15. august 2017 kl. 19.19.15 UTC+2 skrev bream...@gmail.com:
> > On Tuesday, August 15, 2017 at 5:23:29 PM UTC+1, Poul Riis wrote:
> > > Den tirsdag den 15. august 2017 kl. 07.29.05 UTC+2 skrev dieter:
> > > > Poul Riis writes:
> > > > > ...
> > > > > For some time I have been using python 3.6.0 on a windows computer.
> > > > > Suddenly, my numpy does not work any more.
> > > > > This one-liner program:
> > > > > import numpy as np
> > > > > results in the long error message below.
> > > > > ...
> > > > > Traceback (most recent call last):
> > > > >   File 
> > > > > "C:\Users\pr\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py",
> > > > >  line 16, in 
> > > > > from . import multiarray
> > > > > ImportError: DLL load failed: Den angivne procedure blev ikke fundet.
> > > > 
> > > > Apparently, the module "multiarry" is implemented in a separate
> > > > DLL (= "Dynamically Loaded Library") and loading this DLL failed.
> > > > 
> > > > There can be several reasons for such a failure, among others:
> > > > 
> > > >  * the DLL is missing
> > > > 
> > > >  * the DLL is corrupted
> > > > 
> > > >  * the DLL depends on something which is missing or corrupted
> > > > 
> > > >  * there is a version mismatch (e.g. between the DLL and the Python
> > > >trying to load it)
> > > > 
> > > > 
> > > > An initial step could be to try to reinstall "numpy" and
> > > > see whether the problem goes away.
> > > 
> > > I have reinstalled numpy several times - doesn't help.
> > 
> > The short answer is you need to upgrade Python, not numpy.
> > 
> > For the long answer please see 
> > https://stackoverflow.com/questions/44537131/numpy-library-importerror-dll-load-failed-the-specified-procedure-could-not-be
> >  which in turn refers to https://bugs.python.org/issue29943.
> > 
> > Kindest regards.
> > 
> > Mark Lawrence.
> 
> I mentioned in my original question that I have tried Python 3.6.2 and that 
> it indeed had no problems with numpy but that it on the other hand gave rize 
> to another problem, namely failing installation of vtk (pip says 'Couldn't 
> find a version that satisfies the requirement vtk'.
> 
> Poul Riis

Pip won't know anything about VTK, you have to download it yourself from 
http://www.vtk.org/.

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python's method-resolution algorithm: An implementation question

2017-08-15 Thread Ian Kelly
On Tue, Aug 15, 2017 at 12:57 PM, Evan Aad  wrote:
> I don't see how, since the L(B*)'s are listed in order in the argument
> list: L(B1), L(B2), ..., and each L(B*) starts with B*: L(B1) =  ...>, L(B2) = , ...
>
> Could you please give a counter-example?

Sure.

merge(, )  ->  

vs:

merge(, , )  ->  TypeError

Or in Python:

>>> class A1: pass
>>> class A2: pass
>>> class B1(A1): pass
>>> class B2(A2, B1): pass
>>> class C(B1, B2): pass
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Cannot create a consistent method resolution order (MRO)
for bases B1, B2
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30747] _Py_atomic_* not actually atomic on Windows with MSVC

2017-08-15 Thread Steve Dower

Steve Dower added the comment:

This commit added *a lot* of warnings - 
http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/1056

Most are of the form:
warning C4133: 'function': incompatible types - from 'volatile uintptr_t *' 
to 'volatile int *'

I can't obviously see where they are coming from, but someone please fix them.

--
resolution: fixed -> 
stage: backport needed -> needs patch
status: closed -> open

___
Python tracker 

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



Re: A question on modification of a list via a function invocation

2017-08-15 Thread Fred Stluka



Here is my attempt to clarify the situation with some ascii graphics.
(Well, not ascii, but utf-8 box-drawing characters — I hope they come 
through ok.

And, of curse, it won't display properly with a proportional font.)

Here's a VERY useful tool for understanding/explaining/drawing
such code snippets:
- http://pythontutor.com

At the "Edit code" link, you can type/paste your own Python
statements and have the tool single-step though them.  At each
step, it draws the data structures with values, links to other data
structures, etc.  A great Python visualization tool!

Enjoy!
--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.


--
https://mail.python.org/mailman/listinfo/python-list


Re: numpy not working any more

2017-08-15 Thread Poul Riis
Den tirsdag den 15. august 2017 kl. 19.19.15 UTC+2 skrev bream...@gmail.com:
> On Tuesday, August 15, 2017 at 5:23:29 PM UTC+1, Poul Riis wrote:
> > Den tirsdag den 15. august 2017 kl. 07.29.05 UTC+2 skrev dieter:
> > > Poul Riis writes:
> > > > ...
> > > > For some time I have been using python 3.6.0 on a windows computer.
> > > > Suddenly, my numpy does not work any more.
> > > > This one-liner program:
> > > > import numpy as np
> > > > results in the long error message below.
> > > > ...
> > > > Traceback (most recent call last):
> > > >   File 
> > > > "C:\Users\pr\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py",
> > > >  line 16, in 
> > > > from . import multiarray
> > > > ImportError: DLL load failed: Den angivne procedure blev ikke fundet.
> > > 
> > > Apparently, the module "multiarry" is implemented in a separate
> > > DLL (= "Dynamically Loaded Library") and loading this DLL failed.
> > > 
> > > There can be several reasons for such a failure, among others:
> > > 
> > >  * the DLL is missing
> > > 
> > >  * the DLL is corrupted
> > > 
> > >  * the DLL depends on something which is missing or corrupted
> > > 
> > >  * there is a version mismatch (e.g. between the DLL and the Python
> > >trying to load it)
> > > 
> > > 
> > > An initial step could be to try to reinstall "numpy" and
> > > see whether the problem goes away.
> > 
> > I have reinstalled numpy several times - doesn't help.
> 
> The short answer is you need to upgrade Python, not numpy.
> 
> For the long answer please see 
> https://stackoverflow.com/questions/44537131/numpy-library-importerror-dll-load-failed-the-specified-procedure-could-not-be
>  which in turn refers to https://bugs.python.org/issue29943.
> 
> Kindest regards.
> 
> Mark Lawrence.

I mentioned in my original question that I have tried Python 3.6.2 and that it 
indeed had no problems with numpy but that it on the other hand gave rize to 
another problem, namely failing installation of vtk (pip says 'Couldn't find a 
version that satisfies the requirement vtk'.

Poul Riis
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python's method-resolution algorithm: An implementation question

2017-08-15 Thread Evan Aad
I don't see how, since the L(B*)'s are listed in order in the argument
list: L(B1), L(B2), ..., and each L(B*) starts with B*: L(B1) = , L(B2) = , ...

Could you please give a counter-example?

On Tue, Aug 15, 2017 at 9:44 PM, Ian Kelly  wrote:
>
> On Tue, Aug 15, 2017 at 9:56 AM, Evan Aad  wrote:
> > According to the description of Python's method resolution order (mro)
> > (https://www.python.org/download/releases/2.3/mro/), a.k.a. C3
> > linearization (see Wikipedia), the algorithm can be described as
> > follows:
> >
> > "the linearization of C is the sum of C plus the merge of the
> > linearizations of the parents and the list of the parents."
> >
> > Symbolically, the algorithm is defined recursively thus:
> >
> > L(O) = 
> > L(C) =  + merge(L(B1),..., L(Bn), )
> >
> > where
> >
> > * O is the class from which every class inherits.
> > * C is a class that inherits directly from B1, ..., Bn, in this order.
> > * < and > are list delimiters.
> > * + is the list-concatenation operator.
> > * 'merge' merges its list arguments into a single list with no
> > repetitions in the manner described in the next paragraph.
> >
> > Consider the head of the first list, i.e L(B1)[0]: if it is a good
> > head, i.e. if it is not in the proper tail of any of the other lists,
> > add it to the linearization of C, and remove it from all the lists in
> > the merge. Otherwise, consider the head of the next list, etc. Repeat
> > until no more classes, or no good heads. In the latter case, it is
> > impossible to construct the merge.
> >
> >
> >
> > Why is the list  of parents given as an argument to
> > 'merge'? Will the algorithm produce different results if this argument
> > is omitted?
>
> It ensures that the parents are linearized in that order. Without that
> list, it would be possible for B2 to appear before B1 in the MRO of C.
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A question on modification of a list via a function invocation

2017-08-15 Thread Larry Hudson via Python-list

On 08/14/2017 08:25 PM, Larry Hudson wrote:
[snip]


Here is my attempt to clarify the situation with some ascii graphics.
(Well, not ascii, but utf-8 box-drawing characters — I hope they come through 
ok.
And, of curse, it won't display properly with a proportional font.)

The left side is the program lines, and the right side tries to show the way Python implements 
the name binding to the data in memory.  (But I abbreviated the long assignment line,

alist[0],alist[1],alist[2]=3,6,9 to )

Program line  Variable bound to memory

===  Initial assignment  

ss = [1, 2, 3]  ss ───> [1, 2, 3]

===  test() code  ===

def test(alist):ss ─┬─> [1, 2, 3]
  alist ─┘
-
 alist = [3, 6, 9]   ss ───> [1, 2, 3]
  alist ───> [3, 6, 9]
-
 return  ss ───> [1, 2, 3]
  alist 

===  test1() code  ==
def test1(alist):   ss ─┬─> [1, 2, 3]
  alist ─┘
-
 ss ─┬─> [3, 6, 9]
  alist ─┘
-
 return  ss ───> [3, 6, 9]
  alist 

===  test2() code  ==
def test2(alist):   ss ─┬─> [1, 2, 3]
  alist ─┘
-
ss ─┬─> [3, 6, 9]
 alist ─┘
-
 alist = [30, 60, 90]ss ───> [3, 6, 9]
  alist ───> [30, 60, 90]
-
 return  ss ───> [3, 6, 9]
  alist 



This needs a minor clarification to the test1 example, plus I want to emphasize that the 
assignment here is through the alist variable.


===  test1() code  ==
def test1(alist):ss ─┬─> [1, 2, 3]
  alist ─┘
-
 ss ─┬─> [3, 6, 9]
  alist ─┘
-
 return  ss ───> [3, 6, 9]
  alist   There is nothing to garbage 
collect here.


--
 -=- Larry -=-
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python's method-resolution algorithm: An implementation question

2017-08-15 Thread Ian Kelly
On Tue, Aug 15, 2017 at 9:56 AM, Evan Aad  wrote:
> According to the description of Python's method resolution order (mro)
> (https://www.python.org/download/releases/2.3/mro/), a.k.a. C3
> linearization (see Wikipedia), the algorithm can be described as
> follows:
>
> "the linearization of C is the sum of C plus the merge of the
> linearizations of the parents and the list of the parents."
>
> Symbolically, the algorithm is defined recursively thus:
>
> L(O) = 
> L(C) =  + merge(L(B1),..., L(Bn), )
>
> where
>
> * O is the class from which every class inherits.
> * C is a class that inherits directly from B1, ..., Bn, in this order.
> * < and > are list delimiters.
> * + is the list-concatenation operator.
> * 'merge' merges its list arguments into a single list with no
> repetitions in the manner described in the next paragraph.
>
> Consider the head of the first list, i.e L(B1)[0]: if it is a good
> head, i.e. if it is not in the proper tail of any of the other lists,
> add it to the linearization of C, and remove it from all the lists in
> the merge. Otherwise, consider the head of the next list, etc. Repeat
> until no more classes, or no good heads. In the latter case, it is
> impossible to construct the merge.
>
>
>
> Why is the list  of parents given as an argument to
> 'merge'? Will the algorithm produce different results if this argument
> is omitted?

It ensures that the parents are linearized in that order. Without that
list, it would be possible for B2 to appear before B1 in the MRO of C.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31170] expat: utf8_toUtf8 cannot properly handle exhausting buffer

2017-08-15 Thread sping

sping added the comment:

For the record, the upstream fix is commit 
https://github.com/libexpat/libexpat/commit/74a7090a6eb92c27b7010287a4082de6b357fa42
 and it will be part of Expat 2.2.4.

--
nosy: +sping
versions: +Python 2.7, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread R. David Murray

R. David Murray added the comment:

OK, that seems reasonable to me.  I'll reopen the issue.  Assuming other 
developers agree that this should be changed, I'm not sure if it will qualify 
as a bug or an enhancement, so I'm leaving versions unselected for now :)

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

___
Python tracker 

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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread Cédric Krier

Cédric Krier added the comment:

On 2017-08-15 17:32, R. David Murray wrote:
> You mean to create the entries on sys.path that do not come from the 
> PYTHONPATH?

Yes because such path could contain ':'.

--

___
Python tracker 

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



PyDev 5.9.2 released

2017-08-15 Thread Fabio Zadrozny
PyDev 5.9.2 Release Highlights

   -

   *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards.
   - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars).
   -

   *Debugger*
   - Integrated speedups for Python 3.6 which use the new Python hook which
  allows the debugger to add breakpoints through bytecode manipulation.
  - Some critical fixes related to issues in the latest debugger
  (#PyDev-837, #PyDev-838, #PyDev-817).
   -

   Added support for having isort as the engine for import sorting.
   - Fixed issue on text search with *Lucene* when the user had another
   plugin which also used lucene (*#PyDev-826*).
   - From this version onwards, PyDev is built with a proper certificate
   (previous versions used a self-signed certificate).
   - Google App Engine templates now working out of the box (patch by *Mat
   Booth*).
   - Optimization in editor highlighting when dealing with huge files.
   - Some bugfixes in pytest integration.
   - *cv2* added to forced builtins by default for working with OpenCV.
   - Fixed issue when parsing empty f-string.

What is PyDev?

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com
What is LiClipse?

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming, TextMate bundles and a number of other languages such as
Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript,
etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://www.liclipse.com/

Cheers,

--
Fabio Zadrozny
--

Software Developer

LiClipse
http://www.liclipse.com

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com

PyVmMonitor - Python Profiler
http://www.pyvmmonitor.com/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Proposed new syntax

2017-08-15 Thread Steve D'Aprano
On Tue, 15 Aug 2017 08:26 am, Gregory Ewing wrote:

> Ben Finney wrote:
>> That the comprehension
>> syntax *does not* necessarily connote a procedural loop, but instead can
>> quite reasonably be interpreted as its designer intended, a single
>> conceptual operation.
> 
> To put it another way: Consider that a comprehension is an
> expression, and I think most people would agree that relying
> on order of evaluation in an expression is a very bad idea,
> since it hurts readability and is prone to subtle bugs.

So you've stopped arguing that list comprehensions don't have a defined order
of evaluation, and are now arguing that code which relies on that order of
evaluation is hard to reason about? I suppose that's progress :-)

I take issue with your statement that relying on order of evaluation is always 
"a very bad idea". Order of evaluation in Python is well-defined, and we
frequently rely on it. There is nothing wrong with writing code like:

x = y + 1/z

x is not None and x > 1

a, b = b, a

while x in foo or x not in bar

and similar. And especially now that print is a regular function instead of a
statement, it is incredibly useful to stick a print or two in the middle of an
expression for debugging. You can't use that trick everywhere, but it is
especially useful in generator expressions as a way of seeing when its called
and yields a value:

(print('generator', x) or expression for x in something)

for example.

But really, the argument that you seem to be making:

# paraphrase, not an actual quote
"Comprehensions might actually have well-defined semantics in terms
of for-loops, just as they are documented to have, but we should
pretend that they don't because some really complicated expressions
with side-effects can be confusing or buggy."

seems pretty dubious to me.


As they say, "A man's got to know his limitations." If you program code that is
as complicated as you can understand, you won't be clever enough to debug it
when it goes wrong. That applies whether we're talking about order of
evaluation, basic arithmetic, threads, async programming, functional idioms,
levels of abstraction or spaghetti code. That makes a good argument for writing
conservative code that is the simplest thing that will work (for some
definition of "work").

It's not an argument for treating the semantics of code as different from what
those semantics actually are.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31213] __context__ reset to None in nested exception

2017-08-15 Thread Christopher Stelma

Christopher Stelma added the comment:

crosslink to related future lib issue that led me to this:

https://github.com/PythonCharmers/python-future/issues/141

--

___
Python tracker 

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



[issue31213] __context__ reset to None in nested exception

2017-08-15 Thread Christopher Stelma

New submission from Christopher Stelma:

When I try to re-raise an exception with a __cause__ inside a nested exception, 
the __context__ of the outer __context__ appears to be reset to None.

e.g.

>>> try:
... try:
... raise Exception('foo')
... except Exception as foo:
... print(foo, foo.__context__, foo.__cause__)
... try:
... raise Exception('bar') from foo
... except Exception as bar:
... print(bar, bar.__context__, bar.__context__.__context__)
... raise foo from bar
... except Exception as foo:
... wat = foo
...
foo None None
bar foo None
>>> print(wat, wat.__context__, wat.__context__.__context__)
foo bar None
>>> print(wat, wat.__cause__, wat.__cause__.__context__)
foo bar None
>>> print(wat, wat.__cause__, wat.__cause__.__cause__)
foo bar foo

here, between "raise foo from bar" and the end, bar.__context__ goes from foo 
to None.  since bar is only raised once, clearly in the context of foo (twice 
over), I would expect bar.__context__ to stay foo.

--
messages: 300305
nosy: Christopher Stelma
priority: normal
severity: normal
status: open
title: __context__ reset to None in nested exception
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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread R. David Murray

R. David Murray added the comment:

You mean to create the entries on sys.path that do not come from the PYTHONPATH?

--

___
Python tracker 

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



[issue31212] min date can't be converted to timestamp

2017-08-15 Thread Dave Johansen

New submission from Dave Johansen:

This worked in Python 3.6.0 and before:
```
from datetime import datetime
d = datetime(1, 1, 1, 0, 0, 0)
d.timestamp()
```

The error output is:
```
ValueError: year 0 is out of range
```

But it used to return `-62135658000.0`.

Appears to be related to https://bugs.python.org/issue29921

--
messages: 300303
nosy: Dave Johansen
priority: normal
severity: normal
status: open
title: min date can't be converted to timestamp
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



Re: numpy not working any more

2017-08-15 Thread breamoreboy
On Tuesday, August 15, 2017 at 5:23:29 PM UTC+1, Poul Riis wrote:
> Den tirsdag den 15. august 2017 kl. 07.29.05 UTC+2 skrev dieter:
> > Poul Riis writes:
> > > ...
> > > For some time I have been using python 3.6.0 on a windows computer.
> > > Suddenly, my numpy does not work any more.
> > > This one-liner program:
> > > import numpy as np
> > > results in the long error message below.
> > > ...
> > > Traceback (most recent call last):
> > >   File 
> > > "C:\Users\pr\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py",
> > >  line 16, in 
> > > from . import multiarray
> > > ImportError: DLL load failed: Den angivne procedure blev ikke fundet.
> > 
> > Apparently, the module "multiarry" is implemented in a separate
> > DLL (= "Dynamically Loaded Library") and loading this DLL failed.
> > 
> > There can be several reasons for such a failure, among others:
> > 
> >  * the DLL is missing
> > 
> >  * the DLL is corrupted
> > 
> >  * the DLL depends on something which is missing or corrupted
> > 
> >  * there is a version mismatch (e.g. between the DLL and the Python
> >trying to load it)
> > 
> > 
> > An initial step could be to try to reinstall "numpy" and
> > see whether the problem goes away.
> 
> I have reinstalled numpy several times - doesn't help.

The short answer is you need to upgrade Python, not numpy.

For the long answer please see 
https://stackoverflow.com/questions/44537131/numpy-library-importerror-dll-load-failed-the-specified-procedure-could-not-be
 which in turn refers to https://bugs.python.org/issue29943.

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread Cédric Krier

Cédric Krier added the comment:

A last comment, I do not think it is an issue to follow posix way to parse 
PATH. But for me, the problem is that Python adds without sanitation the 
sys.prefix to the PYTHONPATH. So I think internally Python should not use PATH 
notation to extend the PYTHONPATH because it is not a robust notation.

--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I ran into an issue with the three calls to functions in ConfigDialog 
(deactivate_current_config, activate_config_changes, and 
save_all_changed_extensions) from within the KeysPage class.  I tried to 
minimize the changes by just creating self.cd for the ConfigDialog instance.  
Besides that, the changes were the same as the FontPage and GenPage.

--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3135

___
Python tracker 

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



Python's method-resolution algorithm: An implementation question

2017-08-15 Thread Evan Aad
According to the description of Python's method resolution order (mro)
(https://www.python.org/download/releases/2.3/mro/), a.k.a. C3
linearization (see Wikipedia), the algorithm can be described as
follows:

"the linearization of C is the sum of C plus the merge of the
linearizations of the parents and the list of the parents."

Symbolically, the algorithm is defined recursively thus:

L(O) = 
L(C) =  + merge(L(B1),..., L(Bn), )

where

* O is the class from which every class inherits.
* C is a class that inherits directly from B1, ..., Bn, in this order.
* < and > are list delimiters.
* + is the list-concatenation operator.
* 'merge' merges its list arguments into a single list with no
repetitions in the manner described in the next paragraph.

Consider the head of the first list, i.e L(B1)[0]: if it is a good
head, i.e. if it is not in the proper tail of any of the other lists,
add it to the linearization of C, and remove it from all the lists in
the merge. Otherwise, consider the head of the next list, etc. Repeat
until no more classes, or no good heads. In the latter case, it is
impossible to construct the merge.



Why is the list  of parents given as an argument to
'merge'? Will the algorithm produce different results if this argument
is omitted?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: numpy not working any more

2017-08-15 Thread Poul Riis
Den tirsdag den 15. august 2017 kl. 07.29.05 UTC+2 skrev dieter:
> Poul Riis  writes:
> > ...
> > For some time I have been using python 3.6.0 on a windows computer.
> > Suddenly, my numpy does not work any more.
> > This one-liner program:
> > import numpy as np
> > results in the long error message below.
> > ...
> > Traceback (most recent call last):
> >   File 
> > "C:\Users\pr\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py",
> >  line 16, in 
> > from . import multiarray
> > ImportError: DLL load failed: Den angivne procedure blev ikke fundet.
> 
> Apparently, the module "multiarry" is implemented in a separate
> DLL (= "Dynamically Loaded Library") and loading this DLL failed.
> 
> There can be several reasons for such a failure, among others:
> 
>  * the DLL is missing
> 
>  * the DLL is corrupted
> 
>  * the DLL depends on something which is missing or corrupted
> 
>  * there is a version mismatch (e.g. between the DLL and the Python
>trying to load it)
> 
> 
> An initial step could be to try to reinstall "numpy" and
> see whether the problem goes away.

I have reinstalled numpy several times - doesn't help.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31211] distutils/util.py get_platform() does not identify linux-i686 platforms

2017-08-15 Thread Siming Yuan

New submission from Siming Yuan:

in CentOS installations where both 32 and 64 bit libraries can co exist, and 
when python is compiled to run with 32-bit libraries (i686)

>>> from distutils.util import get_platform
>>> get_platform()
'linux-x86_64'

because the api only looks at OS flavor and not the actual binary architecture.

this string is used as part of PEP425 tags in the built wheel/egg file:
my_package-3.3.0-cp34-cp34m-linux-x86_64.whl

but this creates a mismatch with PIP - pip.pep425tags returns "linux-i686" 
instead on the same python instance, addressed by:

# snippet pip code
def _is_running_32bit():
return sys.maxsize == 2147483647

if result == "linux_x86_64" and _is_running_32bit():
# 32 bit Python program (running on a 64 bit Linux): pip should only
# install and run 32 bit compiled extensions in that case.
result = "linux_i686"

so the end result is any packages built with sdist_wheel (using 
setuptools/distutils) is not installable on the same instance.

Of course the workaround is to overwrite that and provide --plat-name 
linux_i686. 

but the question is - shouldn't the tags line up?

--
components: Distutils
messages: 300300
nosy: dstufft, merwok, siming85
priority: normal
severity: normal
status: open
title: distutils/util.py get_platform() does not identify linux-i686 platforms
versions: Python 3.4, 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



Vulture 0.25

2017-08-15 Thread Jendrik Seipp

Vulture - Find dead code


Vulture finds unused code in Python programs. This is useful for
cleaning up and finding errors in large code bases. If you run Vulture
on both your library and test suite you can find untested code.

Due to Python's dynamic nature, static code analyzers like Vulture are
likely to miss some dead code. Also, code that is only called
implicitly may be reported as unused. Nonetheless, Vulture can be a
very helpful tool for higher code quality.


Download

https://github.com/jendrikseipp/vulture
http://pypi.python.org/pypi/vulture


Features

* fast: static code analysis
* lightweight: only one module
* tested: tests itself and has complete test coverage
* complements pyflakes and has the same output syntax
* supports Python 2.6, 2.7 and 3.x


News

* Detect unsatisfiable statements containing ``and``, ``or`` and ``not``.
* Use filenames and line numbers as tie-breakers when sorting by size.
* Store first and last line numbers in Item objects.
* Pass relevant options directly to ``scavenge()`` and ``report()``.


Cheers,
Jendrik
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


[issue25144] 3.5 Win install fails with "TARGETDIR"

2017-08-15 Thread Steve Dower

Steve Dower added the comment:

Yu Zhigang - can you post your install logs from the failed install? You'll 
notice in my last message I said that I added some extra logging.

However, it sounds like you have a certain system option set that essentially 
breaks paths passed between non-admin and admin processes. There is very little 
we can do about that, and the fix applied for this issue is not intended to 
solve it.

--

___
Python tracker 

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



All zunzun source code repositories move to Bitbucket

2017-08-15 Thread zunzun . com
All zunzun curve fitting and surface fitting source code repositories have been 
moved to Bitbucket, no future development will be done using GitHub. Please 
update any git URLs to the following. All code us Python 3 unless otherwise 
noted.

Web curve fitting and surface fitting:
Deluxe Django site: https://bitbucket.org/zunzuncode/zunzunsite3
Deluxe Django site (Python 2): https://bitbucket.org/zunzuncode/zunzunsite
Flask site: https://bitbucket.org/zunzuncode/FlaskFit
CherryPy site: https://bitbucket.org/zunzuncode/CherryPyFit
Bottle site: https://bitbucket.org/zunzuncode/BottleFit

GUI Curve fitting and surface fitting applications:
https://bitbucket.org/zunzuncode/tkinterFit
https://bitbucket.org/zunzuncode/pyQt5Fit
https://bitbucket.org/zunzuncode/pyGtkFit
https://bitbucket.org/zunzuncode/wxPythonFit

Miscellaneous applications:
Animated Confidence Intervals: 
https://bitbucket.org/zunzuncode/CommonProblems
Initial Fitting Parameters: 
https://bitbucket.org/zunzuncode/RamanSpectroscopyFit
Multiple Statistical Distributions Fitter: 
https://bitbucket.org/zunzuncode/tkinterStatsDistroFit

Core fitting libraries:
https://bitbucket.org/zunzuncode/pyeq2 (Python 2)
https://bitbucket.org/zunzuncode/pyeq3

James Phillips
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Vulture 0.24

2017-08-15 Thread Jendrik Seipp

Vulture - Find dead code


Vulture finds unused code in Python programs. This is useful for
cleaning up and finding errors in large code bases. If you run Vulture
on both your library and test suite you can find untested code.

Due to Python's dynamic nature, static code analyzers like Vulture are
likely to miss some dead code. Also, code that is only called
implicitly may be reported as unused. Nonetheless, Vulture can be a
very helpful tool for higher code quality.


Download

https://github.com/jendrikseipp/vulture
http://pypi.python.org/pypi/vulture


Features

* fast: static code analysis
* lightweight: only one module
* tested: tests itself and has complete test coverage
* complements pyflakes and has the same output syntax
* supports Python 2.6, 2.7 and 3.x


News

* Detect unsatisfiable ``while``-conditions (thanks @RJ722).
* Detect unsatisfiable ``if``- and ``else``-conditions (thanks @RJ722).
* Handle null bytes in source code.


Cheers,
Jendrik
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


pytest 3.2.1 released

2017-08-15 Thread Bruno Oliveira
pytest 3.2.1 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

  pip install --upgrade pytest

The full changelog is available at
http://doc.pytest.org/en/latest/changelog.html.

Thanks to all who contributed to this release, among them:

* Alex Gaynor
* Bruno Oliveira
* Florian Bruhin
* Ronny Pfannschmidt
* Srinivas Reddy Thatiparthy


Happy testing,
The pytest Development Team
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Vulture 0.23

2017-08-15 Thread Jendrik Seipp

Vulture - Find dead code


Vulture finds unused code in Python programs. This is useful for
cleaning up and finding errors in large code bases. If you run Vulture
on both your library and test suite you can find untested code.

Due to Python's dynamic nature, static code analyzers like Vulture are
likely to miss some dead code. Also, code that is only called
implicitly may be reported as unused. Nonetheless, Vulture can be a
very helpful tool for higher code quality.


Download

https://github.com/jendrikseipp/vulture
http://pypi.python.org/pypi/vulture


Features

* fast: static code analysis
* lightweight: only one module
* tested: tests itself and has complete test coverage
* complements pyflakes and has the same output syntax
* supports Python 2.6, 2.7 and 3.x


News


0.23 (2017-08-10)
-
* Add ``--min-confidence`` flag (thanks @RJ722).


Cheers,
Jendrik
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


pytest-logger 0.2.0

2017-08-15 Thread Krzysztof Laskowski

Hi All,

pytest-logger is a pytest plugin putting stdlib logs to:
- tmpdir directory structure mimicking test suite structure,
- pytest terminal output in real time, as test progresses.

pypi: https://pypi.python.org/pypi/pytest-logger/0.2.0
repo: https://github.com/aurzenligl/pytest-logger
docs: http://pytest-logger.readthedocs.io

* logs to filesystem in fine-grained way: per-logger and per-testcase
* logs to terminal in real-time: allows cmdline filtering by logger and 
level
* uses pytest hooks as user API, which makes plugin neutral unless 
deliberately hook-configured


# conftest.py example
def pytest_logger_config(logger_config):
'''logs:
- foo.warn, bar.warn and baz.warn to filesystem,
- foo.warn, bar.error to terminal
- allows to change default --log value to any combination of 
loggers and levels

'''
logger_config.add_loggers(['foo', 'bar', 'baz'], 
stdout_level='warn')

logger_config.set_log_option_default('foo,bar.error')

I'd happily receive feedback and suggestions via mail or github issues.

Best Regards,
Krzysztof Laskowski

--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


cx_Oracle 6.0

2017-08-15 Thread Anthony Tuininga
What is cx_Oracle?

cx_Oracle is a Python extension module that enables access to Oracle
Database for Python 3.x and 2.x and conforms to the Python database API 2.0
specifications with a number of enhancements.


Where do I get it?
https://oracle.github.io/python-cx_Oracle

The easiest method to install cx_Oracle 6.0 is via pip as in

python -m pip install cx_Oracle --upgrade


What's new since 5.3?

This is the first production release of version 6.0. The complete release
notes can be found here: http://cx-oracle.readthe
docs.io/en/latest/releasenotes.html#version-6-0-august-2017.

A summary of the changes compared to version 5.3 is found below:

*Highlighted Enhancements*

- Has been re-implemented to use the new ODPI-C (
https://oracle.github.io/odpi) abstraction layer for Oracle Database. The
cx_Oracle API is unchanged. The cx_Oracle design, build and linking process
has improved because of ODPI-C.

- Now has Python Wheels available for install. This is made possible by the
ODPI-C architecture. Windows installers and Linux RPMs are no longer
produced since PyPI no longer supports them.

- Has less code in Python's Global Interpreter Lock, giving better
scalability.

- Added support for universal rowids.

- Added support for DML returning of multiple rows.

- Now associates LOB locators to LOB objects so they are not overwritten on
database round trips.

*Installation Changes*

- On Linux, cx_Oracle 6 no longer uses instant client RPMs automatically.
You must set LD_LIBRARY_PATH or use ldconfig to locate the Oracle Client
library.

- On platforms other than Windows, if ORACLE_HOME is set (in a database or
full client installation), remove requirement to set LD_LIBRARY_PATH in
order to locate the Oracle Client library (https://github.com/oracle/odp
i/issues/20).

*Connection Management Enhancements*

- Prevent closing the connection when there are any open statements or LOBs
and add new error "DPI-1054: connection cannot be closed when open
statements or LOBs exist" when this situation is detected; this is needed
to prevent crashes under certain conditions when statements or LOBs are
being acted upon while at the same time (in another thread) a connection is
being closed; it also prevents leaks of statements and LOBs when a
connection is returned to a session pool.

- Added attribute SessionPool.stmtcachesize to support getting and setting
the default statement cache size for connections in the pool.

- Added attribute Connection.dbop to support setting the database operation
that is to be monitored.

- Added attribute Connection.handle to facilitate testing the creation of a
connection using a OCI service context handle.

- Added parameters tag and matchanytag to the cx_Oracle.connect and
SessionPool.acquire methods and added parameters tag and retag to the
SessionPool.release method in order to support session tagging.

- Added parameter edition to the cx_Oracle.SessionPool method.

- Added parameters region, sharding_key and super_sharding_key to the
cx_Oracle.makedsn() method to support connecting to a sharded database (new
in Oracle Database 12.2).

- Removed requirement that encoding and nencoding both be specified when
creating a connection or session pool. The missing value is set to its
default value if one of the values is set and the other is not (
https://github.com/oracle/python-cx_Oracle/issues/36).

 - Permit use of both string and unicode for Python 2.7 for creating
session pools and for changing passwords (https://github.com/oracle/pyt
hon-cx_Oracle/issues/23).

*Data Type and Data Handling Enhancements*

- Added attributes Variable.actualElements and Variable.values to
variables.

- Added support for smallint and float data types in Oracle objects, as
requested (https://github.com/oracle/python-cx_Oracle/issues/4).

- Added support for getting/setting attributes of objects or element values
in collections that contain LOBs, BINARY_FLOAT values, BINARY_DOUBLE values
and NCHAR and NVARCHAR2 values. The error message for any types that are
not supported has been improved as well.

- An exception is no longer raised when a collection is empty for methods
Object.first() and Object.last(). Instead, the value None is returned to be
consistent with the methods Object.next() and Object.prev().

- Removed requirement for specifying a maximum size when fetching LONG or
LONG raw columns. This also allows CLOB, NCLOB, BLOB and BFILE columns to
be fetched as strings or bytes without needing to specify a maximum size.
The method Cursor.setoutputsize no longer does anything, since ODPI-C
automatically manages buffer sizes of LONG and LONG RAW columns.

- Enable temporary LOB caching in order to avoid disk I/O as suggested (
https://github.com/oracle/odpi/issues/10).

*Error Handling Enhancements*

- Provide improved error message when OCI environment cannot be created,
such as when the oraaccess.xml file cannot be processed properly.

- Define exception classes on the connection object in addition 

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-15 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 27541.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Repr of collection's subclasses

___
Python tracker 

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



[issue31194] Inconsistent __repr__s for _collections objects

2017-08-15 Thread Vedran Čačić

Vedran Čačić added the comment:

More and more, Python looks to me like a certain language that I thought I had 
left behind a long time ago.

   [...] Each  operator  decides  which sort of scalar it
   would be  most  appropriate  to  return.   
   [...] In  general, they do what you want,
   unless you want consistency.

Maybe it's just a sign of growing up. :-)

--
nosy: +veky

___
Python tracker 

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



Re: Application Error

2017-08-15 Thread Ian Kelly
On Tue, Aug 15, 2017 at 3:37 AM, Alhassan Tom Alfa
 wrote:
> Dear Sir,
>
> I just downloaded Python on my PH Windows 10 PC but any time I tried to
> start the application it always give the following error message;
>
> Python.exe - Application Error
> The application was unable to start correctly (0xc07b). Click Ok to
> close the application.
>
> How this error be corrected? I really need to use this application

https://stackoverflow.com/questions/20650596/cannot-open-python-error-0xc07b
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Application Error

2017-08-15 Thread Bob Gailer
On Aug 15, 2017 9:50 AM, "Alhassan Tom Alfa"  wrote:
>
> Dear Sir,
>
> I just downloaded Python
Exactly what did you download?
Where did you download it from?
There are 32 bit versions and 64-bit versions. Did you download the one
corresponding to your computer?
Normally when you download python You are downloading an installer. Did you
run the installer?
on my PH
What is pH?
Windows 10 PC but any time I tried to
> start the application
When you say application are you referring to python or some Python program?
Exactly what are you doing to run the application? Be as specific as
possible.
it always give the following error message;
>
> Python.exe - Application Error
> The application was unable to start correctly (0xc07b). Click Ok to
> close the application.
Personally I have never heard of this error. Have you tried to Google it?
The comments above are my own comments they reflect my own experience there
may be others on this list who will give you a better answer.
>
> How this error be corrected? I really need to use this application
We are all volunteers who choose to help others with questions. Expressions
of urgency usually don't motivate us. So in the future just ask a question.
>
> Thank you in anticipation for a quick response
>
> Best Regards,
>
> Tom
>
> <
https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon
>
> Virus-free.
> www.avast.com
> <
https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Application Error

2017-08-15 Thread Alhassan Tom Alfa
Dear Sir,

I just downloaded Python on my PH Windows 10 PC but any time I tried to
start the application it always give the following error message;

Python.exe - Application Error
The application was unable to start correctly (0xc07b). Click Ok to
close the application.

How this error be corrected? I really need to use this application

Thank you in anticipation for a quick response

Best Regards,

Tom


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


Any advice on getting Pyscripter installed & working with Python on Windows 10 computer ?

2017-08-15 Thread TKS
>
>
> Hi there,
>
> I am trying to assist my daughter with a school IT task to install Python
> & Pyscripter on a Windows 10 notebook. (64 bit system)
>
> It seems no version of Pyscripter will work - it fails to complete the
> installation & ends with an error ("Python could not be properly
> initialised, we must quit").
> I have tried using 32 & 64 bit versions for both & alternating options,
> but same error comes up.
>
> Can you offer any suggestions on how to get this working ?
>
> Thank you.
> ​TK.
>


> ​
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread R. David Murray

R. David Murray added the comment:

I'm not sure there is anything we should do here, then, because we are 
conforming to the posix parsing for PATH in our PYTHONPATH implementation.

I think if you want to pursue this further you should take it to the 
python-ideas mailing list.  I'm going to close the issue, but you can reopen it 
if python-ideas thinks it is worth doing something (and there is something we 
can reasonably do :)

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread Cédric Krier

Cédric Krier added the comment:

Yes I mean ':' for posix.
Indeed I do not known a posix way to escape the colon (it was discussed here: 
https://stackoverflow.com/questions/14661373/how-to-escape-colon-in-path-on-unix).
But it does not mean that the method makepathobject could not support one. I'm 
thinking about path single-quoted.

--

___
Python tracker 

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



[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread R. David Murray

R. David Murray added the comment:

By DELIM, you mean the shell ':'?  As far as I've been able to determine there 
is no way defined in posix to escape that character.  If you can find one, 
please let us know.  (I think the same is true for the Windows semicolon but 
I'm not sure.)

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



Re: Proposed new syntax

2017-08-15 Thread Rustom Mody
On Tuesday, August 15, 2017 at 5:48:43 PM UTC+5:30, Steve D'Aprano wrote:
> On Tue, 15 Aug 2017 02:54 pm, Rustom Mody wrote:
> 
> > On Monday, August 14, 2017 at 10:35:22 PM UTC+5:30, Terry Reedy wrote:
> [...]
> >> Suppose stdin contains "a\nb\nc\nd\ne\nf\ng\n".
> >> What is the meaning of
> >> [input(f"response{i}") for i in range(6)]?
> >> In Python, the predictable result is
> >> ['a', 'b', 'c', 'd', 'e', 'f']
> >> It would not be with some of Rustom Mody's 'equivalents'.
> 
> Indeed. Terry has hit the nail on the head here. Python's documented semantics
> is predictable and deterministic, and the documented semantics of
> comprehensions are explicitly based on sequential for-loops.
> 
> To continue to insist, in contradiction to the documentation, that list comps
> might legitimately operate in arbitrary order is simply irrational. If they
> behaved as Rustom is insisting they might, it would be a bug in the
> implementation.

I know that list-comps behave like the l2r-pass-doing-appends as SPECIFIED
in the docs.
In my view the IMPLEMENTATION is correct wrt that specification
Whereas the SPECIFICATION, in being over-specific is wrong

In the same way that if someone explaining C were to say that the '+' operator
is (the SAME AS) ADD x86 instructions and then proves that case by showing gcc 
-S's output.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-15 Thread Cédric Krier

New submission from Cédric Krier:

If the path on which Python is installed contains the DELIM, the resulted 
sys.path is split.
I think maybe there should be a escape mechanism for the PYTHONPATH.

--
components: Interpreter Core
messages: 300293
nosy: ced
priority: normal
severity: normal
status: open
title: Can not import site from sys.prefix containing DELIM
type: crash

___
Python tracker 

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



Re: Proposed new syntax

2017-08-15 Thread Steve D'Aprano
On Tue, 15 Aug 2017 02:54 pm, Rustom Mody wrote:

> On Monday, August 14, 2017 at 10:35:22 PM UTC+5:30, Terry Reedy wrote:
[...]
>> Suppose stdin contains "a\nb\nc\nd\ne\nf\ng\n".
>> What is the meaning of
>> [input(f"response{i}") for i in range(6)]?
>> In Python, the predictable result is
>> ['a', 'b', 'c', 'd', 'e', 'f']
>> It would not be with some of Rustom Mody's 'equivalents'.

Indeed. Terry has hit the nail on the head here. Python's documented semantics
is predictable and deterministic, and the documented semantics of
comprehensions are explicitly based on sequential for-loops.

To continue to insist, in contradiction to the documentation, that list comps
might legitimately operate in arbitrary order is simply irrational. If they
behaved as Rustom is insisting they might, it would be a bug in the
implementation.


>> Or let L = .
>> This implementation of list reversal: [L.pop() for i in range(len(L))]
> 
> In languages, especially those with a clearly separated lang-spec from
> specific implementation-spec (eg C99), there is a sharp distinction made
> between - undefined behaviour
> - unspecified behaviour
> - erroneous behaviour
> 
> 
> Roughly:
> - Erroneous means compiler/runtime should flag an error
> - Undefined means implementation can format your hard disk and clear your bank
>   account

In *some* languages, not all, undefined means the implementation can format your
hard disk. Those languages include C (and perhaps C++). I don't know of any
other languages which are so hostile to the developer (and their end users) as
to specify such abominable behaviour and claim it is a feature. (There may be
others, I just don't know them.)

In general, undefined and unspecified are synonymous.


> 
https://stackoverflow.com/questions/18420753/unspecified-undefined-and-implementation-defined-behavior-wiki-for-c
> - Unspecified means not error but not spelled out
> 
> My point of suggesting those alternative implementations is precisely
> to make your examples above fall squarely into unspecified category

Terry's examples don't demonstrate unspecified behaviour. The order of execution
is completely specified. See the links to the docs I have already posted.


> Note that this would square with the informal practice seen in places like
> this ML/NG where a noob asks a question using a comprehension such as the
> ones you've used and someone more experienced pipes up "Dont do that"

Don't do that *in production code.*

[print(x, y) for x in values for y in others]

is a good way of learning how to read list comprehensions.

You're making the classic logical error of affirming the consequent:

https://en.wikipedia.org/wiki/Affirming_the_consequent

we should avoid code with unspecified behaviour

we should avoid this code, therefore it must have unspecified behaviour

Just because code showing unspecified behaviour should be avoided, doesn't mean
that all code that should be avoided has unspecified behaviour.

There are plenty of reasons for avoiding certain misuses of comprehensions that
have nothing to do with unspecified behaviour.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-15 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I'll work on this today.

--

___
Python tracker 

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



Re: Proposed new syntax

2017-08-15 Thread Steve D'Aprano
On Tue, 15 Aug 2017 01:26 pm, Paul Rubin wrote:

> Steve D'Aprano  writes:
[...]
>> In Haskell, you cannot get the last N elements of a list without
>> allocating memory for the previous ones.
> 
> lastn n xxs@(x:xs)
>   | length (take n xs) == n-1 = xxs
>   | otherwise = lastn n xs
> 
> main = print . lastn 5 $ [1..1000]
> 
> *Main> main
> [996,997,998,999,1000]
> 
> works for me. 

Right. Did you read the Stackoverflow page I linked to? They all pretty much say
the same thing, although most of the given solutions use `drop`. Sorry if my
wording was unclear.


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31197] Namespace disassembly omits some compiled objects

2017-08-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Another refactoring point that came up in the same discussion: it might be nice 
if the objects that expose code attributes all offered a read-only __code__ 
property, rather than requiring the dis module (and other consumers) to be 
aware of all the different object-specific property names.

--

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2017-08-15 Thread Yu Zhigang

Yu Zhigang added the comment:

It's quite an issue... This is 2017 and it's still there. Anyway, I encountered 
the same problem by running the installer in Win7, and it was fixed by running 
it again in administrative mode.

--
nosy: +Yu Zhigang

___
Python tracker 

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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Christian Heimes added the comment:

2.7, 3.6 and master are fixed.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 05b7d9c6675b71d17f5fcf379b3888fba431f14e by Christian Heimes in 
branch '2.7':
[2.7] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3094)
https://github.com/python/cpython/commit/05b7d9c6675b71d17f5fcf379b3888fba431f14e


--

___
Python tracker 

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



Re: Redirecting input of IDLE window

2017-08-15 Thread Friedrich Rentsch



On 08/14/2017 10:47 AM, Friedrich Rentsch wrote:

Hi,

I work interactively in an IDLE window most of the time and find 
"help (...)" very useful to summarize things. The display comes up 
directly (doesn't return a text, which I could edit, assign or store). 
I suspect that there are ways to redirect the display, say to a file. 
Thanks for suggestions.



Frederic




Peter Otten's "mypager" works well. All suggestions provide a welcome 
opportunity to learn more about the inner workings. Thank you all for 
your responses.


Frederic



--
https://mail.python.org/mailman/listinfo/python-list


[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 7f6a13bd562ff6a265fc63a991327feaecb07a77 by Christian Heimes in 
branch '3.6':
[3.6] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3093)
https://github.com/python/cpython/commit/7f6a13bd562ff6a265fc63a991327feaecb07a77


--

___
Python tracker 

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



Re: Solution Manual Test Bank for South-Western Federal Taxation 2018: Corporations, Partnerships, Estates and Trusts, 41st Edition by Hoffman

2017-08-15 Thread alister via Python-list
On Mon, 14 Aug 2017 15:48:02 -0700, zhilongch64 wrote:


Please do the whole world a big favour & NEVER reply to spam
if no-one responded this heinous practice would die.




-- 
 I hate users
 you sound like a sysadmin already!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 7b40cb7293cb14e5c7c8ed123efaf9acb33edae2 by Christian Heimes in 
branch 'master':
bpo-30714: ALPN changes for OpenSSL 1.1.0f (#2305)
https://github.com/python/cpython/commit/7b40cb7293cb14e5c7c8ed123efaf9acb33edae2


--

___
Python tracker 

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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3133

___
Python tracker 

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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-08-15 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3134

___
Python tracker 

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



[issue30576] http.server should support HTTP compression (gzip)

2017-08-15 Thread Pierre Quentel

Pierre Quentel added the comment:

On Python-ideas someone asked if other compressions could be supported besides 
gzip.

The latest version of the PR adds a mechanism for that : 
SimpleHTTPRequestHandler has a new attribute "compressions", a dictionary that 
maps compression encodings (eg "gzip") to a "compressed data generator". The 
generator takes a file object as argument, yields non-empty chunks of 
compressed data and ends by yielding b'' for compliance with Chunked Transfer 
Encoding protocol.

To support other compression algorithms, "compressions" can be extended with 
another key (eg "brotli") mapped to the appropriate generator. A test has been 
added with the non-standard "bzip2" encoding, using the bz2 module in the 
standard distribution.

I also added support for "deflate" by default (it's very close to "gzip").

--

___
Python tracker 

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



Re: Proposed new syntax

2017-08-15 Thread Gregory Ewing

Paul Rubin wrote:

Historically (in "naive set theory") we didn't bother with any of this.
We could write { S : S \not\in S } for the set of all sets that are not
members of themselves.  Is S a member of itself ("Russell's paradox")?
Either way leads to contradiction.  So the comprehension axiom schemas
for set theory had to be designed to not allow formulas like that.


Personally I think mathematicians worry overly much about that.
What it means is that not every predicate can be used to define
a set. A manifestation of the same thing in computing is that
not every program you can write down will terminate. But we
don't warp our languages in an effort to make non-terminating
programs impossible; we just accept them as a fact of life
and move on.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Proposed new syntax

2017-08-15 Thread Ian Kelly
On Mon, Aug 14, 2017 at 8:24 PM, Steve D'Aprano
 wrote:
> I think the closest analogy in Python terms would be a generator expression 
> with
> a cache. That's not *quite* the same, because Python is eagerly evaluated and
> Haskell is lazily evaluated, but the critical fact (which Ian seems to have
> completely missed) is that while evaluation can be delayed, touching each
> element *in order* from start to end cannot be. You cannot jump to an 
> arbitrary
> index in Haskell.
>
> But one thing is sure: even if evaluation is delayed, before you can access
> element N, you have to access element N-1. Whether it is implemented via
> recursion, a while-loop, or an actual for-loop, it is still logically
> equivalent to a for-loop through the elements.

I don't think that I've missed anything here. That the
*implementation* uses some kind of recursive application does not make
the *semantics* of the list comprehension logically equivalent to a
for loop.

This is about as close as you can get to a for loop with side effects
in Haskell:

Prelude Data.Traversable> forM [1..5] $ \n -> print $ n*n
1
4
9
16
25
[(),(),(),(),()]

And here's taking the last element of a list comprehension that,
according to you, should be "logically equivalent" to the above loop:

Prelude Data.Traversable> [ print $ n*n | n <- [1..5] ] !! 4
25

Wait, where are the side effects of the first four elements that had
to be recursed over to get to the last element? Clearly these are not
logically equivalent. As I said, Haskell list comprehensions are not
loops.
-- 
https://mail.python.org/mailman/listinfo/python-list