[issue31584] Documentation Language mixed up

2017-10-09 Thread INADA Naoki

INADA Naoki  added the comment:

Japanese HTML has this line:

https://docs.python.org/2/faq/design.html; />

I suspect this line affects CDN's cache.
But I can't find document about canonical link in fastly's document.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue31728] crashes in _elementtree due to unsafe decrefs of Element.text and Element.tail

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

As serhiy pointed out in a comment in PR 3924, setting self->text or self->tail 
to
NULL might lead to an assertion failure, so we should also prevent the following
assertion failure (and the similar one for tail):
import xml.etree.ElementTree
class X:
def __del__(self):
elem.text

elem = xml.etree.ElementTree.Element('elem')
elem.text = X()
elem.__setstate__({'tag': None}) # implicitly also set elem.text to None

--

___
Python tracker 

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



[issue31736] PEP 485 tiny typo

2017-10-09 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for the report. Fixed in 
https://github.com/python/peps/commit/070dc7e037e5f66e4e17b661641503815a8bbe05

(By the way, you can report issues like this at 
https://github.com/python/peps/issues or send a PR directly.)

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Amber Brown

Amber Brown  added the comment:

Donald hits it on the head for me.

As long as the code is not covered by the same API deprecation contract that 
the rest of the standard library is, it should make it obvious when attempting 
to use it. I can be relatively certain that a lot of people were not aware that 
the potential scope of asyncio changes included what it potentially could have, 
and I personally wasn't aware that typing was a provisional module (and got 
burnt by incompatible changes in 3.6). There was a small note in the docs, but 
when I was learning from cattrs's docs and not CPython's, how was I supposed to 
know?

A warning is low cost, there's a way to switch it off, and it potentially 
informs users that they need to be aware of its provisional status, especially 
if it's a dependency of a dependency.

--
nosy: +hawkowl

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Donald Stufft

Donald Stufft  added the comment:

The fundamental problem is that unless you're closely following the development 
of python-dev, it's really really easy to use a provisional module without 
knowing that you are.

Take asyncio for example, as far as I can tell the documentation that noted it 
was provisional was a single, near invisible (light grey on a white background) 
call out at the very top of a single page in the documentation. This is made 
especially hard when you have people giving talks at PyCon encouraging people 
to use this, libraries of the code that don't mention that asyncio is 
provisional, so unless you're directly using asyncio you might not even be 
aware that they're using a provisional API at all.

This has the effect that by including these APIs and make the fact they are 
provisional practically unnoticeable, it pushes the pain of dealing with 
changes onto library authors who have their own users asking them to integrate 
with these features. Putting library authors in the position of either having 
to opt-in to a provisional API and hope it doesn't change, having to scramble 
to keep up with changes in new minor releases, or having to relitigate why 
they're not going to support a provisional API.

Ironically, as we found with web APIs, releasing provisional APIs can actually 
make things worse for end users, because people will expect the usage of the 
APIs as if they were covered under the normal contract, but the developers of 
those APIs feel empowered to make more drastic changes. The long development 
time of CPython makes this even worse (it was ~2 years from the release of 
3.4.0 and 3.6.0 for asyncio to become non provisional, longer if you count 
alpha/beta/etc) because people want to use the new stuff, but they have to wait 
a fairly long time to be "allowed" to do it, all the while the general 
ecosystem consensus is "just do it and ignore the warning, if you noticed the 
warning at all".

Ultimately, the provisional status doesn't reduce the pain of getting APIs 
wrong, it just shifts the pain from CPython's developers to the software 
developers writing stuff that depends on CPython but that they don't directly 
control the execution environment (e.g., all the OSS libraries and applications 
on PyPI). A proposal like this helps alleviate some of that pain by creating 
additional barriers to entry to make end users less likely to use it unless 
they understand what they're asking for.

--

___
Python tracker 

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



Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , 
eryk...@gmail.com says...
> 
> On Mon, Oct 9, 2017 at 10:04 PM, John Black  wrote:
> > In article , python@example.invalid says...
> >>
> >> Le 09/10/2017 à 18:22, John Black a écrit :
> >> > I want sep="" to be the default without having to specify it every time I
> >> > call print.  Is that possible?
> >>
> >>  >>> oldprint = print
> >>  >>> def print(*args,**kwargs):
> >> ...   oldprint(*args,**kwargs,sep='')
> >> ...
> >>  >>> print(1,2,3)
> >> 123
> >
> > Winner!  Thanks all.
> 
> functools.partial(print, sep='') is the winner, IMO.

Ok, I got that working too after someone told me I have to import 
functools.  Can you explain what it means?  It looks like it is not 
defining another function like the other solutions but is truly changing 
the defaults for the existing function print?

John Black

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


[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Guido van Rossum

Guido van Rossum  added the comment:

While I understand the sentiment, having this warning pop up every time you 
import a provisional module while developing code feels like harassment of the 
very users we'd like to try out the provisional APIs.

It's also too course-grained -- most of the time a provisional module is pretty 
stable but has a few gray areas that are still under development.

For those people who are writing software for the ages, maybe this can be an 
opt-in warning? I won't object to that.

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

This is also fairly similar to Rust's approach of using feature flags to 
explicitly opt-in to unstable features: https://doc.rust-lang.org/unstable-book/

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Another advantage of this approach: anyone running their tests in a "no 
warnings allowed" configuration would get a hard failure when dependencies on a 
provisional API were unexpectedly introduced (e.g. when updating a third party 
library), rather than silently acquiring a potential future compatibility issue.

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

New submission from Nick Coghlan :

Chatting to Donald Stufft and Amber Brown about the way we currently handle 
provisional APIs, I think they have a legitimate concern that we may not be 
gathering adequately informed consent from users when they depend on APIs that 
we've reserved the right to change in the future.

So what I'm now wondering is whether or not it may be worth amending PEP 411 to 
say that all provisional modules should include an import-time snippet like the 
following:

import __main__
if not getattr(__main__, f"use_provisional_{__name__}"):
import warnings
warnings.warn(FutureWarning, f"The {__name__} module is currently a 
provisional API. New features might be added and API may change even between 
minor releases if deemed necessary.")

The exact wording of the warning would match the caveat used in that module's 
API documentation (the variant above comes from the "typing" module)

The idea here would be that *application* developers would get a FutureWarning 
whenever a provisional module was imported, unless they set 
"use_provisional_" in __main__.

Storing the marker attribute in __main__ would be intended to serve two 
purposes:

- it's always going to be imported anyway, so the runtime cost of the new 
snippet in the provisional modules will be low
- it sends a clear indication to library authors that they *shouldn't* be 
setting the flag implicitly as a side-effect of import (framework authors, by 
contrast, may decide to set it, since they're more in control of the overall 
application behaviour than library authors)

--
messages: 304006
nosy: dstufft, gvanrossum, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Default to emitting FutureWarning for provisional APIs
type: enhancement
versions: 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



[issue31314] email throws exception with oversized header input

2017-10-09 Thread Dong-hee Na

Dong-hee Na  added the comment:

I sent a patch if anyone have a time, please take a look :)

--
nosy: +corona10

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

What is "the backports module"?  I still don't understand what a backports 
directory, that I don't think our installer creates, has to do with your 
MyLibraries directory.

I'm sorry that I'm having trouble following your explanation.  Maybe you could 
list out the contents of your directories and what your sys.path is?

--

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread Chris Caron

Chris Caron  added the comment:

Thank you for replying so quickly;  the issue stems from a bug created here
which explains it a bit better:
https://github.com/caronc/nzb-notify/issues/27 (scroll to the bottom).

In my case, I had a lib\site-packages\backports in C:\Python27 that keeps
over-riding the one defined in the \MyLibraries path. But even when the
'sys.path' has been successfully overridden, the backports module (one i
provide for the package of interest) keeps reverting to the
C:\Python27\lib\site-packages\ path.  It actually just throws an exception
that the module doesn't exist (when ordering of paths would say it does).

To answer your other question: I got the installer from here:
https://www.python.org/downloads/release/python-2713/ (the MSI 64 bit
installer - second from the bottom)

--

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

Where did you get your installer?  I don't find any references to 'backports' 
in our repo, other than a couple of places in the docs where the word appears.

I also don't understand the relationship between your MyPackages and a 
backports directory.  They seem to be unrelated in your examples.

--
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: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
On 2017-10-09 09:44, Mikhail V  wrote:
 Have you ever worked on a slow remote session where a GUI is
 completely impracticable (or maybe even unavailable), and redrawing
 the screen is too expensive to do all the time?
>>>
>>> So where does the redrawing happen? The machine youre sitting on (let's
>>> call it 'A') and send remote commands or retrieving text files? Or the
>>> redrawing must be synced on both A and
>>> the remote machine? If so, then why so?
>
> Peter J. Holzer wrote:
>
>> Because you want to see what you are typing. Imagine you are logged into
>> a server on the other side of the world. You want to edit a file on that
>> machine (for example a configuration file for the web server). You
>> invoke the editor on that server.
>
> I've never done this, but if one told me to edit a file,
> my first attempt would be like:
> - get read/write access to the file system
> - browse it (e.g. some file browser plugin?)
> - get the file to the local machine
> - edit locally
> - write it back to the remote machine

I've mentioned that possibility, but as I've also mentioned it may not
even be possible, and even if it is, it feels clunky to me. I'm already
on the server because I'm investigating an issue. I can simply edit the
file there. Why should I switch to a different tool (e.g. WinSCP), open
another connection, navigate to a directory again, copy a file, edit it,
copy it back (ok, the actual copying back and forth may happen
automatically, so I don't have to do that)?

Of course I am assuming that I have an editor I'm familiar with on the
server. For me this is almost always the case (I use vi (or rather vim)
- yes, I'm currently writing this posting with vim). For a Windows user
this will usually not be the case: There will be no Notepad++, Atom or
PyCharm installed on a typical Linux server.

(Of course there are those who maintain that you should never ever log
in to server: All interaction should be through APIs and management
systems. That may be true if you have thousands of servers. If you have
a few dozen I think that to get a management system into place which is
even close to the linux CLI tools in veratility is way too much work.)


>>> And not in a nice editor with normal fonts?
>>> Am i missing something or your 'A' machine cannot use graphics?
>
>> ... The server may not be able to
>> (it's a server, why would anyone install a GUI on it?)
>
> If I ever work on it (locally) why would I want a GUI on it?
> o_O   I'm not sure if I'm getting you.
> You mean probably a server which is never worked on locally?

Typically yes. T usually am sitting in front of a server just long
enough to make sure I have a network connection. Then I go back to my
office and continue from there. Server rooms are loud, drafty, and
either too cold or too warm.

But it really doesn't matter to me: On the text console I can use
exactly the same programs that I would use remotely over ssh. The only
differences are that there is only one window and I can't resize it.


>> streaming the screen contents of a rich GUI around the world may be not
>> be possible for bandwidth or delay reasons.
> Sure, streaming video consumes a lot, but that is what one tries to
> avoid if under limitations so streaming messages only is faster.

Streaming video is basically what RDP or VNC are. A command line shell
is closer to streaming messages. X11 is really message-based but it's
slow.

hp


-- 
   _  | Peter J. Holzer| Fluch der elektronischen Textverarbeitung:
|_|_) || Man feilt solange an seinen Text um, bis
| |   | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread Chris Caron

New submission from Chris Caron :

The Windows install of Python 2.7.13 defaults it's install into 
**C:\Python27**.  It creates several subdirectories within this; one of which 
is **C:\Python27\lib\site-packages\backports**. So just out of the box (without 
this script installed):
```python
import backports
print(backports.__path__)
# C:\Python27\lib\site-packages\backports
```

I have a custom package that sets the sys.path(0, "new path") entry which works 
great in Linux. I ship all my modules and settings in this path.  This to work 
great in Windows too 'except' for the reference to `backports`.

Consider the block of code:
```python
import sys
from os import getcwd
from os.path import join
sys.path.insert(0, join(getcwd(), 'MyLibraries'))

# Now if we import backports, we should find the one in our MyLibraries 
directory
import backports
print(backports.__path__)# Nope... :(
# C:\Python27\lib\site-packages\backports

# What's weird is it's not entirely broken... you can do the following:
import chardet
print(chardet.__path__)
# Prints my path to MyLibraries/chardet
# So the path is correct and other libraries are coming in correctly
```

What's really weird, is (in Windows) even if i delete the 
**C:\Python27\lib\site-packages\backports**, it still imports the module; so 
it's like part of the Python27 build in some way.

`pip install` with the backports module I want works great because it drops the 
correct package in this 'lib/site-packages\backports' directory which is 
constantly being referenced.

>From what I can see the Microsoft version of Python27 can't seem to stop 
>referencing (even when told not to) the _backports_ location. Linux works 
>perfectly (as intended) but having customers port to this isn't an option for 
>me.

--
components: Windows
messages: 304001
nosy: Chris Caron, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: backports import path can not be overridden in Windows (Linux works fine)
type: behavior
versions: Python 2.7

___
Python tracker 

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



Re: Is there a way to globally set the print function separator?

2017-10-09 Thread eryk sun
On Mon, Oct 9, 2017 at 10:04 PM, John Black  wrote:
> In article , python@example.invalid says...
>>
>> Le 09/10/2017 à 18:22, John Black a écrit :
>> > I want sep="" to be the default without having to specify it every time I
>> > call print.  Is that possible?
>>
>>  >>> oldprint = print
>>  >>> def print(*args,**kwargs):
>> ...   oldprint(*args,**kwargs,sep='')
>> ...
>>  >>> print(1,2,3)
>> 123
>
> Winner!  Thanks all.

functools.partial(print, sep='') is the winner, IMO. Or even code that
use kwargs.setdefault('sep', ''). The above code is wrong in a way
that leads to a TypeError. Can you see the problem?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Grant Edwards
On 2017-10-09, John Black  wrote:

> I want to make sure I understand what this line is doing: 
>
>> oldprint = print
>
> Experimenting, I find this is not a rename because I can use both 
> function names.

Right it's not _changing_ a name.  It's _adding_ a name.

> It looks it literally copies the function "print" to 
> another function called "oldprint".

No, it binds a new name of 'oldprint' to the function to which 'print'
is bound.  It does not create a second function, nor does it remove
the binding of the name 'print' to that function.  It just adds a
second name that's also bound to that function.

> But now, I have a way to modify the builtin funciton "print" by
> referencing oldprint.  Without oldprint, I have no way to directly
> modify print?

Well... you can still access the builtin print via the module that
contains it:

   >>> def print(*args, **kw):
   ...   __builtins__.print(*args, sep='', **kw)
   ... 
   >>> print(1,2,3)

However, anytime you find yourself using double underscore stuff you
should think to yourself "I should find a better way to do that."

> def print(*args, **kw):
> print(*args, sep='', **kw)
>
> meaning print calls print (itself) with sep=''.  But this failed and I 
> guess the reason is that it would keep calling itself recursively adding 
> sep='' each time?

Yep.

Just define a new function with a new name:

   def myprint(*args, **kw):
   print(*args, sep='', **kw)

Redefining builtins is just going get you sworn at down the road a
bit.  If not by yourself, then by somebody else...

-- 
Grant Edwards   grant.b.edwardsYow! Used staples are good
  at   with SOY SAUCE!
  gmail.com

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


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , python@example.invalid says...
> 
> Le 09/10/2017 à 18:22, John Black a écrit :
> > I want sep="" to be the default without having to specify it every time I
> > call print.  Is that possible?
> 
>  >>> oldprint = print
>  >>> def print(*args,**kwargs):
> ...   oldprint(*args,**kwargs,sep='')
> ...
>  >>> print(1,2,3)
> 123

Winner!  Thanks all.

I want to make sure I understand what this line is doing: 

> oldprint = print

Experimenting, I find this is not a rename because I can use both 
function names.  It looks it literally copies the function "print" to 
another function called "oldprint".  But now, I have a way to modify the 
builtin funciton "print" by referencing oldprint.  Without oldprint, I 
have no way to directly modify print?  For example, based on your post, I 
tried:

def print(*args, **kw):
print(*args, sep='', **kw)

meaning print calls print (itself) with sep=''.  But this failed and I 
guess the reason is that it would keep calling itself recursively adding 
sep='' each time?  Thanks.

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


[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I meant that if make deque.copy(), deque.__add__() and deque.__mul__() 
returning an exact deque for subclasses, this would make the deque class more 
consistent with other collections and solve this issue. This could even make 
them (almost) atomic.

--

___
Python tracker 

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



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Ah, here also there are crashes when calling methods of uninitialized 
connection objects.

Should i fix this as part of this issue, or open another one?

--

___
Python tracker 

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



Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Chris Angelico
On Tue, Oct 10, 2017 at 7:40 AM, John Black  wrote:
> In article ,
> __pete...@web.de says...
>>
>> John Black wrote:
>>
>> > I want sep="" to be the default without having to specify it every time I
>> > call print.  Is that possible?
>>
>> No, but you can replace the print function with your own:
>>
>> >>> print = functools.partial(print, sep="")
>> >>> print("I", "recommend", "you", "choose", "another", "name", "and",
>> "preserve", "your", "sanity")
>> Irecommendyouchooseanothernameandpreserveyoursanity
>>
>> And everybody else's.
>
> print=functools.partial(print, sep="")
> NameError: name 'functools' is not defined

It's a module you can import.

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


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , 
__pete...@web.de says...
> 
> John Black wrote:
> 
> > I want sep="" to be the default without having to specify it every time I
> > call print.  Is that possible?
> 
> No, but you can replace the print function with your own:
> 
> >>> print = functools.partial(print, sep="")
> >>> print("I", "recommend", "you", "choose", "another", "name", "and", 
> "preserve", "your", "sanity")
> Irecommendyouchooseanothernameandpreserveyoursanity
> 
> And everybody else's.

print=functools.partial(print, sep="")
NameError: name 'functools' is not defined

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


[issue31738] Lib/site.py: method `abs_paths` is not documented

2017-10-09 Thread Julien Palard

New submission from Julien Palard :

Hi, thanks for reporting.

This method has been renamed in 
https://github.com/python/cpython/commit/28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9
 and is only used in Lib/site.py (currently in main()).

The function has a docstring, so:

  Help on function abs_paths in module site:

  abs_paths()
  Set all module __file__ and __cached__ attributes to an absolute path


Is this function usefull for you outside of site.py?

--
nosy: +mdk

___
Python tracker 

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



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

New submission from Oren Milman :

The following code causes refleaks:
import sqlite3
connection = sqlite3.Connection.__new__(sqlite3.Connection)
connection.__init__('foo')
connection.__init__('foo')

This is because pysqlite_connection_init() (in Modules/_sqlite/connection.c)
doesn't decref (if needed) before assigning to various fields of `self`.

I would open a PR to fix this soon.

--
components: Extension Modules
messages: 303997
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: refleaks when calling sqlite3.Connection.__init__() more than once
type: resource usage
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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

Change by Oren Milman :


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

___
Python tracker 

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



[issue31724] test_xmlrpc_net should use something other than buildbot.python.org

2017-10-09 Thread Zachary Ware

Change by Zachary Ware :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

Tested locally with different versions of sphinx-build:

- 1.3.3 does not produce the issue
- 1.6.2 (used on docs.python.org) produces the issue
- 1.6.3 does not produce the issue
- 1.6.4 does not produce the issue

Reading the changelog between 1.6.2 and 1.6.3 lead to 
https://github.com/sphinx-doc/sphinx/issues/3824 itself leading to
https://github.com/sphinx-doc/sphinx/commit/f99fe20e507210bd7db8665b8f234f1fe25c8100

So it looks fixed in 1.6.3 and 1.6.4, I'm running a full local build (using 
docsbuild-scripts) using sphinx 1.6.4 to see if we can upgrade.

--

___
Python tracker 

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



Re: on = style

2017-10-09 Thread bartc

On 09/10/2017 07:40, Abdur-Rahmaan Janhangeer wrote:

hi just a quick question, why is

my_pens = 4
my_pencils = 5

is preffered to

my_pens = 4
my_pencils = 5

*referring to = symbol alignment



I will sometimes line things up, if a block of assignments are related:

  red = 1
  green   = 2
  blue= 3

There might sometimes be extra maintenance if you then add:

  turquoise = 4

and have to readjust the others, or you add:

  yellow= 201

and prefer the number should be aligned right-justified:

  red   =   1
  green =   2
  blue  =   3
  turquoise =   4
  yellow= 201

but it's not hard. Although it might not be worth doing until a program 
is finished. Compare to:


  red = 1
  green = 2
  blue = 3
  turquoise = 4
  yellow = 201

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


[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

Which example?  (It might be easiest to just generate a PR with your suggested 
improvement.)

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



[issue31719] [2.7] test_regrtest.test_crashed() fails on s390x

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Why not use just abort() or Py_FatalError()?

$ ./python -c 'import ctypes; ctypes.CDLL("libc.so.6").abort()'
Aborted (core dumped)

$ ./python -c 'import ctypes; ctypes.pythonapi.Py_FatalError(b"boom!")'
Fatal Python error: boom!

Current thread 0x7f26805c7580 (most recent call first):
  File "", line 1 in 
Aborted (core dumped)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread Nathaniel Manista

New submission from Nathaniel Manista :

https://docs.python.org/3.7/library/socket.html#socket.socket.close says "it is 
recommended to close() [sockets] explicitly, or to use a with statement around 
them", but in the example code on the same page at 
https://docs.python.org/3.7/library/socket.html#example correct use of the 
.close() method seems to be missing.

--
assignee: docs@python
components: Documentation
messages: 303993
nosy: Nathaniel Manista, docs@python
priority: normal
severity: normal
status: open
title: socket.close recommended but not demonstrated in same-page example code
type: enhancement
versions: 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



[issue26546] Provide translated french translation on docs.python.org

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

→ https://docs.python.org/fr/

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



[issue31584] Documentation Language mixed up

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

FTR I'm still daily monitoring the presence of mixed-up pages server side and 
did not spotted a single one.

I'm still using my very basic:

  $ grep -rl 'définition' /srv/docs.python.org/ja/; grep -rl か 
/srv/docs.python.org/{2.7,3.6,3.7}

--

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

We spotted some quoting probleme in the french translation too, and I still 
didn't had time to look at it, typically here: 
https://docs.python.org/fr/3/library/itertools.html#itertool-functions

where we're getting:

  10.1.1. Fonctions d”itertool¶

instead of:

  10.1.1. Fonctions d'itertool¶

--

___
Python tracker 

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



EuroPython 2017: Videos for Tuesday available online

2017-10-09 Thread M.-A. Lemburg
We are pleased to announce the second batch of cut videos for
EuroPython 2017.

To see the new videos, please head over to our EuroPython YouTube
channel and select the "EuroPython 2017" playlist. The new videos
start at entry 31 in the playlist.


  * EuroPython 2017 Videos *

http://europython.tv/


In the coming weeks, we will continue to release the other videos
currently marked as “private”, in batches of one conference day per
week.


Enjoy,
--
EuroPython 2017 Team
http://ep2017.europython.eu/
http://www.europython-society.org/

PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/916690691224473601
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31314] email throws exception with oversized header input

2017-10-09 Thread Dong-hee Na

Change by Dong-hee Na :


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

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Attaching the strace output.

--
Added file: https://bugs.python.org/file47202/trace

___
Python tracker 

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



[issue31738] Lib/site.py: method `abs_paths` is not documented

2017-10-09 Thread Liel Fridman

Change by Liel Fridman :


--
components: Tests
nosy: lielfr
priority: normal
severity: normal
status: open
title: Lib/site.py: method `abs_paths` is not documented
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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Ned Deily

Change by Ned Deily :


--
nosy: +mdk

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Richard Gibson

New submission from Richard Gibson :

The content at docs.python.org seems to be inserting language-dependent "smart 
quotes" in code blocks, which mangles backslashes and sequences like `'''`. 
Observed at 
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
 , which renders

  longstring  ::=  “”’” longstringitem* “”’” | ‘”“”’ longstringitem* ‘”“”’

instead of

  longstring  ::=  "'''" longstringitem* "'''" | '"""' longstringitem* '"""'

and

  stringescapeseq ::=  “" 

instead of

  stringescapeseq ::=  "\" 

, and looks even worse in other languages:

  longstring  ::=   » »” » longstringitem*  » »” » | “ »«  »” 
longstringitem* “ »«  »”

  longstring  ::=  「」』」 longstringitem* 「」』」 | 『」「」』 longstringitem* 『」「」』


Running `make html` locally produces the desired output, so whatever's going on 
appears specific to the public site.

--
assignee: docs@python
components: Documentation
messages: 303988
nosy: docs@python, gibson042
priority: normal
severity: normal
status: open
title: Documentation renders incorrectly
versions: Python 2.7, 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: The "loop and a half"

2017-10-09 Thread boB Stepp
On Sun, Oct 8, 2017 at 5:36 AM, bartc  wrote:
>
> On 08/10/2017 10:12, Steve D'Aprano wrote:
>>
>> On Sun, 8 Oct 2017 02:06 am, bartc wrote:

>>> I'm getting fed up with this thread now.
>>
>>
>> This thread would be a lot less frustrating if you would enter into it with a
>> spirit of open-minded enquiry rather than an overbearing sense of superiority
>> that anything others do that you don't must be worthless.
>
>
> Frustrating for whom?
>
> It seems to me that it's pretty much everyone here who has an overbearing 
> sense of superiority in that everything that Unix or Linux does is a million 
> times better than anything else.

I follow this list in an effort to learn as much as I can even though
I am usually a fish out of water here.  But this thread in all its
twists and turns and various subject line changes seems to have gotten
totally out of hand.  Even though I am quoting only part of this one
message, there are actually many others that I am responding to here.

In my opinion (Honestly admitting my lack of technical competence.),
this insatiable thirst on this list to get every bit of technical
minutiae exactly correct is doing a severe disservice to the
friendliness of this community.  Yes, gently correct the (perceived)
errors, because we all want to have it right, but please cease this
incessant pounding of points (and people) into the ground to prove we
are right and they are wrong!

I doubt any of this is going to change Bart's mind.  Why can we not
allow him to make his points, respond to them appropriately, and then
let it go when it is clear he has strongly held opinions that are not
likely to change?

And Bart, when large numbers of technical experts in their fields have
spent many hours/months/years, yea, even several decades, developing
these software systems, why do you think that you, all by yourself,
know better?  Can you not see how frustrating this is for people who
have spent good chunks of their lives trying to do the best they can
on these software systems?  Don't you think it is a better approach to
perhaps do some self-examination and approach things from a more
humble learner's perspective?  And BTW, there are many users of
non-*nix systems on this list, or who do work on multiple operating
system platforms.

Can we not let people be who they are, perceived warts (valid or not)
and all, and after responding (hopefully gently) to technical errors
just let them be???

Peace.


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


[issue31736] PEP 485 tiny typo

2017-10-09 Thread Ben Bolker

New submission from Ben Bolker :

In two places in https://www.python.org/dev/peps/pep-0485/ floating point 
numbers are incorrectly formatted: 1-e8 and 1-e9 rather than 1e-8 and 1e-9 
("absolute tolerance default", para. 3 and "relative tolerance default", para. 
1)

--
messages: 303987
nosy: bbolker
priority: normal
severity: normal
status: open
title: PEP 485 tiny typo
type: enhancement

___
Python tracker 

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



Re: Python GUI application embedding a web browser - Options?

2017-10-09 Thread fpp
Paul Moore  said :

> On 9 October 2017 at 04:25,   wrote:
>> Did you find out the answer for that?
> 
> Nothing much beyond the pointer to PyQt (which basically said "a lot
> of the info on the web is out of date" so I should check the latest
> docs). I didn't take it much further, though, as it was a hobby
> project and the learning curve for PyQt (any GUI framework, really)
> was a bit high for the amount of spare time I had at the time.
> 
> Paul

Have you looked at CEFpython ?
It seems to work with all major GUIs (Qt, wx, Tk, gtk..)
https://github.com/cztomczak/cefpython/tree/master/examples

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


[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

Paul Pinterits  added the comment:

If we take this class:

class Obj:
@property
def d(self):
print('called')

And we access Obj.d:

_ = Obj.d

According to the docs, the following should happen:

# obj.d looks up d in the dictionary of obj
d = Obj.__dict__['d']

# If d defines the method __get__(),
if hasattr(d, '__get__'):

# then d.__get__(obj) is invoked
d.__get__(Obj)

We know this doesn't happen because nothing is printed to stdout.

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6e3d6b5dc22cd06d8c4d44a38a8a3415e4bebb16 by Victor Stinner in 
branch 'master':
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929)
https://github.com/python/cpython/commit/6e3d6b5dc22cd06d8c4d44a38a8a3415e4bebb16


--

___
Python tracker 

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



Re: Finding Old Posts on Python

2017-10-09 Thread Abdur-Rahmaan Janhangeer
download the archive in compressed format.

then use notepad++ or sublimetext with option search in files. search for
your name !

Abdur-Rahmaan Janhangeer,
Mauritius
abdurrahmaanjanhangeer.wordpress.com

On 8 Oct 2017 03:45, "Cai Gengyang"  wrote:

> Hello,
>
> Does anyone know of a way to find all my old posts about Python ? Thanks a
> lot!
>
> GengYang
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Terry Reedy

On 10/9/2017 12:22 PM, John Black wrote:

I want sep="" to be the default without having to specify it every time I
call print.  Is that possible?

John Black


Define a replacement print function that makes this the default. 
Something like (untested, a detail may be wrong):


_print = print
def print(*args, **kwargs):
_print(*args, {'sep':''}.update(kwargs))


--
Terry Jan Reedy

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


[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

Paul Pinterits  added the comment:

I'm aware that descriptors have to exist on the class in order to work. The 
point is that the documentation states "If d defines the method __get__(), then 
d.__get__(obj) is invoked" (where d is obj.d), which is simply not true.

--

___
Python tracker 

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



Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Peter Otten
John Black wrote:

> I want sep="" to be the default without having to specify it every time I
> call print.  Is that possible?

No, but you can replace the print function with your own:

>>> print = functools.partial(print, sep="")
>>> print("I", "recommend", "you", "choose", "another", "name", "and", 
"preserve", "your", "sanity")
Irecommendyouchooseanothernameandpreserveyoursanity

And everybody else's.

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


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Python

Le 09/10/2017 à 18:22, John Black a écrit :

I want sep="" to be the default without having to specify it every time I
call print.  Is that possible?


>>> oldprint = print
>>> def print(*args,**kwargs):
...   oldprint(*args,**kwargs,sep='')
...
>>> print(1,2,3)
123
--
https://mail.python.org/mailman/listinfo/python-list


Re: on = style

2017-10-09 Thread Abdur-Rahmaan Janhangeer
hum i see clearly with all my python experience, i have more to learn.

i never aligned the = but i found it neat looking but discouraged by pep8.
glad i did not switch to it and maintained it for sometimes !

thanks for answers !

Abdur-Rahmaan Janhangeer,
Mauritius
abdurrahmaanjanhangeer.wordpress.com

On 9 Oct 2017 10:40, "Abdur-Rahmaan Janhangeer" 
wrote:

> hi just a quick question, why is
>
> my_pens = 4
> my_pencils = 5
>
> is preffered to
>
> my_pens = 4
> my_pencils = 5
>
> *referring to = symbol alignment
>
> tk !
>
> Abdur-Rahmaan Janhangeer,
> Mauritius
> abdurrahmaanjanhangeer.wordpress.com
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31415] Add -X option to show import time

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3910
stage: resolved -> patch review

___
Python tracker 

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



Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Paul Moore
On 9 October 2017 at 17:22, John Black  wrote:
> I want sep="" to be the default without having to specify it every time I
> call print.  Is that possible?

def myprint(*args, **kw):
print(*args, sep="", **kw)

If you want, assign print=myprint.

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


Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Ned Batchelder

On 10/9/17 12:22 PM, John Black wrote:

I want sep="" to be the default without having to specify it every time I
call print.  Is that possible?




There isn't a way to change the default for print(sep="") globally. 
Generally when you want better control over the output, you use string 
formatting.  Instead of:


    print("X is ", x, " and y is ", y, sep="")

use:

    print("X is {} and y is {}".format(x, y))

If you show us your actual print lines, we can give more concrete advice.

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


Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
I want sep="" to be the default without having to specify it every time I 
call print.  Is that possible?

John Black

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


[issue27172] Undeprecate inspect.getfullargspec()

2017-10-09 Thread Tim Graham

Tim Graham  added the comment:

Perhaps the reason for the undeprecation could use some clarification. In a 
Python 3 only world (where Django's master branch is), I believe there's still 
usefulness for inspect.getfullargspec() -- see 
https://github.com/django/django/search?q=getfullargspec for usages.

--

___
Python tracker 

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



[issue31683] a stack overflow on windows in faulthandler._fatal_error()

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

IMHO this issue is theorical. I don't expect that anyone would call 
Py_FatalError() with a very long message, so I will not backport the fix to 
Python 2.7 and 3.6.

Thanks for the bug report Oren Milman!

--
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: The "loop and a half"

2017-10-09 Thread Marko Rauhamaa
Grant Edwards :

> On 2017-10-09, Marko Rauhamaa  wrote:
>> The problem is it's too low-level ("mechanism, not a policy"). What
>> we'd need is this setup:
>>
>>+-+
>>| client  |
>>+-+
>>| toolkit |
>>|   RPC   |
>>+++
>> |
>> | TCP
>> |
>>+++
>>| toolkit |
>>|  server |
>>+++
>> |
>> | Local
>> |
>>  +--+--+
>>  |   Wayland   |
>>  |  compositor |
>>  +-+
>
> But then you need to re-impliment that for each and every toolkit.
> With the old X11 scheme, it only need to be implimented once.

The solution is that the toolkit RPC sends (or is prepared to send) the
toolkit server plugin to the generic remote server. In fact, that's how
web pages are implemented using JavaScript (with the roles of the server
and the client reversed).


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


[issue24084] pstats: sub-millisecond display

2017-10-09 Thread Romuald Brunet

Romuald Brunet  added the comment:

I figured we didn't want to change the size of the columns (+12 COL), but this 
could easily be done yes

--

___
Python tracker 

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



[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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



[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

commit fae0512e58619231a566bf77aa21148440b0ec8d
Author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
Date:   Thu Oct 5 07:10:59 2017 -0700

[3.6] bpo-31178: Mock os.waitpid() in test_subprocess (GH-3896) (#3897)

Fix test_exception_errpipe_bad_data() and
test_exception_errpipe_normal() of test_subprocess: mock os.waitpid()
to avoid calling the real os.waitpid(0, 0) which is an unexpected
side effect of the test.
(cherry picked from commit 11045c9d8a21dd9bd182a3939189db02815f9783)

--

___
Python tracker 

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



[issue31727] FTP_TLS errors when

2017-10-09 Thread Steve Dower

Steve Dower  added the comment:

"OSError: [Errno 0] Error" typically means that OpenSSL failed due to a Windows 
error, but we assumed it failed due to a POSIX error and so read the wrong 
error number (errno instead of GetLastError()).

It's worth testing with Python 3.7.0a1, since we made some changes to OpenSSL 
integration (as well as updating it to a significantly newer version) that may 
impact this scenario.

--
assignee:  -> christian.heimes
components: +SSL
nosy: +christian.heimes

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar  added the comment:

You get what you should get: when you print obj.d, Obj.d, you will get:



which is exactly what you expect:
- in the first case, you assigned a property object to the dictionary at 
obj.__dict__, so that's what you get back when you run obj.d.
- you defined a property on a class called d, and you get it when you run Obj.d

If you run print(Obj().d) you will get a TypeError: your lambda should read:

lambda self: print('called')

Properties should be added to the class not the instance, see 
https://stackoverflow.com/questions/1325673/how-to-add-property-to-a-class-dynamically
 and https://eev.ee/blog/2012/05/23/python-faq-descriptors/

--
nosy: +Henk-Jaap Wagenaar

___
Python tracker 

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



Re: The "loop and a half"

2017-10-09 Thread Grant Edwards
On 2017-10-09, Marko Rauhamaa  wrote:

> I can't comment on Windows. However, X11's remote access is hardly
> usable.

15 years ago it worked great over 256Kbps DSL links.  Even on dialup
links it was usable (if a bit clumsy).

It's the toolkits that are broken when it comes to remote access.

> The problem is it's too low-level ("mechanism, not a policy"). What
> we'd need is this setup:
>
>+-+
>| client  |
>+-+
>| toolkit |
>|   RPC   |
>+++
> |
> | TCP
> |
>+++
>| toolkit |
>|  server |
>+++
> |
> | Local
> |
>  +--+--+
>  |   Wayland   |
>  |  compositor |
>  +-+

But then you need to re-impliment that for each and every toolkit.
With the old X11 scheme, it only need to be implimented once.

> Unfortunately, what we wil be given is:
>
>+-+
>| client  |
>+-+
>| toolkit |
>|   lib   |
>+++
> |
> | Local
> |
>  +--+--+
> |   Wayland   |
> |  compositor |
>  +-+
>
>
> Which will get rid of the network transparency altogether.

For all practial purposes, X11 network transparancy has been gone for
years: it only works for apps that nobody cares about.  I still use it
occasionally just to verify that a remotely upgraded/installed
wxPython app will start up, but it's way too slow to actually _use_
the app.

-- 
Grant Edwards   grant.b.edwardsYow! I want the presidency
  at   so bad I can already taste
  gmail.comthe hors d'oeuvres.

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


[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread Steve Dower

Steve Dower  added the comment:

> Is it possible to be asked to be called as the last handler ...

Unfortunately not, since the stack-based handlers always come after the vector 
handlers, and C++ handlers written using try/catch will always be stack-based.

It may be interesting for faulthandler to have a stack-based version, so that 
you can provide the function to call and it will call it inside an exception 
handler. But I don't think it's that interesting and in any case doesn't need 
to be in the stdlib.

I wouldn't worry about 0xE0434F4D for now, but if someone comes along with a 
need for it then we can add it.

--

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

FYI the merged fix is:

commit 9764c151c51480a7ca6042b1ccd69be2620ff360
Author: matejcik 
Date:   Thu Feb 16 14:41:31 2017 +0100

update test_socket AEAD test for kernel 4.9 and up (#133)

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Forgot the mention the kernel version which is 3.10.0-693.2.1.el7.ppc64le

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> The issue is reproducible on a CentOS 7.4 on ppc64le architecture.

What is the kernel version?

It would be nice to have the strace output. Example:

strace -o trace ./python -m test -v test_socket -m test_sha256
# then get the trace file

I'm surprised because it seems like ENOKEY (error 126) can only be get on 
accept(), not on send():
http://elixir.free-electrons.com/linux/latest/source/crypto/af_alg.c#L295

--
nosy: +haypo

___
Python tracker 

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



[issue31681] pkgutil.get_data() leaks open files in Python 2.7

2017-10-09 Thread Éric Araujo

Change by Éric Araujo :


--
assignee:  -> merwok
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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Eric N. Vander Weele

Change by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Yes, i am going manually over the code to find similar stuff to #31718,
and i afraid i found quite a few, and still working on it..

--

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ghaering, serhiy.storchaka
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> I'm curious, how did you find this code? Are you using a code generator 
> coupled with a tool to track for reference leaks?

Oh, I think that the issue is related to bpo-31718.

--

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I merged your PR, thanks! As I wrote on the PR:

I don't think that a NEWS entry is needed, since you are not supposed to call 
__init__() multiple times.

I don't think that it's worth it to backport the fix to Python 2.7 and 3.6. So 
I close the issue.

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> The following code causes refleaks:

I'm curious, how did you find this code? Are you using a code generator coupled 
with a tool to track for reference leaks?

--

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c0cabc23bbe474d542ff8a4f1243f4ec3cce5549 by Victor Stinner (Oren 
Milman) in branch 'master':
bpo-31723: Fix refleaks when zipimporter.__init__() is called more than once 
(GH-3919)
https://github.com/python/cpython/commit/c0cabc23bbe474d542ff8a4f1243f4ec3cce5549


--
nosy: +haypo

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

New submission from Paul Pinterits :

The [descriptor 
howto](https://docs.python.org/3/howto/descriptor.html#invoking-descriptors) 
states:

"For example, obj.d looks up d in the dictionary of obj. If d defines the 
method __get__(), then d.__get__(obj) is invoked [...]"

This is not true - the descriptor obtained from obj's dictionary is never 
invoked. If it was, the following two snippets would produce output:


class Class:
pass

obj = Class()
obj.__dict__['d'] = property(lambda: print('called'))

_ = obj.d  # nothing is printed.


class Obj:
@property
def d(self):
print('called')

_ = Obj.d  # nothing is printed.

--
assignee: docs@python
components: Documentation
messages: 303968
nosy: Paul Pinterits, docs@python
priority: normal
severity: normal
status: open
title: Documentation incorrectly states how descriptors are invoked
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for your patches, Mark. A few remarks:

Python 3.5 is in security fix-only mode. The issue is not a security bug.

Python has switched to a different workflow a while ago. Please provide a pull 
request on GitHub against master (3.7). I'll take care of the backports.

Also your implementation of version specific TLS has multiple flaws, e.g. 
missing NULL check and missing set_max_proto_version() calls. I opened a new PR.

--

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Christian Heimes

Change by Christian Heimes :


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

___
Python tracker 

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



[issue24084] pstats: sub-millisecond display

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, "2447µs" makes the output more difficult to parse (by a program) and to 
read (by a human). Why not always displaying 6 digits (after the dot) for the 
two "percall" columns.

--
nosy: +haypo

___
Python tracker 

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



Re: The "loop and a half"

2017-10-09 Thread Grant Edwards
On 2017-10-09, Marko Rauhamaa  wrote:
> Grant Edwards :
>
>> On 2017-10-09, alister via Python-list  wrote:
>>
>>> or if you want the luxury of a GUI editor simply ssh to the remote
>>> machine & run the editor there (using X forwarding to route the
>>> display to you local PC)
>>
>> AFAICT, most modern GUI toolkits are no longer usable via X forwarding
>> at sub-gigabit network speeds. The toolkit designers have botched
>> things up so that even the most trivial operation requires hundreds of
>> round-trips between server and client.
>
> Yep.
>
> Funny thing is, xterm runs nicely over a 9,600-baud line, but there's no
> hope to get Firefox, Evince or the like to run over a 1,500,000 bps
> connection.

Most of the "old-school" apps that use athena or motif widgets work
fine.  There are a a couple more modern toolkits that still work
right: the last time I tried an fltk, it seemed OK.

But, both GTK and QT are hopeless pigs.

Xemacs can be built so that it works fine remotely -- but if you're an
emacs user you generally don't care. It's simpler to just run emacs on
the remote machine via a normal "tty" connection.

> Latency is more of an issue than throughput,

That's true, I should have been more precise.

> indicating that those round-trips are sequential. X11 was designed
> to be pipelined but the toolkits can't pipeline themselves.

-- 
Grant Edwards   grant.b.edwardsYow! Am I SHOPLIFTING?
  at   
  gmail.com

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


[issue31681] pkgutil.get_data() leaks open files in Python 2.7

2017-10-09 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset cfe1aefcbd2534ddc1059a7332842644e6c8d1e4 by Éric Araujo (Elvis 
Pranskevichus) in branch '2.7':
bpo-31681: Make sure pkgutil.get_data closes files properly (#3875)
https://github.com/python/cpython/commit/cfe1aefcbd2534ddc1059a7332842644e6c8d1e4


--
nosy: +merwok

___
Python tracker 

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



Re: The "loop and a half"

2017-10-09 Thread Marko Rauhamaa
alister :
> I cant see any reason why I would want to run a web browser remotely

I have had that need occasionally. More recently, I wanted to print a
PDF document using evince. It took forever for evince to respond over
the WAN. I had to resort to other means.

> I can see that even this would be too slow on some connections but it
> invariably works better that Remote desktop which seems to be the
> preferred approach in the windows world where they don't have much
> choice.

I can't comment on Windows. However, X11's remote access is hardly
usable.

The problem is it's too low-level ("mechanism, not a policy"). What we'd
need is this setup:

   +-+
   | client  |
   +-+
   | toolkit |
   |   RPC   |
   +++
|
| TCP
|
   +++
   | toolkit |
   |  server |
   +++
|
| Local
|
 +--+--+
 |   Wayland   |
 |  compositor |
 +-+


Unfortunately, what we wil be given is:

   +-+
   | client  |
   +-+
   | toolkit |
   |   lib   |
   +++
|
| Local
|
 +--+--+
 |   Wayland   |
 |  compositor |
 +-+


Which will get rid of the network transparency altogether.


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


Re: The "loop and a half"

2017-10-09 Thread alister via Python-list
On Mon, 09 Oct 2017 17:27:27 +0300, Marko Rauhamaa wrote:

> Grant Edwards :
> 
>> On 2017-10-09, alister via Python-list  wrote:
>>
>>> or if you want the luxury of a GUI editor simply ssh to the remote
>>> machine & run the editor there (using X forwarding to route the
>>> display to you local PC)
>>
>> AFAICT, most modern GUI toolkits are no longer usable via X forwarding
>> at sub-gigabit network speeds. The toolkit designers have botched
>> things up so that even the most trivial operation requires hundreds of
>> round-trips between server and client.
> 
> Yep.
> 
> Funny thing is, xterm runs nicely over a 9,600-baud line, but there's no
> hope to get Firefox, Evince or the like to run over a 1,500,000 bps
> connection.
> 
> Latency is more of an issue than throughput, indicating that those
> round-trips are sequential. X11 was designed to be pipelined but the
> toolkits can't pipeline themselves.
> 
> 
> Marko

works fine over my wifi which is considerably less than gigabit speeds
then again I only run applications remotely that are sensible to run 
remotely such as text editors (geany) & file managers (thunar)
I cant see any reason why I would want to run a web browser remotely

I can see that even this would be too slow on some connections but it 
invariably works better that Remote desktop which seems to be the 
preferred approach in the windows world where they don't have much choice.




-- 
It's very glamorous to raise millions of dollars, until it's time for the
venture capitalist to suck your eyeballs out.
-- Peter Kennedy, chairman of Kraft & Kennedy.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31092] delicate behaviour of shared (managed) multiprocessing Queues

2017-10-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> To a avoid race condition

As Oren explained, the race condition is due to your use of the managed Queue.  
If you keep the object alive in the main process until the tasks have finished, 
there shouldn't be any problem.  The question is: is there any reason you don't 
want to?

--

___
Python tracker 

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



A programmable python debugger. Set one breakpoint to x-ray everything

2017-10-09 Thread H.C. Chen
peforth 

If the below explanations would be messy please directly refer to README.md @ 
https://github.com/hcchengithub/peforth

A programmable python debugger. Set one breakpoint to x-ray everything.

You guys know how to bebug already. We all do. But when it comes to Machine 
Learning and Tensorflow or the likes, things are getting annoying if we were 
still using traditional debuggers. A programmable debugger is what in my mind 
and probably in yours too. One breakpoint to investigate about everything with 
procedures that we come out at the point depend on variant needs of emerged 
ideas good or bad.

Debug commands in FORTH syntax

So now we need to choose an interactive UI and its syntax that is light weight, 
reliable and flexible so we won't regret of choosing it someday, has been there 
for decades so many people don't need to learn about another new language 
although we are only to use some debug commands, yet easy enough for new users, 
that's FORTH.

Install peforth:

pip install peforth 
Run peforth:

Print "Hello World!"

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

c:\Users\your-working-folder>python -m peforth .' Hello World!!' cr bye
Hello World!!

c:\Users\your-working-folder>
so your peforth has been working fine. To your application, import peforth as 
usual to bring in the debugger:

c:\Users\your-working-folder>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import peforth
p e f o r t hv1.07
source code http://github.com/hcchengithub/peforth
Type 'peforth.ok()' to enter forth interpreter, 'exit' to come back.

>>>
The greeing message tells us how to enter the FORTH interpreter for your 
debugging or investigating and how to come back to continue running your code.

Let's try to debug a program

# 100.py

sum = 0
for i in range(100):
sum += i
print("The sum of 1..100 is ", sum)
Run it:

c:\Users\your-working-folder>python 100.py
The sum of 1..100 is 4950

c:\Users\your-working-folder>
The result should be 5050 but it's not! Let's drop a breakpoint to see what's 
wrong:

# 100.py with breakpoing   .- Specify an unique command prompt to indicate 
where 
   |  the breakpoint is from if there are many of 
them
import peforth |.- pass locals() at the breakpoint
sum = 0||  to our debugger
for i in range(100):   ||   .--- use a FORTH 
constant   
sum += i   ||   |to represent 
the locals()
peforth.ok('my first breakpoint> ',loc=locals(),cmd="constant 
locals-after-the-for-loop")
print("The sum of 1..100 is ", sum)
Run again:

c:\Users\your-working-folder>python 100.py
p e f o r t hv1.07
source code http://github.com/hcchengithub/peforth
Type 'peforth.ok()' to enter forth interpreter, 'exit' to come back.

 .--- at the breakpoint, type in 'words' 
 |command to see what have we got   
my first breakpoint> words. It's a long list of 'words'
... snip ...  | or available commands. Don't worry, 
we'll use only some of them.
expected_rstack expected_stack test-result [all-pass] *** all-pass [r r] [d d] 
[p 
p] WshShell inport OK dir keys --- locals-after-the-for-loop
   |
The last one is what --' 
we have just created throuth the breakpoint statement
, named "locals-after-the-for-loop"
Let's see it:

   print a carriage return at the end ---.
  print the thing -. | 
   | |
my first breakpoint> locals-after-the-for-loop . cr
({'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': 
<_frozen_importlib_external.SourceFileLoader object at 0x01DD2D737710>, 
'__spec__': None, '__annotations__': {}, '__builtins__': , '__file__': '100.py', '__cached__': None, 'peforth': , 'sum': 4950, 'i': 99}, {}, 'my first breakpoint> ')
my first breakpoint>|   |   |
|   |   '--- our command
   our sum -'   |prompt
|  indicates where the 
99 instead of 100 --'  breakpoint is from
this is the problem !!
Now leave the breakpoint and let the program continue:

my first breakpoint> exit
my first breakpoint> The sum of 1..100 is  4950

c:\Users\your-working-folder>
Investigate by running experiments right at a breakpoint

When at a breakpoint in Tensorfow tutorials, I always want to make some 
experiments on those frustrating 

[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Also, the following code results in a memory leak:
import sqlite3
cache = sqlite3.Cache.__new__(sqlite3.Cache)

This is because pysqlite_cache_dealloc() just returns in case of an 
uninitialized
Cache object.

--

___
Python tracker 

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



Re: The "loop and a half"

2017-10-09 Thread Marko Rauhamaa
Grant Edwards :

> On 2017-10-09, alister via Python-list  wrote:
>
>> or if you want the luxury of a GUI editor simply ssh to the remote
>> machine & run the editor there (using X forwarding to route the
>> display to you local PC)
>
> AFAICT, most modern GUI toolkits are no longer usable via X forwarding
> at sub-gigabit network speeds. The toolkit designers have botched
> things up so that even the most trivial operation requires hundreds of
> round-trips between server and client.

Yep.

Funny thing is, xterm runs nicely over a 9,600-baud line, but there's no
hope to get Firefox, Evince or the like to run over a 1,500,000 bps
connection.

Latency is more of an issue than throughput, indicating that those
round-trips are sequential. X11 was designed to be pipelined but the
toolkits can't pipeline themselves.


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


[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Since this issue is on the thin border between "feature" and "bug fix", I would 
like to get the feedback of Benjamin on this change.

@Benjamin: Are you ok to make such change late in the Python 2.7 cycle, in 
Python 2.7.15?

--

___
Python tracker 

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



Re: The "loop and a half"

2017-10-09 Thread Grant Edwards
On 2017-10-09, alister via Python-list  wrote:

> or if you want the luxury of a GUI editor simply ssh to the remote 
> machine & run the editor there (using X forwarding to route the display 
> to you local PC)

AFAICT, most modern GUI toolkits are no longer usable via X forwarding
at sub-gigabit network speeds.  The toolkit designers have botched
things up so that even the most trivial operation requires hundreds of
round-trips between server and client.

-- 
Grant Edwards   grant.b.edwardsYow! Did YOU find a
  at   DIGITAL WATCH in YOUR box
  gmail.comof VELVEETA?

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


Re: The "loop and a half"

2017-10-09 Thread Grant Edwards
On 2017-10-09, Gregory Ewing  wrote:
> Grant Edwards wrote:
>> Which took it from RSX-11.  Or probably more specifically from
>> FILES-11.  I woldn't be surprised if the enineers at DEC got it from
>> somewhere else before that.
>
> Quite possibly it goes back to the very earliest DEC OS
> that had files, whatever that was.
>
> The reason for it was that the file system only kept track
> of file sizes in blocks, not bytes, so some way was needed
> to mark the end of a text file part way through a block.

A "feature" that CP/M copied almost verbatim.  If you looked at the
CP/M FCB (file-control-block) structure it looked almost identical to
that used by early DEC OSes.  DOS then copied CP/M's file i/o scheme
even more exactly than CP/M had copied DEC.  It was years later than
DOS finally copied some Unix features like nested directories, opening
files via path strings, etc.

-- 
Grant Edwards   grant.b.edwardsYow! Do you think the
  at   "Monkees" should get gas on
  gmail.comodd or even days?

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


[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

All Victor's PRs LGTM is they look good to Benjamin.

But on the next iteration we can get a report that tests don't work if set 
PYTHONSHOWREFCOUNT.

--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-10-09 Thread Larry Hastings

Larry Hastings  added the comment:

Wait, what is all this nonsense?

inspect.getfullargspec is Python 3 only.  It was added to support keyword-only 
parameters.  Python 2 doesn't *have* keyword-only parameters, so it isn't 
needed there.

Check for yourself: Python 2 doesn't have inspect.getfullargspec.

https://docs.python.org/2/library/inspect.html#inspect.getargspec

We might consider un-deprecating inspect.getargspec() for supporting code 
supporting Py2 and Py3.  But there's no point in un-deprecating 
inspect.getfullargspec() for that reason.

Nick: please *back out* your pointless, taffy-headed checkin.

--
status: closed -> open

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

(I prefer to not split the discussion on this issue and my 2 PR, I prefer to 
only discuss the design in this issue.)

https://github.com/python/cpython/pull/3927#pullrequestreview-67963845

Serhiy:
> Using the requires_type_collecting decorator LGTM. But I don't sure about 
> adding PYTHONSHOWALLOCCOUNT. This looks like a new feature to me.
> What if split this PR on two parts? The one fixes issues related to immortal 
> types, the other is about additional output.

Both changes are connected. If you only want to fix tests, that's the purpose 
of my much longer PR 3910.

"This looks like a new feature to me."

My PR changes the default behaviour, but COUNT_ALLOCS is not enabled by 
default, not even by the debug mode. You have to explicitely enable it. I 
expect that developers who use this option are able to track the Python 2.7 
changelog and "discover" the newly added environment variable by themself. 
Moreover, defining PYTHONSHOWALLOCCOUNT=1 is "backward compatible" with Python 
< 2.7.15 and Python 3, since unknown environment variables are just ignored.

--

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

New submission from Oren Milman :

The following code causes a crash:
import sqlite3
cache = sqlite3.Cache.__new__(sqlite3.Cache)
cache.get(None)

This is because pysqlite_cache_get() (in Modules/_sqlite/cache.c) assumes that
the Cache object is initialized, and so it passes self->mapping to
PyDict_GetItem(), which assumes it is not NULL, and crashes.


Also, the following code causes a SystemError ('null argument to internal
routine'), as well as refleaks in the deallocation of the Cache object:
import sqlite3
cache = sqlite3.Cache(str)
try:
cache.__init__()
except TypeError:
pass
cache.get(None)

This is because pysqlite_cache_init() first sets self->factory to NULL, and
only then parses its arguments, so in case it fails to parse the arguments
(e.g. due to a wrong number of arguments) we are left with a partially
initialized Cache object.


While we are here, we should also fix refleaks that occur when
sqlite3.Cache.__init__() is called more than once.

--
components: Extension Modules
messages: 303958
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crash or SystemError in sqlite3.Cache in case it is uninitialized or 
partially initialized
type: crash
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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> How many tests are still left broken if just change the COUNT_ALLOCS output 
> to stderr instead of stdout?

That's my first PR: PR 3910.


> COUNT_ALLOCS is not the only option that spoils Python output. Py_TRACE_REFS 
> adds even more noise to stderr, and this is a default option in debug build.

Again, I created bpo-31733 to propose to make this *super annoying* [xxx refs] 
line *by default*. It makes this issue more consistent ;-)

--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "Do you going to backport also -X showrefcount?"

I just created bpo-31733 "Add PYTHONSHOWREFCOUNT environment variable to Python 
2.7".

--

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +benjamin.peterson, ezio.melotti, serhiy.storchaka
stage: patch review -> 

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



  1   2   >