[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-06 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Library (Lib)
dependencies: +Dict order is now guaranteed, so add tests and doc for it

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 5127 makes frames be created only when the size of the payload is not less 
than 4. Since the minimal size of 3 chunks is 3 bytes this is the absolute 
minimum of frame size.

It would be better to count the number of chunks instead of bytes, but this 
will complicate implementations, especially Python implementation.

--

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-06 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32507] Change Windows install to applocal UCRT

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:

The PR is ready, but I'll leave this open for a few days in case anyone wants 
to comment.

--

___
Python tracker 

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



[issue32501] Documentation for dir([object])

2018-01-06 Thread Matthew Cowles

Matthew Cowles  added the comment:

My thanks to David for the clarification. I don't find the logic he describes 
(but does not necessarily subscribe to!) persuasive in this case. In my 
opinion, "Let's be incorrect for the sake of simplicity," is not the way to 
document a programming language in the language's official library 
documentation.

I think that saying, "If the object (technically the class) has a method 
named..." would add very little burden to people who don't care about the 
difference.

--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

Ah, I like dropping "For objects that do not provide sequence protocol". Go for 
it!

--

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Tim Peters

Tim Peters  added the comment:

And I somehow managed to unsubscribe Steven :-(

--
nosy: +steven.daprano

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Tim Peters

Tim Peters  added the comment:

Right, "..." immediately after a ">>>" line is taken to indicate a code 
continuation line, and there's no way to stop that short of rewriting the 
parser.

The workaround you already found could be made more palatable if you weren't 
determined to make it impenetrable ;-)  For example,

"""
>>> print("not an ellipsis\\n" + res) #doctest:+ELLIPSIS
not an ellipsis
...
d41d8cd98f00b204e9800998ecf8427e __init__.py
...
"""

Or if this is a one-off, some suitable variant of this is simple:

"""
>>> "d41d8cd98f00b204e9800998ecf8427e __init__.py" in res
True
"""

I'd prefer that, since it directly says you don't care about anything other 
than that `res` contains a specific substring (in the original way, that has to 
be _inferred_ from the pattern of ellipses).

--
nosy:  -steven.daprano
type: enhancement -> behavior

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Oops, somehow managed to accidentally unsubscribe r.david.murray

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Here's a simple demonstration of the issue:


# --- cut %< ---
import doctest

def hash_files():
"""
>>> hash_files()  # doctest: +ELLIPSIS
...
d41d8cd98f00b204e9800998ecf8427e __init__.py
...

"""
print("""\
e1f9390d13c90c7ed601afffd1b9a9f9 records.py
6a116973e8f29c923a08c2be69b11859 ledger.py
d41d8cd98f00b204e9800998ecf8427e __init__.py
b83c8a54d6b71e28ccb556a828e3fa5e qif.py
ac2d598f65b6debe9888aafe51e9570f ofx.py
9f2572f761342d38239a1394f4337165 msmoney.py
""")

doctest.run_docstring_examples(hash_files, globals())

# --- cut %< ---


The documentation does say that output must follow the final >>> or ... 

https://docs.python.org/3/library/doctest.html#how-are-docstring-examples-recognized

so I believe this is expected behaviour and not a bug.

Here is a workaround. Change the doctest to something like this:


>>> print('#', end=''); hash_files()  # doctest: +ELLIPSIS
#...
d41d8cd98f00b204e9800998ecf8427e __init__.py
...



But a more elegant solution would be to add a new directive to tell doctest to 
interpret the ... or >>> as output, not input, or to add a new symbol similar 
to .

I'm changing this to an enhancement request as I think this would be useful.

--
components: +Library (Lib)
nosy: +steven.daprano, tim.peters -r.david.murray
type: behavior -> enhancement
versions: +Python 3.8

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread R. David Murray

R. David Murray  added the comment:

Ah, I see my answer crossed with your post :)

--

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread R. David Murray

R. David Murray  added the comment:

What happens if you print a placeholder line first, before your test output?  
I'm not sure it will work, I seem to remember something about an ellipses 
starting a line just not being supported, but it was a long time ago...

So, that doesn't work, maybe do something like res = ['x' + l for l in res] so 
that you can use x...?

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I did find [this ugly 
workaround](https://github.com/jaraco/jaraco.financial/commit/9b866ab7117d1cfc26d7cdcec10c63a608662b46):

>>> print('x' + res)
x...

--

___
Python tracker 

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



[issue32509] doctest syntax ambiguity between continuation line and ellipsis

2018-01-06 Thread Jason R. Coombs

New submission from Jason R. Coombs :

I'm trying to write a doctest that prints the hash and filename of a directory. 
The input is the test dir, but due to the unordered nature of file systems, the 
doctest checks for one known file:

def hash_files(root):
"""
>>> res = hash_files(Path(__file__).dirname())
Discovering documents
Hashing documents
...
>>> print(res)
...
d41d8cd98f00b204e9800998ecf8427e __init__.py
...
"""

However, this test fails with:

― [doctest] jaraco.financial.records.hash_files 
――
047 
048 >>> res = hash_files(Path(__file__).dirname())
049 Discovering documents
050 Hashing documents
051 ...
052 >>> print(res)
Expected:
d41d8cd98f00b204e9800998ecf8427e __init__.py
...
Got:
e1f9390d13c90c7ed601afffd1b9a9f9 records.py
6a116973e8f29c923a08c2be69b11859 ledger.py
d41d8cd98f00b204e9800998ecf8427e __init__.py
b83c8a54d6b71e28ccb556a828e3fa5e qif.py
ac2d598f65b6debe9888aafe51e9570f ofx.py
9f2572f761342d38239a1394f4337165 msmoney.py




The first ellipsis is interpreted as a degenerate continuation of the input 
line, and it seems it's not possible to have an ellipsis at the beginning of 
the expected input.

Is there any workaround for this issue?

--
messages: 309599
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: doctest syntax ambiguity between continuation line and ellipsis
type: behavior

___
Python tracker 

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



[issue32508] Problem while reading back from a list of lists

2018-01-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

It isn't clear to me what bug you are reporting here:

- What do you mean by "problem reading back from a list of lists"? What sort of 
problem? 

- What makes you think that there is a bug in the interpreter, rather than in 
your own code?

We aren't going to debug your code for you: if you have found a bug, please 
report the simplest code that shows the bug. You may find it helpful to read 
this first:

http://sscce.org/

Although it is written for Java, the same applies to Python code too.

I'm closing this ticket for now.

If you simplify your code to something that demonstrates a bug in the Python 
interpreter, rather than a bug in your own code, please re-open this ticket 
with a better description of what the problem is, and the shortest, simplest 
demonstration of that problem that you can come up with.

Thank you.

--
nosy: +steven.daprano
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



[issue32508] Problem while reading back from a list of lists

2018-01-06 Thread J Viswanathan

New submission from J Viswanathan :

Please see the attached source file,  the related data file and the log
file.

When run with

 python hksu_copy.py  check_su.dat

the following is the output (which is incorrect):

-*- mode: compilation; default-directory: "c:/Users/J V/Documents/gamsdir/"
-*-
Compilation started at Sun Jan  7 07:54:52

python hksu_copy.py check_su.dat
nedge, check_k 1 1
nedge, check_k 2 2
nedge, check_k 3 4
nedge, check_k 4 2
nedge, klist 4 [1, 2, 4]
nedge, check_k 5 4
nedge, check_k 6 7
nedge, check_k 7 2
nedge, klist 7 [2, 4, 7]
nedge, check_k 8 4
nedge, check_k 9 7
nedge, check_k 10 1
nedge, klist 10 [2, 4, 7]
nedge, check_k 11 2
nedge, check_k 12 2
nedge, klist 12 [1, 2]
nedge, check_k 13 6
nedge, check_k 14 2
nedge, klist 14 [2, 6]
nedge, check_k 15 4
nedge, check_k 16 6
nedge, check_k 17 8
nedge, check_k 18 2
nedge, klist 18 [2, 4, 6, 8]
nedge, check_k 19 3
nedge, check_k 20 3
nedge, klist 20 [2, 3]
nedge, check_k 21 4
nedge, check_k 22 2
nedge, klist 22 [3, 4]
nedge, check_k 23 4
nedge, check_k 24 1
nedge, klist 24 [2, 4]
nedge, check_k 25 4
nedge, check_k 26 8
nedge, check_k 27 9
nedge, check_k 28 1
nedge, klist 28 [1, 4, 8, 9]
nedge, check_k 29 2
nedge, check_k 30 4
nedge, check_k 31 9
nedge, check_k 32 2
nedge, klist 32 [1, 2, 4, 9]
nedge, check_k 33 4
nedge, check_k 34 8
nedge, check_k 35 3
nedge, klist 35 [2, 4, 8]
nedge, check_k 36 4
nedge, check_k 37 7
nedge, check_k 38 8
nedge, check_k 39 2
nedge, klist 39 [3, 4, 7, 8]
nedge, check_k 40 3
nedge, check_k 41 4
nedge, check_k 42 2
nedge, klist 42 [2, 3, 4]
nedge, check_k 43 4
nedge, check_k 44 7
nedge, check_k 45 8
nedge, check_k 46 1
nedge, klist 46 [2, 4, 7, 8]
nedge, check_k 47 3
nedge, check_k 48 4
nedge, check_k 49 5
nedge, check_k 50 7
nedge, check_k 51 2
nedge, klist 51 [1, 3, 4, 5, 7]
nedge, check_k 52 4
nedge, check_k 53 7
nedge, check_k 54 1
nedge, klist 54 [2, 4, 7]
nedge, check_k 55 2
nedge, check_k 56 5
nedge, check_k 57 1
nedge, klist 57 [1, 2, 5]
nedge, check_k 58 2
nedge, check_k 59 5
nedge, check_k 60 9
nedge, check_k 61 2
nedge, klist 61 [1, 2, 5, 9]
nedge, check_k 62 5
nedge, check_k 63 2
nedge, klist 63 [2, 5]
nedge, check_k 64 5
nedge, check_k 65 6
nedge, check_k 66 9
nedge, check_k 67 1
nedge, klist 67 [2, 5, 6, 9]
nedge, check_k 68 5
nedge, check_k 69 1
nedge, klist 69 [1, 5]
nedge, check_k 70 3
nedge, check_k 71 5
nedge, check_k 72 9
nedge, check_k 73 5
nedge, klist 73 [1, 3, 5, 9]
nedge, check_k 74 7
nedge, check_k 75 9
nedge, check_k 76 1
nedge, klist 76 [5, 7, 9]
nedge, check_k 77 4
nedge, check_k 78 7
nedge, check_k 79 5
nedge, klist 79 [1, 4, 7]
nedge, check_k 80 5
nedge, klist 80 [5]
nedge, check_k 81 9
nedge, check_k 82 1
nedge, klist 82 [5, 9]
nedge, check_k 83 4
nedge, check_k 84 4
nedge, klist 84 [1, 4]
nedge, check_k 85 5
nedge, check_k 86 7
nedge, check_k 87 9
nedge, check_k 88 2
nedge, klist 88 [4, 5, 7, 9]
nedge, check_k 89 4
nedge, check_k 90 5
nedge, check_k 91 9
nedge, check_k 92 5
nedge, klist 92 [2, 4, 5, 9]
nedge, check_k 93 7
nedge, check_k 94 9
nedge, check_k 95 2
nedge, klist 95 [5, 7, 9]
nedge, check_k 96 5
nedge, check_k 97 9
nedge, check_k 98 4
nedge, klist 98 [2, 5, 9]
nedge, check_k 99 5
nedge, check_k 100 8
nedge, check_k 101 9
nedge, check_k 102 4
nedge, klist 102 [4, 5, 8, 9]
nedge, check_k 103 5
nedge, check_k 104 9
nedge, check_k 105 1
nedge, klist 105 [4, 5, 9]
nedge, check_k 106 3
nedge, check_k 107 9
nedge, check_k 108 1
nedge, klist 108 [1, 3, 9]
nedge, check_k 109 3
nedge, check_k 110 4
nedge, check_k 111 5
nedge, check_k 112 7
nedge, check_k 113 9
nedge, check_k 114 2
nedge, klist 114 [1, 3, 4, 5, 7, 9]
nedge, check_k 115 3
nedge, check_k 116 2
nedge, klist 116 [2, 3]
nedge, check_k 117 7
nedge, check_k 118 8
nedge, check_k 119 2
nedge, klist 119 [2, 7, 8]
nedge, check_k 120 3
nedge, check_k 121 7
nedge, check_k 122 1
nedge, klist 122 [2, 3, 7]
nedge, check_k 123 2
nedge, check_k 124 3
nedge, check_k 125 1
nedge, klist 125 [1, 2, 3]
nedge, check_k 126 2
nedge, check_k 127 4
nedge, check_k 128 5
nedge, check_k 129 1
nedge, klist 129 [1, 2, 4, 5]
nedge, check_k 130 2
nedge, check_k 131 3
nedge, check_k 132 4
nedge, check_k 133 5
nedge, check_k 134 3
nedge, klist 134 [1, 2, 3, 4, 5]
nedge, check_k 135 5
nedge, check_k 136 7
nedge, check_k 137 3
nedge, klist 137 [3, 5, 7]
nedge, check_k 138 5
nedge, check_k 139 7
nedge, klist 139 [3, 5]
nedge, check_k 140 2
nedge, klist 140 [7]
nedge, check_k 141 3
nedge, check_k 142 5
nedge, check_k 143 6
nedge, check_k 144 2
nedge, klist 144 [2, 3, 5, 6]
nedge, check_k 145 6
nedge, check_k 146 4
nedge, klist 146 [2, 6]
nedge, check_k 147 3
nedge, klist 147 [4]
nedge, check_k 148 6
nedge, check_k 149 3
nedge, klist 149 [3, 6]
nedge, check_k 150 1
nedge, klist 150 [3]
nedge, check_k 151 3
nedge, check_k 152 4
nedge, check_k 153 6
 No. of edges:  153
The last of the klists : nedge, klist 153 [1, 3, 4, 6]
 No. of left vertices :  51  No. of right vertices :  51
x :  0  klist :  [1, 3, 4, 6]
x :  1  klist :  

[issue32501] Documentation for dir([object])

2018-01-06 Thread R. David Murray

R. David Murray  added the comment:

I'm not sure, but the discussion I remember was that it would require changes 
to an awful lot of places in the docs that would make the docs harder to read.  
It is very seldom in normal Python coding that an object has a method that it 
does *not* get from its class, and by the time you get to the level where you 
are adding methods to instances it is likely you know about dunder methods only 
being looked up on classes.  Usually you learn about it the first time you try 
to put a dunder method on an instance, and you scratch your head for a while, 
and then you find out...but complicating the docs to mention this at every turn 
would be...excessive, I think.  But again, I'm not 100% sure I'm remembering 
the outcome of that conversation, and I can't remember where it took place (it 
was an issue in this tracker, but I don't know which one.)

--

___
Python tracker 

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



[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2018-01-06 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4987

___
Python tracker 

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



[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:


New changeset af11a15c586e980a157c04ee60b6e33dc7228f3f by Steve Dower (Max 
Bélanger) in branch 'master':
bpo-32282: Remove unnecessary check for `VersionHelpers.h` in `socketmodule.c` 
on Windows
https://github.com/python/cpython/commit/af11a15c586e980a157c04ee60b6e33dc7228f3f


--

___
Python tracker 

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



[issue28747] Expose SSL_CTX_set_cert_verify_callback

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:

The change to make OpenSSL a separate DLL (on Windows, at least, which is all I 
really care about) means this function is available via ctypes. That's good 
enough for me, so I'll close this.

--
resolution:  -> out of date
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



[issue29409] Implement PEP 529 for io.FileIO

2018-01-06 Thread Steve Dower

Change by Steve Dower :


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

___
Python tracker 

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



[issue28888] Installer fails when newer version of CRT is pending installation

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:

This will be fixed by the change for 3.7, and it's enough of an edge case for 
3.6 that I'm okay with not fixing it.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Change Windows install to applocal UCRT

___
Python tracker 

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



[issue32507] Change Windows install to applocal UCRT

2018-01-06 Thread Steve Dower

Change by Steve Dower :


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



[issue32507] Change Windows install to applocal UCRT

2018-01-06 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch, patch
pull_requests: +4984, 4985
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



[issue29911] Uninstall command line in Windows registry does not uninstall

2018-01-06 Thread Steve Dower

Change by Steve Dower :


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

___
Python tracker 

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



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

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:

It is standard procedure for us to stop producing binary releases when a 
version switches to security-only mode. The burden on our volunteers would 
become overwhelming otherwise.

If you'd like to propose a change to this policy, start by posting on 
python-list, and then if there is general support someone there will bring the 
conversation to the development team. Resurrecting old bugs is not an efficient 
way to request this kind of change.

--

___
Python tracker 

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



[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

Correct. I'm working on that one now. I'll open it tonight or tomorrow.

--

___
Python tracker 

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



[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2018-01-06 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

@Eric
> I'm closing this, and will open another issue to raise an error for: ...

I think we also need a separate issue for not overriding __repr__ etc, if 
'__repr__' in cls.__dict__.

--

___
Python tracker 

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



[issue25546] python 3.5 installation problem; Error 0x80240017: Failed to execute MSU package

2018-01-06 Thread Steve Dower

Change by Steve Dower :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Change Windows install to applocal UCRT

___
Python tracker 

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



[issue25954] Python 3.5.1 installer fails on Windows 7

2018-01-06 Thread Steve Dower

Change by Steve Dower :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Change Windows install to applocal UCRT

___
Python tracker 

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



[issue32507] Change Windows install to applocal UCRT

2018-01-06 Thread Steve Dower

New submission from Steve Dower :

There's enough instability due to using the proper UCRT installer (e.g. 
issue25546, issue25954, also others not reported on bpo) and good enough 
install base that we can simplify things by just installing it locally on 
machines that require it.

This may also require updating venv (though I think we're fine) and virtualenv 
(I'll ping).

My proposal is to bundle the UCRT redistributable DLLs into their own MSI and 
install them alongside the main executable when required. If a user later 
installs it properly, the up-to-date version will be used instead. This should 
be good enough to cover people still on Windows 7/8, and will also reduce the 
installer size slightly (though at the cost of potentially breaking 
non-standard virtual environments or entrypoint stubs that link to the CRT 
dynamically).

--
assignee: steve.dower
components: Windows
messages: 309589
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Change Windows install to applocal UCRT
type: enhancement
versions: 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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Note that many other PySequence_* functions support only sequences. For example 
PySequence_Count(o1, o2) is the equivalent of the Python expression o1 + o2 
only if o1 is a sequence. If pass integer objects to PySequence_Count() it will 
return an error.

I would remove "do not" from the documentation. Or even the whole "For objects 
that do not provide sequence protocol" since this is implied.

--

___
Python tracker 

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



[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

I'm closing this, and will open another issue to raise an error for:

@dataclass
class C:
x = field()

--
resolution:  -> wont fix
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



[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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



[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-06 Thread Eric V. Smith

New submission from Eric V. Smith :

There are several places where OrderedDict escapes from dataclasses. Switching 
to dict means we don't have to use OrderedDict forever.

For the 3.6 backport, I'm also going to use dict. I saw an analysis (from 
Raymond, maybe?) that says there are no 3.6 implementations that don't 
guarantee insertion order for dict.

--
assignee: eric.smith
messages: 309587
nosy: eric.smith
priority: normal
severity: normal
status: open
title: dataclasses: no need for OrderedDict now that dict guarantees to keep 
insertion order
type: behavior
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



[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith

New submission from Eric V. Smith :

This is an attractive nuisance, especially when coming from attrs. Make it an 
error, since it's using field() with no annotation:

@dataclass
class C:
x = field()

--
assignee: eric.smith
messages: 309586
nosy: eric.smith, gvanrossum, levkivskyi
priority: normal
severity: normal
status: open
title: dataclasses: make field() with no annotation an error
type: behavior

___
Python tracker 

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



[issue32441] os.dup2 should return the new fd

2018-01-06 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Good catch, the code makes much more sense now :-)

--

___
Python tracker 

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



[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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

___
Python tracker 

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



[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset d80b443f02e087dd289ffefd04179c675304d76d by Eric V. Smith in 
branch 'master':
 bpo-32279: Add additional params to make_dataclass(), pass through to 
dataclass(). (gh-5117)
https://github.com/python/cpython/commit/d80b443f02e087dd289ffefd04179c675304d76d


--

___
Python tracker 

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



[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


--
pull_requests: +4983

___
Python tracker 

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



[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-06 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Jan 6, 2018, at 13:33, Zachary Ware  wrote:
> 
> I notice that my 'Installed' builder 
> (http://buildbot.python.org/all/#/builders/103) has been broken since PR4911 
> landed.  My suspicion is that it's just another directory missed in the 
> Makefile install libinstall target, but haven't actually looked into it.

Dang.  I’ll try to look into this as soon as possible, but it might be a day or 
so.

--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

Since docs and implementation disagree let's call it undefined. I really
can't comment on what PyPy should do.

--

___
Python tracker 

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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset ed7d429ebb591f65cef558760fb4ebdc4fc8f8b0 by Eric V. Smith in 
branch 'master':
bpo-32278: Allow dataclasses.make_dataclass() to omit type information. 
(gh-5115)
https://github.com/python/cpython/commit/ed7d429ebb591f65cef558760fb4ebdc4fc8f8b0


--

___
Python tracker 

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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-06 Thread Brett Cannon

Brett Cannon  added the comment:

I bet Barry forgot to add some test directories to the makefile.

On Sat, Jan 6, 2018, 10:33 Zachary Ware,  wrote:

>
> Zachary Ware  added the comment:
>
> I notice that my 'Installed' builder (
> http://buildbot.python.org/all/#/builders/103) has been broken since
> PR4911 landed.  My suspicion is that it's just another directory missed in
> the Makefile install libinstall target, but haven't actually looked into it.
>
> --
> nosy: +zach.ware
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32441] os.dup2 should return the new fd

2018-01-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I suspect the dup3_works variable is supposed to be static.

--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Michał Górny

Michał Górny  added the comment:

Well, my two main concerns are:

1) whether it is acceptable for PyPy to not raise TypeError in this case, or if 
I should report it to PyPy upstream as a bug,

2) and whether programmers can appropriately rely on PySequence_Length() 
raising TypeError for non-sequence types or if they should use e.g. 
PySequence_Check() explicitly.

--

___
Python tracker 

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



[issue32501] Documentation for dir([object])

2018-01-06 Thread Matthew Cowles

Matthew Cowles  added the comment:

If David is right and people have previously decided not to change wording like 
this, can someone explain why? As it stands, the meaning is clear and incorrect.

--
nosy: +mdcowles

___
Python tracker 

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



[issue32504] Wheel failed include data_files

2018-01-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Please report to the wheel maintainers at https://github.com/pypa/wheel

--
nosy: +benjamin.peterson
resolution:  -> third party
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



[issue32450] non-descriptive variable name

2018-01-06 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
resolution:  -> wont fix
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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


--
pull_requests: +4981

___
Python tracker 

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



[issue32450] non-descriptive variable name

2018-01-06 Thread Yuri Kanivetsky

Yuri Kanivetsky  added the comment:

Well, it's just that I was digging into Python's code. And it took me quite a 
while to figure out what the variable holds. Running into "ndots" name 
clarified that. That generally means that variable name doesn't describe its 
content well. But I'm new to Python's code, so it might not be the case. Feel 
free to close the issue.

--

___
Python tracker 

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



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

2018-01-06 Thread Gregory Szorc

Gregory Szorc  added the comment:

I was going to update some CI that tests all supported versions of Python and 
pins the Python 3 versions. That CI was previously using the MSI installers for 
Python 3.4. To my surprise, the MSIs stopped being generated after the 3.4.4 
release! https://www.python.org/ftp/python/3.4.4/ has MSIs (and MacOS .pkg 
files). But all subsequent releases (e.g. 
https://www.python.org/ftp/python/3.4.7/) do not.

I'm OK with the decision to abandon MSIs and move to the .exe installer for 
newer Python releases (like 3.5 and 3.6). However, ceasing to produce the MSIs 
(and MacOS .pkg files for that matter) midway through 3.4's support cycle feels 
wrong to me. 3.4.4 was the last release with binary distributions for Windows 
and MacOS. 3.4.5 and newer releases have fixes to security issues. That means 
people using the binary distributions of 3.4 on these platforms are stuck on 
3.4.4 and are thus vulnerable to known security issues. That's... not great.

I think the MSI (and .pkg) distributions should be restored for 3.4. 
Furthermore, I would encourage Python to adopt the practice that distribution 
mechanisms aren't modified during a Python version's support cycle. Someone 
will inevitably rely on any distribution format that is published. And taking 
it away in a support cycle will orphan those users on an old, buggy release.

--
nosy: +Gregory.Szorc

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> What do you mean?

Large bytes and strings was written inside a frame when serialize by dumps(). 
dump() (as well as Python implementations of dumps() and dump()) write them 
outside of a frame.

--

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 5114 implements this when serialize in C into memory.

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

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Humm, this feature doesn't work with C implementation.

What do you mean?

--

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4980

___
Python tracker 

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



[issue32504] Wheel failed include data_files

2018-01-06 Thread atya

New submission from atya :

Hi,

I created a  wheel using python3.4 install bdist_wheel command.

I have data dir and in contains files Test.png.

in setup.py I added
data_files=[
('/usr/share', ['data/Test.png'])
]

when I am instaating the wheel the data files did not copy.

--
components: Build
messages: 309569
nosy: atya
priority: normal
severity: normal
status: open
title: Wheel failed include data_files
versions: Python 3.4

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2018-01-06 Thread Christoph Gohlke

Christoph Gohlke  added the comment:

> Have you confirmed that's a problem?

No, I have not noticed any problems yet with with Python 3.7.0a3 and many 
extensions built with VS2017.5.

--

___
Python tracker 

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



[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-06 Thread Mario Corchero

Mario Corchero  added the comment:

pdb and cProfile are covered.

If no one is working on it, do you want me try to put through a patch for 
"profile" and "trace"?
Should I create a separate issue if so?

>From Issue 17473 it will leave only:

doctest: Which might be controversial
dis: main is execution a "_test" function. That said, running -m dis might be 
useful.

The rest might not need the change as:

modulefinder: __main__ is for test purposes
tabnanny: works on files and directories
pyclbr: already works with modules

--
nosy: +mariocj89

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-06 Thread stein-k

stein-k  added the comment:

The message is incorrect for the input to the function, and confusing because 
the caller did supply a bytes-like object.

The exception is from an implementation detail, and if the implementation 
changes the exception could as well. 

I suggest the implementation is changed to follow the example of  
urllib.parse.unquote_to_bytes, which encodes its string parameter to bytes if 
it receives a str object.

Alternatively, a check for required type should be implemented and raise a 
TypeError with the correct error-message.

--

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Humm, this feature doesn't work with C implementation.

--

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Pickle protocol 4 uses framing for reducing the overhead of calling the read() 
method for small chunks of data. Most read chunks are small -- opcodes, small 
integers, short strings, etc, and calling read() for every 1 or 4 bytes is too 
expensive. But using framing itself adds an overhead. It increases the size of 
pickled data by 9 bytes. A frame  itself needs 3 reads -- the opcode, the frame 
size, and a payload. Thus it doesn't make sense to create a frame containing 
less than 3 chunks of data.

For example after issue31993 pickling the list [b'a'*7, b'b'*7] with 
the Python implementation produces a data containing 3 frames of sizes 3, 1 and 
3. Using frames here is completely redundant.

--
components: Library (Lib)
messages: 309564
nosy: Olivier.Grisel, alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Avoid creating small frames in pickle protocol 4
type: performance
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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-06 Thread Zachary Ware

Zachary Ware  added the comment:

I notice that my 'Installed' builder 
(http://buildbot.python.org/all/#/builders/103) has been broken since PR4911 
landed.  My suspicion is that it's just another directory missed in the 
Makefile install libinstall target, but haven't actually looked into it.

--
nosy: +zach.ware

___
Python tracker 

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



[issue32502] uuid1() broken on macos high sierra

2018-01-06 Thread Andres Petralli

Andres Petralli  added the comment:

Here's the output from my system. This is a Mac Pro with a firewire port. Looks 
as if the address was picked up from fw0: actually, not lo0. Guess _find_mac 
just iterates until it hits a matching word for a hw address:

lo0: flags=8049 mtu 16384
options=1203
inet 127.0.0.1 netmask 0xff00 
inet6 ::1 prefixlen 128 
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
nd6 options=201
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
UHC58: flags=0<> mtu 0
XHC0: flags=0<> mtu 0
UHC90: flags=0<> mtu 0
UHC61: flags=0<> mtu 0
UHC29: flags=0<> mtu 0
UHC26: flags=0<> mtu 0
UHC93: flags=0<> mtu 0
EHC253: flags=0<> mtu 0
EHC250: flags=0<> mtu 0
fw0: flags=8863 mtu 4078
lladdr 70:cd:60:ff:ab:cd:ef:12 
nd6 options=201
media: autoselect 
status: inactive

--

___
Python tracker 

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



[issue32427] Rename and expose dataclasses._MISSING

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


--
status: open -> closed

___
Python tracker 

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



[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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



[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset e7ba013d870012157f695ead7e3645c2828a7fc5 by Eric V. Smith in 
branch 'master':
bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is a 
dataclass or an instance of one. (#5113)
https://github.com/python/cpython/commit/e7ba013d870012157f695ead7e3645c2828a7fc5


--

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Olivier Grisel

Olivier Grisel  added the comment:

Thanks for the very helpful feedback and guidance during the review.

--

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Definitely! Thank you for your contribution :-)

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Olivier Grisel

Olivier Grisel  added the comment:

Shall we close this issue now that the PR has been merged to master?

--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

If we were to take the docs literally then PySequence_{Size,Length} should just 
be aliases for PyObject_Size.  But I'm reluctant to change something that has 
been like this for ages.

In fact maybe we should deprecate them, together with other PySequence_ and 
PyMapping_ operations that have more general PyObject_ alternatives?

You can read the source code to find the root cause for the behavior -- 
PySequence_{Size,Length} only looks for tp_as_sequence->sq_length, but dict has 
that field set to NULL.  (A dict's size is computed by 
tp_as_mapping->mp_length.)

Fixing dict by adding a redundant sq_length seems brittle (there may be many 
other mapping types with similar issues).

So I think we should update the docs to recommend PyObject_Size instead.

--

___
Python tracker 

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



[issue32502] uuid1() broken on macos high sierra

2018-01-06 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Jan 6, 2018, at 11:26, Andres Petralli  wrote:
> 
> Traceback (most recent call last):
>  File "/Users/andy/Desktop/test.py", line 3, in 
>str(uuid.uuid1())
>  File 
> "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py",
>  line 607, in uuid1
>clock_seq_hi_variant, clock_seq_low, node), version=1)
>  File 
> "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py",
>  line 168, in __init__
>raise ValueError('field 6 out of range (need a 48-bit value)')
> ValueError: field 6 out of range (need a 48-bit value)

Interesting.  This doesn’t fail for me on 10.13.2.

--
nosy: +barry

___
Python tracker 

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



[issue17763] test_pydoc fails with the installed testsuite

2018-01-06 Thread Mark Lawrence

Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17763] test_pydoc fails with the installed testsuite

2018-01-06 Thread Petr Viktorin

Petr Viktorin  added the comment:

This is caused by Brailcom's Speech Dispatcher, whose config script ran 
optparse on import. Apparently it was fixed in their version 0.8.6.

Some references:
https://github.com/brailcom/speechd/commit/1808ea1a6e840951ffde61e5a6476ccfc118ab5a
https://its.freebsoft.org/its/issues/29268
https://bugs.archlinux.org/task/40478
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838665

--
nosy: +encukou

___
Python tracker 

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



[issue32502] uuid1() broken on macos high sierra

2018-01-06 Thread Andres Petralli

New submission from Andres Petralli :

uuid.py is getting a 64 bit hardware address for the loopback adapter in High 
Sierra, specifically in _ifconfig_getnode(). The function expects a 48 bit mac 
address, but is instead getting 64 bits back and converting it to an int value 
that is too long for the subsequent call in uuid.py. Apple must have moved to 
using EUI-64 for the loopback adapters.

This is a sample output of the call to ifconfig that is being parsed:

b'lo0: flags=8049 mtu 16384\n'
b'\toptions=1203\n'
b'\tinet 127.0.0.1 netmask 0xff00 \n'
b'\tinet6 ::1 prefixlen 128 \n'
b'\tlladdr 70:cd:60:ff:ab:cd:ef:12 \n'

As you can see, the lladdr is longer than the usual 48 bit mac address but is 
nontheless returned for the node value, which then triggers

ValueError('field 6 out of range (need a 48-bit value)')


Full traceback:


Traceback (most recent call last):
  File "/Users/andy/Desktop/test.py", line 3, in 
str(uuid.uuid1())
  File 
"/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py",
 line 607, in uuid1
clock_seq_hi_variant, clock_seq_low, node), version=1)
  File 
"/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py",
 line 168, in __init__
raise ValueError('field 6 out of range (need a 48-bit value)')
ValueError: field 6 out of range (need a 48-bit value)

--
components: macOS
messages: 309554
nosy: anpetral, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: uuid1() broken on macos high sierra
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



[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

I've updated the PEP, too.

--

___
Python tracker 

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



[issue32501] Documentation for dir([object])

2018-01-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

It's described here: 
https://docs.python.org/3/reference/datamodel.html#special-lookup

Maybe we should have a glossary entry for "special method lookup", and somehow 
link mentions like __dir__ to it?

This is slightly different from 
https://docs.python.org/3/reference/datamodel.html#specialnames, which already 
has a glossary entry.

On the other hand, unless you already understand the problem, it's going to be 
difficult to search for it.

--
nosy: +eric.smith

___
Python tracker 

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



[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith

Change by Eric V. Smith :


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

___
Python tracker 

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



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3cd7c6e6eb43dbd7d7180503265772a67953e682 by Serhiy Storchaka 
(Olivier Grisel) in branch 'master':
bpo-31993: Do not allocate large temporary buffers in pickle dump. (#4353)
https://github.com/python/cpython/commit/3cd7c6e6eb43dbd7d7180503265772a67953e682


--

___
Python tracker 

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



[issue32501] Documentation for dir([object])

2018-01-06 Thread R. David Murray

R. David Murray  added the comment:

This is a general property of dunder methods in python3, and I think we have 
chosen not to change the wording when this has come up in other contexts.  I'm 
not sure, though.

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



[issue32441] os.dup2 should return the new fd

2018-01-06 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Both the change in my previous post or using a definition for 'res' are not 
needed if 'dup3_works' is removed. That would make the code more clear for both 
gcc and a human reader. The attached patch removes it.

Using a definition for 'res' LGTM also.

--
Added file: https://bugs.python.org/file47366/without-dup3_works.patch

___
Python tracker 

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



[issue32206] Run modules with pdb

2018-01-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

Re-opening for the CLI help updates.

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

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2018-01-06 Thread Steve Dower

Steve Dower  added the comment:

Have you confirmed that's a problem? There are new compatibility promises that 
did not exist for earlier versions of the runtime, but that does not mean there 
are no bugs.

--

___
Python tracker 

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



[issue29086] Document C API that is not part of the limited API

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have found that there is an option :stableabi: for C API elements. But it is 
not used in the documentation. Shouldn't we start to use it?

--

___
Python tracker 

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



[issue32206] Run modules with pdb

2018-01-06 Thread Mario Corchero

Change by Mario Corchero :


--
pull_requests: +4978

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Agreed, it looks either mistaken or confusing. This wording is used from the 
first versions of the C API documentation. I don't know what is meant here.

--
assignee:  -> docs@python
components: +Documentation -Extension Modules
nosy: +docs@python, gvanrossum
versions: +Python 3.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



[issue32501] Documentation for dir([object])

2018-01-06 Thread Vladislavs Burakovs

New submission from Vladislavs Burakovs :

Documentation page [1]  says "If the object has a method named __dir__(), this 
method will be called and must return the list of attributes.". 

It seems that on Python 3.6 it only works if the *class* has a method named 
__dir__. Should the documentation be changed?

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

D:\Users\wlad>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class C: pass
...
>>> x = C()
>>> import types
>>> x.__dir__ = types.MethodType(lambda _:[], x)
>>> dir(x)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', 
'__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', 
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', 
'__str__', '__subclasshook__', '__weakref__']
>>> C.__dir__ = types.MethodType(lambda _:[], x)
>>> dir(x)
[]

[1] https://docs.python.org/3/library/functions.html

--
assignee: docs@python
components: Documentation
messages: 309544
nosy: Vladislavs Burakovs, docs@python
priority: normal
severity: normal
status: open
title: Documentation for dir([object])
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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Michał Górny

Michał Górny  added the comment:

So is the documentation mistaken or just confusing? It says straight:

> For objects that do not provide sequence protocol, this is equivalent to the 
> Python expression len(o).

So it the 'do not' mistaken or does it mean objects that are sequences but do 
not provide the sequence protocol?

--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-01-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PySequence_Length(o) is equivalent to the Python expression len(o) only if o is 
a sequence. dict is not a sequence. You must use a correct API:

PyObject_Size() -- for general objects.
PyMapping_Size() -- if the object is a mapping.
PyDict_Size() -- if the object is a concrete dict.

--
nosy: +serhiy.storchaka

___
Python tracker 

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