[issue33052] Sporadic segmentation fault in test_datetime

2018-11-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Related discussion with same segfault in Travis CI : issue33701

--

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


miss-islington  added the comment:


New changeset 60cf26528b931215160a53fd61836dbe4f036009 by Miss Islington (bot) 
in branch '3.6':
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
https://github.com/python/cpython/commit/60cf26528b931215160a53fd61836dbe4f036009


--

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


miss-islington  added the comment:


New changeset f6602f92664b782125a1ec5009706f9300fe7e80 by Miss Islington (bot) 
in branch '3.7':
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
https://github.com/python/cpython/commit/f6602f92664b782125a1ec5009706f9300fe7e80


--
nosy: +miss-islington

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9765

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 3015fb8ce4d25603434b9b44bb7effb98a481532 by Gregory P. Smith in 
branch 'master':
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
https://github.com/python/cpython/commit/3015fb8ce4d25603434b9b44bb7effb98a481532


--

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9764

___
Python tracker 

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



Re: passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread dieter
Benedikt Kroll  writes:

> Hi,
>
> using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm 
> having trouble
> passing the value back to Apache. 
>
> The log says "map lookup OK", but the value is empty.
>
> According to the Apache documentation 
> (https://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg), the 
> script "should return one new-line terminated response string on STDOUT" 
> which is then used as the rewrite target.
>
> I have tried to do this using:
> sys.stdout.write(newValue + "/n")

Should this not be "\n" rather than "/n"?
> sys.stdout.flush()

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

> Can we prefix MEMORY_SANITIZER with _Py_?

Yes, I wondered if I should do that.  not that I expect anyone would ever 
define it to mean anything else, but that seems like the right thing to do.  
https://github.com/python/cpython/pull/10503

--

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2018-11-12 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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +9763

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

yeah, i've been surprised how far i was able to get from an oss CPython tree 
and pre-built clang 7 binary installation.  If you have headers installed for 
common libraries like libssl-dev and libreadline-dev you can't produce an 
interpreter that'll work as those both lead to quick crashes.  also, in my 
experience optimized builds tend to be more problematic (too early to say if 
what i'm seeing are actual problems).

also, make sure llvm-symbolize (no suffixes) is in your path for it to 
auto-symbolize the traces showing you where in the code it pointed out issues.  
when it points within shared libraries instead of the Python source tree - 
that's a hint that the library probably may need msan compilation.

I'm plodding through things to see if I can get a _useful_ buildbot setup (i 
don't care of some extension modules can't be covered for now) out of all of 
this.

--

___
Python tracker 

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



Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Michael Torrie
On 11/12/2018 05:55 PM, David Rock wrote:
> Is there a requirement to use only what comes in the standard libraries, or 
> can you use things from pypi?
> Getting interface details is exactly why netifaces was created
> 
> https://pypi.org/project/netifaces/

Also if working with NetworkManager is required, nm has a python api:
https://pythonhosted.org/python-networkmanager/

Grepping command-line tools is a time-honored unix tradition, but it can
be fragile.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Wildman via Python-list
I tried posting this already but it didn't make it.  I am
trying again...

On Tue, 13 Nov 2018 01:07:06 +0530, srinivasan wrote:

> Dear Python Experts,
> 
> *First method:*
> 
> I need to get the IP address basically the gateway IP

I am assuming your platform is Linux.  If I am incorrect then
ignore this post.

The code below reads /proc/net/route to obtain the gateway and
then prints it.  It can be run as-is from a terminal.

#
#!/usr/bin/env python

import socket
import struct

def get_gateway_ip():
try:
with open("/proc/net/route", "r") as f:
route = f.readlines()
except IOError:
return None
for line in route:
fields = line.strip().split()
if fields[1] != "" or not int(fields[3], 16) & 2:
continue
gateway = socket.inet_ntoa(struct.pack(" GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Bill Campbell
On Tue, Nov 13, 2018, srinivasan wrote:
>Dear Python Experts,
>
>*First method:*
>
>I need to get the IP address basically the gateway IP in my setup I get it
>as "192.168.178.1" when I run the below standalone python code.
>
>
>*def get_gateway_ip(self):*
>*"""*
>*Get the IP address to the WIFI module from the AP*
>*"""*
>
>*cmd = 'ip route show 0.0.0.0/0  dev wlp1s0 | cut
>-d\  -f3'*
>*f = os.popen(cmd)*
>*return str(f.read().strip())*

This command should get the gateway IP.

Linux: cmd = "ip route list | awk '/^default/{print $3}'"

or perhaps

Linux: cmd = "netstat -rn | awk '/^0.0.0.0/{print $2}'"

OSX: cmd = "netstat -rn | awk '/^default/{print $2}'"

I don't have a freebsd system available to test this, but I think
this pattern should work:

re.compile(r'^(default|0\.0\.0\.0)\s+(\S+)')

Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www2.celestial.com/ PO Box 820; 6641 E. Mercer Way
Mobile: (206) 947-5591  Mercer Island, WA 98040-0820
Fax:(206) 232-9186  Skype: jwccsllc

On the free market, everyone earns according to his productive
value in satisfying consumer desires. Under statist distribution,
everyone earns in proportion to the amount he can plunder from
the producers. -- Murray N. Rothbard
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread David Rock

> On Nov 12, 2018, at 13:37, srinivasan  wrote:
> 
> Dear Python Experts,
> 
> *First method:*
> 
> I need to get the IP address basically the gateway IP in my setup I get it
> as "192.168.178.1" when I run the below standalone python code.

Is there a requirement to use only what comes in the standard libraries, or can 
you use things from pypi?
Getting interface details is exactly why netifaces was created

https://pypi.org/project/netifaces/

damocles:src drock$ python3
Python 3.7.0 (default, Oct 28 2018, 22:17:08) 
[Clang 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> gws = netifaces.gateways()
>>> gws
{'default': {2: ('192.168.69.1', 'en0')}, 2: [('192.168.69.1', 'en0', True)]}
>>> gws['default']
{2: ('192.168.69.1', 'en0’)}

— 
David Rock
da...@graniteweb.com




-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9762

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9761

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks @alex! I will try again after linking against ASAN-compiled version of 
my libraries.

--

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Alex Gaynor


Alex Gaynor  added the comment:

All libraries that are linked against, including libc, need to be compiled with 
MSAN. MSAN is not for the faint of heart.

--

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I cannot initialize the interpreter after compiling with 
--with-memory-sanitizer:

❯ CC=clang ./configure  --with-memory-sanitizer && make -j
❯ ./python
Python 3.8.0a0 (heads/master:1584a00815, Nov 13 2018, 03:29:18)
[Clang 7.0.0 (tags/RELEASE_700/final)] on linux
Type "help", "copyright", "credits" or "license" for more information.
==10989==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5592f18005c3  (/home/pablogsal/cpython/python+0x9a55c3)
#1 0x5592f175c176  (/home/pablogsal/cpython/python+0x901176)
#2 0x5592f17592da  (/home/pablogsal/cpython/python+0x8fe2da)
#3 0x5592f1750f82  (/home/pablogsal/cpython/python+0x8f5f82)
#4 0x5592f174a336  (/home/pablogsal/cpython/python+0x8ef336)
#5 0x5592f174c906  (/home/pablogsal/cpython/python+0x8f1906)
#6 0x5592f14ae214  (/home/pablogsal/cpython/python+0x653214)
#7 0x5592f14a6915  (/home/pablogsal/cpython/python+0x64b915)
#8 0x5592f14a293c  (/home/pablogsal/cpython/python+0x64793c)
#9 0x5592f0f5ad88  (/home/pablogsal/cpython/python+0xffd88)
#10 0x5592f0f5ce73  (/home/pablogsal/cpython/python+0x101e73)
#11 0x5592f0f4d908  (/home/pablogsal/cpython/python+0xf2908)
#12 0x7fd1a7381222  (/usr/lib/libc.so.6+0x24222)
#13 0x5592f0ed3cdd  (/home/pablogsal/cpython/python+0x78cdd)

  Uninitialized value was created by a heap allocation
#0 0x5592f0f02a0d  (/home/pablogsal/cpython/python+0xa7a0d)
#1 0x7fd1a73cd790  (/usr/lib/libc.so.6+0x70790)

SUMMARY: MemorySanitizer: use-of-uninitialized-value 
(/home/pablogsal/github/cpython/python+0x9a55c3)
Exiting

❯ clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

❯ /lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.28.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 8.2.1 20180831.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
.

I am missing something or is this expected (as there are more PRs to come)?

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2018-11-12 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> I’m a little concerned about this approach because it means random third 
> party modules can affect the global environment for your application, without 
> knowing it.  Since the hook installation happens at import time, and just 
> depending on a library that has such a .pth file will install it, the end 
> application will not have control over its global state.
But "affecting the global environment for your application" is exactly 
what is intended here. You want multiple packages to all load their code 
into the same namespaces (aka module objects), thus of course 
potentially affecting/overriding each other's functionality. That's what 
you get when you have plugins -- a badly-written/incompatible plugin can 
and will break your app.

It doesn't have to "just depend on a library that has such a .pth file", 
it's up to the import hook's implementation. I just gave as example the 
simplest solution that requires zero effort on the main package 
maintainer's part.

E.g. you can only allow adding a new submodule by default, or require 
the "parent" package to "allow" insertions into itself, or move 
registration into the parent's configuration file (so the user needs to 
enable the plugin manually), or provide some more granular code 
injection techniques like e.g. event handler lists that certain plugins' 
functions will be added into. All that matters here is that the hook is 
going to automagically assemble the resulting namespaces from parts upon 
import.

Finally, Python applications don't have full control over their global 
state anyway. Any module can monkey-patch or override any other module 
via a variety of means. So, this risk is not something new or unexpected.

--
nosy: +__Vano

___
Python tracker 

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



[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue31541] Mock called_with does not ensure self/cls argument is used

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Will

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



[issue31541] Mock called_with does not ensure self/cls argument is used

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg329801

___
Python tracker 

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



[issue31541] Mock called_with does not ensure self/cls argument is used

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I agree with Karthikeyan: This is is the expected behaviour. The moment you use 
a mock, any implementation details are lost unless you use wraps or similar to 
also transfer the call to the/a real object.

--
nosy: +pablogsal

___
Python tracker 

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



[issue35215] Replacing CPython memory allocation

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> The point of this 'issue' is to ask the community to suggest how i can go 
> about finding where the problem is. As I said, there is a lot of code :)

Sadly, this tracker is to track bugs related to CPython. Modifying the 
interpreter to change the memory allocation scheme (replacing the code in 
obmalloc.c) is not supported, so I have to close this issue :(

You can try to ask the question on some of the mailing lists (like python-dev) 
to see is someone can help you with this. I would advice to also provide some 
minimal reproducer/example code, as is very difficult to recommend anything 
without knowing what exactly are you modifying.

If you think there is something wrong/we can improve around this area, please, 
feel free to reopen this issue or open a new one :)

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Can we prefix MEMORY_SANITIZER with _Py_?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +9760

___
Python tracker 

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



[issue35225] test_faulthandler fails under ubsan

2018-11-12 Thread Benjamin Peterson


New submission from Benjamin Peterson :

The UBsan buildbot is failing test_faulthandler. We should either spread some 
__attribute__((no_sanitize_undefined)) around or make the tests skip.

==
FAIL: test_enable_fd (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 274, in test_enable_fd
self.check_fatal_error("""
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 115, in check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 108, in check_error
output, exitcode = self.get_output(code, filename=filename, fd=fd)
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 73, in get_output
self.assertEqual(output, '')
AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != 
''
Diff is 2693 characters long. Set self.maxDiff to None to see it.
==
FAIL: test_enable_file (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 258, in test_enable_file
self.check_fatal_error("""
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 115, in check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 108, in check_error
output, exitcode = self.get_output(code, filename=filename, fd=fd)
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 68, in get_output
self.assertEqual(output, '')
AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != 
''
Diff is 2693 characters long. Set self.maxDiff to None to see it.
==
FAIL: test_sigfpe (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 176, in test_sigfpe
self.check_fatal_error("""
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 115, in check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
  File 
"/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py",
 line 110, in check_error
self.assertRegex(output, regex)
AssertionError: Regex didn't match: '^Fatal Python error: Floating point 
exception\n\nCurrent thread 0x[0-9a-f]+ \\(most recent call first\\):\n  File 
"", line 3 in ' not found in 'Modules/faulthandler.c:1059:11: 
runtime error: division by zero\nFatal Python error: Floating point 
exception\n\nCurrent thread 0x7f14c5e81740 (most recent call first):\n  
File "", line 3 in 
\nUndefinedBehaviorSanitizer:DEADLYSIGNAL\n==5027==ERROR: 
UndefinedBehaviorSanitizer: FPE on unknown address 0x006d13a3 (pc 
0x7f14c5355f9f bp 0x02f485a0 sp 0x02f698e8 T5027)\n#0 
0x7f14c5355f9e in gsignal (/lib/x86_64-linux-gnu/libpthread.so.0+0x10f9e)\n
#1 0x7f14c53560bf  (/lib/x86_64-linux-gnu/libpthread.so.0+0x110bf)\n#2 
0x829906 in faulthandler_sigfpe 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/./Modules/faulthandler.c:1059:11\n
#3 0x4707c3 in _PyMethodDef_RawFastCallKeywords 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call
 .c\n#4 0x46e5d1 in _PyCFunction_FastCallKeywords 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call.c:730:14\n 
   #5 0x656805 in call_function 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:4570:9\n 
   #6 0x64b0d6 in _PyEval_EvalFrameDefault 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3164:23\n
#7 0x6596be in _PyEval_EvalCodeWithName 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3946:14\n
#8 0x6384ee in PyEval_EvalCodeEx 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3975:12\n
#9 0x6384ee in PyEval_EvalCode 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:508\n
#10 0x6e816e in run_mod 
/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:1030:9\n
#11 0x6e816e in PyRun_StringFlags 

[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Alex Gaynor


Change by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



Re: IDLE Default Working Directory

2018-11-12 Thread eryk sun
On 11/12/18, Thomas Jollans  wrote:
> On 13/11/2018 00:45, Terry Reedy wrote:
>>
>> On Windows, a simple alternate is a .bat file.  I belive the folloiwing
>> should work.
>>
>> cd c:/desired/startup/directory
>> py -x.y -m idlelib
>>
>> The default for x.y is latest 3.x or latest 2.x if no 3.x.
>
> Correct me if I'm wrong, but won't that create an empty command prompt
> window nobody wants to see? (which you can get rid of by calling
> START /B on a win32 application like pythonw.exe. Is there a pyw.exe or
> something?)

It should be something like `start "IDLE" pyw.exe -3.x -m idlelib`.
This assumes pyw.exe is in a PATH directory, which it should be if
Python 3.x was installed for all users. We need the START command to
prevent waiting for the pyw.exe command to exit. If CMD waits, then
its console window will be displayed while IDLE is running. Even with
START, CMD's console window will display briefly, which is ugly and
distracting, so ideally the OP should use a .lnk shortcut instead of a
batch script.

Note that the START command's /B option is irrelevant since pyw.exe
isn't a console application. This option makes the CreateProcess call
use the flag CREATE_NEW_PROCESS_GROUP instead of CREATE_NEW_CONSOLE.
Without the latter flag, a console application inherits the parent's
console, and as a new process group it will have Ctrl+C disabled by
default. This allows running a console application in the
[B]ackground. (I recommend redirecting its stdin to NUL as well.)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Nope, actually double fork doesn't work.  It's misleading because in my 
testing, the first invocation of the process causes the core dump, but 
subsequent runs do not.

--

___
Python tracker 

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



Re: Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Cameron Simpson

On 12Nov2018 21:17, MRAB  wrote:

On 2018-11-12 19:37, srinivasan wrote:

When I use the subprocess I see the below issue:
def get_gateway_ip(self):

[...]
p = subprocess.Popen('ip route show 0.0.0.0/0 dev wlp1s0 | 
cut -d\

-f3', stdout=subprocess.PIPE)

[...]

root:~/qa/test_library# python3 wifi.py
Enabling wifi
Verify wifi connectivity
True
Get gateway wifi ip
Traceback (most recent call last):
  File "wifi.py", line 134, in 
print(m.get_gateway_ip())
  File "wifi.py", line 76, in get_gateway_ip
p = subprocess.Popen('ip route show 0.0.0.0/0 dev wlp1s0 | cut -d\
-f3', stdout=subprocess.PIPE)
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1289, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ip route show
0.0.0.0/0 dev wlp1s0 | cut -d\\  -f3'
root:~/qa/test_library#

As I am stuck with this issue from past 2 days, wondering for any 
clues



'Popen' thinks that the string you gave it is the path to a command.
It's not; it's a command line with arguments.
You can tell it that the string is a command line by also passing the 
keyword argument 'shell=True':


p = subprocess.Popen(r'ip route show 0.0.0.0/0 dev wlp1s0 | cut -d\ 
-f3', stdout=subprocess.PIPE, shell=True)


But as someone (Chris?) mentioned, it is _better_ to use a command path.

Although using shell=True lets you take a shell command you've worked 
out at the command prompt and use it directly in a Popen call, because 
such commands must include shell punctuation and may also include some 
string insertion, they are easy to get subtle wrong, often in ways that 
can be subverted by bad insertion.


I want to repeat Chris' recommendation to run things like the "ip" 
command directly:


 p = subprocess.Popen(['ip', 'route', 'show', '0.0.0.0/0', 'dev', 'wlp1s0'], 
...)

because it bypasses the shell entirely and lets you insert any string 
(such as the interface name above) directly.


Then do the logic which the "cut" command is providing directly in 
Python: it is more debuggable and more flexible.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I'm still testing this solution, but it looks like if you set the environment 
variable, and then double fork, the granchild won't crash.  Roughly:

os.putenv('OBJC_DISABLE_INITIALIZE_FORK_SAFETY', 'YES')
pid = os.fork()
if pid == 0:
subpid = os.fork()
if subpid == 0:
# I'm in a safe grandchild

--

___
Python tracker 

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



[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-12 Thread Windson Yang


Windson Yang  added the comment:

I will work on it today :D

--
nosy: +Windson Yang

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Christoph Gohlke


Christoph Gohlke  added the comment:

> test_isdigit.c: Can you try to call locale.setlocale(locale.LC_CTYPE, "") 
> before running your benchmark on Python 3.7.0?

Yes, that slows down Python 3.7.0a3 to the 3.7.0a4 level.

--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> This issue may be related to bpo-34485.

I'm thinking to:

New changeset 177d921c8c03d30daa32994362023f777624b10d by Victor Stinner in 
branch 'master':
bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988)
https://github.com/python/cpython/commit/177d921c8c03d30daa32994362023f777624b10d

Oh, I only made this change in the future Python 3.8 (master branch). So this 
change may be unrelated.

Note: Right now, my Windows VM is broken, so I cannot investigate this 
performance issue which seems to be specific to the msvcrt (libc of Microsoft 
VisualStudio).

--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

test_isdigit.c: Can you try to call locale.setlocale(locale.LC_CTYPE, "") 
before running your benchmark on Python 3.7.0?

This issue may be related to bpo-34485.

--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Christoph Gohlke


Christoph Gohlke  added the comment:

I attached a minimal C extension module that can be used to demonstrate the 
performance degradation from Python 3.7.0a3 to 3.7.0a4.

Build the extension with `py setup.py build_ext --inplace`, then run the 
following code on Python 3.7.0a3 to 3.7.0a4:

```
import time
from test_isdigit import test_isdigit

start_time = time.time()
test_isdigit()
print(time.time() - start_time)
```

On my Windows 10 Pro WS system, the timings are:

Python 3.7.0a3: ~0.0156
Python 3.7.0a4: ~0.3281


I would expect that other locale aware functions in the UCRT are also affected 
but I have not tested that.

--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> digits = ''.join([str(i) for i in range(10)]*1000)
> %timeit digits.isdigit() # --> 2X+ slower on python 3.7.1

This code calls:

* (Python) str.isdigit()
* unicode_isdigit_impl()
* _PyUnicode_IsDigit()
* _PyUnicode_ToDigit() which uses Python internal Unicode database

This code doesn't depend on locales at all. It's pure Unicode.

--

___
Python tracker 

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



[issue29564] ResourceWarning: suggest to enable tracemalloc in the message

2018-11-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2c07c493d2eb45101312e3eb3a77f94d0c9cad1f by Victor Stinner in 
branch 'master':
bpo-29564: warnings suggests to enable tracemalloc (GH-10486)
https://github.com/python/cpython/commit/2c07c493d2eb45101312e3eb3a77f94d0c9cad1f


--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Dragoljub


Dragoljub  added the comment:

Here is a simple pure python example:

digits = ''.join([str(i) for i in range(10)]*1000)
%timeit digits.isdigit() # --> 2X+ slower on python 3.7.1

Basically in Pandas C-code parser we call the isdigit() function for each 
number that is to be parsed. so 12345.6789 calls isdigt() 9 times to determine 
if this is a digit character that can be converted to a float. The problem is 
in the latest version of Python with locale updates isdigit() takes a locale 
argument that seems to be passed over and over slowing down this check. Is it 
possible that we disable any local passing from Python down to lower-level C 
code, or simply set the default locale to 'C' to keep it from thrashing?

--

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Christoph Gohlke


Change by Christoph Gohlke :


Added file: https://bugs.python.org/file47929/setup.py

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Christoph Gohlke


Change by Christoph Gohlke :


Added file: https://bugs.python.org/file47928/test_isdigit.c

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2018-11-12 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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-12 Thread Christoph Gohlke


Christoph Gohlke  added the comment:

> Can someone please try to write an example which only uses the stdlib?

The simplest is to compare performance of the 
`windll.LoadLibrary('API-MS-WIN-CRT-STRING-L1-1-0.DLL')` function on Python 
3.7.0a3 and 3.7.0a4, but that will mostly measure Python/ctypes overhead. I 
will post a minimal C extension instead.


> What are these extensions? Where do them come from?

The `isdigit` function is from the UCRT. The `parsers` Cython/C extension is 
part of the pandas wheel on PyPI. The context for this issue is at 
https://github.com/pandas-dev/pandas/issues/23516


> I don't understand which "locale changes" you are talking about. You can 
> change the locale using locale.setlocale().

The `UCRT.isdigit` function, when run on Python >=3.7.0a4, calls the 
`_isdigit_l` function, which calls `_LocaleUpdate::_LocaleUpdate` (see the VS 
profiler output).

--
nosy: +cgohlke

___
Python tracker 

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



[issue35031] test_asyncio test_start_tls_server_1 fails in AMD64 FreeBSD CURRENT buildbots

2018-11-12 Thread miss-islington


miss-islington  added the comment:


New changeset 3f9fe53c98978955fea4e36456c784694e6458a8 by Miss Islington (bot) 
in branch '3.7':
bpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011)
https://github.com/python/cpython/commit/3f9fe53c98978955fea4e36456c784694e6458a8


--
nosy: +miss-islington

___
Python tracker 

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



[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Based on my testing, the environment variable has to be set before the parent 
process starts.  Neither os.environ nor os.putenv seem to do the trick.

--

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2018-11-12 Thread Emily Morehouse


Change by Emily Morehouse :


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

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2018-11-12 Thread Emily Morehouse


Change by Emily Morehouse :


--
keywords: +patch, patch
pull_requests: +9758, 9759
stage:  -> patch review

___
Python tracker 

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



[issue35223] Pathlib incorrectly merges strings.

2018-11-12 Thread Roffild


Roffild  added the comment:

It is necessary to assemble a single path from several lines depending on the 
OS.

It is logical to expect behavior in Java.
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html
Converts a path string, or a sequence of strings that when joined form a path 
string, to a Path. If more does not specify any elements then the value of the 
first parameter is the path string to convert. If more specifies one or more 
elements then each non-empty string, including first, is considered to be a 
sequence of name elements (see Path) and is joined to form a path string. The 
details as to how the Strings are joined is provider specific but typically 
they will be joined using the name-separator as the separator. For example, if 
the name separator is "/" and getPath("/foo","bar","gus") is invoked, then the 
path string "/foo/bar/gus" is converted to a Path. A Path representing an empty 
path is returned if first is the empty string and more does not contain any 
non-empty strings.

My temporary fix is something like this:
print("\\".join(["C:/123\\345", "\\", "folder///filename.bin"]).replace("/", 
"\\").replace("", "\\").replace("", "\\"))

--

___
Python tracker 

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



[issue35031] test_asyncio test_start_tls_server_1 fails in AMD64 FreeBSD CURRENT buildbots

2018-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9757

___
Python tracker 

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



[issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr

2018-11-12 Thread skreft


skreft  added the comment:

@r.david.murray where do you see that those functions are only defined for 
ascii? There's nothing in the online docs stating that and furthermore 
`formataddr` has supported non-ascii names since version 3.3. RFC 2822 is 
however mentioned in the docstrings.

The fact that `formataddr` is not really the inverse warrants at least a note 
or clarification in the docs.

--

___
Python tracker 

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



[issue32492] C Fast path for namedtuple's property/itemgetter pair

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -9755

___
Python tracker 

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



[issue32492] C Fast path for namedtuple's property/itemgetter pair

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -9756

___
Python tracker 

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



[issue32492] C Fast path for namedtuple's property/itemgetter pair

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +9754, 9755

___
Python tracker 

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



[issue32492] C Fast path for namedtuple's property/itemgetter pair

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +9754, 9755, 9756

___
Python tracker 

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



[issue32492] C Fast path for namedtuple's property/itemgetter pair

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +9754

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2018-11-12 Thread Emily Morehouse


New submission from Emily Morehouse :

This issue will serve to track development and PRs for the implementation of 
PEP 572: Assignment Expressions.

--
assignee: emilyemorehouse
components: Interpreter Core
messages: 329781
nosy: emilyemorehouse, gvanrossum, tim.peters
priority: normal
severity: normal
status: open
title: PEP 572: Assignment Expressions
type: enhancement
versions: Python 3.8

___
Python tracker 

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



Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy

On 11/12/2018 7:15 PM, Thomas Jollans wrote:

On 13/11/2018 00:45, Terry Reedy wrote:


On Windows, a simple alternate is a .bat file.  I belive the folloiwing
should work.

cd c:/desired/startup/directory
py -x.y -m idlelib

The default for x.y is latest 3.x or latest 2.x if no 3.x.


Correct me if I'm wrong, but won't that create an empty command prompt
window nobody wants to see? (which you can get rid of by calling
START /B on a win32 application like pythonw.exe. Is there a pyw.exe or
something?


Yes, thanks for the reminder.  Unless the console is needed (as when 
user code creates subprocesses that print) 'pyw' can be used instead of 
'py'.


When using CommandPrompt, 'pyw -m idlelib' detaches the process from the 
console, which might or might not be a good thing.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I've done a fair bit of testing and it seems rather inconsistent as to whether 
either of these work when added right before an explicit call to `os.fork()`:

os.environ['OBJC_DISABLE_INITIALIZE_FORK_SAFETY'] = 'YES'

ctyles.cdll.LoadLibrary('/System/Library/Frameworks/Foundation.framework/Foundation')

Neither of these seems to reliably prevent the __NSPlaceholderDate warning, nor 
prevent the core dumps.  The best I've been able to do is to prevent them by 
setting the environment variable *before* the parent process starts (i.e. 
outside of the Python code of the process).

--

___
Python tracker 

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



[issue35223] Pathlib incorrectly merges strings.

2018-11-12 Thread Eric V. Smith

Eric V. Smith  added the comment:

As far as which path components are returned, I think this is working as 
designed. The documentation for os.path.join says:

"""
If a component is an absolute path, all previous components are thrown away and 
joining continues from the absolute path component.

On Windows, the drive letter is not reset when an absolute path component 
(e.g., r'\foo') is encountered.
"""

pathlib's documentation for creating PurePath objects says:

"""
When several absolute paths are given, the last is taken as an anchor 
(mimicking os.path.join()’s behaviour)
"""

--
nosy: +eric.smith

___
Python tracker 

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



[issue35215] Replacing CPython memory allocation

2018-11-12 Thread paul


paul  added the comment:

Hi guys, 

First, thanks for the prompt replies. 

@matrixise: If there is i can't find it, but i am happy to accept it as a 
possibility. Equally, maybe there is an assumption about memory in the cpython 
implementation somewhere that goes against my memory allocator -> this is 
obviously not cpythons fault. The point of this 'issue' is to ask the community 
to suggest how i can go about finding where the problem is. As i said, there is 
a lot of code :)

@pablogsal: Yeah. I had a look in there. In cpython, i have made all 
allocations from obmalloc use my memory allocation functions, including the 
arenas. 

Perhaps a starting point would be if anyone has ideas about how to go about 
debugging this??

best, 

Paul

--

___
Python tracker 

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



Re: IDLE Default Working Directory

2018-11-12 Thread Thomas Jollans
On 13/11/2018 00:45, Terry Reedy wrote:
> 
> On Windows, a simple alternate is a .bat file.  I belive the folloiwing
> should work.
> 
> cd c:/desired/startup/directory
> py -x.y -m idlelib
> 
> The default for x.y is latest 3.x or latest 2.x if no 3.x.

Correct me if I'm wrong, but won't that create an empty command prompt
window nobody wants to see? (which you can get rid of by calling
START /B on a win32 application like pythonw.exe. Is there a pyw.exe or
something?)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: distribute python interpreter and dependencies

2018-11-12 Thread Thomas Jollans
On 12/11/2018 17:40, Juan Cristóbal Quesada wrote:
> Hello,
> this is my first mail. I resorted to the list after some prior struggling.

Welcome!

> Im facing the need to distribute a python installation folder and
> interpreter in a shared network drive.
> 
> Im also distributing the application's source code that would lie also in
> another network drive.
> 
> For this, my attempts have gone towards replicating the python installation
> folder created after installing python27 in one machine and copy all the
> files and directories to the network drive. After that, copied the
> python27.dll of the C:/Windows/System32 file and set all the
> Python27/lib;Python27/DLLs/Python27/Scripts... to the PATH environment
> variable through a launcher script.

I assume you have a good reason to want to use an old version of Python...

> 
> This works on my machine and a couple othersBUT, not in some other
> machines running as well windows 10 pro. 

In what way does it not work? Is there an error message?

> So i investigated a bit and
> discovered that if i install the python27 (2.7.11 same version) in one of
> those failing machines... the "ctypes.pyd" module's filesize is
> different So i replaced the original python27 folders with those of the
> new installed python and now it works on those machines..havent
> tried yet if it still works on the first ones...
> 
> Why is this behaviour? Im guessing the python27 installer generates some
> dlls "on the fly" that are tied to the windows operating system...
> 
> I dont want to create a windows executable via py2exe or
> pyinstaller.. What are the best steps to make a python interpreter
> available to all windows based different machines? Am i missing something
> else? What are the steps the python windows installer performs in order?

I have no idea what the Python.org installer is doing here, but you
could try one of the other Python distributions (e.g. miniconda)...
MAYBE you'll have more luck with that (Or ActivePython, or WinPython, or
whatever).


-- Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 3b5b1c0931cd32253bbf2f3bd74e90ff821e026e by Gregory P. Smith in 
branch '3.6':
[3.6] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10493)
https://github.com/python/cpython/commit/3b5b1c0931cd32253bbf2f3bd74e90ff821e026e


--

___
Python tracker 

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



[issue35223] Pathlib incorrectly merges strings.

2018-11-12 Thread Roffild


New submission from Roffild :

Code:
import os
print(os.path.join("C:/123\\345", "\\", "folder///filename.bin"))
import pathlib
print(pathlib.PureWindowsPath("C:/123\\345", "\\", "folder///filename.bin"))

Result:
C:\folder///filename.bin
C:\folder\filename.bin

Expected result for Windows:
C:\123\345\folder\filename.bin

The number of slashes should be controlled by the library. Replacing / on \ 
should also depend on the OS.

--
components: IO, Library (Lib), Windows
messages: 329776
nosy: Roffild, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Pathlib incorrectly merges strings.
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



Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy

On 11/12/2018 10:35 AM, Bev in TX wrote:

On Nov 12, 2018, at 9:16 AM, eryk sun  wrote:


On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> 
wrote:


I looked in IDLE's own configuration menu, and didn't see anything there --
and I fear that I might have to fight some Windows settings somewhere else
instead.   I think this is Windows 10.


Modify the "Start in" field of the IDLE shortcut. You can use
environment variables, e.g. "%UserProfile%\Documents".


I am not the OP and I’m on macOS — no shortcuts.  How would one do the same 
thing on other platforms?
Bev in TX


For me, open (command-O) opens 'Documents'.  I presume it should be easy 
enough to move into a 'py' subfolder.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


[issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr

2018-11-12 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the report, but parseaddr and formataddr are defined *only* for 
ASCII.  In the port to python3, parseaddr sort-of-maybe-sometimes does the 
naively expected thing with non-ascii, but that's just an accident.  We could 
have added a check for non-ascii to parseaddr during the python3 port, but we 
didn't think of it, and it is too late now since adding it would break 
otherwise working code even though that code is technically broken.

So, for the defined API of parseaddr/formataddr, there is no bug here.

As for handling non-ascii in email per your link:

>>> from email.message import EmailMessage
>>> from email.policy import default
>>> m = EmailMessage(policy=default.clone(utf8=True))
>>> m['From'] = 'skreft+ñandú@sudoai.com
>>> bytes(m)
b'From: skreft+\xc3\xb1and\xc3\x...@sudoai.com\n\n'

(NB: in testing the above I discovered there is actually a recent bug in the 
serialization when utf8 is *False*: it does RFC2047 encoding of the username, 
which it should not do...instead it should raise an error.  Feel free to open a 
bug report for that...)

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

___
Python tracker 

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



Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy

On 11/12/2018 2:28 PM, eryk sun wrote:

On 11/12/18, Christman, Roger Graydon  wrote:

eryk sun  responded:

On 11/12/18, Christman, Roger Graydon  wrote:


I looked in IDLE's own configuration menu, and didn't see anything there
--
and I fear that I might have to fight some Windows settings somewhere
else
instead.   I think this is Windows 10.


Modify the "Start in" field of the IDLE shortcut. You can use
environment variables, e.g. "%UserProfile%\Documents".



Unfortunately, since I do not have any administrative privileges, I do not
think I have the ability to modify any of these shortcuts.  Nor do I know
off hand how to set environment variables in a manner that would work
consistently throughout the term, so that they persist for all logins.


If Python is installed for all users, then the shortcut should be a
file named like "IDLE (Python 3.x [32|64]-bit).lnk" in the directory
"%ProgramData%\Microsoft\Windows\Start Menu\Programs\Python 3.x". Copy
it to the user's desktop, where you'll have the right to modify it. Or
instead you can just create a new shortcut on the desktop that runs
"C:\path\to\python\installation\pythonw.exe"
"C:\path\to\python\installation\Lib\idlelib\idle.pyw".

As to environment variables to use in "Start in", %UserProfile% is a
built-in variable for the current user's profile directory; you don't
have to add it.


On Windows, a simple alternate is a .bat file.  I belive the folloiwing 
should work.


cd c:/desired/startup/directory
py -x.y -m idlelib

The default for x.y is latest 3.x or latest 2.x if no 3.x.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

it still seems relevant, having better docs is always good.

--

___
Python tracker 

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



[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-12 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

It's been more than 3 years, since this was opened, but I will ask 
nevertheless. Should a PR maybe made for this issue?

--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr

2018-11-12 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is indeed an issue with formataddr, it expects the input to be ascii 
encoded as RFC 2822 requires.

Email is much more complicated though and has been internationalized, a summary 
of this work is available at 
https://en.wikipedia.org/wiki/Email_address#Internationalization.

I think the check in formataddr is not desirable anymore and should be remove.

I'm not sure wether the resulting value should be encoded using email.header or 
not.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue10486] http.server doesn't set all CGI environment variables

2018-11-12 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, REMOTE_USER are present

REMOTE_IDENT is not but I'm not sure it's worth adding.

I can send a PR to add REMOTE_HOST and remove the condition for QUERY_STRING.

Otherwise, I don't think the other environment variables should be added, they 
are implementation dependant and not defined in RFC 3875.

Should we close this issue?

--

___
Python tracker 

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



[issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly

2018-11-12 Thread Oscar Esteban


Oscar Esteban  added the comment:

I tried to reuse as much as I could from the patch, but it didn't solve the 
issue at first.

I have changed the responsibility of identifying and prescribing a solution 
when a worker got killed. In the proposed patch, the thread handling results 
(i.e. tasks queued by one worker as done) was responsible. In the PR, the 
responsibility is reassigned to the thread handling workers (since, basically, 
one or more workers suddenly die).

The patch defined a new BROKEN state that was assigned to the results handler 
thread. I transferred this behavior to the worker handler thread. But, I'm 
guessing that the BROKEN state should be assigned to the Pool object instead, 
to be fully semantic. Although that would require passing the reference to the 
object around and complicate unnecessarily the implementation. Happy to 
reconsider though.

I added three tests, one that was present with the patch, a variation of it 
adding some wait before killing the worker, and the one that Francis Bolduc 
posted here (https://bugs.python.org/issue22393#msg294968).

Please let me know whether any conversation about this bug should take place in 
GitHub, with the PR instead of here.

Thanks a lot for the guidance, Antoine.

--

___
Python tracker 

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



Re: passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread MRAB

On 2018-11-12 09:39, Benedikt Kroll wrote:

Hi,

using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm 
having trouble
passing the value back to Apache.

The log says "map lookup OK", but the value is empty.

According to the Apache documentation 
(https://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg), the script 
"should return one new-line terminated response string on STDOUT" which is then 
used as the rewrite target.

I have tried to do this using:
sys.stdout.write(newValue + "/n")
sys.stdout.flush()

However, Apache receives only an empty return value (with no error).

On Stackoverflow and others, I found and tried out some examples, which
in some cases where quite old, so probably written for older versions.

The following is what I extracted from the more current hints I could find.


*.conf
RewriteEngine On
RewriteMap extrw "prg:/opt/extrw.py"
RewriteRule "^(.*)" "${extrw:%{REQUEST_URI}}"


/opt/extrw.py
import sys
while True:
newValue = "/index.html" # placeholder for testing
sys.stdout.write(newValue + "/n")
sys.stdout.flush()


log for curl 127.0.0.1/abc
init rewrite engine with requested uri /abc
applying pattern '^(.*)' to uri '/abc'
map lookup OK: map=extrw key=/abc -> val=
rewrite '/abc' -> ''
local path result:


The expected result would be to have "map lookup OK: map=extrw key=/abc
-> val=/index.html" in the third line.

Any help would be appreciated!

The examples I've found are also reading from stdin, so I'd suggest 
trying that:


import sys

while True:
arg = sys.stdin.readline()
newValue = "/index.html" # placeholder for testing
sys.stdout.write(newValue + "/n")
sys.stdout.flush()
--
https://mail.python.org/mailman/listinfo/python-list


[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Lisa Roach


Lisa Roach  added the comment:

Using plain angle brackets is common placeholder notation, and I think changing 
it to something different might be confusing to those who are familiar with the 
pattern. I have also seen plenty of people copying and pasting the wrong things 
because of this notation, but I agree with Steven that it is a part of the 
learning process that we all go through.

Perhaps just adding the line ' must be replaced by the path of the 
directory containing the virtual environment' would suffice to clarify?

--
nosy: +lisroach

___
Python tracker 

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



Re: Anyone running Python on MS Azure?

2018-11-12 Thread Cris Medina
The python azure lib that MS maintains wraps all Azure services like boto3
does for AWS. However, be prepared for constant changes that are
incompatible across versions. They do provide a mechanism for you to stick
with an API version for backwards compatibility that allows an upgrade of
the python module while keeping with the interfaces you use.

The main problem I've had with Azure is not the python module, it's the
reliability of the services themselves. Be prepared for endless retries and
moments in which you've made a change that service accepted, but doesn't
actually take effect for a long time (several mins to half hour). You'll
also receive sporadic internal error responses from the servers when making
API calls.

Services I use almost daily: spin up, manage (including remote execution)
and destroy compute and network resources (including express route, virtual
gateways and connections).

Hope this helps.-

On Fri, Nov 9, 2018, 7:44 PM Malcolm Greene  wrote:

> Curious to hear if any of you are running Python scripts/apps on MS
> Azure cloud services? What services are you using and what has your
> experience been? Advice?
> Background: Customer migrating to Azure. I'm trying to get ahead of the
> curve regarding how Python-friendly the Azure platform is.
> Thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


distribute python interpreter and dependencies

2018-11-12 Thread Juan Cristóbal Quesada
Hello,
this is my first mail. I resorted to the list after some prior struggling.

Im facing the need to distribute a python installation folder and
interpreter in a shared network drive.

Im also distributing the application's source code that would lie also in
another network drive.

For this, my attempts have gone towards replicating the python installation
folder created after installing python27 in one machine and copy all the
files and directories to the network drive. After that, copied the
python27.dll of the C:/Windows/System32 file and set all the
Python27/lib;Python27/DLLs/Python27/Scripts... to the PATH environment
variable through a launcher script.

This works on my machine and a couple othersBUT, not in some other
machines running as well windows 10 pro. So i investigated a bit and
discovered that if i install the python27 (2.7.11 same version) in one of
those failing machines... the "ctypes.pyd" module's filesize is
different So i replaced the original python27 folders with those of the
new installed python and now it works on those machines..havent
tried yet if it still works on the first ones...

Why is this behaviour? Im guessing the python27 installer generates some
dlls "on the fly" that are tied to the windows operating system...

I dont want to create a windows executable via py2exe or
pyinstaller.. What are the best steps to make a python interpreter
available to all windows based different machines? Am i missing something
else? What are the steps the python windows installer performs in order?
-- 
https://mail.python.org/mailman/listinfo/python-list


passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread Benedikt Kroll
Hi,

using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm 
having trouble
passing the value back to Apache. 

The log says "map lookup OK", but the value is empty.

According to the Apache documentation 
(https://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg), the script 
"should return one new-line terminated response string on STDOUT" which is then 
used as the rewrite target.

I have tried to do this using:
sys.stdout.write(newValue + "/n")
sys.stdout.flush()

However, Apache receives only an empty return value (with no error).

On Stackoverflow and others, I found and tried out some examples, which
in some cases where quite old, so probably written for older versions.

The following is what I extracted from the more current hints I could find.


*.conf
RewriteEngine On
RewriteMap extrw "prg:/opt/extrw.py"
RewriteRule "^(.*)" "${extrw:%{REQUEST_URI}}"


/opt/extrw.py
import sys
while True:
   newValue = "/index.html" # placeholder for testing
   sys.stdout.write(newValue + "/n")
   sys.stdout.flush()


log for curl 127.0.0.1/abc
init rewrite engine with requested uri /abc
applying pattern '^(.*)' to uri '/abc'
map lookup OK: map=extrw key=/abc -> val=
rewrite '/abc' -> ''
local path result:


The expected result would be to have "map lookup OK: map=extrw key=/abc
-> val=/index.html" in the third line.

Any help would be appreciated!

Thanks!
Benedikt
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

https://docs.python.org/3/library/venv.html

> my students are often confused by it, sometimes they copy the angle brackets, 
> sometime even the prompt.

Learning to recognise placeholders and the prompt is an essential part of 
learning to code, and a stage that everyone has to go through. Replacing plain 
text markup with styled formatting doesn't change that, but it does make it 
harder for the blind or visually impaired who are using screen-readers, or 
those who prefer to use a plain text interface with no support for bold/italic.

How do your enhancements look in w3m, links or linx? The current design renders 
nicely in plain text on links. (I haven't checked the other two.)


> I ran a few tests.

What sort of tests? Usability tests? What results did you get?


> Someone on #python-fr proposed 
> https://framapic.org/XnBQZcJVRlZw/F05D7I8nSKd0.png

Link doesn't work for me. I get a blank page.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr

2018-11-12 Thread skreft

New submission from skreft :

The docs 
(https://docs.python.org/3/library/email.util.html#email.utils.formataddr) say 
that formataddr is the inverse of parseaddr, however non-ascii email addresses 
are treated differently in both methods.

parseaddr will return non-ascci addresses, whereas formataddr will raise a 
UnicodeError.

Below is an example:

In [1]: import email.utils as u

In [2]: u.parseaddr('skreft+ñandú@sudoai.com')
Out[2]: ('', 'skreft+ñandú@sudoai.com')

In [3]: u.formataddr(u.parseaddr('skreft+ñandú@sudoai.com'))
---
UnicodeEncodeErrorTraceback (most recent call last)
 in ()
> 1 u.formataddr(u.parseaddr('skreft+ñandú@sudoai.com'))

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py 
in formataddr(pair, charset)
 89 name, address = pair
 90 # The address MUST (per RFC) be ascii, so raise a UnicodeError if 
it isn't.
---> 91 address.encode('ascii')
 92 if name:
 93 try:

UnicodeEncodeError: 'ascii' codec can't encode character '\xf1' in position 7: 
ordinal not in range(128)

--
components: email
messages: 329765
nosy: barry, r.david.murray, skreft
priority: normal
severity: normal
status: open
title: email.utils.formataddr is not exactly the reverse of 
email.utils.parseaddr
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



[issue33944] Deprecate and remove pth files

2018-11-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Nov 10, 2018, at 04:50, Ivan Pozdeev  wrote:

> In its .pth file, each such package will import the hook's module (which will 
> cause the hook to be installed on the first import) and "register" its 
> namespaces and/or dependencies with it. The hook will then calculate the 
> required load order and enforce it upon import of any of the registered 
> namespaces.

I’m a little concerned about this approach because it means random third party 
modules can affect the global environment for your application, without knowing 
it.  Since the hook installation happens at import time, and just depending on 
a library that has such a .pth file will install it, the end application will 
not have control over its global state.  It’s not possible to know whether this 
is a serious problem, but in the past, global state changes are problematic 
when applications do not have control over it.

--

___
Python tracker 

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



[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2018-11-12 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue10486] http.server doesn't set all CGI environment variables

2018-11-12 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

The reference given in 
https://github.com/python/cpython/blob/b36b0a3765bcacb4dcdbf12060e9e99711855da8/Lib/http/server.py#L1074
 is not accessible anymore.

I think we should replace it by https://tools.ietf.org/html/rfc3875#section-4.1

--

___
Python tracker 

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



[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Julien Palard


Julien Palard  added the comment:

Forgot to mention, the bold and italics one were done using unicode 
mathematical characters, they are not properly rendered in PDFs so we can't use 
them as is: https://mdk.fr/pdf.png

--

___
Python tracker 

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



[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Julien Palard


New submission from Julien Palard :

I'd like to enhance the readability of the "venv activation commands" in 
library/venv.html, my students are often confused by it, sometimes they copy 
the angle brackets, sometime even the prompt.

I don't think we can fix everything, but maybe enhance a bit, I ran a few tests.

Before modification: 
https://screenshotscdn.firefoxusercontent.com/images/77cf6612-1934-4a3b-9376-87a012a76bc3.png

First try with a :file:, not better: 
https://screenshotscdn.firefoxusercontent.com/images/db4e1191-a740-4828-b53a-ccc4a8d33dae.png

Second try, simply double backquotes:
https://screenshotscdn.firefoxusercontent.com/images/d6be92a1-e4af-40f5-9281-d9c09d8a0908.png

Third try using bold but it hurt the eyes:
https://screenshotscdn.firefoxusercontent.com/images/6fb1026f-064b-41dd-822b-3b258e37a85e.png

4th try using simply capslock, maybe better:
https://screenshotscdn.firefoxusercontent.com/images/9e9c3f7b-639c-4f26-abcc-20948e15a65d.png

5th try using capslock and italics, I like it:
https://screenshotscdn.firefoxusercontent.com/images/b5ae5582-1706-4ea9-a702-910daf2c69bc.png

Someone on #python-fr proposed 
https://framapic.org/XnBQZcJVRlZw/F05D7I8nSKd0.png (rendered from markdown in 
github). I like it but it would require a specific role to render bold-italic 
in code block.

--
assignee: mdk
components: Documentation
messages: 329762
nosy: mdk
priority: normal
severity: normal
status: open
title: Enhance venv activate commands readability

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +9751

___
Python tracker 

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



[issue35216] misleading error message from shutil.copy()

2018-11-12 Thread Julien Palard


Julien Palard  added the comment:

Using `cp` on Debian Buster I'm having a better error message:

$ touch foo
$ cp foo bar/
cp: failed to access 'bar/': Not a directory

>From copy.c (from Debian coreutils):

/* Improve quality of diagnostic when a nonexistent dst_name
   ends in a slash and open fails with errno == EISDIR.  */
if (dest_desc < 0 && dest_errno == EISDIR
&& *dst_name && dst_name[strlen (dst_name) - 1] == '/')
  dest_errno = ENOTDIR;

--
nosy: +mdk

___
Python tracker 

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



[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I'm not sure whether it's a duplicate or not, since in my case it doesn't hang, 
but instead core dumps.  It's seems like the reasoning given in the Ruby bug is 
relevant to Python too, so maybe we should adopt the same workaround.  For our 
internal projects, I'm probably just going to set the environment variable for 
now.

I'd love to know what Ned and Ronald thing, thus cc'ing them.

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1 by Gregory P. Smith in 
branch '3.7':
[3.7] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10492)
https://github.com/python/cpython/commit/5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1


--

___
Python tracker 

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



[issue33725] High Sierra hang when using multi-processing

2018-11-12 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This can a duplicate of https://bugs.python.org/issue33725

--

___
Python tracker 

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



[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Apparently, GitLab have a more permanent solution around this by enabling the 
Objective-C runtime before any forking happens: 

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16649/diffs

--

___
Python tracker 

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



[issue35215] Replacing CPython memory allocation

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi @paul,

have you already checked 
https://docs.python.org/3/c-api/memory.html#customize-memory-allocators ?

--

___
Python tracker 

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



[issue35215] Replacing CPython memory allocation

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg329755

___
Python tracker 

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



[issue35215] Replacing CPython memory allocation

2018-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi @paul,

have you already checked 
https://docs.python.org/3/c-api/memory.html#customize-memory-allocators?

--
nosy: +pablogsal

___
Python tracker 

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



[issue35219] macOS 10.14 Mojave crashes in multiprocessing

2018-11-12 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

On Nov 12, 2018, at 13:34, Pablo Galindo Salgado  wrote:

> Apparently setting the env variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES 
> should fix some fork-related changes. Have you tried already doing this? Does 
> it change the behaviour of the errors in any way?

Yes, sorry I got distracted before I could add a comment about this.  I have 
indeed tested this and it does prevent the core files.

--

___
Python tracker 

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



[issue35207] Disallow expressions like (a) = 42

2018-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> not a bug
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



  1   2   >