[issue30046] csv: Inconsistency re QUOTE_NONNUMERIC

2017-04-19 Thread Dong-hee Na

Changes by Dong-hee Na :


--
pull_requests:  -1305

___
Python tracker 

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



[issue30046] csv: Inconsistency re QUOTE_NONNUMERIC

2017-04-19 Thread Dong-hee Na

Changes by Dong-hee Na :


--
pull_requests:  -1303

___
Python tracker 

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



[issue30046] csv: Inconsistency re QUOTE_NONNUMERIC

2017-04-19 Thread Dong-hee Na

Dong-hee Na added the comment:

I would like to solve this issue. 
Is there any other way than casting specifically for the bool object?
(e.g For general ways?)

--
nosy: +corona10

___
Python tracker 

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



[issue30046] csv: Inconsistency re QUOTE_NONNUMERIC

2017-04-19 Thread Dong-hee Na

Dong-hee Na added the comment:

Oh, I read the Serhiy Storchaka 's comment just right now.

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

How to use this feature? argparse is executed every time when the end user runs 
the program. But generating a man page is the action that should be executed at 
develop or build stage. The end user gets a generated man page, he doesn't need 
the option to generate a man page on a fly. The developer needs the ability to 
generate a man page rather than running the program for its main purpose. What 
should be the structure of the program that uses argparse for parsing arguments 
and for generating a man page? How generating a man page should be invoked?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about difference_update(), issubset(), issuperset(), __eq__()?

Raising TypeError looks reasonable to me. Operations with ordinal sets can 
raise TypeError for unhashable values.

>>> [] in set()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'
>>> set().remove([])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'
>>> set().discard([])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'

Unlike to set.__contains__ WeakSet.__contains__ returns False for unsupported 
types:

>>> [] in weakref.WeakSet()
False

Shouldn't set.__contains__ be changed to return False for unhashable values? Or 
may be make WeakSet.__contains__ raising TypeError for values that can't have 
weak references?

--
components: +Library (Lib)
nosy: +rhettinger, serhiy.storchaka, stutzbach

___
Python tracker 

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



[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

dict.pop() supports unhashable values, but dict.__contains__() and dict.get() 
don't:

>>> [] in {}
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'
>>> {}.get([], 42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'
>>> {}.pop([], 42)
42

OrderedDict.pop() also doesn't support unhashable values:

>>> collections.OrderedDict().pop([], 42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'list'

--

___
Python tracker 

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



[issue30095] HTMLCalendar allow custom classes

2017-04-19 Thread Walter Dörwald

Walter Dörwald added the comment:

IMHO this could all be done by overwriting the relevant methods.

But this might be overkill.

I think a solution might be to move the CSS classes into class attributes of 
HTMLCalendar. Customizing the CSS classes would then be done by subclassing 
HTMLCalendar and overwriting the appropriate class attributes.

Is this what you had in mind?

--
nosy: +doerwalter

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu

Louie Lu added the comment:

> How to use this feature?
> argparse is executed every time when the end user runs the program.
> But generating a man page is the action that should be executed at
> develop or build stage.
> ...
> How generating a man page should be invoked?

For now, man page will only be generated by using `print_manpage` function, and 
argparse won't add a shortcut like help page (-h).

Developer can use `parser.add_manpage_section` to add custom manpage section, 
e.g. copyright, report bugs.

The only thing that will affect it that `add_manpage_section` will be adding at 
runtime, but user won't used it.


> The end user gets a generated man page, he doesn't need the option to 
> generate a man page on a fly. The developer needs the ability to generate a 
> man page rather than running the program for its main purpose.

Yes, this patch will only offer the ability to generate man page, but if 
developer want to build with `setup.py`, it still need to combine them.


> What should be the structure of the program that uses argparse for parsing 
> arguments and for generating a man page?

It won't need additional change, just used current method and it will work.

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But how to use print_manpage()? Can you provide a new template of a program 
that uses argparse?

--

___
Python tracker 

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



[issue30095] HTMLCalendar allow custom classes

2017-04-19 Thread Oz Tiram

Oz Tiram added the comment:

@doerwalter, exactly. I found myself overwriting the relevant methods too many 
times.

I usually did something like this:

class WorkCalendar(HTMLCalendar):

def formatmonthname(self, theyear, themonth, withyear=True,
style=r'class="month-head"'):
 
"""
Return a month name as a table row.
"""
monthname = super().formatmonthname(theyear, themonth, withyear)
regex = r'class\="month"'
return re.sub(regex, style, monthname, 1)


Using class attributes would nice, also considering that the days CSS classes 
are defined as class attributes.

My intention was a few more class attributes (for the month header, and month) 
and also change the existing code such that each day can have multiple CSS 
classes and not just one.

I am willing to work on a PR for that if that sounds good and there is someone 
who would be willing to merge it.

--

___
Python tracker 

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



[issue30095] HTMLCalendar allow custom classes

2017-04-19 Thread Oz Tiram

Oz Tiram added the comment:

... Using class attributes would nice, also considering that the days CSS 
classes are defined as class attributes.

I meant to write :

Using class attributes would be nicer, also considering that the days CSS 
classes are defined as class attributes.

--

___
Python tracker 

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



[issue30095] HTMLCalendar allow custom classes

2017-04-19 Thread Walter Dörwald

Walter Dörwald added the comment:

OK, go ahead. I'm looking forward to what you come up with.

--

___
Python tracker 

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



[issue29925] test_uuid fails on OS X Tiger

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c209b70d610da50a844a3c10f37d6183bade3446 by Victor Stinner in 
branch 'master':
bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971)
https://github.com/python/cpython/commit/c209b70d610da50a844a3c10f37d6183bade3446


--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu

Louie Lu added the comment:

Attachment is the poc of generating man page via `print_manpage`:

$ ./python poc_2.py > output && man ./output

--
Added file: http://bugs.python.org/file46812/poc_2.py

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu

Louie Lu added the comment:

Also, `print_manpage` use the same infra as `print_help` and `print_usage`, so 
it can use the parameter `file` to output to different stream or file.

--

___
Python tracker 

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



[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2017-04-19 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Raising TypeError looks reasonable to me. 
> Operations with ordinal sets can raise TypeError 
> for unhashable values.

I agree.  TypeError looks the right exception in this case.

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Your example just prints a man page. It doesn't do anything useful besides this.

I'm asking how argparse can do two incompatible things: provide a command-line 
interface for an end user and generate a man page in a build script.

Do you mean that the programmer should create a separate script for generating 
a man page and copy a part of the code from the main program? This workflow 
should be documented, with examples. And it is not applicable for simple 
one-file scripts.

--

___
Python tracker 

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



[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The argument for not raising TypeError for unsupported types:

This is just from the definition of a set. If the set can't contain the value 
of specific type, then checking if this value is contained in the set should 
return False, and discarding it from the set should be no-op.

The argument for raising TypeError for unsupported types:

Using a value of unsuitable type is likely a programming error. Silencing 
TypeError can hide an error. Since raising and catching an exception is costly 
(but it is cheaper in C than in Python), this also can lead to performance 
degradation which is hard to catch.

If the first argument is stronger then the second argument then we should 
change a number of set, dict, dict views and OrderedDict methods and make them 
returning a reasonable result rather than raising TypeError.

If the second argument is stronger then the first argument then we should 
change just WeakSet.__contains__() and dict.pop(). Since this is a behavior 
change that can break third-party code they should first emit deprecation 
warnings for one or two releases.

--

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-19 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

> So I expect that the case you 'care most about' already works.

Yes, it works. That's the most ironic part of this issue: getfullargspec(func) 
works but packages like Sphinx will not call getfullargspec(func) because they 
do not detect that "func" is actually a function.

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu

Louie Lu added the comment:

Sorry that I didn't figure out what you said in the previous msg.

> provide a command-line interface for an end user

I add a parameter that developer can switch command line option for man page, 
if the option is on, user can do this:

./python foo.py --manpage

and open the manpage, but I think this isn't a good approach, since normal user 
will simply use `man foo.py`.

> generate a man page in a build script.
> Do you mean that the programmer should create a separate script for 
> generating a man page and copy a part of the code from the main program? This 
> workflow should be documented, with examples. And it is not applicable for 
> simple one-file scripts.

I not sure if argparse need to provide a setuptools command, if need, the 
approach that Oz provide can be used, and developer only need to do like this 
in setup.py

from argparser import build_manpage
cmdclass={'build_manpage': build_manpage}

then at the command line, developer can build manpage as `./python setup.py 
build_manpage --output=foo.1 --parser=foo.parser`

If provide this is function too far for argparse, then as you said, a 
well-documented workflow should be provided.



Even if argparse provide this function, end-user still can't easily do the 
trick `man foo.py` or `man foo` if script point is provide in setup.py. If need 
to approach things like `man foo`, it may need to integrate with setuptools to 
put the man page file to the correct path (e.g. /usr/share/man/man1)

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Zbyszek Jędrzejewski-Szmek

Zbyszek Jędrzejewski-Szmek added the comment:

If you can import the module that defines the parser, and get at the generated 
parser, this should be trivial to integrate with the build system. Something 
like:
   PYTHONPATH=. python3 -c 'import mymodule; p=mymodule.make_parser(); 
p.print_manpage(file="mymodule.1")'

This operation could either be done automatically during build always, or it 
could just be done by the developers and the man page put under version control.

--

___
Python tracker 

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



[issue29533] urllib2 works slowly with proxy on windows

2017-04-19 Thread Julia Dolgova

Julia Dolgova added the comment:

I compared the behaviour of urllib with these browsers: Firefox("use system 
proxy" selected), Google Chrome, Yandex. And also Skype (requests to 
login.live.com). All of them are not doing DNS requests for proxy bypass 
handling as Marc expects.
The result is attached: compare_urllib_progs.png

--
Added file: http://bugs.python.org/file46813/compare_urllib_progs.png

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-19 Thread crenwick

crenwick added the comment:

> Feel free to suggest a better wording.

> I think the only change that needs to be made is to make the existing message 
> say 'asyncio.Future' instead of just 'Future'.

I hear ya. New commit in the PR reverts the TypeError I added, and changes the 
original TypeError language to simply read "An asyncio.Future ..." instead of 
just "A Future ...".

--

___
Python tracker 

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



[issue30078] "-m unittest --help" says nothing about direct script exection

2017-04-19 Thread Louie Lu

Louie Lu added the comment:

Add a simple line to `MAIN_EXAMPLES`:

"%(prog)s path/to/test_file.py  - run tests from test_file.py"

--
nosy: +louielu

___
Python tracker 

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



[issue30078] "-m unittest --help" says nothing about direct script exection

2017-04-19 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +1306

___
Python tracker 

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



[issue27727] Update Tools/freeze to use .vcxproj files

2017-04-19 Thread Kaeptm Blaubaer

Changes by Kaeptm Blaubaer :


--
resolution: duplicate -> 

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue21150] Add quick links table to argparse docs

2017-04-19 Thread Louie Lu

Changes by Louie Lu :


--
nosy: +louielu

___
Python tracker 

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



[issue21150] Add quick links table to argparse docs

2017-04-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Gaurav, overall this looks nice.  

I would drop the example column because it will make the row too wide for 
viewing.  Alternatively, put the examples in a separate table (as was done for 
the combinatoric functions in the itertools docs: 
https://docs.python.org/3/library/itertools.html#module-itertools ).

--

___
Python tracker 

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



[issue21150] Add quick links table to argparse docs

2017-04-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +bethard

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset bf623ae8843dc30b28c574bec8d29fc14be59d86 by Serhiy Storchaka in 
branch 'master':
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)
https://github.com/python/cpython/commit/bf623ae8843dc30b28c574bec8d29fc14be59d86


--

___
Python tracker 

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



[issue30101] Add support for ncurses A_ITALIC

2017-04-19 Thread Eijebong

Changes by Eijebong :


--
components: Library (Lib)
nosy: Eijebong
priority: normal
pull_requests: 1307
severity: normal
status: open
title: Add support for ncurses A_ITALIC
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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1308

___
Python tracker 

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



[issue22352] Ensure opcode names and args fit in disassembly output

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d90045f319e2ea9772b9fbd62a05fdf34af96b6c by Serhiy Storchaka in 
branch 'master':
bpo-22352: Adjust widths in the output of dis.dis() for large line numbers and 
(#1153)
https://github.com/python/cpython/commit/d90045f319e2ea9772b9fbd62a05fdf34af96b6c


--

___
Python tracker 

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



[issue22352] Ensure opcode names and args fit in disassembly output

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset a79f4c219531c05fc8f670c1e4bbf12c081935d3 by Serhiy Storchaka in 
branch 'master':
bpo-30070: Fixed leaks and crashes in errors handling in the parser module. 
(#1131)
https://github.com/python/cpython/commit/a79f4c219531c05fc8f670c1e4bbf12c081935d3


--

___
Python tracker 

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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 66bffd1663489d080349debbf1b472d432351038 by Serhiy Storchaka in 
branch 'master':
bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)
https://github.com/python/cpython/commit/66bffd1663489d080349debbf1b472d432351038


--

___
Python tracker 

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



[issue30102] improve performance of libSSL usage on hashing

2017-04-19 Thread Gustavo Serra Scalet

New submission from Gustavo Serra Scalet:

To correctly pick the best algorithm for the current architecture,
libssl needs to have OPENSSL_config(NULL) called as described on:
https://wiki.openssl.org/index.php/Libcrypto_API

This short change lead to a speedup of 50% on POWER8 when using
hashlib.sha256 digest functionality as it now uses a SIMD approach that was 
already existing but not used by cpython.

--
assignee: christian.heimes
components: SSL
messages: 291892
nosy: christian.heimes, gut
priority: normal
severity: normal
status: open
title: improve performance of libSSL usage on hashing
type: enhancement
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue30102] improve performance of libSSL usage on hashing

2017-04-19 Thread Gustavo Serra Scalet

Changes by Gustavo Serra Scalet :


--
pull_requests: +1309

___
Python tracker 

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



[issue27869] test failures under Bash on Windows / WSL

2017-04-19 Thread Brett Cannon

Changes by Brett Cannon :


--
title: test failures under Bash on Windows -> test failures under Bash on 
Windows / WSL

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-19 Thread Kyle Glowacki

New submission from Kyle Glowacki:

Looking in the man pages for the uuencode and uudecode 
(http://www.manpagez.com/man/5/uuencode/), I see that the encoding used to go 
from ascii 32 to 95 but that 32 is deprecated and generally newer releases go 
from 33-96 (with 96 being used in place of 32).   This replaces the " " in the 
encoding with "`".  

For example, the newest version of busybox only accepts the new encoding.

The uu package has no way to specify to use this new encoding making it a pain 
to integrate.   Oddly, the uu.decode function does properly decode files 
encoded using "`", but encode is unable to create them.

--
components: Extension Modules
messages: 291893
nosy: LawfulEvil
priority: normal
severity: normal
status: open
title: uu package uses old encoding
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 680fea4067537a9b9c79aadd44a3a19e83cd2dbf by Serhiy Storchaka in 
branch '3.6':
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) 
(#1180)
https://github.com/python/cpython/commit/680fea4067537a9b9c79aadd44a3a19e83cd2dbf


--

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-19 Thread R. David Murray

Changes by R. David Murray :


--
components: +Library (Lib) -Extension Modules

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-19 Thread R. David Murray

Changes by R. David Murray :


--
type: behavior -> enhancement
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1311

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1312

___
Python tracker 

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



[issue30102] improve performance of libSSL usage on hashing

2017-04-19 Thread Christian Heimes

Christian Heimes added the comment:

This small change also changes behavior of OpenSSL dramatically. What are your 
Python and OpenSSL versions? How did you profile the performance of the hashing 
functions?

If OpenSSL_config() really improves performance on relevant platforms, then we 
should be consistent and call it in _ssl.c, too.

--

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e63af29c87b44bb7ada5783cd0ff6ee6d4f9c17c by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() 
(GH-1096) (GH-1180) (#1182)
https://github.com/python/cpython/commit/e63af29c87b44bb7ada5783cd0ff6ee6d4f9c17c


--

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1313

___
Python tracker 

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



[issue30102] improve performance of libSSL usage on hashing

2017-04-19 Thread Gustavo Serra Scalet

Gustavo Serra Scalet added the comment:

> Christian Heimes added the comment:
> 
> This small change also changes behavior of OpenSSL dramatically. What
> are your Python and OpenSSL versions? 

I tested by compiling my own python3 (8aaf499) against its parent (d6d344d) For 
python2, I made the same by compiling the 2.7.13 as a baseline and results were 
consistent with the python I have on Ubuntu 17.10 (3.5.3 and 2.7.13).

> How did you profile the
> performance of the hashing functions?

I compared the timings between my patched vs patchless python versions by using 
a 630MB file to calculate sha256 as:

perf stat -r 10 Python-2.7.13/python -c "import hashlib; 
print(hashlib.sha256(open('ubuntu-16.10-server-ppc64el.iso','rb').read()).hexdigest())"

The speedup of ~50% is given due to patchless taking 3.082156387s and patched 
taking 2.027484800s (errors are less than 1%)

I also noticed what changed on a code level by checking with gdb what is being 
executed on the sha loop. After my patch I see altivec (SIMD) functions being 
used on SHA main loop.

> If OpenSSL_config() really improves performance on relevant platforms,
> then we should be consistent and call it in _ssl.c, too.

I'll check that then. Thanks for the hint.

Ps: please note this behavior is noticed on a POWER8 machine. I'm not an 
OpenSSL expert so I don't know if there are now more optimizations enabled on 
other architectures as well.

--

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 64aa4df8502ca5d0a8ffb767ff97f625625c758c by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() 
(GH-1096) (GH-1180) (#1183)
https://github.com/python/cpython/commit/64aa4df8502ca5d0a8ffb767ff97f625625c758c


--

___
Python tracker 

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



[issue30061] Check if PyObject_Size() raised an error

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1314

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 39dedb6e1a18069ce8f5c8e6076e9d9ef9d6d515 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser 
module. (GH-1131). (#1184)
https://github.com/python/cpython/commit/39dedb6e1a18069ce8f5c8e6076e9d9ef9d6d515


--

___
Python tracker 

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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1315

___
Python tracker 

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



[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2017-04-19 Thread Eryk Sun

Eryk Sun added the comment:

In case you didn't get notified by Rietveld, I made a couple suggestions on 
your latest patch. Also, if you wouldn't mind, please update the patch to apply 
cleanly to 3.7 -- especially since STARTUPINFO now has an __init__ method.

--

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1316

___
Python tracker 

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



[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-19 Thread STINNER Victor

New submission from STINNER Victor:

Since the build 154, many tests fail on the AMD64 FreeBSD CURRENT Debug 3.x 
buildbot slave because of float rounding errors. Failing tests:

* test_cmath
* test_float
* test_json
* test_marshal
* test_math
* test_statistics
* test_strtod

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/154/steps/test/logs/stdio

Problem: none of build 154 changes are related to floats

* commit f9f87f0934ca570293ba7194bed3448a7f9bf39c
* commit 947629916a5ecb1f6f6792e9b9234e084c5bf274

It looks more like a libc change of the FreeBSD CURRENT slave.

Example of errors:

==
FAIL: test_specific_values (test.test_cmath.CMathTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_cmath.py",
 line 420, in test_specific_values
msg=error_message)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_cmath.py",
 line 149, in rAssertAlmostEqual
'{!r} and {!r} are not sufficiently close'.format(a, b))
AssertionError: acos0036: acos(complex(-1.0002, 0.0))
Expected: complex(3.141592653589793, -0.04471763360830684)
Received: complex(3.141592653589793, -0.04471763360829195)
Received value insufficiently close to expected value.

==
FAIL: test_floats (test.test_json.test_float.TestPyFloat)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_json/test_float.py",
 line 8, in test_floats
self.assertEqual(float(self.dumps(num)), num)
AssertionError: 1.9275814160560202e-50 != 1.9275814160560204e-50

FAIL: test_bigcomp (test.test_strtod.StrtodTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_strtod.py",
 line 213, in test_bigcomp
self.check_strtod(s)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_strtod.py",
 line 104, in check_strtod
"expected {}, got {}".format(s, expected, got))
AssertionError: '0x1.8265ea9f864bcp+579' != '0x1.8265ea9f864bdp+579'
- 0x1.8265ea9f864bcp+579
? ^
+ 0x1.8265ea9f864bdp+579
? ^
 : Incorrectly rounded str->float conversion for 29865e170: expected 
0x1.8265ea9f864bcp+579, got 0x1.8265ea9f864bdp+579

--
messages: 291901
nosy: haypo, koobs
priority: normal
severity: normal
status: open
title: Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot
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



[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Interpreter Core, Tests
nosy: +mark.dickinson

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

Until a solution is found, I proposed to revert the change to "repair" 
buildbots.

See also the python-ideas thread: [Python-ideas] Thread-safe generators
https://mail.python.org/pipermail/python-ideas/2017-April/045427.html

--

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 952a05e4e2cf082b74a1676a2804f1f43a9b7702 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser 
module. (GH-1131). (#1185)
https://github.com/python/cpython/commit/952a05e4e2cf082b74a1676a2804f1f43a9b7702


--

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 1e62bf145b4865d03a29a5720a4eb84c321a9829 by Victor Stinner in 
branch 'master':
bpo-30030: Revert f50354ad (tempfile) (#1187)
https://github.com/python/cpython/commit/1e62bf145b4865d03a29a5720a4eb84c321a9829


--

___
Python tracker 

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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e2546172622dd52692cf0e26c2b931f942f345b6 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). 
(GH-1110) (#1186)
https://github.com/python/cpython/commit/e2546172622dd52692cf0e26c2b931f942f345b6


--

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor. I was going to do this but was unable to do this because I 
was out of my developing environment.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1317

___
Python tracker 

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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1318

___
Python tracker 

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



[issue28533] Replace asyncore

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

> asyncore is still used in several tests and should be replaced.

Here is the list of Python files using asyncore:

haypo@selma$ grep -l asyncore $(find -name "*.py")
./Lib/asyncore.py
./Lib/asynchat.py
./Lib/test/test_smtpd.py
./Lib/test/test_asyncore.py
./Lib/test/test_smtplib.py
./Lib/test/test_os.py
./Lib/test/test_ssl.py
./Lib/test/test_logging.py
./Lib/test/libregrtest/save_env.py
./Lib/test/test_asynchat.py
./Lib/test/test_pyclbr.py
./Lib/test/test_support.py
./Lib/test/test_poplib.py
./Lib/test/test_ftplib.py
./Lib/smtpd.py

smtpd has been rewritten with asyncio:
http://aiosmtpd.readthedocs.io/

The documentation of the smtpd module already points to aiosmtpd.

libregrtest/save_env.py only checks that asyncore.socket_map is not modified, 
we can keep it until asyncore is really removed.

test_support.py only tests that it's possible to have a "clean" import of 
asyncore, it can be easily be replaced later.

The list can reduced to:

./Lib/test/test_smtplib.py
./Lib/test/test_os.py
./Lib/test/test_ssl.py
./Lib/test/test_logging.py
./Lib/test/test_pyclbr.py
./Lib/test/test_poplib.py
./Lib/test/test_ftplib.py

--
nosy: +haypo

___
Python tracker 

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



[issue28533] Replace asyncore

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

asyncore was modified to emit a DeprecationWarning:
http://bugs.python.org/issue25002#msg279417

But then a lot of code starts with to fail -Werror.

Copy of Martin Panter's msg279469:

I normally run the tests with -Werror, and the failures I get are:

* test_ssl, test_smtplib, test_poplib, test_logging, test_ftplib, test_support: 
tests use asyncore
* test_os: test uses asynchat (When you import asynchat, the first error 
complains about importing asyncore, there are actually two warnings)
* test_all: This seems to ignore DeprecationWarning; perhaps an exception for 
PendingDeprecationWarning should also be added?
* test_asyncore and test_asynchat: Obviously these have to still test the 
modules, so they should anticipate the warnings, perhaps using Serhiy’s code
* test_smtpd: smtpd module itself uses asyncore; see Issue 25008

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to close this issue and instead work on the the issue #28533: modify 
code using asyncore to use something else.

--

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 2a1bf0633cd0c55662df7875ee2b1654251adf6b by Serhiy Storchaka in 
branch '2.7':
[2.7] [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser 
module. (GH-1131). (GH-1185) (#1189)
https://github.com/python/cpython/commit/2a1bf0633cd0c55662df7875ee2b1654251adf6b


--

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c97c1914f401359f2a7e6c8e0364e71ad9fb5bc8 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). 
(GH-1110) (#1190)
https://github.com/python/cpython/commit/c97c1914f401359f2a7e6c8e0364e71ad9fb5bc8


--

___
Python tracker 

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



[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue25002] Deprecate asyncore/asynchat

2017-04-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Sounds good.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue30078] "-m unittest --help" says nothing about direct script exection

2017-04-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +ezio.melotti, michael.foord, rbcollins
stage: needs patch -> patch review

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1319

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

I reopen the issue to propose a different approach: 
https://github.com/python/cpython/pull/1191 replaces Random with SystemRandom 
and drops get_candidate_names().

@Serhiy: I hesitated to add you as a co-author, but I'm not sure that you like 
my approach :-) Tell me what do you think. At least, I reused your docstring 
and your updated unit test!

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This isn't a different approach and this doesn't work because generators are 
not thread-safe.

--

___
Python tracker 

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



[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2017-04-19 Thread Segev Finer

Segev Finer added the comment:

Added the 4th version after review by eryksun (In rietveld).

--
Added file: 
http://bugs.python.org/file46814/windows-subprocess-close-fds-v4.patch

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

> Remoe _get_candidate_names() and the global _name_sequence

I understood the rationale behind _get_candidate_names() is to prevent 
generating the same name when _RandomNameSequence() uses random.Random. Since 
my change uses random.SystemRandom, I consider that it's now ok to create 
multiple generators in paralle. Is that rationale correct?

--

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

test_threadedtempfile passed on Linux, but randomly failed on Windows. :( And 
_RandomNameSequence is used not only in tempfile.

I suggest to wait until add a wrapper that makes generators thread-safe. Since 
it added we could restore the generator implementation of _RandomNameSequence.

--

___
Python tracker 

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



[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread donkopotamus

donkopotamus added the comment:

Just to add, I framed this slightly wrongly by using a list [] as an example, 
whereas my original motivating case was objects that are hashable but not 
weakly referenceable.   (eg () ).

So there are two cases to consider ... what to do in discard/remove etc when 
the value is (i) not weakly referenceable, and (ii) when the value is not 
hashable.

--

___
Python tracker 

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



[issue30105] Duplicated connection_made() call for some SSL connections

2017-04-19 Thread kyuupichan

New submission from kyuupichan:

An asyncio SSL server frequently sees duplicated connection_made() calls for an 
incoming SSL connection.  It does not happen to all SSL connections; perhaps 
10-25% of them.  It never happens to TCP connections. 

Here are some examples of logs from one I run.  I see this on MacOSX and 
DragonflyBSD, others have reported the same on Linux, so I believe it's a quirk 
in asyncio and not O/S specific.  I assume it is a bug in the wrapping of the 
raw TCP transport with an SSL one.

2017-04-20 07:22:44.676180500 INFO:ElectrumX:[14755] SSL 218.185.137.81:52844, 
256 total
2017-04-20 07:22:45.666747500 INFO:ElectrumX:[14756] SSL 218.185.137.81:52847, 
256 total

The log is output on a connection_made() callback to a protocol, and not from 
the protocol's constructor.  They are very close together, from the same IP 
address and ports that are close together.  The first connection was closed 
with connection_lost() before the 2nd connection_made() because the total 
session count (here 256) did not increase.

Here is another section of my log with 2 more examples.  Totals are not 
monotonic because of course disconnections (not logged) happen all the time.

2017-04-20 07:30:31.529671500 INFO:ElectrumX:[14796] SSL 193.90.12.86:42262, 
259 total
2017-04-20 07:31:04.434559500 INFO:ElectrumX:[14797] SSL 70.199.157.209:10851, 
259 total
2017-04-20 07:31:05.765178500 INFO:ElectrumX:[14798] SSL 70.199.157.209:10877, 
259 total
2017-04-20 07:31:32.305260500 INFO:ElectrumX:[14799] SSL 64.113.32.29:35025, 
256 total
2017-04-20 07:31:44.731859500 INFO:ElectrumX:[14800] SSL 188.107.123.236:60867, 
255 total
2017-04-20 07:31:45.504245500 INFO:ElectrumX:[14801] SSL 188.107.123.236:60868, 
255 total
2017-04-20 07:31:48.943430500 INFO:ElectrumX:[14802] SSL 136.24.49.122:54987, 
255 total
2017-04-20 07:31:59.967676500 INFO:ElectrumX:[14803] TCP 113.161.81.136:2559, 
256 total
2017-04-20 07:32:03.249780500 INFO:ElectrumX:[14804] SSL 69.121.8.201:63409, 
256 total

Another reason I believe this is an asyncio issue on the server side is that 
someone else's server software that doesn't use asyncio logs in a similar way 
and does not see duplicated incoming "connections".

--
components: asyncio
messages: 291919
nosy: kyuupichan, yselivanov
priority: normal
severity: normal
status: open
title: Duplicated connection_made() call for some SSL connections
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue30106] test_asyncore: test_handle_write() fails in tearDown()

2017-04-19 Thread STINNER Victor

New submission from STINNER Victor:

On the AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot, test_handle_write() of 
test_asyncore now fails on calling asyncore.close_all() in tearDown().

Moreover, since my commit 7b9619ae249ed637924d1c76687b411061753e5a, the 
following test_quick_connect() now fails on self.fail("join() timed out"). I 
guess that asyncore.socket_map still contains unwanted sockets from 
test_handle_write() which failed.

Attached PR should fix the test_handle_write() failure by calling 
asyncore.close_all() with ignore_all=True.

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/174/steps/test/logs/stdio

==
ERROR: test_handle_write (test.test_asyncore.TestAPI_UseIPv6Poll)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncore.py",
 line 505, in tearDown
asyncore.close_all()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncore.py",
 line 561, in close_all
x.close()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncore.py",
 line 397, in close
self.socket.close()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/socket.py",
 line 417, in close
self._real_close()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/socket.py",
 line 411, in _real_close
_ss.close(self)
ConnectionResetError: [Errno 54] Connection reset by peer

==
FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv6Poll)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/support/__init__.py",
 line 2042, in decorator
return func(*args)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncore.py",
 line 800, in test_quick_connect
self.fail("join() timed out")
AssertionError: join() timed out

--
components: Tests
messages: 291920
nosy: haypo
priority: normal
severity: normal
status: open
title: test_asyncore: test_handle_write() fails in tearDown()
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



[issue30106] test_asyncore: test_handle_write() fails in tearDown()

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1320

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-19 Thread STINNER Victor

New submission from STINNER Victor:

Example of buildbot build which created a python.core file.

Tests crashing Python on purpose should use test.support.SuppressCrashReport. I 
don't see which test can crash in the following list.

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/175/steps/test/logs/stdio

0:04:54 [132/404/6] test_raise passed -- running: test_subprocess (61 sec)
0:04:54 [133/404/6] test_dict passed -- running: test_subprocess (62 sec)
0:04:54 [134/404/6] test_telnetlib passed -- running: test_subprocess (62 sec)
0:04:55 [135/404/6] test_robotparser passed -- running: test_subprocess (63 sec)
0:04:56 [136/404/6] test_py_compile passed -- running: test_subprocess (64 sec)
0:04:56 [137/404/6] test_listcomps passed -- running: test_subprocess (64 sec)
0:04:56 [138/404/6] test_pty passed -- running: test_subprocess (64 sec)
0:04:56 [139/404/6] test_defaultdict passed -- running: test_subprocess (64 sec)
running: test_io (30 sec), test_subprocess (94 sec)
0:05:27 [140/404/6] test_subprocess passed (94 sec) -- running: test_io (31 sec)
0:05:27 [141/404/6] test_unpack passed -- running: test_io (31 sec)
0:05:28 [142/404/6] test_bytes passed -- running: test_io (33 sec)
0:05:29 [143/404/6] test_weakset passed -- running: test_io (33 sec)
0:05:36 [144/404/6] test_eintr passed -- running: test_io (40 sec)
0:05:37 [145/404/6] test_userstring passed -- running: test_io (41 sec)
0:05:37 [146/404/6] test_support passed -- running: test_io (41 sec)
0:05:37 [147/404/6] test_ioctl skipped -- running: test_io (42 sec)
test_ioctl skipped -- Unable to open /dev/tty
0:05:40 [148/404/6] test_cmd_line passed -- running: test_io (44 sec)
0:05:41 [149/404/6] test_turtle skipped -- running: test_io (45 sec)
test_turtle skipped -- No module named '_tkinter'
0:05:41 [150/404/6] test_subclassinit passed -- running: test_io (45 sec)
0:05:42 [151/404/6] test_set passed -- running: test_io (46 sec)
0:05:43 [152/404/6] test_xml_etree_c passed -- running: test_io (47 sec)
0:05:43 [153/404/6] test_binascii passed -- running: test_io (47 sec)
0:05:48 [154/404/6] test_normalization passed -- running: test_io (52 sec)
fetching http://www.pythontest.net/unicode/9.0.0/NormalizationTest.txt ...
0:05:49 [155/404/6] test_os passed -- running: test_io (54 sec)
stty: stdin isn't a terminal
0:05:50 [156/404/6] test_abc passed -- running: test_io (54 sec)
0:05:50 [157/404/6] test_dummy_threading passed -- running: test_io (54 sec)
0:05:50 [158/404/6] test_pkgutil passed -- running: test_io (54 sec)
0:05:50 [159/404/6] test_compile passed -- running: test_io (55 sec)
0:05:51 [160/404/6] test_largefile passed -- running: test_io (55 sec)
0:05:54 [161/404/6] test_io failed (env changed) (57 sec)
test_BufferedIOBase_destructor (test.test_io.CIOTest) ... ok
...
test_interrupted_write_unbuffered (test.test_io.PySignalsTest) ... ok
--
Ran 565 tests in 57.439s

OK (skipped=2)
Warning -- files was modified by test_io
  Before: []
  After:  ['python.core']

--
components: Tests
messages: 291921
nosy: haypo, koobs
priority: normal
severity: normal
status: open
title: python.core file created when running tests on AMD64 FreeBSD CURRENT 
Non-Debug 3.x buildbot
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



[issue29887] test_normalization doesn't work

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1321

___
Python tracker 

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



[issue29887] test_normalization doesn't work

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

> The test should try to write the file in a temporary file, or simply skip the 
> test.

I proposed https://github.com/python/cpython/pull/1196 to skip the test in that 
case.

Creating a temporary file is more complex since the API doesn't work as a 
context manager, and it's unclear who would be responsible to remove the 
temporary file.

--

___
Python tracker 

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



[issue30108] test_site modifies sys.path

2017-04-19 Thread STINNER Victor

New submission from STINNER Victor:

See on Travis CI: https://travis-ci.org/python/cpython/jobs/223771666

Warning -- sys.path was modified by test_site

  Before: (47345855849656, ['', '/usr/local/lib/python37.zip', 
'/home/travis/build/python/cpython/Lib', 
'/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug'], ['', 
'/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', 
'/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug'])

  After:  (47345855849656, ['', '/usr/local/lib/python37.zip', 
'/home/travis/build/python/cpython/Lib', 
'/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug'], ['', 
'/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', 
'/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug', 
'/home/travis/.local/lib/python3.7/site-packages'])

--
components: Tests
messages: 291923
nosy: haypo
priority: normal
severity: normal
status: open
title: test_site modifies sys.path
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



[issue30108] test_site modifies sys.path

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

Ah, I reproduced the bug:

$ rmdir ~/.local/lib/python3.7/site-packages; ./python -m test test_site 
Run tests sequentially
0:00:00 [1/1] test_site
Warning -- sys.path was modified by test_site
  Before: (140302199734024, ['', '/home/haypo/prog/GIT/perf', 
'/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', 
'/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7'], ['', 
'/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', 
'/home/haypo/prog/python/master/Lib', 
'/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7'])
  After:  (140302199734024, ['', '/home/haypo/prog/GIT/perf', 
'/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', 
'/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7'], ['', 
'/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', 
'/home/haypo/prog/python/master/Lib', 
'/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7', 
'/home/haypo/.local/lib/python3.7/site-packages']) 
test_site failed (env changed)

1 test altered the execution environment:
test_site

Total duration: 229 ms
Tests result: SUCCESS

--

___
Python tracker 

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



[issue30108] test_site modifies sys.path

2017-04-19 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1322

___
Python tracker 

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



[issue29887] test_normalization doesn't work

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d13d54748d3a7db023d9db37223ea7d40bb8f8e3 by Victor Stinner in 
branch 'master':
bpo-29887: test_normalization handles PermissionError (#1196)
https://github.com/python/cpython/commit/d13d54748d3a7db023d9db37223ea7d40bb8f8e3


--

___
Python tracker 

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



[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-19 Thread Pavol Lisy

Pavol Lisy added the comment:

Maybe I am wrong but don't we get another weird behavior? 

   import sys.path  # this is error now
   ModuleNotFoundError: No module named 'sys.path'; 'sys' is not a package

So we probably expect same behavior here:

   import sys.path as foo

But if we just replace LOAD_ATTR with IMPORT_FROM in the compiler then wouldn't 
it works like:

   from sys import path as foo

?

--
nosy: +Pavol Lisy

___
Python tracker 

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



[issue30106] test_asyncore: test_handle_write() fails in tearDown()

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 11470b6dcdbc170779499a4a040b93c842a0d194 by Victor Stinner in 
branch 'master':
bpo-30106: Fix tearDown() of test_asyncore (#1194)
https://github.com/python/cpython/commit/11470b6dcdbc170779499a4a040b93c842a0d194


--

___
Python tracker 

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



[issue30102] improve performance of libSSL usage on hashing

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

> This small change also changes behavior of OpenSSL dramatically.

What do you mean by "dramatically"? What does a openssl.cnf configuration 
contain?

Do other applications using OpenSSL call OPENSSL_config(NULL)?

Since OPENSSL_config() accepts a filename, maybe a first step would be to 
expose the function as ssl.OPENSSL_config(filename) to allow user to load 
*explicitly* a configuration file? ssl.OPENSSL_config() would call 
OPENSSL_config(NULL). Would it work for you, Gustavo?

--

More links:

- https://wiki.openssl.org/index.php/Manual:OPENSSL_config(3)
- https://en.wikibooks.org/wiki/OpenSSL/Initialization

--
nosy: +haypo

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2017-04-19 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

For the archaeologists of the future, smtpd.py is also deprecated in favor of 
aiosmtpd.

http://aiosmtpd.readthedocs.io/en/latest/

--

___
Python tracker 

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



[issue30106] test_asyncore: test_handle_write() fails in tearDown()

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

It seems like the change 11470b6dcdbc170779499a4a040b93c842a0d194 fixed 
test_handle_write(), but test_quick_connect() fails on thread.join().

test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Poll) ... Exception in 
thread Thread-2:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 916, in _bootstrap_inner
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 864, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py",
 line 785, in 
count=500))
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", 
line 207, in loop
poll_fun(timeout, map)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", 
line 144, in poll
r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor

FAIL

test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Select) ... Exception in 
thread Thread-3:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 916, in _bootstrap_inner
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 864, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py",
 line 785, in 
count=500))
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", 
line 207, in loop
poll_fun(timeout, map)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", 
line 144, in poll
r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor

FAIL

==
FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Poll)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 2042, in decorator
return func(*args)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py",
 line 800, in test_quick_connect
self.fail("join() timed out")
AssertionError: join() timed out

==
FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Select)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 2042, in decorator
return func(*args)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py",
 line 800, in test_quick_connect
self.fail("join() timed out")
AssertionError: join() timed out

--

___
Python tracker 

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



[issue30106] test_asyncore: test_handle_write() fails in tearDown()

2017-04-19 Thread STINNER Victor

STINNER Victor added the comment:

Since my change 7b9619ae249ed637924d1c76687b411061753e5a, test_asyncore now 
fails on the AMD64 FreeBSD CURRENT Debug 3.x buildbot, it wasn't the case 
before. First fail:
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/174/

--

___
Python tracker 

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



  1   2   >