Re: Old Man Yells At Cloud

2017-09-20 Thread Steven D'Aprano
On Tue, 19 Sep 2017 18:43:43 -0700, Rick Johnson wrote:

> On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico
> wrote:
>> On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram 
>> wrote:
>> > Steve D'Aprano  did *not* write [it was
>> > edited/abbreviated by me - S. R.]:
>> > |disadvantages:
>> > |0 - it makes print a special thing
> 
> No more "special" than any other reserved word in Python.

The other reserved words are either:

- values, like None, which can be included in expressions;

- operators, like `is`, `or`, and `not`;

- block statements, like `for x in seq` or `while flag` which
  require a block;

- statements, like `import` and `del`, which operate on names
  rather than values.

(Did I miss any?)


print is the only one which could be a function, and looks like a 
function (apart from the lack of parens). Hence people keep trying to do 
things like use it in lambdas:

https://www.quora.com/Why-does-putting-print-inside-a-Python-lambda-
function-raise-a-syntax-error

Since it *could* be a function, but isn't, that makes it special in a 
special way.


>> > |1 - beginners have to unlearn
> 
> Only if they decide to move to Python3 *AND* only if they decide to use
> the print function at _all_.

Even if you don't use print, you will still have to read other people's 
code that uses it.

And its not just a Python 3 issue. Long before there was a Python 3, 
people would over-generalise from function calls and add extraneous 
brackets around print's argument. It wouldn't matter if you were printing 
a single value, but if you printed two arguments, you would actually 
print a tuple instead.

Here are some more recent examples:

https://stackoverflow.com/questions/38254008/

https://stackoverflow.com/questions/36345800/


but if you have plenty of time on your hands to search the archives of 
this mailing list (newsgroup) you'll find people occasionally writing 
"print(...)" all the way back to Python 2.0 or 1.5.


Very possibly including me.


>> > |2 - `print(x, y)` is *not* the same as `print x, y`;
> 
> Well, duh!

Duh to *you and me*, perhaps, but not so obvious to everyone. See links 
above.

And especially not obvious to beginners, who have to learn that print is 
magically and unlike all other functions, doesn't require parentheses.


[...]
> I'll leave the remaining feature implementations as an exercise for the
> reader...

I already said that you can work around the crippling limitations of 
print by avoiding it.

So why have a standard print (pseudo-)function if it is so crippled and 
limited that it has to be worked around to be useful for anything more 
complicated than "Hello World"?

For the microscopic cost of requiring parens when calling the print 
function, you gain all the features of a function. That's a great 
tradeoff. Beginners have to learn to use parens for every other function 
they use. Having one more is an insignificant cost. And for advanced 
programmers, now you have a print function that is actually useful.


>> > |5 - it can't be mocked, shadowed, monkey-patched or replaced for
>> > testing;
> 
> So wrap sys.stdout.write with your own function and then mock it until
> it crys and runs home to mommy; shadow it until it reports you as a
> stalker; and monkey patch it until your sewing hand becomes racked with
> arthritic pain!

You aren't thinking it through far enough.

If it's *my* code, I can just use my editor to search for "print foo" and 
replace it with "awesome_print(foo)" and I'm done.

But if I'm using a library or some other piece of code that uses print, 
and I can't edit the source code (maybe I don't even have the source 
code), I need to mock it (etc). Now I'm completely out of luck, because 
you can't shadow or replace the print statement.

I *might* be able to hack up some sort of magic replacement for stdout, 
but that's easier said than done, and if the library is printing to other 
files I'm screwed. What am I going to do, chase down every single call to 
print? How? By scanning the .pyc files and disassembling the byte-code?

Sure, if you are willing to invest sufficiently large time, money and 
effort, there's a solution. But something which should take literally 
five seconds:

import nasty_library_that_uses_print as nasty
nasty.print = lambda *args: logger(*args)  # or similar

could take weeks of development effort to get right.


>> > |6 - and you can't even write help(print) in the interactive
>> > interpreter
> 
> Hmm, neither can you get help for these:
> 
> # PYTHON 2.x
> >>> help(del)
> SyntaxError: invalid syntax

Indeed you can't.

But there is a very good reason why del, if, else etc are statements. 
They *have to be*. For example, you can't write del as a function, 
because if you do, it won't receive the names of the variables, only 
their values.

It's a trade-off. With del, if, else etc, the value of them being 
statements far outweighs the 

[issue31506] Improve the error message logic for object_new & object_init

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

C.__new__(42) emits different error, "TypeError: object.__new__(X): X is not a 
type object (int)". Perhaps you meant C.__new__(C, 42) which now emits 
"TypeError: C() takes no arguments".

Messages "object.__new__() takes no arguments" and "object.__init__() takes no 
arguments" are not correct since both object.__new__() and object.__init__() 
take one argument -- a class and an instance correspondingly.

--

___
Python tracker 

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



[issue31527] Report details of excess arguments in object_new & object_init

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

str(x=1) is not the best example since str() takes keyword arguments. Look at 
tuple() and list():

>>> tuple(x=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: tuple() takes no keyword arguments
>>> list(x=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: list() takes no keyword arguments

Initial version of my patch for issue31506 reported error messages similar to 
tuple() and list(), but at end I simplified it since in any case the error 
message was not perfect.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27319] Multiple item arguments for selection operations

2017-09-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3656

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-20 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:01 PM, Steven D'Aprano
 wrote:
> The other reserved words are either:
>
> - values, like None, which can be included in expressions;
>
> - operators, like `is`, `or`, and `not`;
>
> - block statements, like `for x in seq` or `while flag` which
>   require a block;
>
> - statements, like `import` and `del`, which operate on names
>   rather than values.
>
> (Did I miss any?)
>
>
> print is the only one which could be a function, and looks like a
> function (apart from the lack of parens).

I'd add one additional variant that could be a function, and that's
'del' when used on something other than a simple name:

>>> del values[2]

Conceptually, this is very similar to values.pop(2), only it doesn't
return the value.

But for its simple-name form, where it reverses the effect of
assignment to a simple name, it has to be a statement.

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


[issue31517] MainThread association logic is fragile

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Is there a problem here?  I haven't heard of anyone even wondering about this 
> before.

This came while working on the PEP 556 implementation.

--

___
Python tracker 

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



[issue31517] MainThread association logic is fragile

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> That said, I do agree with Tim that the status quo isn't broken per se: we 
> renamed `thread` to `_thread` in Python 3 for a reason

This is not caused by `_thread` specifically, but any background thread created 
by C code that might invoke Python code.  The reproducer just uses the 
`_thread` module out of convenience.

--

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Cheryl. I'll open a separate issue.

--

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I missed that the selection() method with its current behavior is 
documented in the module documentation. It isn't undocumented implementation 
detail. This raises a bar for removing higher.

I think it is better to defer removing to 3.8 or later. Instead we should 
document the deprecation.

--

___
Python tracker 

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



Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Robin Becker

On 16/09/2017 01:58, Steve D'Aprano wrote:



If you want to test for None specifically:

if any(v is None for v in values):
 print "at least one value was None"


...

for some reason that seems slow on my machine when compared with

if None in values:
   .



C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)" "any(v is None 
for v in values)"
100 loops, best of 3: 0.62 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(None,2,None)" "any(v is 
None for v in values)"
100 loops, best of 3: 0.504 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(None,2,None)" "None in 
values"
1000 loops, best of 3: 0.0309 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)" "None in 
values"
1000 loops, best of 3: 0.097 usec per loop


it also seems a bit less obvious
--
Robin Becker

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


wxPython 4.0.0b2 release

2017-09-20 Thread Robin Dunn
Announcing wxPython 4.0.0b2
===

PyPI:   https://pypi.python.org/pypi/wxPython/4.0.0b2
Extras: https://extras.wxPython.org/wxPython4/extras/
Pip:``pip install wxPython==4.0.0b2``

Changes in this release include the following:

* Added a deprecated compatibility helper for wx.CustomDataFormat.

* Transfer ownership of the wx.EvtHandler object when pushing/popping
  them, and also for Set/RemoveEventHandler. (#443)

* Add missing wx.VScrolledWindow methods listed in the docs as
  deprecated but still present. (#441)

* Fixed copy/paste error in wx.BusyInfo.__exit__ (#449)

* Added new tool wxget, (a minimal wx implementation of wget)

* Added new tools wxdocs and wxdemos to launch the respective items,
  fetching and unpacking as required. (#437)

* Fixes to ensure that the locale message catalogs are included in the
  release files. (#464)

* Fix wx.ListCtrl.SetItemData to check that the data value is not out
  of the range of a C long. (#467)

* Changed the default port on *nix builds to be GTK3. The new
  ``--gtk2`` flag for build.py can be used to force a build for GTK2
  instead, and the ``--gtk3`` flag still exists, but defaults to True
  unless ``--gtk2`` is specified. Please note that there is currently
  no auto-detection of whether GTK3 is available or not, so if you
  know you need to build for GTK2 then you need to use the build flag,
  and there is currently no way to specify that flag for builds
  performed by pip. (#431)

* Fix parameter names in Toolbar.AddTool methods to be
  consistent. (#475)

* Remove inconsistent GetVirtualSize method in ScrolledWindow and let
  it be inherited from wx.Window instead. (#474)

* Fix crashing bug caused by importing a module that reinitializes the
  wxModule system after having imported wxpyTag. (#468)

* Fix missing methods in various DataObject classes. (They were
  actually accidentally marked "private" when they should have been
  public.) (#480)

* Add missing ListCtrl.DeleteAllColumns. (#486)

* Various fixes in the demo.

* Fixed improper initial scale factor in wx.lib.agw.speedmeter

* Fix for calls to wx.Notebook.HitTest calling the wrong instance
  (base class version) of the method. (#499)

* Add wx.Simplebook class.

* Fix exception in wx.lib.agw.customtreectrl when calling
  SortChildren. (#463, #500)

* Fix missing imports needed for drawing the legend in
  wx.lib.plot. (#503)

* Fix other instances of list.sort using old cmp-style ordering
  functions.  (#508)

* Update SizedControls to do a sanity check on the parent's sizer, as
  GetSizer can return None for SizedParent under certain
  circumstances, such as when AUI reparents the control during pane
  movement. (#523, #537)

* Added Vagrant configs for Fedora 23 and Fedora 26, and dropped
  Fedora 24.  Wheels built on F23 can also be used on F24 and F25, and
  F26 adds Python 3.6 support.

* Fix bitwise OR bug in wx.lib.agw.aui.framemanager. (#493)

* Fix bugs in wx.lib.plot when saving file. (#526)

* Fix integer division bug in ultimatelistctrl. (#528)

* Fix bug in wx.SearchCtrl.SetCancelBitmap (#532)

* Fixed property grid SetPropertyValue method to not truncate floating
  point values to integers, and a couple other possible incorrect
  conversions.  (#536)




What is wxPython?
-

wxPython is a cross-platform GUI toolkit for the Python programming
language.  It allows Python programmers to create programs with a
robust, highly functional graphical user interface, simply and
easily. It is implemented as a set of Python extension modules that
wrap the GUI components of the popular wxWidgets cross platform
library, which is written in C++. Supported platforms are Microsoft
Windows, Mac OS X and macOS, and Linux or other unix-like systems with
GTK2 or GTK3 libraries. In most cases the native widgets are used on
each platform to provide a 100% native look and feel for the
application.


What is wxPython Phoenix?
-

wxPython's Project Phoenix is a new from-the-ground-up implementation
of wxPython, created with the intent of making wxPython “better,
stronger, faster than he was before.” In other words, this new
implementation is focused on improving speed, maintainability and
extensibility of wxPython, as well as removing most of the cruft that
had accumulated over the long life of Classic wxPython.

The project has been in development off and on, mostly behind the
scenes, for many years. For the past few years automated snapshot
builds have been available for those adventurous enough to try it, and
many people eventually started using the snapshots in their projects,
even for production releases.  While there are still some things on
the periphery that need to be completed, the core of the new wxPython
extension modules which wrap the wxWidgets code has been stable for a
long time now.

Due to some things being cleaned up, reorganized, simplified and
dehackified wxPython Phoenix is not completely backwards compatible

ANN: poliastro 0.7 released

2017-09-20 Thread Juan Luis Cano
Hi all,

It fills us with astronomical joy to announce the release of *poliastro
0.7.0*! 

poliastro is a pure Python library that allows you to simulate and analyze
interplanetary orbits in a Jupyter notebook in an interactive and easy
way, used
by people from all around the world
.

This release is the biggest one since the creation of the project in terms
of code changes and new features, and on behalf of the poliastro
development team I would like to deeply thank the European Space Agency for
the SOCIS grant that made it possible.

Highlights from this release include:

* New package for reading NEOs data (asteroids and comets)
* Coordinate frame transformations
* pip packaging
* New patched conics functions for the Kerbal Space Program fans!

As an example, a Jupyter notebook analyzing the orbit of the Florence
asteroid, that passed near the Earth earlier this month, is available:

http://docs.poliastro.space/en/v0.7.0/examples/Catch%20that%20asteroid!.html

If you want to know more, don't miss my talk on EuroPython 2016:

https://youtu.be/VCpTgU1pb5k

An executive summary of the release notes can be read here:

http://blog.poliastro.space/2017/09/15/2017-09-15-poliastro-070-released-ready-pycones/

We encourage you to join our chat on Matrix:

https://riot.im/app/#/room/#poliastro:matrix.org


*Per Python ad Astra! *


*---*
Juan Luis Cano Rodríguez
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3657

___
Python tracker 

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



[RELEASE] Python 3.6.3rc1 and 3.7.0a1 are now available for testing and more

2017-09-20 Thread Ned Deily
The Python build factories have been busy the last several weeks preparing
our fall lineup of releases.  Today we are happy to announce three
additions: 3.6.3rc1, 3.7.0a1, and 3.3.7 final, which join last weekend's
2.7.14 and last month's 3.5.4 bug-fix releases and 3.4.7 security-fix
update (https://www.python.org/downloads/).

1. Python 3.6.3rc1 is the first release candidate for Python 3.6.3, the next
maintenance release of Python 3.6.  While 3.6.3rc1 is a preview release and,
thus, not intended for production environments, we encourage you to explore
it and provide feedback via the Python bug tracker (https://bugs.python.org).
3.6.3 is planned for final release on 2017-10-02 with the next maintenance
release expected to follow in about 3 months.  You can find Python 3.6.3rc1
and more information here:
https://www.python.org/downloads/release/python-363rc1/

2. Python 3.7.0a1 is the first of four planned alpha releases of Python 3.7,
the next feature release of Python.  During the alpha phase, Python 3.7
remains under heavy development: additional features will be added
and existing features may be modified or deleted.  Please keep in mind
that this is a preview release and its use is not recommended for
production environments.  The next preview release, 3.6.0a2, is planned
for 2017-10-16.  You can find Python 3.7.0a1 and more information here:
https://www.python.org/downloads/release/python-370a1/

3. Python 3.3.7 is also now available.  It is a security-fix source-only
release and is expected to be the final release of any kind for Python
3.3.x before it reaches end-of-life status on 2017-09-29, five years after
its initial release.  Because 3.3.x has long been in security-fix mode,
3.3.7 may no longer build correctly on all current operating system
releases and some tests may fail.  If you are still using Python 3.3.x,
we **strongly** encourage you to upgrade now to a more recent, fully
supported version of Python 3.  You can find Python 3.3.7 here:
https://www.python.org/downloads/release/python-337/ 

--
  Ned Deily
  n...@python.org -- []

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

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


Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Bill

Robin Becker wrote:

On 16/09/2017 01:58, Steve D'Aprano wrote:



If you want to test for None specifically:

if any(v is None for v in values):
 print "at least one value was None"


...

for some reason that seems slow on my machine when compared with

if None in values:
   .


This does not seem particularly surprising.  "None in values" is known 
as soon as None is found.
In "any(v is None for v in values)",  "any" probably isn't called until 
its argument is (fully) known.  Of course the results would depend on 
the implementation.  It would be interesting to compare the results if 
you used the optimize option (it's either -o or -O).


Bill



C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)" 
"any(v is None for v in values)"

100 loops, best of 3: 0.62 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit 
-s"values=(None,2,None)" "any(v is None for v in values)"

100 loops, best of 3: 0.504 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit 
-s"values=(None,2,None)" "None in values"

1000 loops, best of 3: 0.0309 usec per loop

C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)" 
"None in values"

1000 loops, best of 3: 0.097 usec per loop


it also seems a bit less obvious


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


[issue31506] Improve the error message logic for object_new & object_init

2017-09-20 Thread Nick Coghlan

Nick Coghlan added the comment:

Aye, the "C.__new__" example omitting the first arg was just an error in that 
example.

And that's a good point about the current "object.__init__()" error message 
actually being incorrect, since the *methods* each take exactly one argument - 
it's only the "object(*args, **kwds)" form that genuinely expects zero 
arguments.

If we were to correct that error as well, we'd end up with the following:

# Without any method overrides
class C:
pass

C(42) -> "TypeError: C() takes no arguments"
C.__new__(C, 42) -> "TypeError: C() takes no arguments"
C().__init__(42) -> "TypeError: C.__init__() takes exactly one argument"
# These next two quirks are the price we pay for the nicer errors above
object.__new__(C, 42) -> "TypeError: C() takes no arguments"
object.__init__(C(), 42) -> "TypeError: C.__init__() takes exactly one 
argument"

# With method overrides
class D:
def __new__(cls, *args, **kwds):
super().__new__(cls, *args, **kwds)
def __init__(self, *args, **kwds):
super().__init__(*args, **kwds)

D(42) -> "TypeError: object.__new__() takes exactly one argument"
D.__new__(D, 42) -> "TypeError: object.__new__() takes exactly one argument"
D().__init__(42) -> "TypeError: object.__init__() takes exactly one 
argument"
object.__new__(C, 42) -> "TypeError: object.__new__() takes exactly one 
argument"
object.__init__(C(), 42) -> "TypeError: object.__init__() takes exactly one 
argument"

--

___
Python tracker 

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



ANN: SfePy 2017.3

2017-09-20 Thread Robert Cimrman

I am pleased to announce release 2017.3 of SfePy.

Description
---

SfePy (simple finite elements in Python) is a software for solving systems of
coupled partial differential equations by the finite element method or by the
isogeometric analysis (limited support). It is distributed under the new BSD
license.

Home page: http://sfepy.org
Mailing list: https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/
Git (source) repository, issue tracker: https://github.com/sfepy/sfepy

Highlights of this release
--

- support preconditioning in SciPy and PyAMG based linear solvers
- user-defined preconditioners for PETSc linear solvers
- parallel multiscale (macro-micro) homogenization-based computations
- improved tutorial and installation instructions

For full release notes see http://docs.sfepy.org/doc/release_notes.html#id1
(rather long and technical).

Cheers,
Robert Cimrman

---

Contributors to this release in alphabetical order:

Robert Cimrman
Lubos Kejzlar
Vladimir Lukes
Matyas Novak
--
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: How to share class relationship representations?

2017-09-20 Thread Leam Hall

On 09/19/2017 11:16 AM, Stefan Ram wrote:

leam hall  writes:

I'm working on designing the classes, sub-classes, and relationships in my
code. What is a good visual way to represent it so it can be stored in git
and shared on the list without large images or attachments?


   Code /is/ design.



I tried that with the small bit of code I have and was told it was too 
confusing. Still working on this.

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


[issue31517] MainThread association logic is fragile

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm not sure this is an issue worth fixing, but I don't think it's a good idea 
to document such quirky semantics.

--

___
Python tracker 

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



[issue31528] Let ConfigParser parse systemd units

2017-09-20 Thread 林自均

New submission from 林自均:

Although systemd units are inspired by .ini format, ConfigParser is unable to 
parse those files because:

1. Multiple assignments to the same option in systemd units are concatenated 
with white spaces.
2. Multiple sections with the same section name are merged.
3. An option assignment of empty value resets the option.

I suggest 3 corresponding parameters in ConfigParser.__init__():

1. merge_options: If set to True, multiple assignment to the same option are 
concatenated with white spaces. Default is False.
2. merge_sections: If set to True, multiple sections with the same name are 
merged. Default is False.
3. empty_is_reset: Only relevant when merge_options is True. If set to True, an 
option assignment of empty value will reset the option. Default is False.

--
components: Library (Lib)
messages: 302604
nosy: johnlinp
priority: normal
severity: normal
status: open
title: Let ConfigParser parse systemd units
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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My screen is 23.5 x 13.25, making it 109 DPI.  I asked Cheryl to try 9 first 
because it is 3/4 of 12.

--

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gregory Ewing

Rhodri James wrote:

Tsk.  You should have learned (a fake simplified) assembler first,


Never mind that fake assembly rubbish, learn a real assembly
language! And hand-assemble it and toggle it into the front
panel switches like I did!

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


[issue31498] Default values for zero in time.strftime()

2017-09-20 Thread Denis Osipov

Changes by Denis Osipov :


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



Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Peter Otten
Bill wrote:

> Robin Becker wrote:
>> On 16/09/2017 01:58, Steve D'Aprano wrote:
>> 
>>>
>>> If you want to test for None specifically:
>>>
>>> if any(v is None for v in values):
>>>  print "at least one value was None"
>>>
>> ...
>>
>> for some reason that seems slow on my machine when compared with
>>
>> if None in values:
>>.
>>
>>
> This does not seem particularly surprising.  "None in values" is known
> as soon as None is found.
> In "any(v is None for v in values)",  "any" probably isn't called until
> its argument is (fully) known.  Of course the results would depend on
> the implementation.  It would be interesting to compare the results if
> you used the optimize option (it's either -o or -O).
> 
> Bill

I don't think that optimisation can do much here, but there's another aspect 
that has a realistic chance to affect the result: 

None in values 

checks equality, and that may be slower than comparing identities:

$ python3 -m timeit -s"from slow_eq import A; values = 1, 2, A()" "any(v is 
None for v in values)"
100 loops, best of 3: 1.1 usec per loop
$ python3 -m timeit -s"from slow_eq import A; values = 1, 2, A()" "None in 
values"
10 loops, best of 3: 1 sec per loop

That's of course an extreme example that I wilfully constructed:

$ cat slow_eq.py 
import time

class A:
def __eq__(self, other):
time.sleep(1)
return NotImplemented


>>> C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)"
>>> "any(v is None for v in values)"
>>> 100 loops, best of 3: 0.62 usec per loop
>>>
>>> C:\usr\share\robin\pythonDoc>python -m timeit
>>> -s"values=(None,2,None)" "any(v is None for v in values)"
>>> 100 loops, best of 3: 0.504 usec per loop
>>>
>>> C:\usr\share\robin\pythonDoc>python -m timeit
>>> -s"values=(None,2,None)" "None in values"
>>> 1000 loops, best of 3: 0.0309 usec per loop
>>>
>>> C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)"
>>> "None in values"
>>> 1000 loops, best of 3: 0.097 usec per loop
>>
>> it also seems a bit less obvious


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


Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gregory Ewing

Grant Edwards wrote:

Alternatively, you should design an instruction set and implement it
using microcode and AM2900 bit-slice processors.


AMD2900? That's cheating! You should design and build your
own logic gates. After refining the silicon to make the
transistors first, of course.

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


[issue31517] MainThread association logic is fragile

2017-09-20 Thread Nick Coghlan

Nick Coghlan added the comment:

We had the quirks of import related threading deadlocks documented for a long 
time, not as a promise, but as a debugging aid (and a recommendation for "don't 
do that").

I'd see this as being similar: we'd document that if you're using the _thread 
module, or otherwise allowing operating system threads not managed by the 
threading module to call in and run arbitrary Python code, then you should run 
"import threading" early in the actual main thread to make sure it gets 
associated correctly.

--

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Chris Angelico
On Wed, Sep 20, 2017 at 7:12 PM, Gregory Ewing
 wrote:
> Grant Edwards wrote:
>>
>> Alternatively, you should design an instruction set and implement it
>> using microcode and AM2900 bit-slice processors.
>
>
> AMD2900? That's cheating! You should design and build your
> own logic gates. After refining the silicon to make the
> transistors first, of course.

What, you take silicon that someone else created?!

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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Cool! I'm tagging this as an easy issue, suitable for first timers or new 
contributors. 

Felipe, are you up for preparing the PR?

--

___
Python tracker 

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



[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-20 Thread Tim Peters

Tim Peters added the comment:

Ya, it's clearly best for `current_thread()` to deliver consistent results.

--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-20 Thread Christian Heimes

Christian Heimes added the comment:

Do we still support cygwin?

--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-20 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, Christian. -- I found that in the docs the culprit is Cygwin:

   db6a569de7ae595ada53b618fce6bbbd1c98d350

--

___
Python tracker 

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



Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Bill

Steve D'Aprano wrote:



In "any(v is None for v in values)",  "any" probably isn't called until
its argument is (fully) known.

No, its a generator expression, so it provides the values one at a time, as
needed.


Okay, thank you for setting me straight.  I'm only about 2 weeks down 
this road so far!  :  )

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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3665

___
Python tracker 

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



[issue31536] `make regen-opcode` triggers wholesale rebuild

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note that at least `make regen-ast` will also need to be changed in order to 
reduce build times on Travis-CI.

--

___
Python tracker 

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



Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 10:07 pm, Steve D'Aprano wrote:

> I'm not sure whether to be surprised or not.
> 
> The first one only checks for identity, which should be really fast, while the
> `is` operator tests for equality too, 

Oops, that's supposed to be `in`, not `is`.


[...]
> Ah... I see that Robin is using especially small tuples, of only three items.
> Yes, I can see why the overhead of the generator expression would slow that
> down. But try it with a list of a thousand values...
> 
> ... and the `is` operator is still faster. Today I learned something.

And *that* should be `in`.

Sigh.




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


[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Ah, didn't see Benjamin's patch: much better solution :-)

--

___
Python tracker 

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



Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> There are tools for getting doctests out of .rst files.  Is it an option to
> use .rst instead of .md?

Given the existence proof of md working as an extension (see my
previous follow-up), my guess is that it more-or-less supports just
about any nearly-plain-text format. I could use .rst, I suppose, but
then I'd have to add a magic token to my files to tell Emacs they are
really in Markdown format.

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


Re: Old Man Yells At Cloud

2017-09-20 Thread Chris Angelico
On Thu, Sep 21, 2017 at 1:06 AM, Dennis Lee Bieber
 wrote:
> On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano
>  declaimed the following:
>
>>For what its worth: from Python 3.5 (I think) onwards the error you get is
>>customized:
>>
>>py> print 1
>>  File "", line 1
>>print 1
>>  ^
>>SyntaxError: Missing parentheses in call to 'print'
>>
>
> So... "print" (the function") is still a special case for the
> interpreter...

Yes, because of all the people migrating from Python 2. If print had
never been a statement, this special case wouldn't have been needed.
And it's only a special case in the handling of one specific exception
- at the point where you would otherwise get a generic error, it
checks to see if it could possibly be a Py2 print statement, and if
so, adjusts the text of the exception.

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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Where in the docs is this `OpenSSL cipher list format` link located?

--
nosy: +Mariatta

___
Python tracker 

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



[issue31535] configparser unable to write comment with a upper cas letter

2017-09-20 Thread Philippe Wagnieres

New submission from Philippe Wagnieres:

I create entry with this:

   self.settings.set('General', 'Initial filter', 'All file (*.*)')
   self.settings.set('General', '# 1 => Text files (*.txt)')
   self.settings.set('General', '# 2 => CSV files (*.csv)')
   self.settings.set('General', '# 3 => Text files (*.txt) \n')

and after writing in a file:
   initial filter = All file (*.*)
   ; 1 => text files (*.txt)
   ; 2 => csv files (*.csv)
   # 3 => text files (*.txt) 

(; or # to test if differ)

It is normal or not?

Thank & Best Regards

--
messages: 302633
nosy: philippewagnie...@hispeed.ch
priority: normal
severity: normal
status: open
title: configparser unable to write comment with a upper cas letter
type: enhancement
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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Felipe

Felipe added the comment:

Woops. Apologies -- I somehow deleted that part from the report. Thanks Antoine 
for jumping in. If you are using the wiki url, make sure not to include the 
question mark at the end :-)

--

___
Python tracker 

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



[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Tim, any opinion on this one?  Do you agree it's an actual bug (if a bit 
obscure)?

--

___
Python tracker 

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



Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Wed, Sep 20, 2017 at 10:09 AM
Subject: Fwd: Issues with python commands in windows powershell
To: python-list@python.org



-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3663
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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 19e4d9346db7fb65845b98a9cb9caacaaac8a81a by Christian Heimes 
(Felipe) in branch 'master':
bpo-31533: fix broken link to OpenSSL docs (#3674)
https://github.com/python/cpython/commit/19e4d9346db7fb65845b98a9cb9caacaaac8a81a


--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The limit 1.4 is not arbitrary. This is a minimal scale for which fonts from 10 
to 14 pixels are not decreased when converted to points (with multiplier 0.75 
and one rounding). round(14 * 0.75) = round(10.5) = 10; 10 * 1.4 = 14.

--

___
Python tracker 

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



Re: Fw: Problems Installing Python36

2017-09-20 Thread Irmen de Jong
On 14/09/2017 05:46, Michael Torrie wrote:
> On 09/12/2017 03:05 AM, Thomas Jollans wrote:
>> Other people on this list:
>> This isn't the first time I've someone with this issue here. It's
>> probably putting off plenty of potential new users who don't make as
>> much effort to find a solution. I can't say I understand the ins and
>> outs of installing things on Windows... is there anything that can be done?
> 
> Last time I brought this up, someone mentioned that the Python installer
> is supposed to automatically install this runtime library if it's not
> installed already.  If so, why are so many people having this problem?
> 

That is what I'm wondering as well.

The only thing I can think of is that it asks windows update to install said KB 
update
but that it depends on something else that isn't installed or that the user 
running the
installation doesn't have the rights to install windows updates. (I suspect 
something
will be logged in the event viewer somewhere...?)

Or that it doesn't attempt to download it at all and that we are misinformed :P


Btw, I personally never had any issues installing Python on Windows.

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


Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Bill

Joey Steward wrote:

-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.


Did you try the same ones in an environment besides powershell?


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


[issue31443] Possibly out of date C extension documentation

2017-09-20 Thread R. David Murray

R. David Murray added the comment:

We do not currently officially support cygwin.  There are people working on 
getting it working again (and having a buildbot) so we can support it, so 
cygwin support is a goal, but not currently a requirement.  I've nosied Erik 
Brey, who is one of the main people interested in and working on cygwin.  The 
note might well be out of date even with regards to cygwin.

--
nosy: +erik.bray, r.david.murray

___
Python tracker 

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



[issue31536] `make regen-opcode` triggers wholesale rebuild

2017-09-20 Thread Antoine Pitrou

New submission from Antoine Pitrou:

`make regen-opcode` always writes the destination unconditionally, after which 
`make` thinks it has to rebuild everything.

--
components: Build
messages: 302649
nosy: pitrou, serhiy.storchaka, twouters
priority: normal
severity: normal
status: open
title: `make regen-opcode` triggers wholesale rebuild
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



Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


[issue31536] `make regen-opcode` triggers wholesale rebuild

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks like `pgen` will also have to be changed, which is more annoying as it's 
written in C...

Perhaps another approach can be used that will use a separate utility to do the 
copying if the contents changed?

--

___
Python tracker 

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



Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


Re: Old Man Yells At Cloud

2017-09-20 Thread Steve D'Aprano
On Thu, 21 Sep 2017 01:06 am, Dennis Lee Bieber wrote:

> On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano
>  declaimed the following:
> 
>>For what its worth: from Python 3.5 (I think) onwards the error you get is
>>customized:
>>
>>py> print 1
>>  File "", line 1
>>print 1
>>  ^
>>SyntaxError: Missing parentheses in call to 'print'
>>
> 
> So... "print" (the function") is still a special case for the
> interpreter...


One of Python's weaknesses is that many error messages are fairly obscure and
uninformative, and the devs are trying to fix that. If that means treating some
things as "special cases", so be it, because practicality beats purity.

But yes, print is specifically a special case because of its history in Python
2. And for exactly the same reason, exec() is also special-cased:

py> exec '1'
  File "", line 1
exec '1'
   ^
SyntaxError: Missing parentheses in call to 'exec'



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


[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Backport was done. Thanks.

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



[issue31443] Possibly out of date C extension documentation

2017-09-20 Thread Stefan Krah

Stefan Krah added the comment:

I've just asked on python-dev if Cygwin is still broken. Not sure
if we support it.

--

___
Python tracker 

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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3664

___
Python tracker 

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



[issue31536] `make regen-opcode` triggers wholesale rebuild

2017-09-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +patch
pull_requests: +3666
stage:  -> patch review

___
Python tracker 

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



[issue26510] [argparse] Add required argument to add_subparsers

2017-09-20 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee:  -> merwok
nosy: +merwok
stage:  -> commit review
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue1230540] sys.excepthook doesn't work in threads

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Matt, do you want to post your patch here?

--

___
Python tracker 

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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Felipe

Felipe added the comment:

Sure, will do!

--

___
Python tracker 

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



[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: "What if just deny reentrant reads? Set a flag while read into a 
buffer, check it before reading in other thread, and raise RuntimeError."

io.BufferedReader/io.BufferedWriter raises a RuntimeError exception for 
reentrant call, but only in the same thread. For example, it ease debug for 
signal handlers which trigger such reentrant call.

I'm not sure about 
0001-stop-crashes-when-iterating-over-a-file-on-multiple-.patch since it 
doesn't fix the consistency: two parallel readline() calls can return the same 
line, instead of being mutual exclusive and only return different lines.

I'm not sure about adding a new lock. "Lock" sounds like "dead locks". I 
dislike the risk of introducing dead locks very late in the Python 2.7 
development cycle.

I like the idea of a simple exception on concurrent operations. But I'm not 
sure how much code it will break :-/ Crazy idea: would it make sense to raise 
an exception by default, but add an opt-in option to ignore the exception? I 
wrote "crazy" since it became clear that the code is not thread-safe and so 
that parallel operations on the same file object is likely to corrupt data in 
various funny ways.

--

___
Python tracker 

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



[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3660
stage:  -> patch review

___
Python tracker 

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



Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> I routinely include doctests as a source of test cases in my nose runs, but I 
> want to also coax it to check the
> examples in my Markdown files. Is there a way to do this? If I explicitly 
> give a Markdown file on the command line,
> nose complains:
>
> Unable to load tests from file ...

I believe I figured this out. It appears to be sufficient to add

doctest-extension=md

to my noserc file.

Camping happy, am I,

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


Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-20 Thread alister via Python-list
On Wed, 20 Sep 2017 14:14:24 +0100, Paul Moore wrote:

> On 20 September 2017 at 13:58, alister via Python-list
>  wrote:
>> On Tue, 19 Sep 2017 14:40:17 -0400, leam hall wrote:
>>
>>> On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben <
>>> stephan...@gmail.com.invalid> wrote:
>>>
 Op 2017-09-19, Steven D'Aprano schreef :

 > There is a significant chunk of the Python community for whom "just
 > pip install it" is not easy, legal or even possible. For them, if
 > its not in the standard library, it might as well not even exist.

 But numpy *is* in the standard library, provided you download the
 correct version of Python, namely the one from:

 https://python-xy.github.io/

 Stephan


>>> Many of us can't pip install; it's in the OS supplied vendor repo or
>>> it doesn't go on the machines.
>>>
>>> Leam
>>
>> dnf install 
>> or apt_get install 
>>
>> most of the mainstream modules seem to be there (certainly numpy)
> 
> You're missing the point. A significant number of Python users work on
> systems where:
> 
> 1. They have no admin rights 2. Their corporate or other policies
> prohibit installing 3rd party software without approval that is
> typically difficult or impossible to get 3. Quite possibly the system
> has no network access outside of the local intranet 4. The system admins
> may not be able or willing to upgrade or otherwise modify the system
> Python
> 
> Writing code that works only with stdlib modules is basically the only
> option in such environments.
> 
> Having said that, I don't advocate that everything be in the stdlib
> because of this. A lot of things (such as numpy) belong as 3rd party
> packages. But that doesn't mean that "get XYZ off PyPI" (or "install XYZ
> alternative Python distribution/version") is a viable solution to every
> problem.
> 
> Paul

not missing the point you said previously "it's in the OS supplied vendor 
repo or it doesn't go on the machines."

dnf/yum or apt_get install form the "vendor supplied repo"

I fully understand that even this may require various hoops to be jumped 
through before it can happen



-- 
Minnie Mouse is a slow maze learner.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> I didn't mean, "Can you name your Markdown files with an .rst extension," I
> meant, "Can you use ReST instead of Markdown?"

I wondered if maybe I was misinterpreting your question. :-)

Conceptually, yes, I could use ReST. I'm just trying to go with the
flow here at work. Markdown seems to be the agreed upon way to write
plain text documentation.

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


Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Larry Martell
On Wed, Sep 20, 2017 at 5:09 AM, Gregory Ewing
 wrote:
>
> Never mind that fake assembly rubbish, learn a real assembly
> language! And hand-assemble it and toggle it into the front
> panel switches like I did!

1979, I was working at Bausch and Lomb in Rochester NY. We had a 16
bit Data General Nova 'Minicomputer'. It had 4 registers, called
accumulators. It had 16 front panel toggle switches, one for each bit,
one that said 'deposit', and one that said run. It had a dial with
stops for AC0, AC1, AC2, AC3 (for the 4 accumulators), PC (program
counter), address and contents.

When you powered up the machine it did not boot. You had to hand enter
a short bootstrap program in binary. Do to this you had to turn the
dial to address, key in a 16 bit address, click deposit, turn the dial
to contents, key in a 16 bit line of assembly code, click deposit, and
repeat this for each line of code (there were like 5 or 6). Then key
in the address of where you wanted to run from turn the dial to PC,
deposit, and click run. Any mistake and it would not boot. Often took
3 or 4 tries.

After a few weeks of this I was sick of it. I had the boot code burned
into an EEPROM (which I had to send out to be programmed). Then I
build a very small wire wrapped board with the EEPROM and an
oscillator and few TTL chips. I tapped into the 5V power on the CPU
board and used the leading edge of that to trigger a one shot which
'woke up' my circuit, and caused it to clock out the code from the
EEPROM and load it to the appropriate place, set the program counter
and start the program. I drilled holes in the CPU board and mounted
this with little plastic standoffs.

I did this all on my own, coming in on the weekends, without company
approval, and when it was working I showed my boss. He was blown away
and he was sure we could patent this and sell it. He had me formalize
the design, write it up, have an actual PCB made, go to the company
lawyers, the whole 9 yards. Then Data General announced the new
version of the Nova  with auto boot.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually such flag already exists. It is unlocked_count.

There is also similar issue with seek().

--

___
Python tracker 

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



Re: Stdlib, what's in, what's out

2017-09-20 Thread Chris Warrick
On 20 September 2017 at 17:16, Dennis Lee Bieber  wrote:
> On Tue, 19 Sep 2017 11:58:47 -0700 (PDT), John Ladasky
>  declaimed the following:
>
>>
>>And of course I have found some other third-party packages: scipy, pandas, 
>>matplotlib, and PyQt5 are important for my work.  I helped a student of mine 
>>get selenium running.  In the case of PyQt, I found TKinter unsatisfactory 
>>many years ago, and went looking for better choices.  I used wxPython first, 
>>when I was working in Py2.  When wxPython was slow to migrate to Py3, I went 
>>searching again.
>>
>
> And if wxPython had been part of the stdlib, it would have meant 
> Python
> 3 would have been delayed years until wxPython had been ported -- or
> wxPython would have been pulled from the stdlib and something else put in
> its place...
>
> So no help to those migrating.

If wxPython had been part of the stdlib, there would be much more
manpower to port it to 3. Also, the project underwent a complete
rewrite, which dooms many projects to failure. Perhaps they wouldn’t
try the rewrite, or they would port the older codebase to Python 3 so
that it could be shipped. (They’re currently at Beta 2 of the
post-rewrite 4.0.0 version.)

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Old Man Yells At Cloud

2017-09-20 Thread Thomas Jollans
On 2017-09-20 17:06, Dennis Lee Bieber wrote:
> On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano
>  declaimed the following:
> 
>> For what its worth: from Python 3.5 (I think) onwards the error you get is
>> customized:
>>
>> py> print 1
>>  File "", line 1
>>print 1
>>  ^
>> SyntaxError: Missing parentheses in call to 'print'
>>
> 
>   So... "print" (the function") is still a special case for the
> interpreter...
> 

Thankfully just the interpreter, and not you or me.

Also, print is not alone in this regard:

Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print 1
  File "", line 1
print 1
  ^
SyntaxError: Missing parentheses in call to 'print'
>>> exec 'print 1'
  File "", line 1
exec 'print 1'
 ^
SyntaxError: Missing parentheses in call to 'exec'
>>> exec('print 1')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
print 1
  ^
SyntaxError: Missing parentheses in call to 'print'
>>>




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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Antoine. So is this a matter of replacing the url to 
https://wiki.openssl.org/index.php/Manual:Ciphers(1)#CIPHER_LIST_FORMAT?
Or is there a better url that will not go out of date in the future...

--
stage:  -> needs patch
versions: +Python 2.7 -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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't think OpenSSL are promising anything about their URLs (the old one 
having gone 404 is proof of that :-)). So Felipe's suggestion is as good as 
any, IMHO.

--
nosy: +christian.heimes

___
Python tracker 

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



Re: [issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread M.-A. Lemburg
Why not simply document the fact that read ahead in Python 2.7
is not thread-safe and leave it at that ?

.next() and .readline() already don't work well together, so this
would just add one more case.

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue31525] require sqlite3_prepare_v2

2017-09-20 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset 525269430a3f9fbb7287e4bb6b365ac216004980 by Benjamin Peterson in 
branch 'master':
closes bpo-31525: require sqlite3_prepare_v2 (#3666)
https://github.com/python/cpython/commit/525269430a3f9fbb7287e4bb6b365ac216004980


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



Re: [Tutor] beginning to code

2017-09-20 Thread Jerry Hill
On Tue, Sep 19, 2017 at 8:26 PM, Rick Johnson
 wrote:
> In the spirit of my last comment, i was going to say: "Or if
> `x` does not support rich comparisons", but alas, it seems that
> _all_ objects in Python support rich comparisons, even when
> it doesn't make sense to! o_O For example:
>
> >>> False > 1
> False
> >>> dir > 1
> True
> >>> isinstance < 100
> False
> >>> "" >= 10
> True
> >>> (1,) <= 500
> False

Rick, I'm pretty sure you already know that you're being deceptive
here.  If anyone else comes across this and doesn't already realize
it, note that Rick is complaining about behavior that changed almost a
decade ago (with the release of Python 3.0).

Here's what a modern python does with those same statements:

Python 3.5.2 (default, Aug 18 2017, 17:48:00)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> False > 1
False
>>> dir > 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: builtin_function_or_method() > int()
>>> isinstance < 100
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: builtin_function_or_method() < int()
>>> "" >= 10
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: str() >= int()
>>> (1,) <= 500
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: tuple() <= int()
>>>

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


[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Guido van Rossum

Guido van Rossum added the comment:

> Why not simply document the fact that read ahead in Python 2.7
> is not thread-safe and leave it at that ?

Program bugs should not crash the interpreter. (ctypes excepted.)

--

___
Python tracker 

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



Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
Actually, I semi-lied. It seems to pick up the second of two examples,
and gets a bit confused about leading whitespace. I think I need to do
some more fiddling.

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


[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3661

___
Python tracker 

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



[issue31493] IDLE cond context: fix code update and font update timers

2017-09-20 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Sorry, I didn't see this until now.

I added a line to editor.py in #31529 for this error message.  In _close() in 
editor.py, self.text was being set to None which wasn't calling the __del__ 
function of multicall.  I added a line to unbind "<>", 
which made the error go away.  I don't know if that's the proper fix or not, 
but it seemed the error was occurring because the `after` wasn't being removed 
at the right time.

--
nosy: +csabella

___
Python tracker 

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



Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Ned Batchelder

On 9/20/17 11:17 AM, Skip Montanaro wrote:

There are tools for getting doctests out of .rst files.  Is it an option to
use .rst instead of .md?

Given the existence proof of md working as an extension (see my
previous follow-up), my guess is that it more-or-less supports just
about any nearly-plain-text format. I could use .rst, I suppose, but
then I'd have to add a magic token to my files to tell Emacs they are
really in Markdown format.



I didn't mean, "Can you name your Markdown files with an .rst 
extension," I meant, "Can you use ReST instead of Markdown?"


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


Re: Stdlib, what's in, what's out

2017-09-20 Thread Ethan Furman

On 09/20/2017 09:24 AM, Chris Warrick wrote:

On 20 September 2017 at 17:16, Dennis Lee Bieber wrote:



And if wxPython had been part of the stdlib, it would have meant Python
3 would have been delayed years until wxPython had been ported -- or
wxPython would have been pulled from the stdlib and something else put in
its place...

 So no help to those migrating.


If wxPython had been part of the stdlib, there would be much more
manpower to port it to 3.


How do you figure?  The available manpower is what it took to get Python 3 itself out when it came out; adding another 
project as large as wxPython would not magically make it so the same target dates were hit -- it's not like we have 
core-devs sitting idly by waiting for something to do.


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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Mariatta, that would be in the documentation for the `SSLContext.set_ciphers` 
method (in `Doc/library/ssl.rst`).

--
nosy: +pitrou

___
Python tracker 

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



How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
I routinely include doctests as a source of test cases in my nose runs, but
I want to also coax it to check the examples in my Markdown files. Is there
a way to do this? If I explicitly give a Markdown file on the command line,
nose complains:

Unable to load tests from file ...

Am I perhaps missing some sort of nose-markdown plugin which would
magically make this work?

Thx,

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


[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Why not simply document the fact that read ahead in Python 2.7
is not thread-safe and leave it at that ?

.next() and .readline() already don't work well together, so this
would just add one more case.

--
nosy: +lemburg

___
Python tracker 

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



Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Ned Batchelder

On 9/20/17 10:07 AM, Skip Montanaro wrote:

I routinely include doctests as a source of test cases in my nose runs, but
I want to also coax it to check the examples in my Markdown files. Is there
a way to do this? If I explicitly give a Markdown file on the command line,
nose complains:

Unable to load tests from file ...

Am I perhaps missing some sort of nose-markdown plugin which would
magically make this work?

Thx,

Skip


There are tools for getting doctests out of .rst files.  Is it an option 
to use .rst instead of .md?


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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Felipe

New submission from Felipe:

The link to the `OpenSSL cipher list format` 404s. I don't know if it's where 
the original meant to point, but the same information is available at 
https://wiki.openssl.org/index.php/Manual:Ciphers(1)#CIPHER_LIST_FORMAT

--
assignee: docs@python
components: Documentation
messages: 302629
nosy: docs@python, fov
priority: normal
severity: normal
status: open
title: Dead link in SSLContext.set_ciphers documentation
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



Re: Old Man Yells At Cloud

2017-09-20 Thread Thomas Jollans
On 2017-09-19 16:30, D'Arcy Cain wrote:
> On 09/19/2017 06:46 AM, Larry Martell wrote:
>> True story - the other day I was in a store and my total was $10.12. I
> 
> One time I was at a cash with three or four items which were taxable.
> The cashier rung each one up and hit the total button.  She turned to me
> and said something like "$23.42 please."  She was surprised to see that
> I was already standing there with $23.42 in my hand.  "How did you do
> that" she asked.  She must have thought it was a magic trick.
> 

God I hate shopping in the US. There you are, adding up the prices on
the products you pick up, figuring out (approximately) how much you'll
owe, you go to pay, and the next thing you know there's some unspecified
(!) markup added to the price.

D'Arcy, I'm with the cashier. You're clearly a witch (or warlock).



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


[issue18875] Idle: Auto insertion of the closing parens, brackets, and braces

2017-09-20 Thread Charles Wohlganger

Charles Wohlganger added the comment:

The PR contains all the requested features, as well as mutual deletion 
(requested on PR page), and I have separated out the options for mutual 
deletion triggered by delete or triggered by backspace. I've found in usage 
that it was irritating to have both, but nice to only have one. Let users pick 
one, both, or none.

--

___
Python tracker 

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



[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Guido van Rossum

Guido van Rossum added the comment:

@benjamin can you post your patch as a PR so you'll get credit for it?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue31532] Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex with PyMem_Raw_Free

2017-09-20 Thread Hartmut Goebel

New submission from Hartmut Goebel:

When using

Py_GetPath();
Py_SetPath(pypath_w);

near the beginning of a program, Py_SetPath crashes with memory corruption if 
run on a systems with glibc's MALLOC_CHECK enabled.

The reason is: Py_GetPath and Py_SetPath use different memory interfaces.

* Py_GetPath() calls calculate_path(), which uses PyMem_New() to allocate the 
memory (see 
https://github.com/python/cpython/blob/v3.6.0/Modules/getpath.c#L738, assigned 
to `buf` first)

* But Py_SetPath() uses PyMem_RawFree() to free the memory (see 
https://github.com/python/cpython/blob/v3.6.0/Modules/getpath.c#L830).


This error DOES NOT occur on Windows, since for win32 there is a separate 
implementation, which uses PyMem_RawMalloc (see 
https://github.com/python/cpython/blob/v3.6.0/PC/getpathp.c#L378).

This error also DOES NOT occur in Python <= 3.5, since PYMEM_FUNCS have been 
the same as PYRAW_FUNCS (see 
https://github.com/python/cpython/blob/v3.5.0/Objects/obmalloc.c#L148). This 
was changed in v3.6.0: PYMEM_FUNCS now is PYOBJ_FUNCS, see 
https://github.com/python/cpython/blob/v3.6.0/Objects/obmalloc.c#L159.

This error only occurs when running on a system with glibc's MALLOC_CHECK 
enabled, which seems to be the default st least on CentOS, Fedora and ArchLinux.

Example code and relevant source see below.


Example stack trace


*** glibc detected *** ./dist/jcollect3: double free or corruption (out): 
0x7fde271ab030 ***
=== Backtrace: =
/lib64/libc.so.6[0x37f0675e66]
/lib64/libc.so.6[0x37f06789b3]
/tmp/_MEIhKg3kx/libpython3.6m.so.1.0(Py_SetPath+0x15)[0x7fde2d20e825]
./dist/jcollect3[0x4043e2]
./dist/jcollect3[0x402db2]
./dist/jcollect3[0x402fb0]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x37f061ed5d]
./dist/jcollect3[0x401a9e]
=== Memory map: 


How to reproduce
~

An example for this problem is the bootloader of PyInstaller (as of 2017-08-01).

* Make sure you are running on a Linux distribution having glibc's MALLOC_CHECK 
enabled.

* Set up a virtual environment (just too keep your system clean)

pip install 
https://github.com/pyinstaller/pyinstaller/archive/develop@%7B2017-08-01%7D.zip
echo 'print("Hello")' > test.py
pyinstaller test.py
dist/test/test  # run the frozen script

The relevant source of PyInstaller's bootloader is at 


--
components: Interpreter Core
messages: 302624
nosy: htgoebel
priority: normal
severity: normal
status: open
title: Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex 
with PyMem_Raw_Free
type: crash
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



[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +patch
pull_requests: +3662
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



[issue31530] [2.7] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread STINNER Victor

STINNER Victor added the comment:

@Serhiy: Would you like to propose a PR to implement your RuntimeError. Maybe 
we can test a few popular Python projects to see if the change would break them?

Which popular applications use threads (and files)? :-)

--

___
Python tracker 

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



[issue31351] ensurepip discards pip's return code which leads to broken venvs

2017-09-20 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +dstufft, ncoghlan

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 20.09.2017 17:22, Guido van Rossum wrote:
> 
>> Why not simply document the fact that read ahead in Python 2.7
>> is not thread-safe and leave it at that ?
> 
> Program bugs should not crash the interpreter. (ctypes excepted.)

Ideally not, agreed :-)

--
title: [2.7] Python 2.7 readahead feature of file objects is not thread safe -> 
Python 2.7 readahead feature of file objects is not thread safe

___
Python tracker 

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



[issue31532] Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex with PyMem_Raw_Free

2017-09-20 Thread Vincent Gatine

Changes by Vincent Gatine :


--
keywords: +patch
pull_requests: +3668
stage:  -> patch review

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Ben Bacarisse
Larry Martell  writes:

> On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James  wrote:
>> 
>> Eh, my school never 'ad an electronics class, nor a computer neither. Made
>> programming a bit tricky; we 'ad to write programs on a form and send 'em
>> off to next county.  None of this new-fangled VHDL neither, we 'ad to do our
>> simulations with paper and pencil.
>> 
>
> We dreamed of writing programs on a form. We had to make Hollerith
> punch cards by hand using a dull knife. You tell that to the kids of
> today and they won't believe you.

Dull knife, was it?  Luxury!  We had to dab at card wi' tongue 'till it
were wet enough to punch with a whittled stick.

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


Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Terry Reedy

On 9/20/2017 1:09 PM, Joey Steward wrote:

-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip


Try py -m django-admin startproject mytests.  If this does not work, ask 
on django lists.



django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
 + CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
 + FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

Joey Steward




--
Terry Jan Reedy

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


[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 6b44ad1abdb9b3aaf27e2ba1fc4b69b9a0f50c25 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31533: fix broken link to OpenSSL docs (GH-3674) (GH-3675)
https://github.com/python/cpython/commit/6b44ad1abdb9b3aaf27e2ba1fc4b69b9a0f50c25


--

___
Python tracker 

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



[issue31533] Dead link in SSLContext.set_ciphers documentation

2017-09-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 5b6452d412b5be45f265093e75563fcf6d05dc3e by Mariatta (Christian 
Heimes) in branch '2.7':
bpo-31533: fix broken link to OpenSSL docs (GH-3674) (GH-3676)
https://github.com/python/cpython/commit/5b6452d412b5be45f265093e75563fcf6d05dc3e


--

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Grant Edwards
On 2017-09-20, Gregory Ewing  wrote:
> Grant Edwards wrote:
>> Alternatively, you should design an instruction set and implement it
>> using microcode and AM2900 bit-slice processors.
>
> AMD2900? That's cheating! You should design and build your
> own logic gates. After refining the silicon to make the
> transistors first, of course.

Digging up the sand with your bare hands, no doubt. ;)

-- 
Grant Edwards   grant.b.edwardsYow! In 1962, you could buy
  at   a pair of SHARKSKIN SLACKS,
  gmail.comwith a "Continental Belt,"
   for $10.99!!

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


  1   2   >