[issue33065] debugger issue concerning importing user created modules into another program

2018-03-12 Thread Joshua De La Rosa

New submission from Joshua De La Rosa :

Taking my first coding class, so I don't know much about coding or python in 
general, but I  ran into a problem when using the Debugger function for a 
homework assignment that neither I nor my professor could make sense of. My 
program executes successfully without running the Debugger or, in the case that 
I am running the Debugger, it only raises an error when I "Step" through the 
imported module that I implemented in another program, rather than just hitting 
"Go". The error it reports is:
AttributeError: '_ModuleLock' object has no attribute 'name'

Not sure which file to submit, since the I created my own module that is used 
in the program that raises the error when I step through it with the Debugger 
mode on.

--
assignee: terry.reedy
components: IDLE
messages: 313721
nosy: jcdlr, terry.reedy
priority: normal
severity: normal
status: open
title: debugger issue concerning importing user created modules into another 
program
type: compile error
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



[issue33064] lib2to3 fails on a trailing comma after **kwargs in a function signature

2018-03-12 Thread Łukasz Langa

Change by Łukasz Langa :


--
keywords: +patch, patch
pull_requests: +5858, 5859

___
Python tracker 

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



[issue33064] lib2to3 fails on a trailing comma after **kwargs in a function signature

2018-03-12 Thread Łukasz Langa

Change by Łukasz Langa :


--
keywords: +patch
pull_requests: +5858

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2018-03-12 Thread Siming Yuan

Siming Yuan  added the comment:

tested again with Python 3.4.8 and the bug is observed. patch & builds fine.

strangely, tested building python 3.6.4 on the same environment without patch, 
no issues, even though the ffi.c code is exactly the same.

--
components: +ctypes
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



[issue33064] lib2to3 fails on a trailing comma after **kwargs in a function signature

2018-03-12 Thread Łukasz Langa

Łukasz Langa  added the comment:

Ned, I'd like this to make into 3.6.5 if at all possible.

--
nosy: +ned.deily
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue33064] lib2to3 fails on a trailing comma after **kwargs in a function signature

2018-03-12 Thread Łukasz Langa

New submission from Łukasz Langa :

Title says all. I have a patch.

--
assignee: lukasz.langa
messages: 313718
nosy: lukasz.langa
priority: normal
severity: normal
status: open
title: lib2to3 fails on a trailing comma after **kwargs in a function signature
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2018-03-12 Thread Siming Yuan

Siming Yuan  added the comment:

attached patch that fixes the build issue.

credit to davin @ https://bugs.python.org/issue23042

--
keywords: +patch
Added file: https://bugs.python.org/file47479/ffi.patch

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2018-03-12 Thread Siming Yuan

New submission from Siming Yuan :

compiling Python 3.5.5 under RHEL 6.4, 32-bit:

build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 In function `ffi_prep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined 
reference to `ffi_closure_FASTCALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' 
can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value


related to https://bugs.python.org/issue23042 - but it seems like the patch for 
x86/ffi.c never made it to release.

--
components: Build
messages: 313716
nosy: siming85
priority: normal
severity: normal
status: open
title: failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'
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



[issue33038] GzipFile doesn't always ignore None as filename

2018-03-12 Thread bbayles

Change by bbayles :


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

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:

> I believe this can be closed as 'fixed'?

Well, it *was* fixed!  But then I reintroduced the boilerplate when I created 
the 3.7 and 3.8 whatsnew files - now fixed.  Thanks for the reminder!

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:


New changeset d461ed84b57aae0bdccd117dc38109c087444d50 by Ned Deily in branch 
'3.7':
bpo-29719: Remove Date and Release field in whatsnew/3.7 (GH-6094)
https://github.com/python/cpython/commit/d461ed84b57aae0bdccd117dc38109c087444d50


--

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:


New changeset a34510a4c562b4b23c7f9da6ff6e2318484f5f1a by Ned Deily in branch 
'master':
bpo-29719: Remove Date and Release field in whatsnew/3.7 and 8 (GH-6093)
https://github.com/python/cpython/commit/a34510a4c562b4b23c7f9da6ff6e2318484f5f1a


--

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Ned Deily

Change by Ned Deily :


--
pull_requests: +5856

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Ned Deily

Change by Ned Deily :


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

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Separate PRs for doc and code changes will be needed anyway if the code change 
is restricted to 3.8.

To me, changing keyword.iskeyword.__doc__ from the irrelevant Python tautology 
'x.__contains__(y) <==> y in x.' to something that says what the function does, 
as docstrings should,  is a bug fix, not an enhancement.  Hence a slight 
slowdown is not a concern to me.  I see 4 possible types of fixes.

1. Write a python function with docstring.  3.8 only as it changes 
type(iskeyword).

def iskeyword(s):
"Return true if s is a Python keyword."
return s in kwlist

2. Change the aberrant set/frozenset.__contains__.__doc__ so it makes some 
sense as a docstring for a bound method (as with list and dict).  
  list/tuple.__contains__.__doc__ is 'Return key in self.'
  dict.__contains__.__doc__ is 'True if the dictionary has the specified key, 
else False.'

I would copy the dict __contains__ docstring, with 'Return' prefixed, to set 
and frozenset, with the obvious substitution.  I don't know about backporting 
this.

3. Make bound_method docstrings writable, like with Python function docstrings 
(3.8 only).  Then we could use Cheryl's suggestion.  Or add a function 
bounddoc(bound_method, docstring) that can change a bound_method's docsting.

CPython uses 2 types for built-in methods bound to an instance.  The choice is 
not consistent within a class or across classes for a particular method.
  builtin_function_or_method ([].append, frozenset().__contains__)
  method-wrapper ([].__contains__)
Python classes result in 'bound method'.  All 3 copy the docstring of the 
instance method.  (For Python classes, one can temporarily change the method 
docstring before creating a new bound method.)

4. Add makebound(method, instance, docstring) that creates a bound method (of 
the appropriate type) but with the passed docstring (3.8 only)

3 or 4 would allow any public bound method to have a custom docstring.

--

___
Python tracker 

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



[issue20917] Idle: Enhance font change notification system

2018-03-12 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
dependencies: +IDLE: Add docstrings and tests for codecontext
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue29719] "Date" of what's new is confusing

2018-03-12 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I believe this can be closed as 'fixed'?

--
nosy: +csabella

___
Python tracker 

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



[issue24518] json.dumps should accept key function for ``sort_keys``

2018-03-12 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

As there was interest in this patch, @catherinedevlin would you be able to make 
a Github pull request for it?

Thanks!

--
nosy: +csabella
stage:  -> needs patch
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!

2018-03-12 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Since issue 32185 has been patched, should this one be revisited to see if that 
solution helped fixed this one?

--
nosy: +christian.heimes, csabella

___
Python tracker 

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



[issue21018] [patch] added missing documentation about escaping characters for configparser

2018-03-12 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

@Arun.Persaud, would you be interested in converting your patch to a Github 
pull request?

--
nosy: +csabella
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

As for StackOverflow links provided by Robert, it looks to me that 
float.is_integer() is always used improperly.

If keep this method it would be worth to warn against improper use of it.

Bad:

(x/5).is_integer()

Good:

x % 5 == 0

or

not x % 5

Bad:

math.sqrt(x).is_integer()

Good:

int(math.sqrt(x))**2 == x

Bad:

while x < y:
if x.is_integer():
print(x)
x += 0.1

Good (if initial x was integer):

x0 = x
i = 0
while x < y:
x = x0 + i/10
if not i % 10:
print(x)
i += 1

And provide an example of a *proper* use case (if it exists).

--

___
Python tracker 

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



[issue33062] ssl_renegotiate() doesn't seem to be exposed

2018-03-12 Thread Vitaly Kruglikov

New submission from Vitaly Kruglikov :

I need to write a test for my client to make sure it's non-blocking ssl 
interactions are able to survive SSL renegotiation. However, I can't seem to 
find anything in our python ssl API that calls `SSL_renegotiate()` in order to 
force renegotiation.

--
assignee: christian.heimes
components: SSL
messages: 313706
nosy: christian.heimes, vitaly.krug
priority: normal
severity: normal
status: open
title: ssl_renegotiate() doesn't seem to be exposed
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33061] NoReturn missing from __all__ in typing.py

2018-03-12 Thread Allen Tracht

Change by Allen Tracht :


--
components: Library (Lib)
nosy: Allen Tracht
priority: normal
severity: normal
status: open
title: NoReturn missing from __all__ in typing.py
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33056] LEaking files in concurrent.futures.process

2018-03-12 Thread miss-islington

Change by miss-islington :


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

___
Python tracker 

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



[issue33058] Enhance Python's Memory Instrumentation with COUNT_ALLOCS

2018-03-12 Thread Eddie Elizondo

Change by Eddie Elizondo :


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

___
Python tracker 

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



[issue33060] Installation hangs at "Publishing product information"

2018-03-12 Thread Carol Willing

Carol Willing  added the comment:

Hi Bob,

Your best option to get timely help information about installation is to visit 
one of the support channels for Python:

- python-help mailing list https://www.python.org/community/lists/
- #python IRC channel https://www.python.org/community/irc/

First, make sure that your system is a 64 bit system. The installer that you 
reference will not work if you are using a 32 bit system.

Double check that you have all Windows updates installed. 

Try the help channels mentioned above or try to install `Windows x86 MSI 
installer` found at https://www.python.org/downloads/release/python-2714/

You can also try a third party distribution such as Anaconda.

--
nosy: +willingc
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



[issue33023] Unable to copy ssl.SSLContext

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You won't have any session resumption tickets until a connection succeeds.  And 
even then, I don't think it would be a problem.  By design, SSL contexts are 
meant to be re-used accross multiple connections.

--

___
Python tracker 

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



[issue33023] Unable to copy ssl.SSLContext

2018-03-12 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

> What would those side-effects be?

Christian Heimes suggested that 
> A context contains elements that can't be cloned easily, e.g. session 
> resumption tickets.

My concern then would be potential side-effects from such session resumption 
tickets and anything else that one connection attempt might save/change within 
an SSL Context that might have an undesirable side-effect on the follow-on 
connection attempts.

--

___
Python tracker 

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



[issue33060] Installation hangs at "Publishing product information"

2018-03-12 Thread Bob Klahn

New submission from Bob Klahn :

I am unable to install Python 2.7.14 on my Windows 7 PC.  Using 
python-2.7.14.amd64.msi .  The installation hangs at the "Publishing product 
information" step.

Subsequent installation attempts result in the message "Python 2.7.14 (64-bit) 
setup was interrupted.  Your system has not been modified.  To install this 
program at a later time, please run the installation again.  Click the Finish 
button to exit the Installer."

I need to be able to make this work! With this version of Windows and this 
version of Python.

Help!

--
components: Installation
messages: 313702
nosy: bobstones
priority: normal
severity: normal
status: open
title: Installation hangs at "Publishing product information"
versions: Python 2.7

___
Python tracker 

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



[issue33059] netrc module validates file mode only for /home/user/.netrc

2018-03-12 Thread Andreas Költringer

New submission from Andreas Költringer :

On my first try to use the netrc module I got back the error: 

"~/.netrc access too permissive: access permissions must restrict access to 
only the owner"

I changed the file permissions and wrapped this up in try-except and went on to 
write some unit tests (using tempfile), assuming that the file mode checks 
would be performed on any netrc file I passed into the constructor (yes, I did 
not read the documentation sufficiently well).

Anyway, I believe that these security checks should be done for any netrc file 
(they contain sensitive information no matter where they are located on the 
file system). There was already a discussion on the topic

https://bugs.python.org/issue14984

where there was concern regarding backwards-compatibility and the idea to 
re-visit this issue "in the future". That was in 2013, so maybe this "future" 
is now?

--
components: Library (Lib)
messages: 313701
nosy: akoeltringer
priority: normal
severity: normal
status: open
title: netrc module validates file mode only for /home/user/.netrc
type: security
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Yury Selivanov

Yury Selivanov  added the comment:

> - I would say event loop per class.  If someone really needs event loop per 
> method, they can create separate classes per method.  It's ugly, but 
> effective.

+1.

- We should have an async setUp capability.  Maybe we could add a helper method 
to be called from setUp rather than adding a whole new asyncSetUp into the 
protocol?  That eliminates the problem of which goes first.

I'd rather have a protocol :)  Protocols are easy to document and it's possible 
to statically validate them (with linters/metaclasses).  Calling some method 
from setUp to call asyncSetUp would be a common gotcha IMO.

We can always call synchronous setUp before asyncSetUp, I think it's intuitive 
enough.

Speaking of addCallback, we should have a distinct addAsyncCallback.  It's OK 
to have an object with both __call__ and __await__ methods -- in which case 
it's not clear which one you should call.

In general, while we will be adding a new subclass and a few 'async'-prefixed 
methods, it should still be relatively straightforward for people to write and, 
more importantly, read the code that uses them.

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Zachary Ware

Zachary Ware  added the comment:

Ok, Yury clarified a few points before I got my message submitted there, so 
some of my last message may be a bit misguided.  In particular, the problems 
with just using `asyncio.run` are clearer to me now.

To give my answers to Yury's open questions:

- We should have an async setUpClass capability, one way or another.

- I would say event loop per class.  If someone really needs event loop per 
method, they can create separate classes per method.  It's ugly, but effective.

- We should have an async setUp capability.  Maybe we could add a helper method 
to be called from setUp rather than adding a whole new asyncSetUp into the 
protocol?  That eliminates the problem of which goes first.

--

___
Python tracker 

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



[issue32911] Doc strings no longer stored in body of AST

2018-03-12 Thread Łukasz Langa

Łukasz Langa  added the comment:

Python's AST already doesn't include a lot of syntax that has no runtime effect:
- comments;
- whitespace and punctuation.

The situation is now made "worse" with constant folding.  You won't have full 
line information on the full expression, you don't even fully *see* expressions 
as syntactically provided by user code.  The docstring is just a special case 
of that.

As a counter example, it still includes function-level type annotations which 
are not evaluated. Clearly we don't have an explicit rule about this.

If you asked *me*, I would say Python provides a "lossy" AST and this is the 
one it itself uses.  It also provides a "lossless" AST and this one is in 
lib2to3.  It's unfortunate that the latter is not documented and kind of 
neglected.  This is something I want to address soonish.

Summing up, I'm in favor of option 3.  The AST preserves the docstring, it 
simply doesn't have information on where exactly it lives.  In exchange, the 
tree makes it easier to *find* the docstring and easier to find the first 
instruction (as Serhiy points out, the first statement is now always code to be 
executed).

Quoting literally the second sentence of the `ast` documentation:
> The abstract syntax itself might change with each Python release.

I am not against Option 2 since it's already implemented but I feel it's a 
pretty big change, pretty late in the release process for 3.7.  The amount of 
work required *just* to preserve the line number of the docstring (which can be 
reasonably guessed anyway) seems silly to me.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Too bad we couldn't do:

iskeyword = frozenset(kwlist).__contains__
iskeyword.__doc__ = 'Test whether a string is a reserved identifier.'

But I'm sure there are reasons for this:
AttributeError: attribute '__doc__' of 'builtin_function_or_method' objects is 
not writable

--
nosy: +csabella

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Zachary Ware

Zachary Ware  added the comment:

1. I'm still -1 on a separate subclass, especially since the subclass should 
still be compatible with the base class.

2. This is only in consideration for 3.8 (even 3.7 is past feature freeze at 
this point), so the version-dependent behavior is unnecessary.

3. I agree that the `super().setUp()` idiom precludes allowing `setUp` and 
`tearDown` to be synchronous or asynchronous unless the idiom becomes 
`self.runMethod(super().setUp)`, but that's longer and harder to remember.  
`setUpClass` and `tearDownClass` also need to be considered.

You also still need to add tests.

`addCleanup` is an open question; I think it could handle sync or async on its 
own but could be convinced otherwise.


Andrew: Judging by your questions in msg313481 I think my description of 
`coroutine_runner` was not specific enough.  The basic idea is that 
unittest.case.TestCase is defined with `coroutine_runner = asyncio.run`, and if 
you need something else then you do:

class MyTest(TestCase):

# I assume trio has something like this :)
coroutine_runner = trio.run

async def test_something_in_trio(self):
self.assertTrue(1)


asyncio gets the special treatment of having its runner set by default by 
virtue of being in the standard library.

I'm certainly open to better naming :)

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Yury Selivanov

Yury Selivanov  added the comment:

First, John and Peter, let's not have two competing PRs.  I'd prefer to have 
only one to make things easier to review.  So far it looks like Peter's is 
slightly more developed.  And this also seems to be a complex issue, so there's 
plenty of work to be done here and you can work on it jointly if you want.

I think a lot of Andrew's recommendations (see [1]) about doSetUp etc make 
sense.

The problem is how to marry methods like `asyncSetUpClass`, `asyncSetUp` and 
`runTest` together: all are async, all should be executed *within* one event 
loop.  They should also be executed *before* you call the actual test method, 
so it's *incorrect* to call the test case and decide if async set ups should be 
called or not.  This is another argument to have a separate AsyncioTestCase 
base class.

BTW, we can use asyncio.run() to execute only *one* coroutine.  If you have 
more than one, they will be executed in *different* event loops!  This is why 
the "coroutine runner" proposal is fundamentally incompatible with having 
`asyncSetUp` methods.

Speaking of asyncSetUp, let me re-iterate why we can't *just* reuse setUp:

  class B:

async def setUp(self):
print('bar')

  class A(B):

def setUp(self):
super().setUp()
print('foo')

If we execute tests in A, 'bar' will never be printed.

So I'm suggesting to try another approach: have a generic ABC 
`unittets.AsyncTestCase(ABC)` with one abstract method: `makeAsyncExecutor`.  
This will be a class intended to be used by framework developers.

We then add a concrete `unittest.AsyncioTestCase(unittest.AsyncTestCase)` 
implementation class to unittest (or should it be asyncio? I'm fine either way).

So what will `makeAsyncExecutor` do?  It should return an instance of 
`unittest.AsyncExecutor(ABC)` object which roughly would look like the 
following (this is just an example design, we need to discuss it further):

  class AsyncExecutor(abc.ABC):

  def init(self)

  def runAsync(self, coro: typing.Coroutine)

  def shutdown(self)

Why do we need a proxy object?  Well, due to some historical reasons, 
`asyncio.loop.close()` just closes the loop.  The actual correct shutdown 
protocol for an asyncio program is a little bit more elaborate, you can take a 
look at how asyncio.run is implemented in Python 3.7: [2].  Correct 
initialization of an event loop might also require extra work.  And keep in 
mind, we want to have a more-or-less generic and reusable implementation here 
so that frameworks like Trio could use this new API too (that's not the main 
goal, but would be nice to have).

A few open questions: 

- Should we have 'asyncSetUpClass'?

- Should we have an event loop per one test case method, or per one class?  
Should this be configurable?  In my experience both things are needed from time 
to time.

- If we have 'asyncSetUp' should it be called before or after 'setUp'?


[1] https://github.com/python/cpython/pull/6051
[2] https://github.com/python/cpython/blob/master/Lib/asyncio/runners.py#L8

--

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Carol Willing

Carol Willing  added the comment:

I've made an additional suggestion on the open PR to add an example to the 
`.rst` doc that better clarifies the differences and usage of `iskeyword` and 
`isidentifier`.

Perhaps making that addition and skipping the updates to the C source code 
would be a reasonable step forward. While perhaps not ideal, it seems a 
reasonable compromise to provide more helpful documentation without any 
potential performance impact or regression.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Robert Smallshire

Robert Smallshire  added the comment:

Thank you Raymond. I'll work up a PR shortly.

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Petter S

Petter S  added the comment:

Personally, I think John's PR is fine. (but the test class could arguably live 
in asyncio) I like that setUp, tearDown and test methods all can be async.

But if setUp and tearDown should never be async as Yury commented above, they 
don't need runners. That is what I went for in my PR.

Introducing three new public methods to TestCase is too much. I originally made 
the runner private, but Yury told me to make it public and document it.

--

___
Python tracker 

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



[issue33058] Enhance Python's Memory Instrumentation with COUNT_ALLOCS

2018-03-12 Thread Eddie Elizondo

Eddie Elizondo  added the comment:

@serhiy.storchaka tracemalloc can't distinguish between the usage of gc allocs, 
normal mallocs, and free list reuse.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I would rather deprecate float.is_integer() if it looks as a magnet of bad code.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Robert, would you please update you patch and submit it to Github as a pull 
request.  It is looking like this will likely go forward after all.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

For changing a docstring we have to change the implementation of iskeyword(). 
It seems to me that the current implementation is the fastest, and any other 
implementation will be a tiny bit slower.

I just wanted to say that this enhancement has a non-zero cost.

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread Petter S

Petter S  added the comment:

John: inspect.iscoroutinefunction(meth) does not work if the method is 
decorated with e.g. unittest.mock.patch.

--

___
Python tracker 

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



[issue33058] Enhance Python's Memory Instrumentation with COUNT_ALLOCS

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Could tracemalloc help you?

--
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue33058] Enhance Python's Memory Instrumentation with COUNT_ALLOCS

2018-03-12 Thread Eddie Elizondo

Eddie Elizondo  added the comment:

Currently, Python has very few instrumentation when it comes to the types of 
allocations that it's doing. For instance, we currently can't identify how many 
times an object uses free lists vs actual mallocs.

Currently, there's a special build which can be used by compiling with 
"-DCOUNT_ALLOCS". However, this build is not ABI compatible with extensions. 
Meaning you have to recompile all the modules that are used. Doing this on a 
large scale scenario (1000+ modules) is not feasible.

Thus, I propose the following enhancements:
* Make COUNT_ALLOCS ABI compatible

Then:
* Expand the counters to not only track allocs and frees but also distinguish 
between:
* GC Counts: Allocs/Frees coming from PyObject_GC_Malloc PyObject_GC_Del
* Memory Counts: Allocs/Frees coming from PyMem_Malloc/PyObject_Malloc 
PyObject_Free (modulo GC objects).
* Free Lists: "Allocs/Frees" coming from specific object's free_lists/caches.
* Misc: Extra kinds of "Allocs/Frees" such as code's zombie frame.

--

___
Python tracker 

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



[issue33058] Enhance Python's Memory Instrumentation with COUNT_ALLOCS

2018-03-12 Thread Eddie Elizondo

New submission from Eddie Elizondo :

[WIP]

--
title: [WIP] Enhance Python's Memory Instrumentation with COUNT_ALLCOS -> 
Enhance Python's Memory Instrumentation with COUNT_ALLOCS

___
Python tracker 

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



[issue33058] Enhancing Python

2018-03-12 Thread Eddie Elizondo

Change by Eddie Elizondo :


--
nosy: elizondo93
priority: normal
severity: normal
status: open
title: Enhancing Python
type: 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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Stefan Krah

Stefan Krah  added the comment:

I agree with Mark's mailing list statements: There is no ambiguity
for decimal, given that the existing predicates ignore the context.

--

___
Python tracker 

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



[issue33058] [WIP] Enhance Python's Memory Instrumentation with COUNT_ALLCOS

2018-03-12 Thread Eddie Elizondo

Change by Eddie Elizondo :


--
title: [WIP] Enhancing Python's COUNT_ALLOCS -> [WIP] Enhance Python's Memory 
Instrumentation with COUNT_ALLCOS

___
Python tracker 

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



[issue33058] [WIP] Enhancing Python's COUNT_ALLOCS

2018-03-12 Thread Eddie Elizondo

Change by Eddie Elizondo :


--
title: Enhancing Python -> [WIP] Enhancing Python's COUNT_ALLOCS

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

As I posted above, keywork.iskeyword already has a bizarrely incorrect 
docstring, so how can there be a performance impact? And why single out such a 
rarely used function?

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What is the use case of float.is_integer() at all? I haven't found its usages 
in large projects on GitHub. Only in playing examples where it is (mis)used in 
cases like (x/5).is_integer() (x % 5 == 0 is better) or (x**0.5).is_integer() 
(wrong for some floats or large integers).

Maybe it should be removed in Python 3.0.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ongoing discussion here: 
https://mail.python.org/pipermail/python-dev/2018-March/152358.html

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset 019f5b3e9e4c2a1297580483c3d5a5a10bddb93b by Antoine Pitrou 
(Antoine Pietri) in branch 'master':
bpo-22674: fix test_strsignal on OSX (GH-6085)
https://github.com/python/cpython/commit/019f5b3e9e4c2a1297580483c3d5a5a10bddb93b


--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Change by Antoine Pitrou :


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



[issue33057] logging.Manager.logRecordFactory is never used

2018-03-12 Thread Ben Feinstein

Change by Ben Feinstein :


Removed file: https://bugs.python.org/file47478/issue_logRecordFactory.py

___
Python tracker 

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



[issue33048] macOS job broken on Travis CI

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:

Thanks, Carol!

--

___
Python tracker 

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



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Guillaume Carre

Guillaume Carre  added the comment:

Yes these were pretty large zip 30 to 60Gb with thousands of small files in
them I've fixed locally on our servers and we've been happy even after
accepting similar sized files from linux machine.
I'm also quite surprised about this not being reported by others.

On Mon, Mar 12, 2018 at 9:01 AM, Thomas Kluyver 
wrote:

>
> Thomas Kluyver  added the comment:
>
> If every Windows 7 computer is generating zipfiles which are invalid in
> this way, that would be a pretty strong argument for Python (and other
> tools) to accept it. But if that was the case, I would also expect that
> there would be many more issues about it.
>
> Are the files you're compressing large (multi-GB)? Python only uses the
> zip64 format when the files are too big for the older zip format; maybe
> Windows is doing the same. Even in that case, I'm still surprised that more
> people don't hit it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken

2018-03-12 Thread Ewoud Kohl van Wijngaarden

Ewoud Kohl van Wijngaarden  added the 
comment:

It's interesting to note that neither IPv4Network[1] nor IPv4Network docs 
mention reverse_pointer. That means it could also remove them (which 
essentially also throws an exception) since they don't make sense for networks. 
It would be useful to have the described functionality under a better name.

[1]: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network
[2]: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network

--

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The change that will add a docstring to keyword.iskeyword() inevitable will 
have a negative performance effect. Is it worth it?

--
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

float.is_integer() was added 6f34109384f3a78d5f4f8bdd418a89caca19631e 
(unfortunately no issue number for looking at the discussion preceded it). I 
don't know reasons. The same changeset added implementations of 
complex.is_finite(), int.is_finite(), long.is_finite(), float.is_inf() and 
float.is_nan(), but they were disabled by default (they are still a dead code 
in sources). The same changeset added well known functions math.isinf(), 
math.isnan(), cmath.isinf() and cmath.isnan().

--

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Carol, Yes, I've raised a PR.

Currently, I've updated the docs for `str.isidentifier` clarifying the usage of 
`keyword.iskeyword`

For updating the docstring of `keyword.iskeyword`, I saw that `Lib/Keyword.py` 
defines this on line 55: `iskeyword = frozenset(kwlist).__contains__`

The docstring of the file says that it is automatically generated from 
`graminit.c`. I observed that file and have no clue on how to proceed to have 
the doc string updated. Can someone provide me a pointer on this please?

--
keywords:  -patch
stage: patch review -> needs patch

___
Python tracker 

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



[issue33048] macOS job broken on Travis CI

2018-03-12 Thread Carol Willing

Carol Willing  added the comment:

I've opened a WIP PR to fix the Travis test config on macOS. Antoine is correct 
that the recent brew changes related to Python caused the test failure.

I will try to get working on Python3 first and then Python2.

--
nosy: +willingc

___
Python tracker 

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



[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-12 Thread Sanyam Khurana

Change by Sanyam Khurana :


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



[issue3014] file_dealloc() assumes errno is set when EOF is returned

2018-03-12 Thread Sanyam Khurana

Change by Sanyam Khurana :


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

___
Python tracker 

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



[issue33057] logging.Manager.logRecordFactory is never used

2018-03-12 Thread Ben Feinstein

Change by Ben Feinstein :


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

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:

> Ned, this is why I'd like issue33048 to be solved :-) Having to rely on the 
> buildbot fleet for bugfix iteration is not convenient at all.

I want to see it solved, too. :-)  But there are other core-devs out there who 
are in a better position to solve it at the moment; it's not particularly a 
macOS problem; it's a problem with using Homebrew and Travis, neither one of 
which I'm all that familiar with and which others have set up.  And I'm in the 
middle of trying to get some releases and other stuff out the door.  So, I'm 
not going to be able to spend time on it right now.  Sorry!

--

___
Python tracker 

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



[issue33048] macOS job broken on Travis CI

2018-03-12 Thread Carol Willing

Change by Carol Willing :


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

___
Python tracker 

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



[issue33056] LEaking files in concurrent.futures.process

2018-03-12 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 095ee415cee41bf24c3a1108c23307e5baf168dd by Andrew Svetlov 
(Thomas Moreau) in branch 'master':
bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (#6084)
https://github.com/python/cpython/commit/095ee415cee41bf24c3a1108c23307e5baf168dd


--
nosy: +asvetlov

___
Python tracker 

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



[issue12345] Add math.tau

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Because of its lucky number. See 
https://github.com/python/core-workflow/issues/223 (fixed).

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pietri

Antoine Pietri  added the comment:

Done, https://github.com/python/cpython/pull/6085

As I said in the PR body, I can't test it myself, I don't have an OSX VM setup.

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pietri

Change by Antoine Pietri :


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



[issue33055] bytes does not implement __bytes__()

2018-03-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This isn't one exception. For example complex doesn't have the __complex__ 
method.

__str__, __float__, __int__ and __bool__ are implemented in str, float, int and 
bool because there are corresponding special slots in a type object. But 
__bytes__ and __complex__ were added later and they have no slots. Calling them 
for bytes and complex will slowdown creating new object.

The user code rarely needs to call these methods directly. Just call bytes(), 
complex(), str(), float(), etc.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Should I submit a new PR for this?

Please do.

--

___
Python tracker 

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



[issue12345] Add math.tau

2018-03-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Why does this issue keep ending up as the target of unrelated PR notifications?

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pietri

Antoine Pietri  added the comment:

Yes, sorry, the issue is that we decided with pitrou to remove the osx specific 
handling.

The fix should be:

diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index fbb12a5b67..ae0351e992 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -58,8 +58,10 @@ class PosixTests(unittest.TestCase):
 self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
 
 def test_strsignal(self):
-self.assertEqual(signal.strsignal(signal.SIGINT), "Interrupt")
-self.assertEqual(signal.strsignal(signal.SIGTERM), "Terminated")
+self.assertTrue(signal.strsignal(signal.SIGINT)
+.startswith("Interrupt"))
+self.assertTrue(signal.strsignal(signal.SIGTERM)
+.startswith("Terminated"))
 
 # Issue 3864, unknown if this affects earlier versions of freebsd also
 def test_interprocess_signal(self):


Should I submit a new PR for this?

--

___
Python tracker 

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



[issue33057] logging.Manager.logRecordFactory is never used

2018-03-12 Thread Ben Feinstein

New submission from Ben Feinstein :

In logging.Manager, the logRecordFactory attribute is never used.

One would expect that makeRecord() (in logging.Logger) would generate a record 
using its manager's logRecordFactory, or fallback to the global 
_logRecordFactory (if has no manager, or manager.logRecordFactory is None), but 
the latter is used exclusively.

--
components: Library (Lib)
files: issue_logRecordFactory.py
messages: 313662
nosy: feinsteinben, vinay.sajip
priority: normal
severity: normal
status: open
title: logging.Manager.logRecordFactory is never used
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47478/issue_logRecordFactory.py

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ned, this is why I'd like issue33048 to be solved :-) Having to rely on the 
buildbot fleet for bugfix iteration is not convenient at all.

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Ned Deily

Ned Deily  added the comment:

test_strsignal is failing on macOS.

==
FAIL: test_strsignal (test.test_signal.PosixTests)
--
Traceback (most recent call last):
  File 
"/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_signal.py", line 
61, in test_strsignal
self.assertEqual(signal.strsignal(signal.SIGINT), "Interrupt")
AssertionError: 'Interrupt: 2' != 'Interrupt'
- Interrupt: 2
?  ---
+ Interrupt


Also:
http://buildbot.python.org/all/#/builders/14/builds/779/steps/4/logs/stdio
http://buildbot.python.org/all/#/builders/93/builds/435/steps/4/logs/stdio

--
nosy: +ned.deily
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



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

If every Windows 7 computer is generating zipfiles which are invalid in this 
way, that would be a pretty strong argument for Python (and other tools) to 
accept it. But if that was the case, I would also expect that there would be 
many more issues about it.

Are the files you're compressing large (multi-GB)? Python only uses the zip64 
format when the files are too big for the older zip format; maybe Windows is 
doing the same. Even in that case, I'm still surprised that more people don't 
hit it.

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-03-12 Thread John Andersen

John Andersen  added the comment:

I've updated my pull request to do the following:

1. Provide a new AsyncTestCase class which is a subclass of TestCase
2. Run coroutines with a coroutineRunner property.
  a. In 3.6 this calls get_evet_loop.run_until_complete
  b. In 3.7 > this calls asyncio.run
3. setUp, testMethod s, and tearDown can be either async or not

Thoughts?

--

___
Python tracker 

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



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Guillaume Carre

Guillaume Carre  added the comment:

Hi,
In my case the zip file was created from windows 7  context menu (send to)
Regards,
Guillaume

On Mon, Mar 12, 2018 at 5:08 AM, Thomas Kluyver 
wrote:

>
> Thomas Kluyver  added the comment:
>
> I found source code for some other projects handling the same data. They
> all seem to agree that it should be 1:
>
> - Golang's zip reading code: https://github.com/golang/go/blob/
> f7ac70a56604033e2b1abc921d3f0f6afc85a7b3/src/archive/zip/
> reader.go#L536-L538
> - A C contrib file with zlib: https://github.com/madler/zlib/blob/
> cacf7f1d4e3d44d871b605da3b647f07d718623f/contrib/minizip/zip.c#L620-L624
> - Code from Info-ZIP, which is used by many Linux distros, is a bit less
> clear, but it has an illuminating comment:
>
> if ((G.ecrec.number_this_disk != 0x) &&
> (G.ecrec.number_this_disk != ecloc64_total_disks - 1)) {
>   /* Note: For some unknown reason, the developers at PKWARE decided to
>  store the "zip64 total disks" value as a counter starting from 1,
>  whereas all other "split/span volume" related fields use 0-based
>  volume numbers. Sigh... */
>
> So I think you've got an invalid zip file. If it's otherwise valid, there
> might be a case for Python tolerating that particular mistake. But it's
> probably better to fix whatever is making the incorrect zip file, because
> other tools are also going to reject it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33056] LEaking files in concurrent.futures.process

2018-03-12 Thread Thomas Moreau

New submission from Thomas Moreau :

The recent changes introduced by https://github.com/python/cpython/pull/3895 
leaks some file descriptors (the Pipe open in _ThreadWakeup).
They should be properly closed at shutdown.

--
components: Library (Lib)
messages: 313656
nosy: tomMoral
priority: normal
pull_requests: 5845
severity: normal
status: open
title: LEaking files in concurrent.futures.process
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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Robert Smallshire

Robert Smallshire  added the comment:

Apologies for the email splurge. That's the first and last time I'll use the 
email interface to bugs.python.org.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Robert Smallshire

Robert Smallshire  added the comment:

To respond to Raymond's points:

1) Nobody is suggesting that every float method should also be available on
int.  Clearly some methods on float are not applicable to int.

2) Taken narrowly, you're right that is_integer() does nothing useful for
int.  Neither do imag, denominator, __floor__, or __trunc__. They're all
present so we can successfully use integers in duck-typing situations along
with the other number types. My claim is that int.is_integer() is useful
for the same reasons.

The problem isn't that you or I don't know that we should write a == int(a)
to be portable, the problem is that code that *already* uses x.is_integer()
fails hard when x happens to be an int. As I've demonstrated, some built-in
operators and functions can return either int or float, even when the
operand types are all int, depending only on the *values* of the operands.

This wouldn't matter if nobody ever wrote f.is_integer(), and instead used
the trivially portable solution, but they do, and at your behest: In 2011
you published "f.is_integer() is the new way to test whether a float is
integral. The old way, x==int(x), is history."  The reality is that folks
often write Python functions which accept *numbers*, without giving too
much thought to whether calling my_func(42.0) will work, but my_func(42)
will cause an unhandled exception that nobody is expecting. Indeed, one of
the joys of Python is that we often don't need to overthink this.

The trivial portable solution is also nearly three times slower than
float.is_integer() and int.is_integer(). Moreso if you package it up in a
function so it can be applied to more complex expressions in, say, a
comprehension, where an intermediate assignment is not possible.

I'm not the only person to be thrown by this. See this:

is_integer() not working: https://stackoverflow.com/
questions/17170226/is-integer-not-working/17170511

and this:

   https://www.reddit.com/r/learnpython/comments/4tp4hy/
need_help_with_identify_number_as_integer/

and this

https://wiesmann.codiferes.net/wordpress/?p=13366

Furthermore, once the is_integer() method is discovered, it leads to folks
writing odd code in order to leverage it, such as always converting user
integer input to float in order to check that it's really is an integer
(which of course subtly limits the precision of allowable integers).
There's an example of this on page 14 of the book *Doing Math With Python*.
https://www.amazon.com/Doing-Math-Python-Programming-Statistics/dp/1593276400

Other prolific and widely respected Python programmers have described this
behaviour as "kind of nuts" (though I'm not going to involve them here).
The behaviour has also invited unfortunate comparisons with similar
non-obvious behaviour in Javascript.

3) I'd be very surprised if the presence of this method on int caused any
more confusion, or impediment to learning than do the presence of int.imag
or int.denominator.

4) I'm less bothered about the numeric tower aspect than I am about
duck-type compatibility between the built-in types int and float. That
said, a key part of what I think is your concern about creating work for
subclass implementers can be addressed by providing a default
implementation Real.is_integer() in terms of int(x) == x.

5) The decimal spec doesn't require an is_decimal function, but it doesn't
forbid it either. In any case, the Decimal implementation already
implements is_integer internally as `cpx_mpd_isinteger` – and uses it a
great deal, which demonstrates its utility. My patch simply exposes it to
Python. There's no danger of violating any specification, unless that
specification says that you must not implement a method called is_integer,
which it doesn't, especially as we would be using a definition which is
already de facto compatible with the standard.  I don't care very much
about Decimal either for my own work, especially as it already stands apart
from the numeric tower. I implemented it to be consistent with my argument
about duck typed numbers (which still largely holds for Decimal, except for
floor division and modulus I believe).

Solutions for which use `a == int(a)` or `a == a.to_integral_value()` fail
for NaN and infinities, whereas float.is_integer() is more robust. It turns
out the trivial portable solution isn't so trivial, or so portable, if
implemented robustly, performantly and with duck-typing in mind.

Ultimately, my argument is one about duck typing across numbers types. If
if that abstraction isn't valued, I have nowhere to go.

*Robert Smallshire | *Managing Director
*Sixty North* | Applications | Consulting | Training
r...@sixty-north.com | T +47 63 01 04 44 | M +47 924 30 350
http://sixty-north.com

On 11 March 2018 at 05:58, Raymond Hettinger  wrote:

>
> Raymond Hettinger  added the comment:
>
> Sorry Robert, but I object to this going forward.
>
> 1) We do not and 

[issue33055] bytes does not implement __bytes__()

2018-03-12 Thread FHTMitchell

New submission from FHTMitchell :

Every object which has a corresponding dunder protocol also implements said 
protocol with one exception:


>>> 'hello'.__str__()
'hello'

>>> (3.14).__float__()
3.14

>>> (101).__int__()
101

>>> True.__bool__()
True

>>> iter(range(10)).__iter__()


>>> b'hello'.__bytes__()
---
AttributeErrorTraceback (most recent call last)
> 1 b'hello'.__bytes__()

AttributeError: 'bytes' object has no attribute '__bytes__'

This was brought up on SO as being inconsistent: 
https://stackoverflow.com/questions/49236655/bytes-doesnt-have-bytes-method/49237034?noredirect=1#comment85477673_49237034

--
components: Interpreter Core
messages: 313653
nosy: FHTMitchell
priority: normal
severity: normal
status: open
title: bytes does not implement __bytes__()
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32608] Incompatibilities with the socketserver and multiprocessing packages

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hi Michael, sorry for the silence on this issue.  I think the ProcessingMixIn 
feature is a good idea, I'll give the PR a review when I get the time.

--
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

Adding a bit of context from my prior email discussion with Hartmut: CPython 
actually reads sys.warnoptions at the end of Py_Initialize (its the last thing 
we do before the function returns).

It also reads sys._xoptions during startup, since that's one way of enabling 
settings like dev mode and UTF-8 mode.

That means that even though PySys_AddWarnOption and PySys_AddXOption weren't 
documented as being safe to call before Py_Initialize, they likely *won't* have 
the desired effect if an embedding application defers calling them until later, 
and their absence from the list of "safe to call before Py_Initialize" 
functions was itself a documentation bug.

For 3.8, I'd hoped that the resolution might be as simple as a hard requirement 
on embedding applications to call PyRuntime_Initialize() before doing 
*anything* with the C API, but including the "internal/pystate.h" header and 
adding a call to _PyRuntime_Initialize() wasn't enough to keep the draft test 
case in my patch from segfaulting :(

--

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is now pushed.  Thank you Antoine!

--
nosy: +pitrou

___
Python tracker 

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



[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread STINNER Victor

STINNER Victor  added the comment:

Python documentation was enhanced in Python 3.7 to explicitly list all 
functions safe to call *before* Py_Initialize():

https://docs.python.org/dev/c-api/init.html#before-python-initialization

PySys_AddWarnOption() is not part of the list. While it's not in the list, I'm 
kind of unhappy that we broke your use case: it wasn't my intent. Because I 
broken your use case with this change part of the big bpo-32030 refactoring:

commit f7e5b56c37eb859e225e886c79c5d742c567ee95
Author: Victor Stinner 
Date:   Wed Nov 15 15:48:08 2017 -0800

bpo-32030: Split Py_Main() into subfunctions (#4399)

IHMO the regression is that PySys_AddWarnOption() now calls 
_PySys_GetObjectId(): in Python 3.6, it wasn't the case.

Python 3.6 code:
---
void
PySys_AddWarnOptionUnicode(PyObject *unicode)
{
if (warnoptions == NULL || !PyList_Check(warnoptions)) {
Py_XDECREF(warnoptions);
warnoptions = PyList_New(0);
if (warnoptions == NULL)
return;
}
PyList_Append(warnoptions, unicode);
}
---

Again, it's a bad idea to use the Python API before Py_Initialize(): you likely 
have to build a Unicode string and you use a list, whereas these two object 
types are not properly initialized...

The PEP 432 and bpo-32030 prepared Python to have a much better API in Python 
3.8 for embedding Python. You will be able to use a wchar_t* string to pass 
warning options.

--

___
Python tracker 

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



[issue33054] unittest blocks when testing function using multiprocessing.Pool with state spawn

2018-03-12 Thread Kenneth Chik

New submission from Kenneth Chik :

I am not sure if this is python or OS problem, I just installed Ubuntu 18.04 
LTS which comes with python3 v3.6.4. When I try to unittest code which contains 
multiprocessing.Pool with spawn, the unittest.main() blocks after completing 
all the tests. This problem did not exist on prior versions of Ubuntu/Python. 
Below is the printout after I KeyboardInterrupt the process.


...
--
Ran 13 tests in 10.472s

OK
^CException ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 1294, in _shutdown
t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt

The spawned processes have all completed and not visible on the process list, 
but the semaphore_tracker process is still there. This is the same with 
previous working system though. Thanks.

--
messages: 313648
nosy: Kenneth Chik
priority: normal
severity: normal
status: open
title: unittest blocks when testing function using multiprocessing.Pool with 
state spawn
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

With both Eric's and Serhiy's updates merged, and issue 33039 broken out for 
the __index__ oddities, this is resolved now.

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

One quibble with Raymond's response:

> 2) Your use case is trivially solved in a portable, trivial, and readable > 
> way:
> 
>a == int(a)

For Decimal, I'd recommend using `a == a.to_integral_value()` instead. Using  
`a == int(a)` will be inefficient if `a` has large exponent, so it's not a good 
general-purpose solution (though it's probably good enough in most real-world 
cases).

Here's an extreme example:

In [1]: import decimal
In [2]: x = decimal.Decimal('1e9')
In [3]: %timeit x == int(x)
1.42 s ± 6.27 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [4]: %timeit x == x.to_integral_value()
230 ns ± 2.03 ns per loop (mean ± std. dev. of 7 runs, 100 loops each)

--

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-12 Thread Joshua Bronson

Joshua Bronson  added the comment:

I'll share the use case that prompted me to submit this PR in the first place.

I am the author of bidict (https://pypi.python.org/pypi/bidict), which provides 
a bidirectional dict class. A bidict is just like a dict, except it 
automatically maintains its inverse bidict, which is accessible via its .inv 
attribute. To prevent a bidict and its inverse from creating a strong reference 
cycle, a weak ref is used to store the reference one direction.

bidicts implement my BidirectionalMapping ABC, which extends 
collections.abc.Mapping to include the .inv abstractproperty. 
BidirectionalMapping overrides __subclasshook__ so that outside implementations 
that don't subclass it explicitly may still be considered subclasses.

Recently, I tried something like `issublass('foo', BidirectionalMapping)`, and 
got the "cannot create weak reference to 'str' object" error. Because this 
error message differs from the (much more helpful) "arg 1 must be a class" 
error message that you get when you do e.g. `issubclass('foo', Mapping)`, I 
thought there might be a bug somewhere in my code. Then I looked deeper and 
found where this is really coming from.

I experimented more and noticed that `issubclass('foo', Reversible)` raises 
AttributeError, which isn't even the same type of error.

The exceptions that are raised in these cases seem like an abstraction leak. 
The error messages do not help users immediately realize what they did wrong 
and how they can fix it; more knowledge of internals is required to make sense 
of what's going on than should be needed. The inconsistency in these errors is 
a further problem. The same mistake should not cause three different errors 
unless there is some really good reason. This seems unintentional. Can any of 
the original authors say whether this is working as intended or if this is in 
fact an oversight?

The current behavior causes confusion for both less experienced and more 
experienced Python users alike. (Would anyone else here have correctly 
predicted all of the different errors that the examples above cause? How many 
other Python experts could have?) For less experienced users, Python's general 
consistency and predictability, lack of gotchas, and good errors are some of 
its best features. This is such an exception that it seems like a bug.

I'm happy for some other patch than the one I submitted in 
https://github.com/python/cpython/pull/5944 to land if necessary, as long as 
something fixes this. And fwiw, +1 for 3.7, unless anyone can demonstrate any 
credible risk.

Thanks for your consideration :)

--

___
Python tracker 

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



[issue29712] --enable-optimizations does not work with --enable-shared

2018-03-12 Thread Eric Dujardin

Eric Dujardin  added the comment:

I have the same error when building 3.6.4, however not exactly with the same 
options. Some context first:
$ lsb_release -d; lscpu |head -1
Description:Ubuntu 14.04.5 LTS
Architecture:  x86_64
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4

I'm careful to start from a freshly untarred source tree. 

This configuration builds a working installation:
$ ./configure --prefix=$PYTHON --enable-optimizations --enable-shared 
LDFLAGS="-Wl,-rpath=$PYTHON/lib -Wl,-Bsymbolic-functions -Wl,-z,relro" 
--with-computed-gotos --with-system-ffi --with-fpectl --with-system-libmpdec
$ make profile-opt

However, I get the reported error when CFLAGS="-mtune=core-avx2  
-march=core-avx2" is added. 

This set of options works fine without --enable-shared, i.e. this is what I am 
using for static builds:
$ ./configure --prefix=$PYTHON --enable-optimizations LDFLAGS="-Wl,-z,relro" 
--with-computed-gotos --with-system-ffi --with-fpectl --with-system-libmpdec 
CFLAGS="-mtune=core-avx2 -march=core-avx2 -Wformat -Werror=format-security"

Note, with the following configuration (-mtune without -march), compilation 
just blocks on Objects/memoryobject.c (ie, gcc never completes):
$ ./configure --prefix=$PYTHON --enable-optimizations --enable-shared 
LDFLAGS="-Wl,-rpath=$PYTHON/lib -Wl,-Bsymbolic-functions -Wl,-z,relro" 
--with-computed-gotos --with-system-ffi --with-fpectl --with-system-libmpdec 
CFLAGS="-mtune=core-avx2  -Werror=format-security"
$ make profile-opt

--
nosy: +eric957

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan

Change by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

I don't think we made any start-up changes that were specific to 
PySys_AddWarnOption, so my suspicion is that the crash is going to be related 
to a change in the constraints on either the unicode object creation or the 
list append operation.

The attached patch adds a new test case (I also cleaned up several other 
details related to test_embed execution in order to more easily see where the 
segfault happens on failure).

Unfortunately, it isn't yet suitable for use with `git bisect`, as I checked 
3.7.0a3 (the earliest tag where the patch applied cleanly), and that commit 
also segfaults. So setting up for git bisect testing (as per the hot-fix 
example in https://git-scm.com/docs/git-bisect#_examples ) will require:

* checking the commit where "test_embed.py" was extracted from "test_capi.py" 
and seeing whether or not that segfaults
* if it *doesn't* segfault, git bisect between there and v3.7.0a3
* if it *does* segfault, make a revised test patch that applies cleanly to 
early versions, and then go back through the 3.7.0 pre-releases to find one 
that works

--
keywords: +patch
nosy: +ncoghlan
Added file: https://bugs.python.org/file47477/bpo-33042-test-case.diff

___
Python tracker 

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



  1   2   >