[issue31535] configparser unable to write comment with a upper cas letter

2018-09-26 Thread Philippe Wagnieres

Philippe Wagnieres  added the comment:

Thank for your support.

Sorry I have no time to give you an answer and work on with Python, but 
I have understand the solution.

Best Regards

Philippe Wagnières
Chalamont 6
1400 Yverdon-les-Bains
Suisse
tel.: +41 76 367 27 43

Le 24.09.2018 à 17:42, Karthikeyan Singaravelan a écrit :
> Karthikeyan Singaravelan  added the comment:
>
> All config options including comment are converted to lowercase when they are 
> stored. You can customize this behavior using 
> https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.optionxform
>  . You can also refer to 
> https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour
>  for more customization. I am closing this as not a bug as part of triaging. 
> Feel free to reopen this if needed.
>
> Thanks for the report Philippe!
>
> --
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-09-26 Thread shashank


shashank  added the comment:

Added tests.
Patch file: safetarfile-4.diff

Following works with 456 tests passed, after doing `make clean && make`
# ./python -m unittest -v test.test_tarfile

Attached patch is on top of master's commit:
commit 2aaf98c16ae3070378de523a173e29644037d8bd (HEAD -> master, origin/master, 
origin/HEAD)
Author: INADA Naoki 
Date:   Wed Sep 26 12:59:00 2018 +0900

--
Added file: https://bugs.python.org/file47826/safetarfile-4.diff

___
Python tracker 

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



[issue34687] asyncio: is it time to make ProactorEventLoop as the default event loop?

2018-09-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I think the only way to make sure that proactor event loop is stable -- 
starting to use it everywhere on Windows.

Let's do it.

--

___
Python tracker 

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



[issue34793] Remove support for "with (await asyncio.lock):"

2018-09-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I don't care too much.
Maybe removal is just fine.
`with await ...` looks awkward anyway

--

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2018-09-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2018-09-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

In my opinion, we should don't change the behavior.
Signal handlers should be processed in main thread at the end, that's how 
Python works for regular synchronous API.

Mentioning it in the doc makes sense.

Would you make a pull request?

--

___
Python tracker 

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



[issue34694] Dismiss To Avoid Slave/Master wording cause it easier for non English spoken programmers

2018-09-26 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy:  -koobs

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-09-26 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

I didn't know this, but apparently the SSLKEYLOGFILE envvar is a de-facto 
standard: chrome, firefox, and libcurl all check for this envvar, and if found 
they log TLS secrets to the file in a specific format.

Reports of projects supporting this:

- https://www.imperialviolet.org/2012/06/25/wireshark.html
- 
https://jimshaver.net/2015/02/11/decrypting-tls-browser-traffic-with-wireshark-the-easy-way/
- https://ec.haxx.se/tls-sslkeylogfile.html

Also, people are using gross ctypes hacks to convince Python to do this too: 
https://github.com/joernheissler/SslMasterKey

Also, now that I know this exists I kind of wish it was supported because I've 
been frustrated by this problem before myself :-).

My first thought was that the ssl module should provide methods to extract the 
various secret values (e.g., wrappers for SSL_SESSION_get_master_key and 
SSL_get_client_random), and leave the environment variable checking to user 
code. But... looking at the file format docs:

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format

...it appears that TLS 1.3 has more and different secrets than previous 
versions, and trying to expose all these different pieces seems pretty messy. 
If we simply implement SSLKEYLOGFILE, that would give people what they want, 
and since we would be writing it out ourselves we could make it handle 
different TLS versions internally without exposing that complexity as part of 
the API.

We would of course have to disable this if -E was passed on the command line.

As an FYI to anyone looking at this bug, Christian (the main ssl module 
maintainer) is generally *very* overloaded, so I would say that the chances of 
this actually being implemented go *way* up if someone puts together a PR.

--
nosy: +njs

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Matthias Klose

New submission from Matthias Klose :

two distutils tests fail when running the tests from an installed location. 3.7 
branch 20180925, succeeded with a 20180911 snapshot. Is there any locale 
setting required?

==
ERROR: test_non_ascii (distutils.tests.test_log.TestLog) 
(errors='surrogateescape')
--
Traceback (most recent call last):
  File "/usr/lib/python3.7/distutils/tests/test_log.py", line 26, in 
test_non_ascii
log.debug('Dεbug\tMėssãge')
  File "/usr/lib/python3.7/distutils/log.py", line 41, in debug
self._log(DEBUG, msg, args)
  File "/usr/lib/python3.7/distutils/log.py", line 34, in _log
stream.write('%s\n' % msg)
  File "/usr/lib/python3.7/encodings/cp437.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0117' in position 
7: character maps to 

==
ERROR: test_find_executable (distutils.tests.test_spawn.SpawnTestCase)
--
Traceback (most recent call last):
  File "/usr/lib/python3.7/distutils/tests/test_spawn.py", line 95, in 
test_find_executable
rv = find_executable(program)
  File "/usr/lib/python3.7/distutils/spawn.py", line 176, in find_executable
path = os.environ['PATH']
  File "/usr/lib/python3.7/os.py", line 678, in __getitem__
raise KeyError(key) from None
KeyError: 'PATH'

--

--
components: Distutils
keywords: 3.7regression
messages: 326428
nosy: doko, dstufft, eric.araujo, ncoghlan, vstinner
priority: normal
severity: normal
status: open
title: distutils tests fail with recent 3.7 branch
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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Matthias Klose


Change by Matthias Klose :


--
nosy: +serhiy.storchaka, steve.dower

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-09-26 Thread Christian Heimes


Christian Heimes  added the comment:

Cory contributed a high level API for OpenSSL 1.1.1,  
https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_keylog_callback.html I 
already have a patch somewhere on my disk. The patch is trivial if we ignore 
OpenSSL < 1.1.1.

--

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-09-26 Thread Christian Heimes


Christian Heimes  added the comment:

Here is a horribly hacky and simple implementation. I have a more elaborate 
implementation that does correct locking and has no global state.

static BIO *bio_keylog = NULL;

static void keylog_callback(const SSL *ssl, const char *line)
{
BIO_printf(bio_keylog, "%s\n", line);
(void)BIO_flush(bio_keylog);
}

int PySSL_set_keylog_file(SSL_CTX *ctx, const char *keylog_file)
{
/* Close any open files */
BIO_free_all(bio_keylog);
bio_keylog = NULL;

if (ctx == NULL || keylog_file == NULL) {
/* Keylogging is disabled, OK. */
return 0;
}

/*
 * Append rather than write in order to allow concurrent modification.
 * Furthermore, this preserves existing keylog files which is useful when
 * the tool is run multiple times.
 */
bio_keylog = BIO_new_file(keylog_file, "a");
if (bio_keylog == NULL) {
BIO *b = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
BIO_printf(b, "Error writing keylog file %s\n", keylog_file);
BIO_free_all(b);
return 1;
}

/* Write a header for seekable, empty files (this excludes pipes). */
if (BIO_tell(bio_keylog) == 0) {
BIO_puts(bio_keylog,
 "# SSL/TLS secrets log file, generated by OpenSSL\n");
(void)BIO_flush(bio_keylog);
}
SSL_CTX_set_keylog_callback(ctx, keylog_callback);
return 0;
}

--
stage:  -> needs patch
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-09-26 Thread Johannes Frank


Johannes Frank  added the comment:

Hi Christian
I would be willing to give this a try, could you publish or send me that
more elaborate code?
Thanks Johannes

On Wed, 26 Sep 2018 at 09:25, Christian Heimes 
wrote:

>
> Christian Heimes  added the comment:
>
> Here is a horribly hacky and simple implementation. I have a more
> elaborate implementation that does correct locking and has no global state.
>
> static BIO *bio_keylog = NULL;
>
> static void keylog_callback(const SSL *ssl, const char *line)
> {
> BIO_printf(bio_keylog, "%s\n", line);
> (void)BIO_flush(bio_keylog);
> }
>
> int PySSL_set_keylog_file(SSL_CTX *ctx, const char *keylog_file)
> {
> /* Close any open files */
> BIO_free_all(bio_keylog);
> bio_keylog = NULL;
>
> if (ctx == NULL || keylog_file == NULL) {
> /* Keylogging is disabled, OK. */
> return 0;
> }
>
> /*
>  * Append rather than write in order to allow concurrent modification.
>  * Furthermore, this preserves existing keylog files which is useful
> when
>  * the tool is run multiple times.
>  */
> bio_keylog = BIO_new_file(keylog_file, "a");
> if (bio_keylog == NULL) {
> BIO *b = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
> BIO_printf(b, "Error writing keylog file %s\n", keylog_file);
> BIO_free_all(b);
> return 1;
> }
>
> /* Write a header for seekable, empty files (this excludes pipes). */
> if (BIO_tell(bio_keylog) == 0) {
> BIO_puts(bio_keylog,
>  "# SSL/TLS secrets log file, generated by OpenSSL\n");
> (void)BIO_flush(bio_keylog);
> }
> SSL_CTX_set_keylog_callback(ctx, keylog_callback);
> return 0;
> }
>
> --
> stage:  -> needs patch
> versions: +Python 3.8 -Python 3.7
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34807] pathlib.[r]glob fails when the toplevel directory is not readable, whereas glob.glob "succeeds"

2018-09-26 Thread Antony Lee


New submission from Antony Lee :

After

$ mkdir -p foo/bar && chmod 000 foo

one gets

In [1]: glob.glob("foo/bar")
Out[1]: []

but

In  [2]: list(Path("foo/bar").glob("*"))

gives a PermissionError.

I'm not arguing that pathlib should reproduce glob's behavior (in fact I think 
raising an exception is better in this case), but this could be better 
documented (os.walk does indicate that "By default, errors from the scandir() 
call are ignored." whereas I don't think either glob or pathlib docs mention 
this point at all).

Compare with https://bugs.python.org/issue24120, which relates to unreadable 
directories found *inside* the toplevel directory.

--
components: Library (Lib)
messages: 326432
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: pathlib.[r]glob fails when the toplevel directory is not readable, 
whereas glob.glob "succeeds"
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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The test in distutils/tests/test_log.py matches the current code (with changes 
added in issue34421), but the code in distutils/log.py doesn't match the 
current code. Looks like the stdlib and tests are unsynchronized.

--

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have reproduced this error by checking out the revision before issue34421 
changes.

git checkout 77b92b15a5e5c84b91d3fd9d02f63db432fa8903~ Lib/distutils/log.py
./python -m test -v -m test_log test_distutils

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> There are _two_ hash functions at play in that collision:  the tuple hash 
> function, and the integer hash function.  Regardless of whether the _tuple_ 
> hash function does [anything involving just `t`], that only directly affects 
> the result of the _int_ hash function

...which is what you want here. The collision hash((3,3)) == hash((-3,-3)) is 
due a specific structure in the input to the FNV algorithm. The operation t ^= 
t << 7 that you suggested (and which I approve, except for the shift amount) is 
meant precisely to destroy that structure.

> If you feel you just have to mess with low-order bits, do it instead on the 
> _tuple_ hash intermediate results, not on its inputs. It's x you care about 
> directly, not t.

That would not be a good solution, because that destroys the structure of the 
has algorithm. For Bernstein for example, each loop iteration should do 
something like

x = (x * m) + t

for *some* value t depending on the input. If you mess with x, then it really 
becomes a different hash algorithm. That is far more dangerous than simply 
applying a permutation on t.

> Mucking with t to avoid the nested-tuple catastrophes is worth it, but I 
> prefer to do that with as little damage to t's desirable properties as 
> reasonably possible.

Which "desirable properties" of t does the operation t ^= (t << 1) damage?

--

___
Python tracker 

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



[issue30156] PYTHONDUMPREFS segfaults on exit

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Note: I reported a similar issue which has then been marked as a duplicate of 
this one: bpo-34223. Copy of my first message:
---
It seems like Python has an invalid object somewhere. PYTHONDUMPREFS=1 makes 
Python crash at exit.

$ PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7f1992292448 [1] (, )
0x7f1992241aa8 [1] {'__doc__': 'Thread-local dummy'}
0x7f199222c740 [1] (,)
0x9c98a0 [2] 
0x7f1992217dc0 [1] 
Segmentation fault (core dumped)
---

--

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-09-26 Thread Tal Einat


Tal Einat  added the comment:

shashank, you're making good progress on this!

The tests should also put SafeTarFile through all of the tests for TarFile, 
considering that it is being described as a drop-in replacement. You should 
look through the existing tests for other modules which do similar things for 
methods to implement this cleanly, e.g. Lib/tests/test_binascii.py and 
Lib/tests/datetimetester.py.

--

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-09-26 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +8985

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 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



[issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order

2018-09-26 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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Test case failure regarding test_find_executable was fixed with issue34530 on 
master and backported.

Thanks

--

___
Python tracker 

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



[issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules

2018-09-26 Thread ekul


ekul  added the comment:

I just got this set of warnings while building 3.6.6 on RasPi Debian9/ARM. Good 
to know the warning is spurious. 

Just finding my way here - is Serhiy's patch above a working 2016 fix for this 
that got stuck in review? I couldn't find a PR for it. If the warning _is_ 
spurious it would be great to patch it.

--
nosy: +ekul

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Matthias Klose


Matthias Klose  added the comment:

issue34530 was already fixed on 20180904, so there's something else...

--

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-26 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks Serhiy, I read the Python-Dev thread you linked to, but that doesn't 
resolve the issues:

- Its topic is Python 2.6 (where this behavior does not occur) rather than 
Python 3 (where it does).

- A few messages into the thread Guido does address Python 3, but in fact says 
"I think the consensus is against round-to-even in 3.0" (see 
https://mail.python.org/pipermail/python-dev/2008-January/075897.html).

- There is no discussion of the fact that this behavior differs from the 
function named "round" in all the other programming languages I mentioned, and 
whether it would therefore be better exposed as an additional function (e.g. 
"round_to_even" or "round_unbiased", and in the math or statistics package 
rather than builtins). Surprisingly, Excel is the only other programming 
environment I saw discussed in the thread. (And round(2.5) == 3 there.)

So that all suggests there must be some other thread or issue where this change 
for Python 3 have been discussed, but I looked again and could not find it. 

The C "rint" example you gave just seems to prove the point that this behavior 
should have a distinct name from "round".

Regarding:
> It is a common knowledge that rounding half-to-even is what users want in 
> most cases

I don't think that's common knowledge; seems like citation needed? Based on all 
the other languages where this differs (not to mention Python 2), it's not 
clear users would want Python 3 to be the only different one. And this is 
definitely a surprise for the majority of programmers, whose experience with 
"round" is how it works everywhere else. (This is making it into pywat after 
all: https://github.com/cosmologicon/pywat/pull/40)

I can submit a PR for at least updating the docs about this (as per my previous 
comment) if that would be welcomed.

--

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

I don't understand this bug report.

"./python -m test test_distutils -v -m test_non_ascii" pass in 3.6, 3.7 and 
master branches.

> two distutils tests fail when running the tests from an installed location. 
> 3.7 branch 20180925, succeeded with a 20180911 snapshot.

I don't know what are these branches.

I tested the v3.7.0 test: "./python -m test test_distutils -v -m 
test_non_ascii" pass as well. It seems like you tested something between 3.7.0 
and the current 3.7 branch.

I suggest you to wait for the 3.7.1 release which should be release next weeks.

--

distutils/log.py evolved a lot. The code now uses:

try:
stream.write('%s\n' % msg)
except UnicodeEncodeError:
# emulate backslashreplace error handler
encoding = stream.encoding
msg = msg.encode(encoding, "backslashreplace").decode(encoding)
stream.write('%s\n' % msg)

Your traceback shows a stream.write() call on line 34, which isn't the case on 
the current 3.7 branch. So you are testing an outdated 3.7 commit.

--

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, to be clear, I suggest to close the issue (FIXED), since both failures 
have been fixed in development branches.

--

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Rounding floating point numbers is a complex topic :-) Here are my notes on 
that topic: https://vstinner.readthedocs.io/misc.html#rounding It took me years 
to fix how Python rounds timestamps :-)

--
nosy: +vstinner

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes. Congratulations on your persistence.

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



[issue34808] bytes[0] != bytes[0:1]

2018-09-26 Thread ucyo


New submission from ucyo :

bytes('sdf', 'UTF8')[0] != bytes('sdf', 'UTF8')[0:1]  # FALSE
'sdf'[0] != 'sdf'[0:1]  # TRUE

Is this a feature or bug. I would have expected the same behaviour.

--
components: Library (Lib)
messages: 326446
nosy: ucyo
priority: normal
severity: normal
status: open
title: bytes[0] != bytes[0:1]
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



[issue32956] python 3 round bug

2018-09-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

@jab: Did you see this message from the thread that Serhiy pointed to? 
https://mail.python.org/pipermail/python-dev/2008-January/075910.html

Here's the sound bite version, but see the message for context:

[Guido]
> Wow. Do you have an opinion as to whether we should adopt
> round-to-even at all (as a default)?

[Tim]
Yes:  yes :-)  [...]

Note that Python is not alone here: .NET also uses round-ties-to-even as the 
default rounding mode. Note also that the languages you mention don't all agree 
with one another either: try rounding -2.5 to the nearest integer in JavaScript 
and see what result you get.

[Joshua]
> and whether it would therefore be better exposed as an additional function 
> (e.g. "round_to_even" or "round_unbiased"

Changing the default behaviour of `round` again seems highly undesirable to me; 
I'd be strongly opposed to such a change. Proposals for backwards-compatible 
changes that make the round-ties-away-from-zero function available again under 
a different name (or via a keyword argument to `round`) could be worth 
discussing. And suggestions/PRs for documentation clarification are welcome, of 
course.

--

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

If I understand correctly you have two cases:
- the standalone script hangs with 3.6 on OS X
- a much more involved use case hangs with 2.7 on RedHat

It's possible you are hitting two different bugs.  The 2.7 issue may be due to 
third-party packages or other issues.

It would be nice if another OS X user could try your reproducer script on 3.6+ 
and find out whether they can reproduce/diagnose the issue at all.

--
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Adding Tim Peters to the nosy list, so that he can tell me that I'm 
misrepresenting him ...

--
nosy: +tim.peters

___
Python tracker 

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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread Matthias Klose


Matthias Klose  added the comment:

well, it was top of the branch yesterday

--

___
Python tracker 

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



[issue34809] On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"

2018-09-26 Thread Ruslan Kharitonov

New submission from Ruslan Kharitonov :

Getting the following error on MacOSX after installing Python 3.7.0 from the 
Python download. Also, tried installing from brew.

➜  ~ python3
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bin.test import *
>>> help(fetch_words)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_sitebuiltins.py",
 line 102, in __call__
import pydoc
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pydoc.py", 
line 66, in 
import platform
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/platform.py", 
line 116, in 
import sys, os, re, subprocess
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py",
 line 139, in 
import _posixsubprocess
ImportError: 
dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so,
 2): Symbol not found: _PyString_AsString
  Referenced from: 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so
  Expected in: flat namespace
 in 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so

--
components: macOS
messages: 326451
nosy: ned.deily, ronaldoussoren, therk
priority: normal
severity: normal
status: open
title: On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"
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



[issue34809] On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"

2018-09-26 Thread Ruslan Kharitonov


Change by Ruslan Kharitonov :


--
type:  -> crash

___
Python tracker 

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



[issue34809] On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"

2018-09-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Do you have a $PYTHONPATH in your environment?

For some reason the 3.7 install is looking in the site-packages directory for 
the 2.7 install. This is probably configuration on your system.

--

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-26 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks, Mark. Yes, I saw where Tim said round-half-even should be the default, 
but I didn't see any proposal to expose it as e.g. math.round_half_even() 
instead, nor a more complete look at what other languages do. That, along with 
the subject being 2.6 and not 3, made me think this change in Python 3 must 
have been discussed more fully elsewhere. Was it not?

And I agree -- nowhere have I been proposing changing "round" again. My 
proposals have been:

1. Update the round() docs to make the documentation of this behavior less 
buried,
2. include a (brief) justification (possibly even just a link to 
http://wiki.c2.com/?BankersRounding or some more-authoritative document), and
3. link to where else this change in Python 3 was discussed more, if anywhere, 
or else confirm this change was made based on no additional analysis that we 
can find written down.

It'd also be interesting to hear if this is something we wish we'd done 
differently now, but that shouldn't distract from 1, 2, and 3.

--

___
Python tracker 

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



[issue34809] On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"

2018-09-26 Thread Ruslan Kharitonov


Ruslan Kharitonov  added the comment:

Yes, this was the issue. Thank you.

> On Sep 26, 2018, at 8:05 AM, Ronald Oussoren  wrote:
> 
> 
> Ronald Oussoren  added the comment:
> 
> Do you have a $PYTHONPATH in your environment?
> 
> For some reason the 3.7 install is looking in the site-packages directory for 
> the 2.7 install. This is probably configuration on your system.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue34808] bytes[0] != bytes[0:1]

2018-09-26 Thread Geoffrey Spear


Geoffrey Spear  added the comment:

Indexing bytes giving an int is a feature. Some might argue it's a bad feature, 
but it was done on purpose.

--
nosy: +geoffreyspear

___
Python tracker 

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



[issue34808] bytes[0] != bytes[0:1]

2018-09-26 Thread ucyo


ucyo  added the comment:

Thank you for the answer.

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



[issue31837] ParseError in test_all_project_files()

2018-09-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

The warnings were introduced with issue13125 and this was fixed with issue30117 
. I verified it as below : 

➜  cpython git:(master) git checkout 14e976e00e65bf343ba0fca016c3c9132a843daf~1
➜  cpython git:(ce0f33d045) git clean -xdf && ./configure --with-pydebug && 
make -s -j4
➜  cpython git:(ce0f33d045) time ./python.exe -I -S -m test.regrtest -vv 
test_import test_lib2to3 >/dev/null
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_41673_tmp.pyc']
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/test_parser.py:430:
 UserWarning: ParseError on file 
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/main.py (bad 
input: type=22, value='=', context=('', (130, 38)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/test_parser.py:430:
 UserWarning: ParseError on file 
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/pytree_idempotency.py
 (bad input: type=22, value='=', context=('', (49, 33)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))
./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 > /dev/null  
44.31s user 1.18s system 94% cpu 47.971 total

# Fixed commit

➜  cpython git:(14e976e00e) time ./python.exe -I -S -m test.regrtest -vv 
test_import test_lib2to3 >/dev/null
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_41839_tmp.pyc']
./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 > /dev/null  
50.50s user 1.56s system 91% cpu 56.778 total

The test_import warning is also not reproducible with master as of now I will 
find the necessary commit and reply back in issue28655. As part of triaging I 
am closing this as duplicate with issue30117 as superseder which has the fix. 
Feel free to reopen this if needed.

Thanks

--
nosy: +xtreak
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_lib2to3.test_parser.test_all_project_files() fails

___
Python tracker 

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



[issue34670] Add set_post_handshake_auth for TLS 1.3

2018-09-26 Thread Dimitri John Ledkov


Dimitri John Ledkov  added the comment:

Will this be backported to the 2.7 branch as well? Pretty please =)

--
nosy: +xnox

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The dependency issue31837 dealing with test_lib2to3 failure was resolved by 
Victor in issue30117 and hence I marked it as a duplicate. The other issue 
regarding test_import is not reproducible on master as of  
2aaf98c16ae3070378de523a173e29644037d8bd. test_import warning was reproducible 
with 14e976e00e65bf343ba0fca016c3c9132a843daf and it seems to have been fixed 
later. The same issue with test_import was reported by Victor in issue30834 
which was closed as outdated since it was not reproducible. I will try to 
bisect to the commit that fixed test_import. I propose closing this as outdated 
as part of triaging.

Thanks much Serhiy and Victor for the reports and fixes.

--
nosy: +xtreak

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-26 Thread Joshua Bronson


Joshua Bronson  added the comment:

I spent a few minutes with git blame/checkout/show and so far have found 
https://bugs.python.org/issue1869 (via 
https://github.com/python/cpython/commit/e6a076d). Still reading -- looks like 
there were a number of different changes made to round() at the same time for 
various reasons -- so maybe changing from round_half_up to round_half_even was 
necessary for the other improvements, and it couldn't have been exposed as a 
separate function? Or maybe that was just never proposed?

--

___
Python tracker 

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



[issue31837] ParseError in test_all_project_files()

2018-09-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thanks Karthikeyan!

--

___
Python tracker 

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



[issue34807] pathlib.[r]glob fails when the toplevel directory is not readable, whereas glob.glob "succeeds"

2018-09-26 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



[issue34262] Asyncio test fails under Win 7

2018-09-26 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



[issue34806] distutils tests fail with recent 3.7 branch

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

> well, it was top of the branch yesterday

Hum, I don't understand because we don't have the same line number:

  File "/usr/lib/python3.7/distutils/log.py", line 34, in _log
stream.write('%s\n' % msg)

$ git show bbdf8723324e31675f298dd273733cc13e1518df:Lib/distutils/log.py|gvim -

(...)
try:
stream.write('%s\n' % msg)
except UnicodeEncodeError:
# emulate backslashreplace error handler
encoding = stream.encoding   # <~~~ line 34
msg = msg.encode(encoding, "backslashreplace").decode(encoding)
stream.write('%s\n' % msg)

--

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2018-09-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Can you provide a link to the occurence of this repetition?

Thanks!

--
nosy: +pablogsal

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2018-09-26 Thread Aydin


Aydin  added the comment:

https://docs.python.org/3/howto/functional.html

In the 5th paragraph.

--

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2018-09-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +akuchling

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2018-09-26 Thread Aydin


Change by Aydin :


--
versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.8

___
Python tracker 

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



[issue34809] On MacOSX with 3.7 python getting "Symbol not found: _PyString_AsString"

2018-09-26 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue31425] Expose AF_QIPCRTR in socket module

2018-09-26 Thread Tal Einat


Tal Einat  added the comment:


New changeset bb8165172ac2ef8c7092e8e82928cc7f5f310ab3 by Tal Einat (Bjorn 
Andersson) in branch 'master':
bpo-31425: Expose AF_QIPCRTR in socket module (GH-3706)
https://github.com/python/cpython/commit/bb8165172ac2ef8c7092e8e82928cc7f5f310ab3


--
nosy: +taleinat

___
Python tracker 

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



[issue31425] Expose AF_QIPCRTR in socket module

2018-09-26 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that "./python -I -S -m test.regrtest -j0 --fail-env-changed 
test_asyncio test_ctypes test_email test_idle test_import test_importlib 
test_json test_lib2to3" now pass on master. I close the issue.

Thanks Karthikeyan ;-)

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



[issue34694] Dismiss To Avoid Slave/Master wording cause it easier for non English spoken programmers

2018-09-26 Thread Paul Moore


Change by Paul Moore :


--
nosy:  -paul.moore

___
Python tracker 

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



[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles

New submission from Sébastien Celles :

Hello,

I'm looking for a way to get (using Python) the maximum and minimum values of C 
types integers (ie  uint8, int8, uint16, int16, uint32, int32, uint64, 
int64...) from Python.

I asked this question on StackOverflow and get a nice answer 
https://stackoverflow.com/questions/52475749/maximum-and-minimum-value-of-c-types-integers-from-python

but I wonder if this kind of feature couldn't be add directly in `ctypes.c_` as 
property.

Maybe we could have the following properties:
- `issigned`
- `max`
- `min`

Moreover being able to convert a number into a C type integer raising exception 
when input data is out of range could also be considered
Maybe using code like https://pastebin.com/cvm95m1x
(instead of silently overflow)

Kind regards

--
messages: 326467
nosy: scls
priority: normal
severity: normal
status: open
title: Maximum and minimum value of C types integers from Python

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

test_import still fails on 3.6.

--

___
Python tracker 

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



[issue34811] test_gdb fails with latest gdb

2018-09-26 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

In Fedora we got a new build of gdb which makes python's test_gdb fail on 
x86_64, i686 and aarch64(arm 64 bits) architectures.

gdb's commits between the passing and failing tests:
https://github.com/bminor/binutils-gdb/compare/ab080c102869dd3ad300a99d0c00b256404fd76b...e08ef628a7e3098699ec6939584e2c9f7a9e1952

This is too big of a list, so here is the commits from gdb's python folder:

https://github.com/bminor/binutils-gdb/commits/master/gdb/python

The offensive commits should be between 
89fbedf3abc90b62fbb7f08782ed78d87b3fccaa on Aug 18, 2018 and
94c8b7253a5e165ee92f7302f3247764d69b55e5 on Sep 16, 2018

Traceback to follow.

--
components: Tests
messages: 326469
nosy: cstratak
priority: normal
severity: normal
status: open
title: test_gdb fails with latest gdb

___
Python tracker 

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



[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Maximum values for uint8, int8, uint16, int16, uint32, int32, uint64, int64 are 
2**8-1, 2**7-1, 2**16-1, 2**15-1, 2**32-1, 2**31-1, 2**64-1, 2**63-1 by 
definition. Minimum values are 0, -2**7, 0, -2**15, 0, -2**31, 0, -2**63.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34811] test_gdb fails with latest gdb

2018-09-26 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue34811] test_gdb fails with latest gdb

2018-09-26 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 485, in 
test_NULL_ob_type
'set v->ob_type=0')
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 456, in 
assertSane
cmds_after_breakpoint=cmds_after_breakpoint)
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 242, in 
get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 (builtin_id) 
pending.\n[Thread debugging using libthread_db enabled]\nUsing host 
libthread_db library "/lib64/libthread_db.so.1".\n'
Breakpoint 1 (builtin_id) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==
FAIL: test_NULL_ptr (test.test_gdb.PrettyPrintTests)
Ensure that a NULL PyObject* is handled gracefully
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 477, in 
test_NULL_ptr
'backtrace'])
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 242, in 
get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 (builtin_id) 
pending.\n[Thread debugging using libthread_db enabled]\nUsing host 
libthread_db library "/lib64/libthread_db.so.1".\n'
Breakpoint 1 (builtin_id) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==
FAIL: test_builtin_method (test.test_gdb.PrettyPrintTests)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 607, in 
test_builtin_method
gdb_repr, gdb_output = self.get_gdb_repr('import sys; 
id(sys.stdout.readlines)')
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 242, in 
get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 (builtin_id) 
pending.\n[Thread debugging using libthread_db enabled]\nUsing host 
libthread_db library "/lib64/libthread_db.so.1".\n'
Breakpoint 1 (builtin_id) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==
FAIL: test_builtins_help (test.test_gdb.PrettyPrintTests)
Ensure that the new-style class _Helper in site.py can be handled
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 513, in 
test_builtins_help
gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', 
import_site=True)
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 242, in 
get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 (builtin_id) 
pending.\n[Thread debugging using libthread_db enabled]\nUsing host 
libthread_db library "/lib64/libthread_db.so.1".\n'
Breakpoint 1 (builtin_id) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==
FAIL: test_bytes (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of bytes
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 301, in 
test_bytes
self.assertGdbRepr(b'')
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 266, in 
assertGdbRepr
gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')')
  File "/builddir/build/BUILD/Python-3.7.0/Lib/test/test_gdb.py", line 242, in 
get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 (builtin_id) 
pending.\n[Thread debugging using libthread_db enabled]\nUsing host 
libthread_db library "/lib64/libthread_db.so.1".\n'
Breakpoint 1 (builtin_id) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==
FAIL: test_corrupt_ob_type (test.test_gdb.PrettyPrintTests)
Ens

[issue34811] test_gdb fails with latest gdb

2018-09-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles

Sébastien Celles  added the comment:

Thanks @serhiy.storchaka I'm aware of this... but I think it could be returned 
programmatically without much difficulty.

--

___
Python tracker 

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



[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles

Sébastien Celles  added the comment:

About raising exception with converting integer value that should overflow 
maybe we should have a parameter

ctypes.c_uint8(256, raise=True)

will raise an exception but 

ctypes.c_uint8(256)

will silently return c_ubyte(0)

--

___
Python tracker 

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



[issue34811] test_gdb fails with latest gdb

2018-09-26 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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8986

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-09-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8987

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

> test_import still fails on 3.6.

Oh, I only tested master. I wrote PR 9589 to fix test_import on 3.6.

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

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Thanks Serhiy. Thanks Victor for the fix. I can confirm this on 3.6. 
Interestingly `--fail-env-changed` flag didn't catch this but running in 
verbose mode failed.

`--fail-env-changed` passes

➜  cpython git:(3707bcf02b) ./python.exe -I -S -m test.regrtest -j0 
--fail-env-changed test_asyncio test_ctypes test_email test_idle test_import 
test_importlib test_json test_lib2to3
Run tests in parallel using 6 child processes
0:00:04 load avg: 3.51 [1/8] test_import passed
0:00:07 load avg: 3.51 [2/8] test_ctypes passed
0:00:09 load avg: 3.87 [3/8] test_idle passed
0:00:19 load avg: 6.23 [4/8] test_importlib passed
0:00:27 load avg: 6.05 [5/8] test_json passed
0:00:29 load avg: 5.72 [6/8] test_email passed
running: test_asyncio (59 sec 815 ms), test_lib2to3 (51 sec 972 ms)
0:01:06 load avg: 4.33 [7/8] test_asyncio passed (1 min 4 sec) -- running: 
test_lib2to3 (58 sec 276 ms)
0:01:09 load avg: 4.33 [8/8] test_lib2to3 passed (1 min 244 ms)

== Tests result: SUCCESS ==

All 8 tests OK.

# warnings are present

➜  cpython git:(3707bcf02b) ./python.exe -I -S -m test.regrtest -vv test_import 
test_lib2to3 >/dev/null
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_10093_tmp.pyc']

Total duration: 1 min 9 sec
Tests result: SUCCESS

--

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-09-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8989

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-09-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8988

___
Python tracker 

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



[issue34765] Update install-sh

2018-09-26 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


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

___
Python tracker 

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



[issue34262] Asyncio test fails under Win 7

2018-09-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

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



[issue34262] Asyncio test fails under Win 7

2018-09-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

ProactorEventLoop is the default event loop with issue34687. There doesn't seem 
to be any warnings in buildbots as I have checked and as @panesen has mentioned 
this is not consistent. I am adding Victor as a notification if he has any 
thoughts. Victor, feel free to remove yourself if this is not relevant.

Thanks

--

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Verified the fix in the PR and there are no warnings

➜  cpython git:(pr_9589) ./python.exe
Python 3.6.6+ (heads/pr_9589:844abda318, Sep 26 2018, 20:59:26)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
➜  cpython git:(pr_9589) ./python.exe -I -S -m test.regrtest -vv test_import 
test_lib2to3 >/dev/null
➜  cpython git:(pr_9589) ./python.exe -I -S -m test.regrtest -j0 
--fail-env-changed test_asyncio test_ctypes test_email test_idle test_import 
test_importlib test_json test_lib2to3
Run tests in parallel using 6 child processes
0:00:06 load avg: 3.19 [1/8] test_import passed
0:00:10 load avg: 3.73 [2/8] test_ctypes passed
0:00:12 load avg: 3.73 [3/8] test_idle passed
0:00:20 load avg: 4.08 [4/8] test_importlib passed
0:00:27 load avg: 4.07 [5/8] test_json passed
0:00:29 load avg: 4.15 [6/8] test_email passed
running: test_asyncio (59 sec 700 ms), test_lib2to3 (49 sec 60 ms)
0:01:04 load avg: 3.97 [7/8] test_asyncio passed (1 min 2 sec) -- running: 
test_lib2to3 (54 sec 18 ms)
0:01:07 load avg: 3.97 [8/8] test_lib2to3 passed (55 sec 380 ms)

== Tests result: SUCCESS ==

All 8 tests OK.

Total duration: 1 min 7 sec
Tests result: SUCCESS


Thanks

--

___
Python tracker 

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



[issue34812] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-09-26 Thread STINNER Victor


New submission from STINNER Victor :

The support.args_from_interpreter_flags() function recreates Python command 
line arguments from sys.flags, but it omits -I (sys.flags.isolated).

Because of that, "./python -I -m test ..." behaves differently than "./python 
-I -m test -j0 ...":
https://bugs.python.org/issue28655#msg326477

--
components: Library (Lib), Tests
messages: 326478
nosy: vstinner
priority: normal
severity: normal
status: open
title: support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag
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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I can confirm this on 3.6. Interestingly `--fail-env-changed` flag didn't 
> catch this but running in verbose mode failed.

Oh... When using -j0, regrtest doesn't spawn worker processes using -I: the 
flag is simply omitted... As a side effect, forget() in test_import doesn't 
remove pyc_file from the current directory.

I created bpo-34812 to track this issue.

--

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 43500a5907eb9ae2e470dcbffe73012cd456f5a1 by Victor Stinner in 
branch '3.6':
bpo-28655: Fix test_import.test_missing_source_legacy() (GH-9589)
https://github.com/python/cpython/commit/43500a5907eb9ae2e470dcbffe73012cd456f5a1


--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 43500a5907eb9ae2e470dcbffe73012cd456f5a1 by Victor Stinner in 
branch '3.6':
bpo-28655: Fix test_import.test_missing_source_legacy() (GH-9589)
https://github.com/python/cpython/commit/43500a5907eb9ae2e470dcbffe73012cd456f5a1


--
nosy: +vstinner

___
Python tracker 

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



[issue34812] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-09-26 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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread calimeroteknik


calimeroteknik  added the comment:

A friend has found a very simple example that triggers such an issue in a very 
reproducible manner.

Attached two versions, one where the child process mysteriously disappears in 
the cpython interpreter.

pypy is unaffected.

--
nosy: +calimeroteknik
Added file: https://bugs.python.org/file47827/hang.py

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread calimeroteknik


calimeroteknik  added the comment:

Attaching the version that randomly raises ChildProcessError: [Errno 10] No 
child processes.
The child process is lost in limbo if we don't sleep/print after creating it.

--
Added file: https://bugs.python.org/file47828/except-out.py

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread Antoine Pitrou


Change by Antoine Pitrou :


Removed file: https://bugs.python.org/file47828/except-out.py

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

@calimeroteknik, this doesn't seem to have anything to do with the issue at 
hand.  Please open a separate issue with your scripts.

--

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-26 Thread Antoine Pitrou


Change by Antoine Pitrou :


Removed file: https://bugs.python.org/file47827/hang.py

___
Python tracker 

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



[issue34813] child process disappears when removing a print statement after its creation

2018-09-26 Thread calimeroteknik


New submission from calimeroteknik :

When two processes are created and killed, the behaviour is different if print 
or sleep statements are inserted.
It can also be random (different results executing the same program several 
times) on certain machines and versions of python.

Attached two versions, one where the child process mysteriously disappears in 
the cpython interpreter, and another other one that raises ChildProcessError: 
[Errno 10] No child processes.

This shows up with cpython, all versions I tested (3.7, 3.6, 3.5, 2.7). pypy is 
unaffected.

--
files: hang.py
messages: 326485
nosy: calimeroteknik, davin, pitrou
priority: normal
severity: normal
status: open
title: child process disappears when removing a print statement after its 
creation
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47829/hang.py

___
Python tracker 

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



[issue34813] child process disappears when removing a print statement after its creation

2018-09-26 Thread calimeroteknik


Change by calimeroteknik :


Added file: https://bugs.python.org/file47830/except-out.py

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


New submission from STINNER Victor :

Python can be compiled in "shared" mode: "./configure --enable-shared", 
Py_ENABLE_SHARED is defined in pyconfig.h. Most Linux distributions use this 
configuration.

By default, Python builds most C extensions using setup.py which is based on 
distutils. The get_libraries() method of Lib/distutils/command/build_ext.py 
explicity add a dependency to libpythonX.Y if Py_ENABLE_SHARED is defined.

But it is possible to use Modules/Setup to build some C extensions using 
Makefile rather than setup.py. If "*shared*" is in Modules/Setup, following 
modules will be compiled as libraries (".so" files on Linux). For example, RHEL 
and Fedora use this configuration for many C extensions. Problem: C extensions 
compiled like are not linked to libpython.


Example of the issue on Fedora 28 with Python 2.7:

$ ldd $(python2 -c 'import _struct; print(_struct.__file__)')
linux-vdso.so.1 (0x7ffeedf38000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7fb4da876000)
libc.so.6 => /lib64/libc.so.6 (0x7fb4da4b7000)
/lib64/ld-linux-x86-64.so.2 (0x7fb4daca1000)

=> notice the lack of libpython

Python 3.6 is fine:

$ ldd $(python3 -c 'import _struct; print(_struct.__file__)')
linux-vdso.so.1 (0x7ffd493dd000)
libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x7f47b916)
...


Patch used by Fedora to build _struct (and other modules) using Makefile:

https://src.fedoraproject.org/rpms/python2/blob/f27/f/python-2.7.1-config.patch



Another example of patch, to build _contextvars as a shared library:

diff --git a/Modules/Setup b/Modules/Setup
index a0622cc8c6..975aeff70d 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -148,7 +148,7 @@ _symtable symtablemodule.c
 # modules are to be built as shared libraries (see above for more
 # detail; also note that *static* or *disabled* cancels this effect):
 
-#*shared*
+*shared*
 
 # GNU readline.  Unlike previous Python incarnations, GNU readline is
 # now incorporated in an optional module, configured in the Setup file
@@ -166,7 +166,7 @@ _symtable symtablemodule.c
 #array arraymodule.c   # array objects
 #cmath cmathmodule.c _math.c # -lm # complex math library functions
 #math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
-#_contextvars _contextvarsmodule.c  # Context Variables
+_contextvars _contextvarsmodule.c  # Context Variables
 #_struct _struct.c # binary structure packing/unpacking
 #_weakref _weakref.c   # basic weak reference support
 #_testcapi _testcapimodule.c# Python C API test module


Attached PR fixes Modules/makesetup to:

* (1) Add a dependency on the Makefile target to libpython: to make sure that 
the parallel compilation works as expected
* (2) Add a dependency to libpythonX.Y on the compiled shared library (".so" 
file on Linux)

--
components: Build
messages: 326486
nosy: vstinner
priority: normal
severity: normal
status: open
title: makesetup: must link C extensions to libpython when compiled in shared 
mode
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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Setup.patch: Example of patch to modify Modules/Setup to compile _contextvars 
as a shared library, to test the fix.

--
Added file: https://bugs.python.org/file47831/Setup.patch

___
Python tracker 

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



[issue34813] child process disappears when removing a print statement after its creation

2018-09-26 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I don't think hang.py is correct.  If you launch a process using subprocess, 
the subprocess owns the child process.  You should not call waitpid() or 
os.kill() separately.  Also, since you don't keep a reference to the 
subprocess.Popen object, its destructor will run and may call waitpid() on the 
child process.  Depending on when exactly the destructor runs, it can interfere 
with your own waitpid() call.

--
nosy: +giampaolo.rodola, gregory.p.smith

___
Python tracker 

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



[issue34813] child process disappears when removing a print statement after its creation

2018-09-26 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Those remarks apply to except-out.py, as well.

--

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Example of the bug:

---
$ git apply ~/Setup.patch
$ ./configure --with-pydebug --enable-shared
$ make
$ grep _contextvars Makefile
(...)

Modules/_contextvarsmodule.o: $(srcdir)/Modules/_contextvarsmodule.c; $(CC) 
$(CCSHARED) $(PY_CFLAGS) $(PY_CPPFLAGS)  -c 
$(srcdir)/Modules/_contextvarsmodule.c -o Modules/_contextvarsmodule.o

Modules/_contextvars$(EXT_SUFFIX):  Modules/_contextvarsmodule.o; $(BLDSHARED)  
Modules/_contextvarsmodule.o   -o Modules/_contextvars$(EXT_SUFFIX)

$ find -name "_contextvars.*so"
./Modules/_contextvars.cpython-38dm-x86_64-linux-gnu.so

$ ldd $(find -name "_contextvars.*so")
linux-vdso.so.1 (0x7ffd27973000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7fd081433000)
libc.so.6 => /lib64/libc.so.6 (0x7fd081074000)
/lib64/ld-linux-x86-64.so.2 (0x7fd081854000)
---

The _contextvars shared library is not linked to libpython. There is not 
"-lpythonX.Y" in the Makefile rule.


Now with the patch:
---
$ git clean -fdx
$ git apply ~/Setup.patch
$ ./configure --with-pydebug --enable-shared
$ make
$ grep _contextvars Makefile
(...)

Modules/_contextvarsmodule.o: $(srcdir)/Modules/_contextvarsmodule.c; $(CC) 
$(CCSHARED) $(PY_CFLAGS) $(PY_CPPFLAGS)  -c 
$(srcdir)/Modules/_contextvarsmodule.c -o Modules/_contextvarsmodule.o

Modules/_contextvars$(EXT_SUFFIX):  Modules/_contextvarsmodule.o $(LDLIBRARY); 
$(BLDSHARED)  Modules/_contextvarsmodule.o $(BLDLIBRARY)   -o 
Modules/_contextvars$(EXT_SUFFIX)

$ find -name "_contextvars.*so"
./Modules/_contextvars.cpython-38dm-x86_64-linux-gnu.so

$ ldd $(find -name "_contextvars.*so")
linux-vdso.so.1 (0x7ffd1e918000)
libpython3.8dm.so.1.0 => not found
(...)
---

With my patch, _contextvars.cpython-38dm-x86_64-linux-gnu.so is linked to 
libpython3.8dm.so.1.0 as expected. The Makefile rule adds  $(LDLIBRARY) to the 
dependencies of the _contextvars(...).so rule and it adds $(BLDLIBRARY) to the 
linker flags of this rule.

--

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Downstream (RHEL) issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1585201

--

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

I copied the nosy list from bpo-32430: people who understand and care about the 
Modules/Setup file :-)

--
nosy: +barry, eric.smith, koobs, martin.panter, mdk, nascheme, pitrou, 
twouters, xdegaye, yan12125

___
Python tracker 

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



[issue34813] child process disappears when removing a print statement after its creation

2018-09-26 Thread calimeroteknik


calimeroteknik  added the comment:

So this is invalid library usage, we need to run .wait() on the Popen object.

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



  1   2   >