[issue33955] Implement PyOS_CheckStack on macOS using pthread_get_stack*_np

2018-07-13 Thread Dong-hee Na


Dong-hee Na  added the comment:

FYI, I've updated the patch to use rlim_cur() on the main thread when 
pthread_get_stacksize_np() is not accurate. This way works pretty well on my 
local machine.
Enjoy your travel!

--

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7815

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset c721472fb83d1f7c7606bcf33ba2d42d6127a764 by Miss Islington (bot) 
in branch '3.7':
bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)
https://github.com/python/cpython/commit/c721472fb83d1f7c7606bcf33ba2d42d6127a764


--
nosy: +miss-islington

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7814

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 16dfca4d829e45f36e71bf43f83226659ce49315 by INADA Naoki in branch 
'master':
bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)
https://github.com/python/cpython/commit/16dfca4d829e45f36e71bf43f83226659ce49315


--

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2018-07-13 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue30400] Race condition in shutil.copyfile(): source file replaced file during copy

2018-07-13 Thread Preston Moore


Preston Moore  added the comment:

I like Victor's idea for updating public functions to support file descriptors. 
 I could submit a patch for this instead if desired.

In the meantime, I've updated the pull request for this issue so the patch I 
originally created that compares inode numbers applies to 3.8.  I've included a 
test case as well.

I think Victor's idea may be superior to the inode comparison. It is in the 
same spirit as glibc preferring openat() rather than open() 
(https://lwn.net/Articles/738694/) to counter directories
changing during an operation.  

Alternatively, coreutils 
(https://github.com/coreutils/coreutils/blob/439741053256618eb651e6d43919df29625b8714/src/copy.c#L1051)
deals with this issue using inode comparison.  Perhaps this is because they 
don't have a clean way of supporting both paths and fds like we do with Python.

This overall issue has extra cause for concern because it can be exploited by 
an attacker as a security vulnerability 
(https://wiki.sei.cmu.edu/confluence/display/c/FIO45-C.+Avoid+TOCTOU+race+conditions+while+accessing+files).
  Additionally, Python projects have encountered similar bugs when 
re-implementing file operations themselves 
(https://code.djangoproject.com/ticket/8479)

I would be happy to fix this bug in any other spots identified using whichever 
strategy is preferred.  If it is possible to get functions operating on file 
descriptors without breaking public functions I think that is the strategy we 
should prefer.   If that is not possible, the above inode comparison strategy 
provides improvement if not a complete fix.
 
Should I submit additional bug reports for these other cases or should I just 
follow on here?

--

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-07-13 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue34110] cPickle may raise AttributeError when loading concurrently in threads

2018-07-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue34110] cPickle may raise AttributeError when loading concurrently in threads

2018-07-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This behaviour also happens on the current master.

--
nosy: +pablogsal

___
Python tracker 

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



[issue32584] Uninitialized free_extra in code_dealloc

2018-07-13 Thread Brett Cannon


Brett Cannon  added the comment:

co_extra_freefuncs is an array of pointers, so there's no way for it to be 
uninitialized unless you didn't initialize the interpreter state 
(https://github.com/python/cpython/blob/b193fa996a746111252156f11fb14c12fd6267e6/Include/pystate.h#L155).
 And looking at your gdb session it shows the memory wipeout pattern which 
means you're accessing an interpreter state that has already been freed itself. 
IOW I don't think this is a PEP 523 issue specifically.

--

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-07-13 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-07-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

I assume it's decided what to do -- it may not be easy to do it, but I wouldn't 
call it controversial at this point.

--

___
Python tracker 

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



[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2018-07-13 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue34102] None.splitlines raises AttributeError in email.feedparser

2018-07-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

What you can do is report to pip and ansible-lint that there is a bug somewhere 
in one of the two packages, or try to figure out which and report it to one of 
them.

--

___
Python tracker 

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



[issue34102] None.splitlines raises AttributeError in email.feedparser

2018-07-13 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: local variable 'parts' referenced before assignment in feedparser in 
email module -> None.splitlines raises AttributeError in email.feedparser

___
Python tracker 

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



[issue34102] local variable 'parts' referenced before assignment in feedparser in email module

2018-07-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

An exception is not a crash.  An intended exception is not even a bug.  A bug 
is a discrepancy between behavior and doc.  In this case, 
email.parser.Feedparser is imported from email.feedparser. Its doc
https://docs.python.org/2.7/library/email.parser.html#feedparser-api
says
"feed(data)
Feed the FeedParser some more data. data should be a string containing one 
or more lines."
In addition, html.parser.HTMLParser.feed(data) say "data must be str."

For either, behavior upon passing anything else is undefined.  Defining the 
behavior for None, and defining it to be 'return something' rather than 'raise 
something', would be an enhancement.  Such enhancements are only added, if 
deemed desirable, in future versions.

(Note: I recommend against resubmitting this for 3.8.  Masking bugs in 3rd 
party code is contrary to policy.  There would have to be a positive use-case 
of benefit large enough to multiple users to overcome the masking deficit.)

--
nosy: +terry.reedy
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed
type: crash -> enhancement

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2018-07-13 Thread Diego Argueta


Diego Argueta  added the comment:

Bug still present in 3.7.0, now seeing it in 3.8.0a0 as well.

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



[issue34100] Same constants in tuples are not merged while compile()

2018-07-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think (space) 'performance' would be a better label, as this is strictly an 
implementation improvement, not a language change.  But we often (usually? 
sometimes?) limit performance improvements to the 'next version' so we have the 
alpha/beta/candidate releases to discover possible regressions.

I think this is worth considering just because the pattern is so odd.  But if 
this is ironed out as part of a broader and better patch, great.

--
nosy: +terry.reedy
stage:  -> needs patch

___
Python tracker 

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



[issue34107] root.warning('msg') output format modified by logging.warning('msg')

2018-07-13 Thread Michael Kearney


Michael Kearney  added the comment:

Thanks for the clarification and doc pointers. I saw "lastResort" attribute in 
the code 
but had not fully understood what was going on. I am not certain I really do 
now, but that's ok. That's why we read docs, read and write
code. Eventually it starts making sense.
It appears that there is history to contend with or complications provoked by 
threads. 

I had not yet read the lastResort discussion in the documentation. That's deep 
in the 
advanced tutorial, I was getting tripped up by simple examples that I concocted 
from 
very simple cases, which can be on the fringes of actual usage. I wonder why 
"lastResort" differs from the built-in default. 

I was playing with basicConfig because I wanted to experiment with formatting 
and level,
and I managed to generate messages that seemed unrelated to formating I had 
specified.


For now it appears that after
import logging

I can add 
logging.warning('')

and achieve what I want. I get the default format where I expect rather than 
lastResort format.

I prefer the default format that I get from the internal call to basicConfig.
I can imagine the there will be a situation where I want the even simpler
"last resort format".

--

___
Python tracker 

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



[issue34095] [2.7] test_idle fails with: /usr/bin/xvfb-run: line 181: 3617 Segmentation fault

2018-07-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think we should first determine whether xvfb is required to get the segfault, 
and second, where it fails.

Does
 -m test.regrtest -v -m test_io test_idle
fail and fail in the same place, the 11th and last test run in the module? If 
not, what about

xvfb-run  -m ...?

In either case, inserting prints in 'test_writelines', which has multiple 
asserts, should determine where it fails.

Test.test_idle checks that tkinter can imported, which in turn imports 
_tkinter, which tries to connect to a windowing system. Running with xvfb 
satisfies this.  Test_idle finds and run the test modules in idlelib.idle_test. 
 Individual modules and classes somewhat redundantly import test.support and 
check "requires('gui')".  So IDLE gui tests, and, I  am fairly sure, the 
tkinter gui tests, also require -ugui or -uall to run.  

Test_io is not a gui test, so does not need or run "requires('gui')", and hence 
does not need -ugui.  On the other hand, it imports PyShell, which imports 
tkinter and _tkinter, and hence would need xvfb-run on a headless server, as 
opposed to a workstation with screen.  Erich, I assume you are running on the 
latter.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-13 Thread Brett Cannon


Brett Cannon  added the comment:

I would still fix it as I suspect there will be a burst of users of this come 
2020 and at this point it won't be a compatibility issue going forward since 
3.4 is so old. :)

--

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset cf21d0031dd84544d4108765553c2b03dfe726c5 by Jason R. Coombs (Miss 
Islington (bot)) in branch '3.7':
bpo-34108: Fix double carriage return in 2to3 on Windows (GH-8271) (#8275)
https://github.com/python/cpython/commit/cf21d0031dd84544d4108765553c2b03dfe726c5


--

___
Python tracker 

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



[issue34110] cPickle may raise AttributeError when loading concurrently in threads

2018-07-13 Thread Guoqiang Zhang


Change by Guoqiang Zhang :


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

___
Python tracker 

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



[issue27741] datetime.datetime.strptime functionality description incorrect

2018-07-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The same part repeated at 
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior 
can also be corrected. It seems both of them use _strptime which returns 
microseconds but only datetime.datetime.strptime uses it with time.strptime 
ignoring it.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34110] cPickle may raise AttributeError when loading concurrently in threads

2018-07-13 Thread Guoqiang Zhang


New submission from Guoqiang Zhang :

If two threads use cPickle to load objects simultaneously, one thread may raise 
an AttributeError. This problem is caused by the partially loaded module.

To reproduce, create a file 'foo.py':
import time
time.sleep(0.1)
class foo():
pass

Then in main.py:
import threading
import cPickle 

threads = [threading.Thread(target=cPickle.loads, args=('cfoo\nfoo\np0\n.',)) 
for _ in range(2)]
[thread.start() for thread in threads]
[thread.join() for thread in threads]

Run main.py, there should be a crash:
Exception in thread Thread-2:
Traceback (most recent call last):
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
 line 810, in __bootstrap_inner
self.run()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
 line 763, in run
self.__target(*self.__args, **self.__kwargs)
AttributeError: 'module' object has no attribute 'foo'

--
components: Library (Lib)
messages: 321627
nosy: sangongs
priority: normal
severity: normal
status: open
title: cPickle may raise AttributeError when loading concurrently in threads
type: crash
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



[issue34063] binhex REASONABLY_LARGE = 32768 so what is 128000

2018-07-13 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I tried changing it to REASONABLY_LARGE and could see no test failures. It 
seems the literal was added as part of a220e67a9ed94d66b81e393a3bb9e6acd10068c1 
(23/03/1996) and REASONABLY_LARGE was before that as added part of 
fcdffeaaa144147f43224a641b668df539ffb6fe (07/08/1995)

➜  cpython git:(master) time ./python -Werror -m unittest -v test.test_binhex
test_binhex (test.test_binhex.BinHexTestCase) ... ok
test_binhex_error_on_long_filename (test.test_binhex.BinHexTestCase) ... ok

--
Ran 2 tests in 0.002s

OK
./python -Werror -m unittest -v test.test_binhex  0.23s user 0.03s system 93% 
cpu 0.279 total

--
nosy: +xtreak

___
Python tracker 

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



[issue34109] Accumulator bug

2018-07-13 Thread Victor Pires


Victor Pires  added the comment:

Sorry, you are right

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



[issue34109] Accumulator bug

2018-07-13 Thread Victor Pires


Change by Victor Pires :


Removed file: https://bugs.python.org/file47689/Bug.html

___
Python tracker 

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



[issue34109] Accumulator bug

2018-07-13 Thread Tim Peters


Tim Peters  added the comment:

?  I expect your code to return -1 about once per 7**4 = 2401 times, which 
would be about 400 times per million tries, which is what your output shows.

If you start with -5, and randint(1, 7) returns 1 four times in a row, r5 is 
left at -5 + 4 = -1.

--
nosy: +tim.peters

___
Python tracker 

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



[issue34109] Accumulator bug

2018-07-13 Thread Victor Pires


New submission from Victor Pires :

A function to return a number from 1 to 5 (inclusive) sometimes returns -1 when 
called thousands of times.

from random import randint
import sys

def rand5():
"""Returns a random integer from 1 to 5 (inclusive)"""
r5 = -5 # This *should* accumulate from zero to 24
for _ in range(4):
r5 += randint(1, 7)

for i in range(5):
if (r5 == -1): # BUG: This should never happen, r5 = [0; 24]
return r5
if (r5 in [(i + j*5) for j in range(5)]):
return (i + 1)


d = {key: 0 for key in range(-1, 6)} # Should only be range(1, 6)...

for _ in range(int(1e6)): # One million
d[rand5()] += 1

print(sys.version)
for key in d:
print(key, d[key])



$ python2.7 Bug.py
2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609]
(0, 0)
(1, 200514)
(2, 200273)
(3, 200689)
(4, 199588)
(5, 198543)
(-1, 393)

$ python3.5 Bug.py
3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609]
0 0
1 200956
2 200529
3 200017
4 199047
5 199030
-1 421

$ python3.6 Bug.py
3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)
[GCC 7.2.0]
-1 421
0 0
1 200562
2 202025
3 200116
4 198899
5 197977

$ python3.7 Bug.py
3.7.0 (default, Jun 28 2018, 13:15:42)
[GCC 7.2.0]
-1 433
0 0
1 200039
2 200676
3 200629
4 199322
5 198901

--
components: Interpreter Core
files: Bug.html
messages: 321623
nosy: vicpires
priority: normal
severity: normal
status: open
title: Accumulator bug
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47689/Bug.html

___
Python tracker 

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



[issue34066] Possible resource warning in "with open()"

2018-07-13 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:

> Would it not be easy to add a named optional keyword
> argument, like "stable=True"?

My pull request did it.

But for now, I get hint on ML and overwrote my PR with another way: Use 
FLAG_REF for all interned strings.

--

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki

INADA Naoki  added the comment:

When I commented out the fix:

$ ./python -c 'int("こんにちは")'
python: Objects/unicodeobject.c:484: _PyUnicode_CheckConsistency: Assertion 
`PyUnicode_READ(kind, data, ascii->length) == 0' failed.
Aborted

I added this to test cases.

--

___
Python tracker 

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



[issue34075] asyncio: We should prohibit setting a ProcessPoolExecutor in with set_default_executor

2018-07-13 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Agree, restricting to ThreadPoolExecutor sounds reasonable.

A custom executor may have the same problem as ProcessPoolExecutor.

Moreover it can work under same scenarios but crash with other third-party libs.

--

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7811

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset cafaf0447b950fd4f59edd8cbde040c61ae528f8 by Jason R. Coombs in 
branch 'master':
bpo-34108: Fix double carriage return in 2to3 on Windows (#8271)
https://github.com/python/cpython/commit/cafaf0447b950fd4f59edd8cbde040c61ae528f8


--

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2018-07-13 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Jonas H.


Jonas H.  added the comment:

The assertion in the patched code, yes. The segfault in the unpatched code, no.

--

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't think this can be tested with Python code, unless you can make sure 
> the target buffer _PyUnicode_TransformDecimalAndSpaceToASCII operates on is 
> initialised with garbage bytes.

We just have to call float() with a non-ASCII string, no? An assertion must 
fail without the fix when Python is compiled in debug mode.

--

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Jonas H.


Jonas H.  added the comment:

I don't think this can be tested with Python code, unless you can make sure the 
target buffer _PyUnicode_TransformDecimalAndSpaceToASCII operates on is 
initialised with garbage bytes.

--

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

The regression never got to 3.6, so this issue likely only affects 3.7+.

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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread Berker Peksag


Berker Peksag  added the comment:

I think we can now close this one. Thanks for the report, David, and thanks for 
the PR Andreas.

(And thanks for creating and maintaining this awesome module for years, Thomas 
:))

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Is it possible to write a reproducer in Python?

The string returned by _PyUnicode_TransformDecimalAndSpaceToASCII() is still a 
NUL-terminated, but the NUL can be far past the end of the string.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset 083a836937b734fcc81b2482d2c52825caff0115 by Miss Islington (bot) 
in branch '3.6':
bpo-4260: Document that ctypes.xFUNCTYPE are decorators (GH-7924)
https://github.com/python/cpython/commit/083a836937b734fcc81b2482d2c52825caff0115


--

___
Python tracker 

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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2018-07-13 Thread Christian Tismer


Christian Tismer  added the comment:

Why must this become slower?

To my knowledge, many projects prefer marshal over pickle
for suitable simple objects because it is
so very fast. I would not throw that away:

Would it not be easy to add a named optional keyword
argument, like "stable=True"?

--
nosy: +Christian.Tismer

___
Python tracker 

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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset 08c1da71030e0d6019b3493e0ffaf060a6aa5d8e by Miss Islington (bot) 
in branch '3.7':
bpo-4260: Document that ctypes.xFUNCTYPE are decorators (GH-7924)
https://github.com/python/cpython/commit/08c1da71030e0d6019b3493e0ffaf060a6aa5d8e


--
nosy: +miss-islington

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-13 Thread Berker Peksag


Berker Peksag  added the comment:

Brett, what do you think about this issue since Python 3.4 is pretty old now. 
Should I convert my patch to GitHub PR or close this issue as 'wontfix'?

--
type:  -> enhancement
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



[issue32046] 2to3 fix for operator.isCallable()

2018-07-13 Thread Dong-hee Na


Dong-hee Na  added the comment:

@serhiy.storchaka
If we don't have plans with backporting patches than we can close this issue.

--

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


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

___
Python tracker 

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



[issue31979] Simplify converting non-ASCII strings to int, float and complex

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7810

___
Python tracker 

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



[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


--
title: float(unicode) may cause segmentation fault -> int(s), float(s) and 
others may cause segmentation fault

___
Python tracker 

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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Petr Viktorin


Petr Viktorin  added the comment:

Which third-party utilities support these? As I said, AFAIK `zip` on my system 
does not.

I assume the loss of data is the reason we have an error now -- if that wasn't 
a concern, zipfile could just silently bump the timestamp to 1980.

When the extensions are implemented, `strict_timestamps=False` should 
*additionally* use the extension, but default should still be to raise the 
error (to prevent metadata loss when decompressing with older/simpler tools).

--

___
Python tracker 

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



[issue34096] [2.7] test_audioop.test_max() failed: AssertionError: -2147483648 != 2147483648L

2018-07-13 Thread Erich Eckner


Erich Eckner  added the comment:

yes, indeed, I just tested with your three flags-variables set and the 
build+test succeeded - I'll have to figure out what the minimal change is, 
though :-)

--

___
Python tracker 

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



[issue34087] float(unicode) may cause segmentation fault

2018-07-13 Thread STINNER Victor


STINNER Victor  added the comment:

It might be a duplicate of bpo-33954: bug in 
_PyUnicode_InsertThousandsGrouping().

--

___
Python tracker 

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



[issue34096] [2.7] test_audioop.test_max() failed: AssertionError: -2147483648 != 2147483648L

2018-07-13 Thread STINNER Victor


STINNER Victor  added the comment:

I installed Fedora 28 in 32-bit (GCC 8.1.1) in a VM to try to reproduce the 
bug, but I failed to reproduce it.

Erich Eckner: IMHO your issue comes from a C flag. Try to loop on:

touch Modules/audioop.c && make && ./python -m test test_audioop

And remove flags from PY_CFLAGS in Makefile, one by one, until the bug goes 
away, to try to identify which C flags causes your issue.

--

___
Python tracker 

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



[issue34087] float(unicode) may cause segmentation fault

2018-07-13 Thread INADA Naoki

INADA Naoki  added the comment:

Very thanks!  I found I set `export PYTHONMALLOC=pymalloc_debug`.
That's why I can't reproduce it.

Now I can reproduce and I get where memory is broken, and understood what cause:

Python traceback is:
Traceback (most recent call first):
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 767, in __init__
self.literal = float(var)
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 646, in __init__
var_obj = Variable(constant).resolve({})
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 568, in compile_filter
return FilterExpression(token, self)
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/templatetags/i18n.py",
 line 368, in do_translate
message_string = parser.compile_filter(bits[1])
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 481, in parse
compiled_result = compile_func(self, token)
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/loader_tags.py",
 line 233, in do_block
nodelist = parser.parse(('endblock',))
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 481, in parse
compiled_result = compile_func(self, token)
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 198, in compile_nodelist
return parser.parse()
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/base.py",
 line 160, in __init__
self.nodelist = self.compile_nodelist()
  File 
"/home/inada-n/t/bpo34087/testproj/v38/lib/python3.8/site-packages/django/template/loaders/base.py",
 line 30, in get_template

C traceback is:

#0  0x557880378c95 in _Py_string_to_number_with_underscores 
(s=0x7ff07d8e7bc0 "\"So erstellen Sie einen Zahlungslink f?ded_blocks'", 
orig_len=39, what=0x55788046d60a "float",
obj='"So erstellen Sie einen Zahlungslink für Ihre Rechnung"', 
arg=0x7ff07d9368b0, innerfunc=0x557880276b10 ) at 
Python/pystrtod.c:410
#1  0x557880279b23 in PyFloat_FromString (v='"So erstellen Sie einen 
Zahlungslink für Ihre Rechnung"') at Objects/floatobject.c:208
#2  0x557880279cd5 in float_new_impl (x=, 
type=0x5578806e4ee0 ) at Objects/floatobject.c:1627
#3  float_new (type=, args=('"So erstellen Sie einen 
Zahlungslink für Ihre Rechnung"',), kwargs=) at 
Objects/clinic/floatobject.c.h:181
#4  0x5578802cfdc5 in type_call (type=type@entry=0x5578806e4ee0 
, args=args@entry=('"So erstellen Sie einen Zahlungslink für Ihre 
Rechnung"',), kwds=kwds@entry=0x0)
at Objects/typeobject.c:929
#5  0x55788026b3bf in _PyObject_FastCallKeywords 
(callable=callable@entry=, stack=, nargs=nargs@entry=1, kwnames=kwnames@entry=0x0)
at Objects/call.c:199
#6  0x5578802526f4 in call_function (kwnames=0x0, oparg=, 
pp_stack=) at Python/ceval.c:4600
#7  _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3183
#8  0x55788024fb17 in function_code_fastcall (co=co@entry=0x7ff07ec4f0c0, 
args=, args@entry=0x7ffc786f2330, nargs=2,
globals=globals@entry={'__name__': 'django.template.base', '__doc__': 
"\nThis is the Django template system.\n\nHow it works:\n\nThe Lexer.tokenize() 
function converts a template string
(i.e., a string containing\nmarkup with custom template tags) to tokens, which 
can be either plain text\n(TOKEN_TEXT), variables (TOKEN_VAR) or block 
statements (TOKEN_BLOCK).\n\nThe Parser(
) class takes a list of tokens in its constructor, and its parse()\nmethod 
returns a compiled template -- which is, under the hood, a list of\nNode 
objects.\n\nEach Node is responsible for c
reating some sort of output -- e.g. simple text\n(TextNode), variable values in 
a given context (VariableNode), results of basic\nlogic (IfNode), results of 
looping (ForNode), or anything el
se. The core Node\ntypes are TextNode, VariableNode, IfNode and ForNode, but 
plugin modules can\ndefine their own custom node types.\n\nEach Node has a 
render() method, which takes a Context
 and returns a string of\nthe rendered node. For example, the render() method 
of a Variable Node ret...(truncated)) at Objects/call.c:283
#9  0x55788026ad87 in _PyFunction_FastCallDict (func=, args=0x7ffc786f2330, nargs=, kwargs=0x0) at 
Objects/call.c:322
#10 0x55788026ddc1 in _PyObject_FastCallDict (kwargs=0x0, nargs=2, 
args=0x7ffc786f2330, callable=) at 
Objects/call.c:98

--
title: django: segmentation fault on random places -> float(unicode) may cause 
segmentation fault

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7808

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread Rodrigo Pinheiro Marques de Araújo

Rodrigo Pinheiro Marques de Araújo  added the comment:

I can reproduce the segmentation fault using 'testproj.tar.gz' with homebrew 
and compiled from source. MacOS X High Sierra 10.13.5 (17F77).

--

___
Python tracker 

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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 379e9d639a52766f79c7a206c5096c8333d1896f by Berker Peksag (Andrés 
Delfino) in branch 'master':
bpo-4260: Document that ctypes.xFUNCTYPE are decorators (GH-7924)
https://github.com/python/cpython/commit/379e9d639a52766f79c7a206c5096c8333d1896f


--

___
Python tracker 

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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7807

___
Python tracker 

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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can't, because Python 2.7 doesn't support it. But you will be able to pack 
files in a ZIP archive and extract them without a loss on 3.8 and with a loss 
of a timestamp on 2.7. And you will be able to use a third-party utilities for 
extracting files without a loss.

--

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
keywords: +patch
pull_requests: +7806
stage: commit review -> patch review

___
Python tracker 

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



[issue34108] 2to3 munges new lines on Windows

2018-07-13 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In issue11594, we attempted to solve the newlines issue but inadvertently 
introduced extraneous CR before CRLF newlines when running on Windows. See 
https://github.com/python/cpython/pull/6483#issuecomment-401957049 for more 
details.

--
assignee: jason.coombs
keywords: 3.7regression
messages: 321599
nosy: jason.coombs
priority: high
severity: normal
stage: commit review
status: open
title: 2to3 munges new lines on Windows
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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Petr Viktorin


Petr Viktorin  added the comment:

I'm not sure the extensions will solve this problem fully.
If an implementation that doesn't support these extensions, how does it handle 
them?

For example, if Python 3.8 implements the extensions, I use py3.8 to create a 
zipfile containing old timestamps, and then want to uncompress the file using 
Python 2.7, how do I avoid losing the timestamp information?

--

___
Python tracker 

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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are ZIP extensions which allow to save timestamps before 1980 and with 
better than 2-seconds resolution. It would be better to use this feature. But 
first we need to resolve issue17681.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17681] Work with an extra field of gzip and zip files

2018-07-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.


Jonas H.  added the comment:

Here's a Docker image that reproduces the bug.

FROM ubuntu:18.04
RUN apt update && apt install -y python3.7-dbg python3.7-venv python3-venv wget
RUN python3.7 -m venv venv
RUN venv/bin/pip install django
RUN wget https://bugs.python.org/file47688/testproj.tar.gz -O - | tar xfz -
CMD cd /testproj && /venv/bin/python manage.py runserver & sleep 5; wget -t1 
localhost:8000 >/dev/null 2>/dev/null

Of course this also works outside Docker. I have reproduced with macOS 10.13.5 
(17F77) and Ubuntu 18.04 (Docker).

On macOS it's Python 3.7.0 (default, Jun 29 2018, 20:13:13) [Clang 9.1.0 
(clang-902.0.39.2)] on darwin, installed from Homebrew.

On Ubuntu it's whatever is in the 18.04 repositories.

--

___
Python tracker 

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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Marcel Plch


Marcel Plch  added the comment:

I have created a PR for this: https://github.com/python/cpython/pull/8270

--

___
Python tracker 

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



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Marcel Plch


Change by Marcel Plch :


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

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:

@jonash What Python binary do you use?
* OS (distro and version)
* Installed from package? if so, complete package name and version.
* Installed from source? if so, step you used to install Python 3.7 (e.g. pyenv 
install 3.7)

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:

I tried it but I can't reproduce...

--

___
Python tracker 

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



[issue34096] [2.7] test_audioop.test_max() failed: AssertionError: -2147483648 != 2147483648L

2018-07-13 Thread STINNER Victor

STINNER Victor  added the comment:

Extract of attached test.pythoninfo output:

sys.maxsize: 2147483647
sysconfig[PY_CFLAGS]: -fno-strict-aliasing -march=i686 -mtune=generic -O2 -pipe 
-fstack-protector-strong -fno-plt -DNDEBUG -march=i686 -mtune=generic -O2 -pipe 
-fstack-protector-strong -fno-plt -I. -IInclude -I./Include -D_FORTIFY_SOURCE=2 
-fPIC -DPy_BUILD_CORE

I tried to reproduce the issue on my x86_64 Fedora 28 (64-bit) using:

   ./configure CFLAGS="-m32" LDFLAGS="-m32" && make

But I failed to reproduce the issue. I also tried to add 
"-fstack-protector-strong -fno-plt" but I still fail to reproduce the bug.

On interesting thing is that your CFLAGS don't contain -fwrapv. You can try the 
following command to check if gcc -v --help contains -fwrapv?

"gcc -v --help|grep -- -fwrapv"

With my french locale, for example, I see:

  -fwrapv Supposer que le débordement de l'arithmétique 
signée boucle sur la plage accessible.

You may try to force -fwrapv using ./configure CFLAGS="-fwrapv" or directly by 
adding directly the option to the OPT variable in Makefile. Example of options 
on my x86_64 Fedora and "./configure":

OPT=-DNDEBUG -g -fwrapv -O3 -Wall
BASECFLAGS=  -Wno-unused-result -Wsign-compare
CONFIGURE_CFLAGS_NODIST= -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration

Note: When Python is compiled with --with-pydebug, -fwrapv is not used.

Note: Your CFLAGS use -O2 whereas Python uses -O3 by default in release mode.

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.


Jonas H.  added the comment:

Sure.

Unpack archive, create new 3.7 venv with Django (latest version is fine), 
./manage.py runserver, curl localhost:8000.

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:

@jonash Thanks!
Would you give me concrete step to run the project and reproduce the segfault?

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread STINNER Victor


STINNER Victor  added the comment:

If someone expects progress on these issues, we need to get a repository that 
we can clone to reproduce the bug. Then the code must be simplified as much as 
possible to reduce the code base. The best is when you still trigger the crash 
with less than 1000 lines of code and no or very few dependencies.

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.


Jonas H.  added the comment:

Reduced it to something that seems unicode related?

No extension modules involved. Vanilla Django project with a single url + 
template.

See testproj/urls.py and tmpl/index.html

--
Added file: https://bugs.python.org/file47688/testproj.tar.gz

___
Python tracker 

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



[issue33859] Spelling mistakes found using aspell

2018-07-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing this since the related PRs are merged.

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



[issue34087] django: segmentation fault on garbage collection in visit_decref()

2018-07-13 Thread INADA Naoki


INADA Naoki  added the comment:

I received two core files ("core" and "core.23") from fenrrir, thank you.
But I can't investigate well, sorry.
I think someone breaks memory, and SEGV happened later.
I need to reproduce it on my machine...

In core.23, SEGV happens in kill() syscall.  I can't get how it can happened.

(gdb) bt 10
#0  0x76c10187 in kill () at ../sysdeps/unix/syscall-template.S:78
#1  0x55778f71 in os_kill_impl (module=, 
signal=, pid=) at ../Modules/posixmodule.c:6749
#2  os_kill (module=, args=, nargs=) at ../Modules/clinic/posixmodule.c.h:2672
#3  0x555dd4ba in _PyMethodDef_RawFastCallKeywords (kwnames=0x0, 
nargs=140737353236984, args=0x77ee7e60, self=,
method=0x55c007a0 ) at ../Objects/call.c:651


In "core", SEGV happens in pymalloc. Pool is broken and I suppose some buffer 
overflow breaks the pool, but I'm not sure.

#0  pymalloc_alloc (ptr_p=ptr_p@entry=0x7fffee81a640, nbytes=40, ctx=) at ../Objects/obmalloc.c:1398
#1  0x5562ed78 in pymalloc_alloc (ctx=, nbytes=40, 
ptr_p=0x7fffee81a640) at ../Objects/obmalloc.c:1565
#2  _PyObject_Malloc (ctx=, nbytes=40) at 
../Objects/obmalloc.c:1555
#3  0x5561d5d5 in new_dict_with_shared_keys (keys=0x74e4c2d0) at 
../Objects/dictobject.c:607
#4  _PyObjectDict_SetItem (tp=tp@entry=0x55e8b338, dictptr=0x7fffedfe4250, 
key=key@entry='s', value=value@entry='\n  ') at ../Objects/dictobject.c:4311
#5  0x5562b2d4 in _PyObject_GenericSetAttrWithDict (dict=0x0, value='\n 
 ', name='s', obj=) at 
../Objects/object.c:1319
#6  PyObject_GenericSetAttr (obj=, name='s', 
value='\n  ') at ../Objects/object.c:1341
#7  0x5562a09f in PyObject_SetAttr (v=v@entry=, name=, value=value@entry='\n  ') at 
../Objects/object.c:978
#8  0x555c67d8 in _PyEval_EvalFrameDefault (f=, 
throwflag=) at ../Python/ceval.c:2002
#9  0x555c1787 in function_code_fastcall (co=co@entry=0x74e90930, 
args=, args@entry=0x7fffee81a930, nargs=2,
globals=globals@entry={'__name__': 'django.template.base', '__doc__': 
"\nThis is the Django template system...
../Objects/call.c:283

(gdb) p pool
$1 = (poolp) 0x7fffee861000
(gdb) p bp
$2 = (block *) 0x7a672f 
(gdb) p *pool
$3 = {ref = {_padding = 0x2c , 
count = 44}, freeblock = 0x7a672f ,
  nextpool = 0x55ba1fd0 , prevpool = 0x55ba1fd0 
, arenaindex = 170, szidx = 4, nextoffset = 1768, maxnextoffset = 
4056}
(gdb) p *(pool->nextpool)
$4 = {ref = {_padding = 0x7fffeec2a000 "}", count = 4005732352}, freeblock = 
0x7fffeea8e000 "\006", nextpool = 0x7fffee861000, prevpool = 0x7fffee861000, 
arenaindex = 4004200448,
  szidx = 32767, nextoffset = 4004200448, maxnextoffset = 32767}

--

___
Python tracker 

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



[issue34087] django: segmentation fault on random places

2018-07-13 Thread INADA Naoki


Change by INADA Naoki :


--
title: django: segmentation fault on garbage collection in visit_decref() -> 
django: segmentation fault on random places

___
Python tracker 

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



[issue34091] REPL does not work in msys2, ConEmu terminals on windows

2018-07-13 Thread Segev Finer


Segev Finer  added the comment:

I'd assume this is using ConEmu's ChildGui which means it hacks up a MinTTY 
window to appear inside ConEmu's GUI. MinTTY doesn't use a real terminal but 
rather pipes as the processes stdio. Any native (non-MSYS2) Windows program 
would have a problem with this.

The known workaround is to launch such programs using WinPTY (Available in the 
MSYS2 pacman), which creates a real console for the program in the background 
and communicates it's input/output so that it appear in the original console.

Sadly that is a limitation of Windows, as Windows does not supply a proper PTY 
interface and MSYS2/MinTTY choose not to use something like WinPTY by default.

--
nosy: +Segev Finer

___
Python tracker 

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



[issue34096] [2.7] test_audioop.test_max() failed: AssertionError: -2147483648 != 2147483648L

2018-07-13 Thread Erich Eckner


Erich Eckner  added the comment:

yes, I'm using gcc (GCC) 8.1.1 20180531
I attached the created pythoninfo

--
Added file: https://bugs.python.org/file47687/pythoninfo

___
Python tracker 

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



[issue34107] root.warning('msg') output format modified by logging.warning('msg')

2018-07-13 Thread Vinay Sajip


Vinay Sajip  added the comment:

This behaviour is as expected. If no handlers are configured for logging, an 
internal "handler of last resort" is used, with just the message output. See:

https://docs.python.org/3/howto/logging.html#what-happens-if-no-configuration-is-provided

If you call logging.warning(...), and if no handlers are configured, then 
basicConfig() is internally called to set up a handler with a basic format 
string. See:

https://docs.python.org/3/library/logging.html#logging.log

So, what you've described is as it should be.

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



[issue34107] root.warning('msg') output format modified by logging.warning('msg')

2018-07-13 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