[issue34602] python3 resource.setrlimit strange behaviour under macOS

2018-09-07 Thread Vladimir Matveev


Vladimir Matveev  added the comment:

I can repro it with a given sample file 
```
vladima-mbp $ cat test.c
#include 
#include 
#include 
#include 
#include 

int main() {
  struct rlimit rl;
  if(getrlimit(RLIMIT_STACK, ) < 0) {
perror("getrlimit");
exit(1);
  }

  rl.rlim_cur = rl.rlim_max;
  if(setrlimit(RLIMIT_STACK, ) < 0) {
perror("setrlimit");
exit(1);
  }
  return 0;
}vladima-mbp $ gcc   -Wl,-stack_size,100   -o test test.c
vladima-mbp $ ./test
setrlimit: Invalid argument
```
Similar settings were added to Python in 
https://github.com/python/cpython/commit/335ab5b66f4

--
nosy: +v2m

___
Python tracker 

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



[issue23855] Missing Sanity Check for malloc() in PC/_msi.c

2018-09-07 Thread Berker Peksag


Change by Berker Peksag :


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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset eb6ab73f93c8b883a8d75a83560e2b4c59170d95 by Pablo Galindo in 
branch '3.6':
[3.6] bpo-34246: Use no mutable default args in smtplib (GH-8554) (#9112)
https://github.com/python/cpython/commit/eb6ab73f93c8b883a8d75a83560e2b4c59170d95


--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I strongly disagree with this as a general principle.

"Master/slave" is a powerful, obvious metaphor which works well and is not the 
same as parent/child, server/client or employer/worker.

In fact, in the BDSM subcultures, "master/slave" can have *positive* 
connotations. You want to support diversity, then why are you discriminating 
against that subculture?

Talking about diversity: my wife is of a nationality that historically were 
often stolen to be slaves and indentured servants, and were discriminated 
against as second-class people right well into the second half the middle of 
the 20th century. My maternal family comes from a racial group (Slavic) which 
gives us the English word for slave and come from serf background. Both of us 
are angered by this attack on our linguistic culture. Stop trying to sanitize 
and infantalize language. That's far more offensive than the master/slave 
terminology.

I'm not sorry for this impassioned plea. You want diversity, that includes 
people like me.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue34609] Idle Unitest

2018-09-07 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Just to help track this down, 'import math' does not cause the trace, but 
'import email' does.  It seems to be modules that have a loader function.  My 
guess (but I haven't tried it yet) is that this would happen if stepping 
through pdb outside of IDLE too.

--

___
Python tracker 

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



[issue34609] Idle Unitest

2018-09-07 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I have Python 3.6.5 on Ubuntu 18.04.  Initially, I was unable to recreate the 
issue.  However, issue33065 from 4 months ago has the same trace (except on a 
different import), so I tried stepping through debug using the minimal example 
that Terry gave and successfully reproduced the trace.

I then tried a new build of 3.8 on Ubuntu and was also able to reproduce by 
using 'step' while in debug.

I also was able to recreate using 'step' under 3.6.3 on Windows 7.

Note: At one point while stepping, the debug window shows a KeyError on 
unittest.  You'll see it yourself, but it is interesting.

--

___
Python tracker 

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



[issue34610] Incorrect iteration of Manager.dict() method of the multiprocessing module.

2018-09-07 Thread deltaclock


New submission from deltaclock :

The manager class of the multiprocessing module doesnt implement __next__ or 
__iter__ on its dictionary method and relies on using __getitem__.

This results in an unexpected functionality of an object that is supposed to 
act like a dict, and instead of looping over the dictionary keys it loops over 
its values.

The user needs to call dict() on this object in order to loop over it 
correctly, which is not that obvious.

The problem originates from there 
https://github.com/python/cpython/blob/master/Lib/multiprocessing/managers.py#L1136

Poc link: https://hastebin.com/codoqihowi.py

--
components: Library (Lib)
files: test.py
messages: 324813
nosy: deltaclock
priority: normal
severity: normal
status: open
title: Incorrect iteration of Manager.dict() method of the multiprocessing 
module.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47792/test.py

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset fa221d804f1bc07d992f820069bad24f176ed66d by Pablo Galindo in 
branch 'master':
bpo-33083: Update "What's new" with math.factorial changes (GH-9109)
https://github.com/python/cpython/commit/fa221d804f1bc07d992f820069bad24f176ed66d


--

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5b7a2cb5caeb7df68e637f45a98632cbc84a51bf by Pablo Galindo in 
branch 'master':
bpo-34246: Make sure test_smtplib always cleans resources when finished 
(GH-9108)
https://github.com/python/cpython/commit/5b7a2cb5caeb7df68e637f45a98632cbc84a51bf


--

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +8566

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Stefan Krah


Stefan Krah  added the comment:

I'm using "master" in memoryview because of the audio connotation ("the 
source from which all copies will be produced"):

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

The ManagedBufferObject is literally the source from which all views 
are produced.

Conductors are sometimes called "Maestro", there are chess grandmasters, 
Tiger Woods won the Masters Tournament, Art Tatum is called a master 
pianist, millions of people hold a master's degree.

The term "master" has so many positive connotations that I think it is 
misguided to effectively eliminate it from the current English language.

--
nosy: +skrah

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9835696ec4c57a9a30f1c11cfb4c5d3e121bf97c by Miss Islington (bot) 
in branch '3.7':
bpo-34246: Use no mutable default args in smtplib (GH-8554)
https://github.com/python/cpython/commit/9835696ec4c57a9a30f1c11cfb4c5d3e121bf97c


--
nosy: +miss-islington

___
Python tracker 

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



[issue23855] Missing Sanity Check for malloc() in PC/_msi.c

2018-09-07 Thread miss-islington


miss-islington  added the comment:


New changeset 73994077250bd70385cb8e7a92f24874129369d1 by Miss Islington (bot) 
in branch '3.7':
bpo-23855: Add missing NULL checks for malloc() in _msi.c (GH-9038)
https://github.com/python/cpython/commit/73994077250bd70385cb8e7a92f24874129369d1


--
nosy: +miss-islington

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 963bcc8b71e4ab8c9ee9a91ed1300b6e39219821 by Pablo Galindo in 
branch '3.6':
[3.6] bpo-34007: Skip traceback tests if the Program Counter is not available. 
(GH-9022)
https://github.com/python/cpython/commit/963bcc8b71e4ab8c9ee9a91ed1300b6e39219821


--

___
Python tracker 

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



[issue34604] Possible mojibake in pwd.getpwnam and grp.getgrnam

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

%R sounds like a good idea, but I suggest to only use %R in the master branch.

--

___
Python tracker 

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



[issue34604] Possible mojibake in pwd.getpwnam and grp.getgrnam

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Wouldn't be better to use %R? The name can contain invisible characters or 
trailing whitespaces, in which case the traceback can look confusing. Since 
names are likely created with PyUnicode_DecodeFSDefault(), they can contain 
undecodable bytes represented as surrogates U+D8XX if the current filesystem 
encoding doesn't match the filesystem encoding used for creating entries.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d5fbe9b1a3d65ceeb9159c5ba999ee966a945f76 by Pablo Galindo (Pablo 
Aguiar) in branch 'master':
bpo-34246: Use no mutable default args in smtplib (GH-8554)
https://github.com/python/cpython/commit/d5fbe9b1a3d65ceeb9159c5ba999ee966a945f76


--

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8565

___
Python tracker 

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



[issue23855] Missing Sanity Check for malloc() in PC/_msi.c

2018-09-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8564

___
Python tracker 

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



[issue23855] Missing Sanity Check for malloc() in PC/_msi.c

2018-09-07 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 4e519377b1b84c9414a360961276993d24198825 by Berker Peksag 
(Zackery Spytz) in branch 'master':
bpo-23855: Add missing NULL checks for malloc() in _msi.c (GH-9038)
https://github.com/python/cpython/commit/4e519377b1b84c9414a360961276993d24198825


--
nosy: +berker.peksag

___
Python tracker 

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



[issue34584] IDLE 3.7.0 on Mac cannot open subprocess

2018-09-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +8563
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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.5

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +8562

___
Python tracker 

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



[issue34584] IDLE 3.7.0 on Mac cannot open subprocess

2018-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

idlelib/run.py imports math through about 3 intermediaries.  Hence it failed, 
and pyshell displayed the message in the .png.  Both modules can raise failure 
messages.  In #25514, the run.py message was revised to point to a new section 
of the doc: "Startup failure".  The second paragraph is

"A common cause of failure is a user-written file with the same name as a 
standard library module, such as random.py and tkinter.py. When such a file is 
located in the same directory as a file that is about to be run, IDLE cannot 
import the stdlib file.  The current fix is to rename the user file."

This is what Joseph should have seen.  I added a note to the issue to also fix 
the pyshell message to point to this section.

A better but harder fix would be to temporarily remove the user directory from 
sys.path so that user files cannot stop run's startup.

--
nosy: +terry.reedy
status: pending -> open
title: subprocess -> IDLE 3.7.0 on Mac cannot open subprocess

___
Python tracker 

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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

> In some cases we have the type itself, not an instance. So it makes sense to 
> make %T an equivalent of arg->tp_name instead of Py_TYPE(arg)->tp_name.

"arg->tp_name" is rare in the code base, whereas "Py_TYPE(arg)->tp_name" is a 
very common pattern.

I'm not sure that a formatter is needed for "arg->tp_name", you can already use 
"%s" with "arg->tp_name", no?

My intent was to make the C code less verbose, respect the PEP 399, but also 
indirectly avoid the implicit borrowed reference of Py_TYPE() :-)
https://pythoncapi.readthedocs.io/bad_api.html#borrowed-references


> On Python side, you need to output either short name obj.__class__.__name__ 
> or full qualified name obj.__class__.__module__ + '.' + 
> obj.__class__.__qualname__ with exception that the module name should be 
> omitted if it is 'builtins'.

Sometimes, the qualified name would be more appropriate, but it's sometimes 
tricky to decide if the short name, qualified name or fully qualified name is 
the "right" name... So I chose to restrict this issue to the most common case, 
Py_TYPE(arg)->tp_name :-)

Ah, and changing strings is a risk of breaking the backward compatibility. For 
example, cause issue with pickle. So it should be discussed on a case by case 
basis.

Moreover, if you want to change a string, the Python code should be updated as 
well. I suggest to open a new issue to discuss that.

Don't get me wrong, I'm interested to do these changes, but it's a wider 
project :-)


> obj.__class__.__qualname__ if obj.__class__.__module__ == 'builtins' else 
> f'{obj.__class__.__module__}.{obj.__class__.__qualname__}'
>
> The case of the module name '__main__' can be handled specially too.
> Obviously it is desirable to have a more handy way of writing such expression.

To be honest, I also considered to proposed a second formatter to do something 
like that :-) But as you explained, I'm not sure which name is the good name: 
qualified or fully qualified (with module name)?

First of all, would it help to have a *function* to get these names? Maybe we 
could first use such functions before discussing adding a new formatter in 
PyUnicode_FromFormat()?

--

___
Python tracker 

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



[issue25514] Improve IDLE's "subprocess didn't make connection" message

2018-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Module shadowing can affect either the gui process or the run process.  #34584 
was the latter: debug_obj imports rpc imports socket imports selectors imports 
math, which was shadowed.

Pyshell starts run.  If run starts OK but cannot connect to pyshell, it 
displays a 'subprocess cannot connect' message, which now refers to the new doc 
section, and exits.  If pyshell does does get a connection, it currently 
displays

"Subprocess Startup Error",
"IDLE's subprocess didn't make connection.  Either IDLE can't "
"start a subprocess or personal firewall software is blocking "
"the connection.",

This also needs revision, with a reference to the doc section.  And add 
'math.py' to shadowed modules.

--

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Vladimir Matveev


Change by Vladimir Matveev :


--
pull_requests: +8561

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Right, the correct section is 4.5. All integers in ZIP files are unsigned and 
in the little endian format.

--

___
Python tracker 

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



[issue34609] Idle Unitest

2018-09-07 Thread Tal Einat


Tal Einat  added the comment:

Testing similarly to Terry, this doesn't reproduce with a recent build of 
master branch (3.8) on Ubuntu 16.04.

I'll be able to try a build of older versions with IDLE only in a few days.

--

___
Python tracker 

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



[issue34546] Add encryption support to zipfile

2018-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> rejected
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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf


Kyle Altendorf  added the comment:

Python 3.7 works with 2-byte elements, I managed to find the wrong section in 
the doc-linked docs.

4.5 Extensible data fields
--

   4.5.1 In order to allow different programs and different types
   of information to be stored in the 'extra' field in .ZIP
   files, the following structure MUST be used for all
   programs storing data in this field:

   header1+data1 + header2+data2 . . .

   Each header should consist of:

   Header ID - 2 bytes
   Data Size - 2 bytes

   Note: all fields stored in Intel low-byte/high-byte order.


And the test showing it working.


import sys
import zipfile

print(sys.version)

fn = sys.argv[1]
print(fn)

options = {
'endianness': ('little', 'big'),
'header_element_bytes': (2, 4),
'additional_size': (0, 4, 4 + 4),
}

for endianness in options['endianness']:
for additional_size in options['additional_size']:
for header_element_bytes in options['header_element_bytes']:
print('\n\n --- trying endianness: {}, additional_size: {}, 
header_element_bytes: {}'.format(endianness, additional_size, 
header_element_bytes))
with zipfile.ZipFile(fn, 'w') as zf:
zi = zipfile.ZipInfo("0")
extra_data = b"hello, extra, and some more just to make it 
longer and such so yeah"
zi.extra = (
(42).to_bytes(header_element_bytes, endianness)
+ (len(extra_data) + 
additional_size).to_bytes(header_element_bytes, endianness)
+ extra_data
)
zf.writestr(zi, b"the real data")

try:
zipfile.ZipFile(fn)
except Exception as e:
print(e)
else:
print('success')


altendky@lt:~/twisted$ python3.7 ../z.py 37.py
3.7.0 (default, Jul  7 2018, 15:49:24)
[GCC 6.3.0 20170516]
37.py


 --- trying endianness: little, additional_size: 0, header_element_bytes: 2
success


 --- trying endianness: little, additional_size: 0, header_element_bytes: 4
Corrupt extra field 6568 (size=27756)


 --- trying endianness: little, additional_size: 4, header_element_bytes: 2
Corrupt extra field 002a (size=71)


 --- trying endianness: little, additional_size: 4, header_element_bytes: 4
Corrupt extra field 6568 (size=27756)


 --- trying endianness: little, additional_size: 8, header_element_bytes: 2
Corrupt extra field 002a (size=75)


 --- trying endianness: little, additional_size: 8, header_element_bytes: 4
Corrupt extra field 6568 (size=27756)


 --- trying endianness: big, additional_size: 0, header_element_bytes: 2
Corrupt extra field 2a00 (size=17152)


 --- trying endianness: big, additional_size: 0, header_element_bytes: 4
Corrupt extra field  (size=10752)


 --- trying endianness: big, additional_size: 4, header_element_bytes: 2
Corrupt extra field 2a00 (size=18176)


 --- trying endianness: big, additional_size: 4, header_element_bytes: 4
Corrupt extra field  (size=10752)


 --- trying endianness: big, additional_size: 8, header_element_bytes: 2
Corrupt extra field 2a00 (size=19200)


 --- trying endianness: big, additional_size: 8, header_element_bytes: 4
Corrupt extra field  (size=10752)

--

___
Python tracker 

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



[issue33625] Release GIL for grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

I was waiting for the encoding fix to close this issue, but bpo-34604 has been 
created.

--

___
Python tracker 

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



[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2018-09-07 Thread Tal Einat


Tal Einat  added the comment:

I'm +1 on this optimization.

--
nosy: +taleinat

___
Python tracker 

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



[issue30977] reduce uuid.UUID() memory footprint

2018-09-07 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +8560

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

> Thank you for merging PRs Victor, but seems you have merged wrong PR for 2.7.

Oh. I didn't notice that there were two PRs for 2.7. Do you want to rebase your 
PR 9062 on 2.7, or revert the commit that I merged? It's up to you ;-)

I reopen the issue.

It seems like PR 8971 is also open.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue since Serhiy requested a NEWS entry.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

IIRC there is similar issue or a discussion on one of mailing lists. But the 
idea about adding this feature on Python side too was considered. It would be 
better to find this discussion before pushing this change.

In some cases we have the type itself, not an instance. So it makes sense to 
make %T an equivalent of arg->tp_name instead of Py_TYPE(arg)->tp_name.

On Python side, you need to output either short name obj.__class__.__name__ or 
full qualified name obj.__class__.__module__ + '.' + obj.__class__.__qualname__ 
with exception that the module name should be omitted if it is 'builtins'.

obj.__class__.__qualname__ if obj.__class__.__module__ == 'builtins' else 
f'{obj.__class__.__module__}.{obj.__class__.__qualname__}'

The case of the module name '__main__' can be handled specially too.
Obviously it is desirable to have a more handy way of writing such expression.

On C side, the problem is that tp_name means different, depending of the kind 
of the type. In some cases it is a short name, in other cases it is a full 
qualified name. It is not easy to write a code that produces the same output in 
Python and C. I have added a helper _PyType_Name() that helps to solve a part 
of these issues. If you want to output a short name (just cls.__name__ in 
Python), use _PyType_Name(cls) instead of cls->tp_name. But this doesn't help 
for the case when you need to output a full qualified name.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf


Kyle Altendorf  added the comment:

Turns out the docs do document this.  My apologies.

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

   4.3.11  Archive extra data record: 

archive extra data signature4 bytes  (0x08064b50)
extra field length  4 bytes
extra field data(variable size)

Aside from the discrepancy between 16-bits and 4 bytes, it seems like something 
should happen, even if it's something other than 'fixing' the code to handle 
the malformed data.  Isn't it a bug for zipfile to create a non-compliant file? 
 Shouldn't it either check or provide an interface by which a compliant file 
could sensibly be created?  It doesn't seem great to just expect users to 
rewrite this each time they call.

(42).to_bytes(4, 'little') + len(data).to_bytes(4, 'little') + data

or, should it be 'big'?  and would it be (len(data) + 4 + 4)?

--

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The value of the extra attribute is not an arbitrary bytes object. It is a 
sequence of blocks in the following format: 16-bit identifier followed by 
16-bit size of the block followed by the specified amount of bytes. Your 
example creates invalid ZIP file.

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



[issue34564] Tutorial Section 2.1 Windows Installation Path Correction

2018-09-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Installation, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue33625] Release GIL for grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue32055] Reconsider comparison chaining for containment tests

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This had not been discussed.

--

___
Python tracker 

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



[issue34609] Idle Unitest

2018-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I cannot confirm this.  I tested 3.6.6 on Windows 10 with tem3.py containing

import unittest
print unittest

I ran this twice, without and with debug on.  The output:

 RESTART: F:\Python\a\tem3.py 

>>> 
[DEBUG ON]
>>> 
 RESTART: F:\Python\a\tem3.py 

[DEBUG ON]
>>>

On the second run, I hit the [Go] button on Debug Control.  The minimal program 
above needs to be tested with 3.6.6 or 3.7.0 on Linux.

--
nosy: +cheryl.sabella, taleinat

___
Python tracker 

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



[issue34546] Add encryption support to zipfile

2018-09-07 Thread Christian Heimes


Christian Heimes  added the comment:

-1 from me, too.

Serhiy already made a valid point and suggested a better alternative.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Having said that, there are situations where words are used confusingly or 
inappropriately, and better choices are available.  (I am sometimes confused, 
for instance, by the use of 'client' and 'server'.)  In such situations, change 
can be justified without reference to private complaints.

--

___
Python tracker 

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



[issue34486] "RuntimeError: release unlocked lock" when starting a thread

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This looks similar to to problems with the "with" statement: see issue29988 and 
issue34067. Except that there is no a "with" statement, and resolving that 
issues will not solve this issue.

--

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for merging PRs Victor, but seems you have merged wrong PR for 2.7.

--

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since this is potentially breaking change, please add a What's New entry for it.

--

___
Python tracker 

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



[issue34573] Simplify __reduce__() of set and dict iterators.

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Perhaps the bug was specific to OrderedDict itrerators. I'll try to write 
additional tests, and after that I'll merge PR 9050.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue23057] [Windows] asyncio: support signal handlers on Windows (feature request)

2018-09-07 Thread Chris Warrick


Change by Chris Warrick :


--
nosy: +Kwpolska

___
Python tracker 

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



[issue34546] Add encryption support to zipfile

2018-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is the reason of using such weak encryption? It looks to me that creating 
a non-encrypted ZIP file and encrypting it with third-party tools is the right 
way if you need an encryption.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To me, there is nothing wrong with the word 'master', as such.  I mastered 
Python to become a master of Python.  Purging Python of 'master' seems 
ill-conceived.  The word 'slave' is different matter to me.

In tk and tkinter, the 'parent' and 'master' of a widget may be different 
widgets, but I cannot remember the functional difference, nor whether the terms 
are used consistently.

Like Larry, I object to action based on hidden evidence.

--
nosy: +terry.reedy -mrabarnett

___
Python tracker 

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



[issue34609] Idle Unitest

2018-09-07 Thread pisc...@yahoo.fr


New submission from pisc...@yahoo.fr :

Idle is unable to import unittest. and raises an attributeError.
Output of the Python shell Idle is included in the file bug idle.

several files raise this exception
on of them is included in this report
the Trace for Idle is as follows :
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "copyright", "credits" or "license()" for more information.
>>> 
[DEBUG ON]
>>> 
 RESTART: 
/home/odile/Documents/dev_logiciels/pyhton/openclassrooms/labyrinthe/roboc2/test/test_carte.py
 
Traceback (most recent call last):
  File 
"/home/odile/Documents/dev_logiciels/pyhton/openclassrooms/labyrinthe/roboc2/test/test_carte.py",
 line 5, in 
import unittest
  File "", line 968, in _find_and_load
  File "", line 148, in __enter__
  File "", line 174, in _get_module_lock
  File "", line 59, in __init__
  File "", line 59, in __init__
  File "/usr/lib/python3.6/bdb.py", line 51, in trace_dispatch
return self.dispatch_line(frame)
  File "/usr/lib/python3.6/bdb.py", line 69, in dispatch_line
self.user_line(frame)
  File "/usr/lib/python3.6/idlelib/debugger.py", line 24, in user_line
self.gui.interaction(message, frame)
AttributeError: '_ModuleLock' object has no attribute 'name'
[DEBUG ON]

Idle version is 3.6.5

--
assignee: terry.reedy
components: IDLE
files: test_main.py
messages: 324779
nosy: pisc...@yahoo.fr, terry.reedy
priority: normal
severity: normal
status: open
title: Idle Unitest
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47790/test_main.py

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Matthew Barnett


Matthew Barnett  added the comment:

Not all uses of the word "master" are associated with slavery, e.g. "master 
craftsman", "master copy", "master file table".

I think it's best to avoid use of master/slave where practicable, but other 
uses of "master" are not necessarily a problem.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Larry Hastings


Larry Hastings  added the comment:

> > Have there been any actual complaints?
> Yes, but sadly they are private.

I'm not super-excited by the idea that Python has to change its behavior based 
on secret comments.  Python has traditionally had a very open governance model 
where all discussions happen in public.

While I understand the need to preserve the privacy of victims, is there some 
way we can bring the decision-making process out into the open?  As far as I 
can tell, the entire process so far has been "Victor concludes that these terms 
are bad, and creates and merges several PRs an hour or two later with zero 
discussion".

Perhaps the complaints could be edited to anonymize them, and then we could see 
them?  Or must Python change its governance model because of diversity concerns?

--

___
Python tracker 

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



[issue34604] Possible mojibake in pwd.getpwnam and grp.getgrnam

2018-09-07 Thread William Grzybowski


Change by William Grzybowski :


--
pull_requests: +8559

___
Python tracker 

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



[issue34604] Possible mojibake in pwd.getpwnam and grp.getgrnam

2018-09-07 Thread William Grzybowski


Change by William Grzybowski :


--
pull_requests: +8558

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

> The Django PR is an unreadable infinitely-long page of miserable arguing.  So 
> the context doesn't help much.

In short, some people associate the words "master" and "slave" to slavery. To 
enhance the diversity in the Python community, I suggest to try to avoid these 
terms whenever possible. As I wrote in previous comments, it seems like we have 
to keep them in a few places.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

> Have there been any actual complaints?

Yes, but sadly they are private.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Larry Hastings


Larry Hastings  added the comment:

As a counter-example: A quick grep finds 555 occurrences of the word "kill" in 
CPython master.  Everybody knows killing is bad and using the term might upset 
certain people.  Yet I would not support expunging the word "kill" from Python.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Larry Hastings


Larry Hastings  added the comment:

I'm a little surprised by this.  It's not like slavery was acceptable when 
these computer science terms were coined and it's only comparatively recently 
that they've gone out of fashion.  On the other hand, there are some areas in 
computer software where "master" and "slave" are the exact technical terms 
(e.g. IDE), and avoiding them would lead to confusion.

Of the four citations you reference, one of them is a PR for Django, and three 
of them say "see the Django PR".  The Django PR is an unreadable 
infinitely-long page of miserable arguing.  So the context doesn't help much.

Have there been any actual complaints?  Or is this an attempt to solve a 
problem that doesn't really exist?

--
nosy: +larry

___
Python tracker 

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



[issue34604] Possible mojibake in pwd.getpwnam and grp.getgrnam

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 28658485a54ad5f9df52ecc12d9046269f1654ec by Victor Stinner 
(William Grzybowski) in branch 'master':
bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098)
https://github.com/python/cpython/commit/28658485a54ad5f9df52ecc12d9046269f1654ec


--

___
Python tracker 

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



[issue34608] gc.get_referrers behavior change 3.6 to 3.7

2018-09-07 Thread Bryan

New submission from Bryan :

When called on a local object inside a function, gc.get_referrers no longer 
returns a Frame as one of the references. I could not find anything in the 
release notes or changeling that indicated that this is an intentional change. 

The following script generates different output when run on Python 3.6 vs 
Python 3.7 (on linux, OSX, or Windows):

```
# referrers.py
import gc, sys

class FakeMod(object): pass

extra = []

def test():
mod = FakeMod()
extra.append(mod)
referrers = gc.get_referrers(mod)
print(".".join(str(x) for x in sys.version_info[:3]), ":", len(referrers), 
referrers)

test()
```

Output:

~ master*
(py37) ❯ python test.py
3.7.0 : 1 [[<__main__.FakeMod object at 0x10b65e320>]]

~ master*
(base) ❯ python test.py
3.6.6 : 2 [[<__main__.FakeMod object at 0x106f3ea90>], ]

--
components: Library (Lib)
messages: 324771
nosy: bryevdv
priority: normal
severity: normal
status: open
title: gc.get_referrers behavior change 3.6 to 3.7
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



[issue34594] Some tests use hardcoded errno values

2018-09-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 18d7dff1bb6f5ca7060b0b2e2a2e74493619178f by Benjamin Peterson 
(Zackery Spytz) in branch '3.7':
[3.7] bpo-34594: Don't hardcode errno values in the tests. (GH-9094)
https://github.com/python/cpython/commit/18d7dff1bb6f5ca7060b0b2e2a2e74493619178f


--

___
Python tracker 

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



[issue34594] Some tests use hardcoded errno values

2018-09-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 9eeecfd5d03cfd6d5cef71de31eed7f65f0e658b by Benjamin Peterson 
(Zackery Spytz) in branch '3.6':
[3.6] bpo-34594: Don't hardcode errno values in the tests. (GH-9096)
https://github.com/python/cpython/commit/9eeecfd5d03cfd6d5cef71de31eed7f65f0e658b


--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7e610bcdf128f61b925654e4fa80fbac83537d0e by Victor Stinner in 
branch 'master':
bpo-34605: childs => children (GH-9102)
https://github.com/python/cpython/commit/7e610bcdf128f61b925654e4fa80fbac83537d0e


--

___
Python tracker 

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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8557

___
Python tracker 

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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 886483e2b9bbabf60ab769683269b873381dd5ee by Victor Stinner in 
branch 'master':
bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)
https://github.com/python/cpython/commit/886483e2b9bbabf60ab769683269b873381dd5ee


--

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

It's also reproducible on master. git blame tells me this is introduced with 
feccdb2a249a71be330765be77dee57121866779 (https://bugs.python.org/issue29774)

➜  cpython git:(master)
commit feccdb2a249a71be330765be77dee57121866779
Author: Serhiy Storchaka 
Date:   Thu Mar 9 18:34:03 2017 +0200

bpo-29774: Improve error reporting for corrupted extra field in ZIP file. 
(#583)

diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index b5c16dbc12..8a19ca246b 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -438,7 +438,9 @@ class ZipInfo (object):
 unpack = struct.unpack
 while len(extra) >= 4:
 tp, ln = unpack(' len(extra):
+raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, 
ln))
+if tp == 0x0001:
 if ln >= 24:
 counts = unpack('>>
➜  cpython git:(master) ./python.exe ../backups/bpo34606.py 36.zip
3.8.0a0 (heads/master:874809ea38, Sep  7 2018, 21:03:18)
[Clang 7.0.2 (clang-700.1.81)]
36.zip
Traceback (most recent call last):
  File "../backups/bpo34606.py", line 14, in 
zipfile.ZipFile(fn)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 1204, in __init__
self._RealGetContents()
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 1327, in _RealGetContents
x._decodeExtra()
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 440, in _decodeExtra
raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))
zipfile.BadZipFile: Corrupt extra field 6568 (size=27756)
➜  cpython git:(master) ✗ rm 36.zip

# checkout feccdb2a249a71be330765be77dee57121866779

➜  cpython git:(master) git checkout feccdb2a249a71be330765be77dee57121866779 
Lib/zipfile.py
➜  cpython git:(master) ✗ ./python.exe ../backups/bpo34606.py 36.zip
3.8.0a0 (heads/master:874809ea38, Sep  7 2018, 21:03:18)
[Clang 7.0.2 (clang-700.1.81)]
36.zip
Traceback (most recent call last):
  File "../backups/bpo34606.py", line 14, in 
zipfile.ZipFile(fn)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 1105, in __init__
self._RealGetContents()
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 1230, in _RealGetContents
x._decodeExtra()
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/zipfile.py", 
line 442, in _decodeExtra
raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))
zipfile.BadZipFile: Corrupt extra field 6568 (size=27756)
➜  cpython git:(master) ✗ rm 36.zip

# checkout feccdb2a249a71be330765be77dee57121866779~1

➜  cpython git:(master) ✗ git checkout 
feccdb2a249a71be330765be77dee57121866779~1 Lib/zipfile.py
➜  cpython git:(master) ✗ ./python.exe ../backups/bpo34606.py 36.zip
3.8.0a0 (heads/master:874809ea38, Sep  7 2018, 21:03:18)
[Clang 7.0.2 (clang-700.1.81)]
36.zip
➜  cpython git:(master) ✗ gsha256sum 36.zip
0f54bd6ab84facfeefc2c38f12c30eb84101b3be3d91f8826f6fa36e73b86cb6  36.zip


Hope this helps. 

I am adding Serhiy who might have a better explanation. @Serhiy Feel free to 
unassign yourself if this is irrelevant.

Thanks

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 254a4663d8c5970ae2928185c50ebaa6c7e62c80 by Pablo Galindo in 
branch 'master':
bpo-20104: Add flag capabilities to posix_spawn (GH-6693)
https://github.com/python/cpython/commit/254a4663d8c5970ae2928185c50ebaa6c7e62c80


--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8556

___
Python tracker 

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



[issue34563] invalid assert on big output of multiprocessing.Process

2018-09-07 Thread Oleksandr Buchkovskyi


Oleksandr Buchkovskyi  added the comment:

thank you for all the help in merging this fix!

--

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5e922658fb55734bf8b4c6246033ea93af172ff7 by Victor Stinner in 
branch 'master':
bpo-34605: Avoid master/slave terms (GH-9101)
https://github.com/python/cpython/commit/5e922658fb55734bf8b4c6246033ea93af172ff7


--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Just want to add that it's a constant source of problem with respect to Redis 
and antirez wrote a detailed blog post about it yesterday : 
http://antirez.com/news/122 . It causes a lot of energy and emotional drain 
when issues like this get to twitter and top pages of HN : 
https://twitter.com/antirez/status/1037809132303208455

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)

I don't think that this change should be backported to 3.7 and older, since it 
*might* break the backward compatibility.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 012f5b968a738b15ae9b40c499a1c0778b0615a9 by Victor Stinner in 
branch 'master':
bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
https://github.com/python/cpython/commit/012f5b968a738b15ae9b40c499a1c0778b0615a9


--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

(Oops, I didn't want to put so many people in the nosy list, sorry about the 
spam.)

--
nosy:  -Alex.Willmer, asvetlov, barry, docs@python, dstufft, eric.araujo, 
ezio.melotti, koobs, larry, mrabarnett, ned.deily, paul.moore, r.david.murray, 
ronaldoussoren, steve.dower, terry.reedy, tim.golden, zach.ware

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, with these 3 PRs, I should have replaced most usages of master and slave 
terms.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


--
components:  -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, 
Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, 
FreeBSD, IDLE, IO, Installation, Library (Lib), Regular Expressions, SSL, 
Tests, Tkinter, Unicode, Windows, XML, ctypes, email, macOS

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8555

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Yury Selivanov


Change by Yury Selivanov :


--
components:  -asyncio
nosy:  -yselivanov

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

nis module contains the error message: NisError("No NIS master found for any 
map"), but libnis has a yp_master() function, it's no like Python picked this 
name. I suggest to keep "master" here to keep Python consistent with libnis. 
And "NIP master" gives the context of the "master" term.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

sqlite3.dump._iterdump() access to the "sqlite_master" table Hum, I don't 
think that Python chose the name of this table. This issue should be addressed 
in SQLite, not in Python.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

In the C API, PyMemoryViewObject has a mbuf.master attribute, 
Include/memoryview.h:

---
typedef struct {
PyObject_HEAD
int flags;  /* state flags */
Py_ssize_t exports; /* number of direct memoryview exports */
Py_buffer master; /* snapshot buffer obtained from the original exporter */
} _PyManagedBufferObject;


/* memoryview state flags */
#define _Py_MEMORYVIEW_RELEASED0x001  /* access to master buffer blocked */
#define _Py_MEMORYVIEW_C   0x002  /* C-contiguous layout */
#define _Py_MEMORYVIEW_FORTRAN 0x004  /* Fortran contiguous layout */
#define _Py_MEMORYVIEW_SCALAR  0x008  /* scalar: ndim = 0 */
#define _Py_MEMORYVIEW_PIL 0x010  /* PIL-style layout */

typedef struct {
PyObject_VAR_HEAD
_PyManagedBufferObject *mbuf; /* managed buffer */
Py_hash_t hash;   /* hash value for read-only views */
int flags;/* state flags */
Py_ssize_t exports;   /* number of buffer re-exports */
Py_buffer view;   /* private copy of the exporter's view */
PyObject *weakreflist;
Py_ssize_t ob_array[1];   /* shape, strides, suboffsets */
} PyMemoryViewObject;
---

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

nntplib.NNTP() has a slave() method, but this method sends a "SLAVE" command to 
the NNTP server. Changing that would require to modify the NNTP protocol, 
that's out of the scope of this issue...

RFC 977 "Network News Transfer Protocol" (NNTP)
Section 3.12: The SLAVE command
https://tools.ietf.org/html/rfc977

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

Tkinter and IDLE are full of "master" variables:

   master: parent for widgets.

It seems to be a keep concept of Tkinter windows.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

The doctest module has doctest.master symbol:
---
# For backward compatibility, a global instance of a DocTestRunner
# class, updated by testmod.
master = None
---

I'm not sure about changing this one. Here there is no slave, so it's less 
confusing.

But more generally, maybe it's time to remove this deprecated variable only 
kept for backward compatibility?

--

___
Python tracker 

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



[issue34607] test_multiprocessing_forkserver is altering the environment on AMD64 FreeBSD 10.x Shared 3.7

2018-09-07 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test_multiprocessing_forkserver is altering the environment on AMD64 FreeBSD 
10.x Shared 3.7:

https://buildbot.python.org/all/#/builders/124/builds/545/steps/4/logs/stdio

== Tests result: ENV CHANGED ==
393 tests OK.
10 slowest tests:
- test_tools: 8 min 56 sec
- test_tokenize: 5 min 47 sec
- test_multiprocessing_spawn: 5 min 42 sec
- test_multiprocessing_forkserver: 4 min 29 sec
- test_lib2to3: 4 min 3 sec
- test_multiprocessing_fork: 3 min 46 sec
- test_concurrent_futures: 3 min 43 sec
- test_asyncio: 2 min 36 sec
- test_compile: 1 min 49 sec
- test_io: 1 min 45 sec
1 test altered the execution environment:
test_multiprocessing_forkserver
22 tests skipped:
test_dbm_gnu test_devpoll test_epoll test_gdb test_idle test_ioctl
test_msilib test_ossaudiodev test_smtpnet test_spwd test_ssl
test_startfile test_tcl test_tix test_tk test_ttk_guionly
test_ttk_textonly test_turtle test_winconsoleio test_winreg
test_winsound test_zipfile64
Total duration: 20 min 58 sec
Tests result: ENV CHANGED
*** Error code 3
Stop.
make: stopped in /usr/home/buildbot/python/3.7.koobs-freebsd10/build
program finished with exit code 1
elapsedTime=1260.965772

--
components: Tests
messages: 324753
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_multiprocessing_forkserver is altering the environment on AMD64 
FreeBSD 10.x Shared 3.7
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



[issue34513] test_multiprocessing_spawn fails on x86 Windows7 3.7 buildbot

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

New failure on x86 Windows7 3.x: 
https://buildbot.python.org/all/#/builders/58/builds/1295/steps/3/logs/stdio

test_no_import_lock_contention 
(test.test_multiprocessing_spawn.WithProcessesTestQueue) ... ok
Timeout (0:15:00)!
Thread 0x0f10 (most recent call first):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 
296 in wait
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\queues.py",
 line 224 in _feed
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 
865 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 
917 in _bootstrap_inner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 
885 in _bootstrap
Thread 0x0ea0 (most recent call first):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\queues.py",
 line 82 in put
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 163 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 173 in handle
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 738 in assertRaises
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 862 in test_put
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 610 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 658 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\runner.py",
 line 176 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1900 in _run_suite
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1990 in run_unittest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 175 in test_runner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 179 in runtest_inner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 140 in runtest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 286 in rerun_failed_tests
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 570 in _main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 531 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 584 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\__main__.py", 
line 2 in 
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 85 in _run_code
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 193 in _run_module_as_main
Traceback (most recent call last):
  File "", line 1, in 
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\spawn.py",
 line 117, in spawn_main
exitcode = _main(fd)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\spawn.py",
 line 127, in _main
self = reduction.pickle.load(from_parent)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 951, in rebuild_pipe_connection
handle = dh.detach()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\reduction.py",
 line 133, in detach
self._access, False, _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access is denied
program finished with exit code 1

--

___
Python tracker 

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



[issue34513] test_multiprocessing_spawn fails on x86 Windows7 3.7 buildbot

2018-09-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

New failure on x86 Windows7 3.6 buildbot:

https://buildbot.python.org/all/#/builders/90/builds/519/steps/3/logs/stdio

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread Ammar Askar


Ammar Askar  added the comment:

The libregrtest change looks good but I disagree on the pty/openpty changes. If 
you look at all the current Linux man pages and documentation, they follow the 
master/slave terminology. Generally, Python documentation for underlying os 
functions like fork, stat etc are kept short because the OS documentation is 
the ultimate resource for them. 

This change causes a deviation from the existing standard and will only serve 
to make things more confusing, I would suggest deferring it until the actual OS 
documentation reflects this change as well.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO it's ok to keep the "master" term for:

* Git "master" branch
* "webmaster"
* "postmaster"

To find all impacted files, I used the commend:

git grep -i -E 'master|slave'|grep -v -E 'webmaster|postmaster|/blob/master/'

--

___
Python tracker 

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



[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf


New submission from Kyle Altendorf :

This was first found over in Twisted tests.  We probably aren't too terribly 
worried about it but I wanted to report here anyways.

https://twistedmatrix.com/trac/ticket/9525

Both 3.6 and 3.7 write the same file (sha at the end) based on the script in 
the first snippet.  3.6 can read both files, 3.7 can't read either.



altendky@lt:~/twisted$ cat ../z.py
import sys
import zipfile

print(sys.version)

fn = sys.argv[1]
print(fn)

with zipfile.ZipFile(fn, 'w') as zf:
zi = zipfile.ZipInfo("0")
zi.extra = b"hello, extra"
zf.writestr(zi, b"the real data")

zipfile.ZipFile(fn)


altendky@lt:~/twisted$ venv36/bin/python ../z.py 36.zip
3.6.6 (default, Jul 24 2018, 16:23:12)
[GCC 6.3.0 20170516]
36.zip


altendky@lt:~/twisted$ venv37/bin/python ../z.py 37.zip
3.7.0 (default, Jul  7 2018, 15:49:24)
[GCC 6.3.0 20170516]
37.zip
Traceback (most recent call last):
  File "../z.py", line 14, in 
zipfile.ZipFile(fn)
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 1200, in __init__
self._RealGetContents()
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 1323, in _RealGetContents
x._decodeExtra()
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 440, in _decodeExtra
raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))
zipfile.BadZipFile: Corrupt extra field 6568 (size=27756)


altendky@lt:~/twisted$ cat ../z.py
import sys
import zipfile

print(sys.version)

fn = sys.argv[1]
print(fn)

#with zipfile.ZipFile(fn, 'w') as zf:
#zi = zipfile.ZipInfo("0")
#zi.extra = b"hello, extra"
#zf.writestr(zi, b"the real data")

zipfile.ZipFile(fn)


altendky@lt:~/twisted$ venv36/bin/python ../z.py 37.zip
3.6.6 (default, Jul 24 2018, 16:23:12)
[GCC 6.3.0 20170516]
37.zip


altendky@lt:~/twisted$ venv37/bin/python ../z.py 36.zip
3.7.0 (default, Jul  7 2018, 15:49:24)
[GCC 6.3.0 20170516]
36.zip
Traceback (most recent call last):
  File "../z.py", line 14, in 
zipfile.ZipFile(fn)
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 1200, in __init__
self._RealGetContents()
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 1323, in _RealGetContents
x._decodeExtra()
  File "/home/altendky/.pyenv/versions/3.7.0/lib/python3.7/zipfile.py", 
line 440, in _decodeExtra
raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))
zipfile.BadZipFile: Corrupt extra field 6568 (size=27756)


altendky@lt:~/twisted$ sha256sum 36.zip
0f54bd6ab84facfeefc2c38f12c30eb84101b3be3d91f8826f6fa36e73b86cb6  36.zip


altendky@lt:~/twisted$ sha256sum 37.zip
0f54bd6ab84facfeefc2c38f12c30eb84101b3be3d91f8826f6fa36e73b86cb6  37.zip

--
components: Library (Lib)
messages: 324743
nosy: altendky
priority: normal
severity: normal
status: open
title: Unable to read zip file with extra
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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-07 Thread Zorg


Zorg  added the comment:

The minimum OS target (which looks like 10.13) should ideally be well defined 
and tested using the latest SDK, rather than there being "no promises". Or at 
least it should be documented that this isn't currently supported, or how to 
disable specific features and which ones to disable. I downloaded the source 
tarball from https://www.python.org/downloads/release/python-370/

Python then isn't viable currently for embedding inside applications 
(https://docs.python.org/3/extending/embedding.html). 3rd party app developers 
on macOS typically have a policy at least supporting back to N-1 or N-2'th OS, 
and in many cases it shouldn't be their dependencies that drive this. 

The other two functions require 10.13:
futimens
utimensat

Fortunately the -Wunguarded-availability warning is enabled which spits out 
warnings on which functions aren't available when targeting a min OS 
(MACOSX_DEPLOYMENT_TARGET)

Can't say I can contribute anything here unfortunately :(. I had to do 
something though, so I hacked the configure scripts and pyconfig.h to make sure 
the clock_* and the above functions I mentioned above weren't being used. 
getentropy was easy to fix more properly because it already has a fallback at 
runtime in case it's not working, so it was just an additional NULL check. 
Looks like the functions are weakly referenced when building to an older OS 
target.

A bad step in future direction would be to continue making "no promises" and 
start using functionality only available on 10.14, 10.15, etc without fallback.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34590] "Logging HOWTO" should share an example of best practices for using logging in a library

2018-09-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Should I make use of a single logger object in my library, multiple loggers
> in a tree, or multiple unrelated loggers? Since I have just one public module,
> I'm tempted to say that I should just use one logger object.

Yes. The advanced logging tutorial (part of the HOWTO) states:

"A good convention to use when naming loggers is to use a module-level logger, 
in each module which uses logging, named as follows:

logger = logging.getLogger(__name__)

This means that logger names track the package/module hierarchy, and it’s 
intuitively obvious where events are logged just from the logger name."

This seems clear enough to me. Did you look at the whole of the HOWTO? If not, 
I'd advise you to take the time

> (The documentation says "No handlers could be found for logger" 
> spam only happens pre-3.2, but some of my users at least think
> they see it in later Pythons.)

In 3.2, the change was made to introduce a "handler of last resort" instead of 
the "no handlers could be found" message, which is only printed if 
logging.lastResort is set to None or other "false" value (by default, it's set 
to a console handler at WARNING level emitting to sys.stderr). If you can give 
specifics of a later Python version where this happens (precise Python version, 
OS etc.) then we can address it.

Practices vary widely because use cases for logging are widely varied. A simple 
one-off script has different needs from a product with a long shelf-life, a 
command-line application has different needs from a long-running server 
application, a single-author application has different needs from one which is 
put together from lots of different dependencies by different authors, etc.

> Why should a Logger object need to have .basicConfig() called on
> it after retrieval (where "retrieval" means "getLogger call") and
> before use anyway?

It doesn't. If you want output, you need handlers. The basicConfig() API is 
just one way of attaching handlers to loggers for simple use cases. The 
question of handlers is also no concern of a library author, other than the 
NullHandler part, as the application is where logging should be configured (as 
mentioned in the "Configuring Logging for a Library" section).

> Then we could establish the "gold standard" for logging and write
> about it in the HOWTO.

There's no one size fits all, I'm afraid, because the package is designed to 
cover a wide range of use cases, not just the simplest ones. While there is 
(IMO) comprehensive documentation, specific proposals for improvements will be 
looked at constructively.

--

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8554

___
Python tracker 

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



  1   2   >