[issue29708] support reproducible Python builds

2018-01-24 Thread Alexandru Ardelean

Change by Alexandru Ardelean :


--
pull_requests: +5159

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-24 Thread Chason Chaffin

Chason Chaffin  added the comment:

Hi Steven,

I have nothing to do with the original submitter but this bug did catch my eye. 
Does using mutable variables in the SMTP library serve a purpose? Looking 
through the code, I wasn't able to spot anything obvious, and I did spot a 
place with a potential bug:

https://github.com/python/cpython/blob/master/Lib/smtplib.py#L960

Here mail_options is mutated in the case of a non-ASCII email address. 
Subsequent calls to send_message, even to a different SMTP server (if I'm not 
mistaken) would also send these headers along.

--
nosy: +chason

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2018-01-24 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> I attempted to implement my weakref idea (i.e. raw file keeps a weakref to 
> the buffered file, calls flush before the raw file gets closed).  That 
> doesn't work either because the GC clears the weakref before calling __del__.

This may be a bit of a left-field or too-big-a-hammer suggestion, but as far I 
can tell from this thread [1] it probably is technically possible to modify the 
GC to clear weakrefs after calling __del__. Nick wasn't a fan (he likes the 
invariant that weakrefs can't trigger a resurrection), but if all else fails it 
might be worth re-raising.

You could add a secondary reference count on FileIO recording how many 
BufferedIO wrappers there are around it; then it's __del__ would skip calling 
close() if there are still BufferedIO wrappers, and BufferedIO.__del__ would 
decrement the reference count and close the underlying file if it hits zero and 
FileIO.__del__ had already been called.

[1] https://mail.python.org/pipermail/python-dev/2016-October/146747.html

--
nosy: +njs

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-24 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Hi Kenny, and thanks, but I'm not sure what your point is. Are you claiming 
this is a bug in the code or the documentation?

For what it is worth... mutable defaults *are* a "gotcha", so the documentation 
isn't wrong. And mutable defaults are *not* illegal nor a bug and are 
occasionally useful. So I'm not sure why you are reporting this? Have you found 
a problem?

(I see that send_message gives rcpt_options a default of {} (empty dict) and 
then passes it to sendmail, which expects rcpt_options to be a list. I don't 
know if that matters.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-24 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-24 Thread Yury Selivanov

New submission from Yury Selivanov :

As discussed, we want to make Server objects more usable in async/await code 
and more compatible with asyncio.run.

This is also needed to handle a use case when two or more servers are created 
and need to start listening at the same time.

We propose to:

1. Add a new bool flag defaulting to True to loop.create_server and 
loop.create_unix_server: start_serving.  By default, loop will return a server 
that is already accepting connections.  When start_serving is set to False, 
create_server and create_unix_server will return a server that will not listen 
on its sockets.

2. A new idempotent Server.start_serving() method can be used to make server 
listen on its sockets (useful when a server object was created with 
start_serving=False).

3. A new Server.serve_forever() method that calls start_serving() and blocks 
forever, until cancelled.  When cancelled, it closes its server object.

4. A new Server.is_serving() method.  This is useful to introspect a server 
object in unittests.

5. Server objects should be async context managers.  Server.__aexit__ should 
close the server and await on Server.wait_closed().

With these new APIs, the following pattern becomes possible:

async def main():
srv = await asyncio.start_server(...)
async with srv:
await srv.serve_forever()

asyncio.run(main())

--
components: asyncio
messages: 310657
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement Server.serve_forever and corresponding APIs
type: enhancement
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



[issue27505] Missing documentation for setting module __class__ attribute

2018-01-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

I think the only thing missing for the 3.7 docs now would be a pair of 
"versionchanged" notes indicating that __class__ has been settable since 3.5, 
while module level __dir__ and __getattr__ support is new in 3.7.

It would also be desirable to add the __class__ docs to the 3.6 maintenance 
branch.

--

___
Python tracker 

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



[issue31972] Inherited docstrings for pathlib classes are confusing

2018-01-24 Thread Chason Chaffin

Change by Chason Chaffin :


--
pull_requests: +5157

___
Python tracker 

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



[issue12706] timeout sentinel in ftplib and poplib documentation

2018-01-24 Thread Marcel Widjaja

Change by Marcel Widjaja :


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



[issue32628] Add configurable DirectoryIndex to http.server

2018-01-24 Thread Erik Paulson

Change by Erik Paulson :


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

___
Python tracker 

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



[issue32661] ProactorEventLoop locks up on close call

2018-01-24 Thread Roger Taylor

New submission from Roger Taylor :

The following problem only occurs when I use ProactorEventLoop.  If I use 
'asyncio.get_event_loop()' it exits normally, rather than infinite looping in 
IOCP land.

1. I run the attached 'bug.py' script in a DOS window.  It is a slightly 
modified version of the asyncio echo server example.
2. It reaches 'loop.run_forever()' and blocks.  I can make connections here and 
use it as an echo server.  Or make no connections.
3. I press Ctrl-C in the DOS window.  Nothing happens.
4. I do a raw connection with Putty and try some input.
5. 'run_forever()' exits and the script proceeds to the 'loop.close()' call.  
Before this is invoked and the infinite loop entered, I see the script output 
''.

At this point, the script locks up and never reaches the next line.  It can be 
interrupted with another Ctrl-C, and the following stack track is seen:

Traceback (most recent call last):
  File "bug.py", line 39, in 
loop.close()
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\proactor_events.py", line 437, in close
self._proactor.close()
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\windows_events.py", line 745, in close
if not self._poll(1):
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\windows_events.py", line 673, in _poll
status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
KeyboardInterrupt

The following code in 'windows_events.py:IocpProactor.close' is looping 
infinitely.

while self._cache:
if not self._poll(1):
logger.debug('taking long time to close proactor')

Note that '_poll' does not actually return anything.

--
components: asyncio
files: bug.py
messages: 310655
nosy: asvetlov, rt121212121, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop locks up on close call
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47408/bug.py

___
Python tracker 

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



[issue32659] Solaris "stat" should support "st_fstype"

2018-01-24 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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



[issue32623] Resize dict on del/pop

2018-01-24 Thread INADA Naoki

INADA Naoki  added the comment:

I think I understand #17563, and I should fix GROWTH_RATE.

Before compact-ordered dict, we can avoid resizing in
"the number of deletions is on a par with the number of insertions."
scenario, by large GROWTH_RATE.
That's because new entry can reuse dummy entries.

But in compact-ordered dict, we can't do that.
We need resizing always, and resize is much faster than legacy dict.

I think GROWTH_RATE should be ma_used*3 for now.

--

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-24 Thread Guido van Rossum

Guido van Rossum  added the comment:

Raising for order=True if one of the ordering dunders exists sounds fine.

I am confused by the corner case for hash. Your table:

"""
eq=?frozen=?__hash__
False   False   do not generate __hash__
False   Truedo not generate __hash__
TrueFalse   set __hash__ to None unless it already exists
TrueTruegenerate __hash__ unless it already exists
 and is None
"""

Then you write at the end of that message:

"""
One special case to recognize is if the class defines a __eq__. In this case, 
Python will assign __hash__=None before the dataclass decorator is called. The 
decorator cannot distinguish between these two cases (except possibly by using 
the order of __dict__ keys, but that seems overly fragile):

@dataclass
class A:
def __eq__(self, other): pass

@dataclass
class B:
def __eq__(self, other): pass
__hash__ = None

This is the source of the last line in the above table: for a dataclass where 
eq=True, frozen=True, and hash=None, if __hash__ is None it will still be 
overwritten. The assumption is that this is what the user wants, but it's a 
tricky corner case. It also occurs if setting hash=True and defining __eq__. 
Again, it's not expected to come up in normal usage.
"""

I think I understand what you are saying there -- the two cases are treated the 
same, and a __hash__ is created (assuming the decorator is really 
"@dataclass(eq=True, frozen=True)"), overwriting the "__hash__ = None" for 
class B.

However the table's last line says "generate __hash__ unless it already exists 
and is None". Perhaps that was a typo and you meant to write "and is *not* 
None"?

--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2018-01-24 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset cab0b2b053970982b760048acc3046363615a8dd by Brett Cannon in 
branch 'master':
bpo-29708: Add What's New entries for SOURCE_DATE_EPOCH and py_compile (GH-5306)
https://github.com/python/cpython/commit/cab0b2b053970982b760048acc3046363615a8dd


--

___
Python tracker 

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



[issue32660] Solaris should support constants like termios' FIONREAD

2018-01-24 Thread Jesús Cea Avión

New submission from Jesús Cea Avión :

Solaris supports termios constants like FIONREAD with an appropiate "#include" 
in the C code. The main issue is that some names conflicts between System V and 
BSD personalities.

I could evaluate the situation and do a patch proposal for Python 3.7. We are 
still a week away of 3.7RC1 and this patch would affect only 
Solaris/derivatives.

--
assignee: jcea
messages: 310651
nosy: jcea
priority: normal
severity: normal
stage: needs patch
status: open
title: Solaris should support constants like termios' FIONREAD
type: enhancement
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



[issue29708] support reproducible Python builds

2018-01-24 Thread Brett Cannon

Change by Brett Cannon :


--
pull_requests: +5153

___
Python tracker 

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



[issue32659] Solaris "stat" should support "st_fstype"

2018-01-24 Thread Jesús Cea Avión

New submission from Jesús Cea Avión :

Solaris has an extra "st_fstype" in the "stat" structure:

"""
   st_fstype
 A null-teminated string that uniquely identifies the type
 of the filesystem that contains the file.
"""

Supporting this should be trivial and 3.7RC1 is still a week away. I can take 
care of the patch for Python 3.7, if you agree that this must be fixed.

--
assignee: jcea
messages: 310650
nosy: jcea
priority: normal
severity: normal
stage: needs patch
status: open
title: Solaris "stat" should support "st_fstype"
type: enhancement
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



[issue32623] Resize dict on del/pop

2018-01-24 Thread INADA Naoki

INADA Naoki  added the comment:

> Should we make sure that all dicts have at least MINSIZE entries?

I don't think so.  I think "allocate on first insert" is good idea for 
dict.clear()
And I think it's good idea for new dict too:
https://github.com/python/cpython/pull/1080

--

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2018-01-24 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Using atexit is not the solution because the data can be lost even while the 
program is running, not just at interpreter shutdown.  The problem occurs if 
the buffered file object and the underlying file object are both part of a 
reference cycle.  Then, when the cycle is destroyed by the GC module, if the 
file __del__ is called before the buffer __del__, data is lost.

So far, the best solution I've come up with is as follows:  split the buffered 
file object into two objects, a wrapper object that will be returned from 
open() and an underlying object that holds the actual buffer.  Make the 
underlying file object keep references to all the buffers that are using the 
file.  When the file _del__ gets called, first flush all of the buffers and 
then close the file.  Splitting the buffered file object is required so that we 
don't create reference cycles.

--

___
Python tracker 

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



[issue32658] Metacharacter (\) documentation suggestion

2018-01-24 Thread Kevin Raeder

New submission from Kevin Raeder :

I've found the Regular Expression HOWTO to be very helpful
(https://docs.python.org/3/howto/regex.html?highlight=regular%20expressions). 
One inconsistency I noticed is that the intro to metacharacters says
"Metacharacters are not active inside classes. "
But farther down we learn that a class can be constructed using \s: [\s,.],
which is "all white space characters , and ."
It's not the 4 characters "\ s , and ."
So I think the first statement would be clearer as
"Metacharacters (except \) are not active inside classes. "

--
assignee: docs@python
components: Documentation
messages: 310647
nosy: docs@python, kdraeder
priority: normal
severity: normal
status: open
title: Metacharacter (\) documentation suggestion

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

OK, test_dictviews and test_ordered_dict now pass for me, and Appveyor already 
ran entire suite and says OK to all.

--

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Hold the failure comment.  I forgot that I have to recompile when patch changes 
.c files.

--

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Not ready to merge.
1. We need the Appveyer test to pass or special action from the gateway gods.
2. After a month, the PR needed to be updated and retested anyway.  I pulled, 
updated, pushed the update (which will trigger Travis and AV), and tested on my 
Windows machine. The two new tests fail.  See PR.
3. Someone has to sell assign and merge when ready.

--

___
Python tracker 

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



[issue32391] Add StreamWriter.wait_closed()

2018-01-24 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue27505] Missing documentation for setting module __class__ attribute

2018-01-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Nick, 

It looks like #32225 took care of this documentation change, so I think this 
can be closed?  Thanks!

--

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

It looks like Serhiy approved the PR on 12/13.  Is it ready to merge?  Thanks!

--

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-24 Thread Kenny Trytek

New submission from Kenny Trytek :

Mutable arguments in signature of send_message:
https://github.com/python/cpython/blob/master/Lib/smtplib.py#L892-L893

More Information:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

--
components: Library (Lib)
messages: 310641
nosy: Kenny Trytek
priority: normal
severity: normal
status: open
title: Mutable Objects in SMTP send_message Signature
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue17882] test_objecttypes fails for 3.2.4 on CentOS 6

2018-01-24 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
resolution:  -> out of date
stage: resolved -> 

___
Python tracker 

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



[issue32391] Add StreamWriter.wait_closed()

2018-01-24 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset fe133aad5949db7309c26c58b066c22e714e by Andrew Svetlov in 
branch 'master':
bpo-32391: Implement StreamWriter.wait_closed() (#5281)
https://github.com/python/cpython/commit/fe133aad5949db7309c26c58b066c22e714e


--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-24 Thread Alexander Belopolsky

Change by Alexander Belopolsky :


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



[issue10381] Add timezone support to datetime C API

2018-01-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 04af5b1ba9eb546a29735fac6cb5298159069b53 by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
bpo-10381: Add timezone to datetime C API (#5032)
https://github.com/python/cpython/commit/04af5b1ba9eb546a29735fac6cb5298159069b53


--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2018-01-24 Thread Brett Cannon

Brett Cannon  added the comment:

Just merged Bernhard's PR which forces hash-based .pyc files. Thanks to 
everyone who constructively helped reach this point.

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



[issue17882] test_objecttypes fails for 3.2.4 on CentOS 6

2018-01-24 Thread bharper

bharper  added the comment:

Hey all,

I am not having this issue on other versions of python.  Seeing that python 3.2 
is EOL, lets just close this issue.

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



[issue29708] support reproducible Python builds

2018-01-24 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset ccbe5818af20f8c12043f5c30c277a74714405e0 by Brett Cannon 
(Bernhard M. Wiedemann) in branch 'master':
bpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)
https://github.com/python/cpython/commit/ccbe5818af20f8c12043f5c30c277a74714405e0


--

___
Python tracker 

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



[issue17882] test_objecttypes fails for 3.2.4 on CentOS 6

2018-01-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I believe this may have been fixed in #19527.

--
nosy: +csabella

___
Python tracker 

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



[issue24132] Direct sub-classing of pathlib.Path

2018-01-24 Thread Keith

Keith  added the comment:

Look at the architecture of Rio in Ruby (also ported to Squeak/Smalltalk)

Leave Path to handle path stuff, and have another class to handle Platform 
stuff.

https://rubygems.org/gems/rio/versions/0.6.0

--
nosy: +keithy

___
Python tracker 

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



[issue32656] writing to stdout prints extraneous size character

2018-01-24 Thread Zachary Ware

Zachary Ware  added the comment:

This is not a bug, it's a side effect of using the REPL for this test and not 
assigning the return value of `sys.stdout.write` to anything.  Try the 
following:

>>> import sys
>>> character_count = sys.stdout.write('python\n') # note trailing newline
python
>>> character_count
6
>>> print('python')
python
>>> 

Or try saving your original test to a file and running it.

--
nosy: +zach.ware
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



[issue32656] writing to stdout prints extraneous size character

2018-01-24 Thread Zachary Ware

Zachary Ware  added the comment:

Of course, I realize after clicking "submit" that my character count there is 
actually wrong, and should be 7.  That's what I get for writing out the example 
instead of actually running and copying it :)

--

___
Python tracker 

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



[issue32656] writing to stdout prints extraneous size character

2018-01-24 Thread David Albert Torpey

New submission from David Albert Torpey :

$ python3.5
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 08:49:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdout.write('python')
python6

--
messages: 310631
nosy: dtorp
priority: normal
severity: normal
status: open
title: writing to stdout prints extraneous size character
versions: Python 3.5

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

Stefan, it would be great to have this committed before 3.7 feature freeze.

The change is pretty straightforward -- we replaced threading.local() with a 
contextvar, which should be a backwards compatible change.

--

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Now that the zipimporter support has landed, I think we're done!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 6f6eb35f9bee18f54945f09664344f2d118ed89f by Barry Warsaw in 
branch 'master':
 bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for 
zipimport (#5248)
https://github.com/python/cpython/commit/6f6eb35f9bee18f54945f09664344f2d118ed89f


--

___
Python tracker 

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

This can probably be closed now. Thanks Victor and Nathaniel!

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 789e359f51d2b27bea01b8c6c3bf090aaedf8839 by Yury Selivanov 
(Victor Stinner) in branch 'master':
bpo-32636: Fix two bugs in test_asyncio (#5302)
https://github.com/python/cpython/commit/789e359f51d2b27bea01b8c6c3bf090aaedf8839


--

___
Python tracker 

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664 by Yury Selivanov 
(Nathaniel J. Smith) in branch 'master':
bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)
https://github.com/python/cpython/commit/fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664


--

___
Python tracker 

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



[issue32410] Implement loop.sock_sendfile method

2018-01-24 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32410] Implement loop.sock_sendfile method

2018-01-24 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 0a5e71b4c70aab87125a54d7a59765e18d7583a4 by Andrew Svetlov in 
branch 'master':
bpo-32410: Improve sock_sendfile tests (#5294)
https://github.com/python/cpython/commit/0a5e71b4c70aab87125a54d7a59765e18d7583a4


--

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 196b8cbab2b5044b92077f0b3c07c798fff68bc6 by Barry Warsaw (Miss 
Islington (bot)) in branch '3.6':
bpo-32651 Recommend getpass.getuser() (GH-5301) (#5304)
https://github.com/python/cpython/commit/196b8cbab2b5044b92077f0b3c07c798fff68bc6


--

___
Python tracker 

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



[issue32655] File mode should be a constant

2018-01-24 Thread R. David Murray

R. David Murray  added the comment:

That isn't a bug.  Python doesn't protect you from doing the wrong thing, in 
general.  On the other hand, it might be a worthwhile improvement to make it 
read-only in this case.  Especially since, as you point out, other seemingly 
similar attributes of this object are read-only.

--
nosy: +r.david.murray
type: behavior -> enhancement

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-24 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5151

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset d499031f5f33c3ef71be7c81ef52eee6b47c42e1 by Barry Warsaw in 
branch 'master':
bpo-32651 Recommend getpass.getuser() (#5301)
https://github.com/python/cpython/commit/d499031f5f33c3ef71be7c81ef52eee6b47c42e1


--

___
Python tracker 

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



[issue32655] File mode should be a constant

2018-01-24 Thread Марат Нагаев

New submission from Марат Нагаев :

Hey guys,
I find bug in Python.
If you'll try to file stream using open function you can edit file mode:
Watch git:
https://gist.github.com/nagayev/7d17ead7b3bc2b06f2445fb5d9122a5c
In fact,mode don't changed,so mode shoul be constant like a encoding of the 
file and raise AttributeError if you'll edit it.

--
title: File mode shou -> File mode should be a constant

___
Python tracker 

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



[issue32655] File mode shou

2018-01-24 Thread Марат Нагаев

Change by Марат Нагаев :


--
components: IO
nosy: nagayev
priority: normal
severity: normal
status: open
title: File mode shou
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-24 Thread STINNER Victor

New submission from STINNER Victor :

I'm working on a pull request to make 
https://github.com/pmp-p/droid-pydk/tree/master/sources.32/cpython-bpo-30386.patchset
 changes upstream.

--
messages: 310619
nosy: vstinner
priority: normal
severity: normal
status: open
title: Fixes Python for Android API 19
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



[issue32652] test_distutils: BuildRpmTestCase tests fail on RHEL buildbots

2018-01-24 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, my latest commit introduced a regression in test_distutils: bpo-32652.

--

___
Python tracker 

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



[issue32653] AttributeError: 'Task' object has no attribute '_callbacks'

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

Can you check if this happens on 3.6?  3.5 is in a security-fix mode only, so 
even if this is a bug it would take us a long time to fix it.

--

___
Python tracker 

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



[issue32653] AttributeError: 'Task' object has no attribute '_callbacks'

2018-01-24 Thread Timur Irmatov

New submission from Timur Irmatov :

Sometimes during shutdown of our simple http server based on asyncio/ aiohttp 
we get following stack trace:

ERROR[2018-01-24 08:28:33,398]: Exception in default exception handler 
while handling an unexpected error in custom exception handler
Traceback (most recent call last):
  File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1293, 
in call_exception_handler
self._exception_handler(self, context)
  File "/opt/alt/python35/bin/imunify360-captchaserver", line 640, in 
_error_handler
loop.default_exception_handler(context)
  File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1256, 
in default_exception_handler
value = repr(value)
  File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 213, in 
__repr__
info = self._repr_info()
  File "/opt/alt/python35/lib64/python3.5/asyncio/tasks.py", line 96, in 
_repr_info
info = super()._repr_info()
  File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 205, in 
_repr_info
if self._callbacks:
AttributeError: 'Task' object has no attribute '_callbacks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1301, 
in call_exception_handler
'context': context,
  File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1256, 
in default_exception_handler
value = repr(value)
  File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 213, in 
__repr__
info = self._repr_info()
  File "/opt/alt/python35/lib64/python3.5/asyncio/tasks.py", line 96, in 
_repr_info
info = super()._repr_info()
  File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 205, in 
_repr_info
if self._callbacks:
AttributeError: 'Task' object has no attribute '_callbacks'

Is this some bug or consequence of our code not cancelling/ waiting for all 
coroutines?

--
components: asyncio
messages: 310616
nosy: Timur Irmatov, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: AttributeError: 'Task' object has no attribute '_callbacks'
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

> Victor, can you submit a new PR for this? Let's merge this right away.

Ok, done: https://github.com/python/cpython/pull/5302

--

___
Python tracker 

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5149

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

So let's retarget this to 3.8 as it's too close to 3.7 feature freeze to get 
seriously considered/merged.

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

I made most, if not all, changes that I wanted to do. It's time to close this 
huge issue to continue the work in new more specific issues.

Notes on Py_Main().

(*) _PyPathConfig_Init() is called even if it's not needed (if all "Path 
configuration outputs" fileds of PyCoreConfig are filled).

(*) pymain_cmdline() uses _Py_CommandLineDetails structure which contains a 
copy of each global configuration variable like Py_UTF8Mode. Internally, the 
function has to "set" or "get" these variables when calling some functions like 
_PyPathConfig_Init().

This code is fragile. *But* pymain_read_conf() is complex, it had to read again 
the whole configuration a second time if the encoding changed.

It would be nice to remove global variables from _Py_CommandLineDetails to 
avoid the get/set dance which introduces a risk of loosing changes by mistake. 
But I'm not sure that it's doable?

(*) Should we make Py_FileSystemDefaultEncoding and 
Py_FileSystemDefaultEncodeErrors configurable in _PyCoreConfig? Same question 
for _Py_StandardStreamEncoding, _Py_StandardStreamErrors and PYTHONIOENCODING 
environment variable.

--

___
Python tracker 

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



[issue32643] Make Task._step, Task._wakeup and Future._schedule_callback methods private

2018-01-24 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32652] test_distutils: BuildRpmTestCase tests fail on RHEL buildbots

2018-01-24 Thread STINNER Victor

New submission from STINNER Victor :

It may be a regression introduced by commit 
8ded5b803705328749622256701b3f08a9d6c5ab, bpo-32030: "Add 
_PyCoreConfig.module_search_paths", since it's the only change of the failing 
build 577.

s390x RHEL 3.x5:

http://buildbot.python.org/all/#/builders/21/builds/577

==
ERROR: test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/tests/test_bdist_rpm.py",
 line 120, in test_no_optimize_flag
cmd.run()
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/command/bdist_rpm.py",
 line 366, in run
self.spawn(rpm_cmd)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/cmd.py", 
line 365, in spawn
spawn(cmd, search_path, dry_run=self.dry_run)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/spawn.py", 
line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/spawn.py", 
line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 
1

==
ERROR: test_quiet (distutils.tests.test_bdist_rpm.BuildRpmTestCase)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/tests/test_bdist_rpm.py",
 line 77, in test_quiet
cmd.run()
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/command/bdist_rpm.py",
 line 366, in run
self.spawn(rpm_cmd)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/cmd.py", 
line 365, in spawn
spawn(cmd, search_path, dry_run=self.dry_run)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/spawn.py", 
line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/distutils/spawn.py", 
line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 
1

--
components: Tests
messages: 310614
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_distutils: BuildRpmTestCase tests fail on RHEL buildbots
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



[issue32030] PEP 432: Rewrite Py_Main()

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

I close the issue.

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



[issue32643] Make Task._step, Task._wakeup and Future._schedule_callback methods private

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 22feeb88b473b288950cdb2f6c5d28692274b5f9 by Yury Selivanov in 
branch 'master':
bpo-32643: Drop support for a few private Task and Future APIs. (#5293)
https://github.com/python/cpython/commit/22feeb88b473b288950cdb2f6c5d28692274b5f9


--

___
Python tracker 

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



[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Nathaniel: do you want to include these fixes in your PR as well?

Victor, can you submit a new PR for this? Let's merge this right away.

--

___
Python tracker 

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



[issue28046] Remove the concept of platform-specific directories

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed. I close again the issue. I don't want to backport this change, it 
doesn't hurt Python 3.6.

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

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

"This will cause significant performance regression for `dict[a]=None;
del dict[a]` loop. del/pop shouldn't do clear()."

Should we make sure that all dicts have at least MINSIZE entries?

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 8ded5b803705328749622256701b3f08a9d6c5ab by Victor Stinner in 
branch 'master':
bpo-32030: Add _PyCoreConfig.module_search_paths (#4954)
https://github.com/python/cpython/commit/8ded5b803705328749622256701b3f08a9d6c5ab


--

___
Python tracker 

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



[issue28046] Remove the concept of platform-specific directories

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 5de15f1d5ff09085620f63f0597d0920d75be719 by Victor Stinner in 
branch 'master':
bpo-28046: Remove MACHDEPPATH from Modules/Setup.dist (#5289)
https://github.com/python/cpython/commit/5de15f1d5ff09085620f63f0597d0920d75be719


--

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2018-01-24 Thread INADA Naoki

INADA Naoki  added the comment:

> * When dict size become 0, make the dict shared-empty, like dict.clear()

This will cause significant performance regression for `dict[a]=None; del 
dict[a]` loop.
del/pop shouldn't do clear().

> * When (dict size < dk_size/8), call insertion_resize()

This is bad too.
When ma_used=127 and dk_size=1024, new size will be 1024!
It's because current GROWTH_RATE is used*2 + size/2.

This GROWTH_RATE is set in issue17563.
We should understand it before changing anything.

--

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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

___
Python tracker 

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



[issue32645] test_asyncio: TLS tests fail on "x86 Windows7" buildbot

2018-01-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

I now have a Win7 VM, I'll take a look at this later.

--

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2018-01-24 Thread Arusekk

Arusekk  added the comment:

Since the issue seems to have been active lately, may I suggest my view on 
solving it.

One solution that comes to my mind is to keep a weak reference to the file, and 
to register an atexit function per file (and to unregister it when the file is 
closed). Example concept-illustrating python code for the _pyio module:

import atexit, weakref

# ...

class TextIOWrapper(TextIOBase):
def __init__(self):
# ...
self._weakclose = operator.methodcaller('close')
atexit.register(self._weakclose, weakref.proxy(self))

# ...

def close(self):
atexit.unregister(self._weakclose)
# and now actually close the file

There is a possibility of a negative impact arising from the use of 
operator.methodcaller, because it may return something cached in future 
versions of python. There is also the issue of unregistering an atexit function 
during atexit processing. But the general idea seems to be simple and worth 
considering.

--
nosy: +Arusekk

___
Python tracker 

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



[issue32651] os.getlogin() should recommend getpass.getuser()

2018-01-24 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

The documentation for os.getlogin() says:

"Return the name of the user logged in on the controlling terminal of the 
process. For most purposes, it is more useful to use the environment variables 
LOGNAME or USERNAME to find out who the user is, or 
pwd.getpwuid(os.getuid())[0] to get the login name of the current real user id.

Availability: Unix, Windows."

Well, why not suggestion getpass.getuser() since that's exactly how the latter 
works? :)

--
assignee: barry
components: Documentation
messages: 310601
nosy: barry
priority: normal
severity: normal
status: open
title: os.getlogin() should recommend getpass.getuser()
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



[issue32650] Debug support for native coroutines is broken

2018-01-24 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +njs

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-24 Thread Andrew Svetlov

New submission from Andrew Svetlov :

pdb (and other Python debuggers) are built on top of bdb.py module.

The module has a support for stepping to next line in function (next command).

The command checks frame flags and do extra steps if the flags contains 
CO_GENERATOR.

But CO_COROUTINE is not supported, it leads to stepping into a native coroutine 
instead of expecting stepping over.

The patch should be relative simple: just add a check for CO_COROUTINE along 
with CO_GENERATOR everywhere.

--
messages: 310600
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Debug support for native coroutines is broken
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2018-01-24 Thread INADA Naoki

Change by INADA Naoki :


--
pull_requests: +5147

___
Python tracker 

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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Change by Xiang Zhang :


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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset e64a47b37d0c592fd162b2f51e79ecfd046b45ec by Xiang Zhang in branch 
'2.7':
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (GH-4056). 
(#5299)
https://github.com/python/cpython/commit/e64a47b37d0c592fd162b2f51e79ecfd046b45ec


--

___
Python tracker 

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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset fd844efa9c31e1f00e04b07940875b9dacff3d77 by Xiang Zhang in branch 
'3.6':
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (GH-4056) 
(#5298)
https://github.com/python/cpython/commit/fd844efa9c31e1f00e04b07940875b9dacff3d77


--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

> We can't just add dl unconditionally.

dlopen() is not used on Windows nor macOS older than 10.3. On old macOS, 
functions like NSCreateObjectFileImageFromFile() are used.

I don't think that the master branch still supports macOS 10.2.

Mac OS X 10.2 was released in 2002 and unsupported as of 2006.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-01-24 Thread Christian Heimes

Christian Heimes  added the comment:

-ldl is the correct fix here. 
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange explains the problem. 
tl;dr linking with dl is required because the linker no longer adds indirect 
dependencies.

We can't just add dl unconditionally. You have to add a check.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

I'm unable to reproduce the issue on Fedora 27 (binutils-2.29-6.fc27.src.rpm, 
gcc-7.2.1-2.fc27.src.rpm). _ctypes.cpython-37dm-x86_64-linux-gnu.so is 
generated whereas it's not linked to libdl.so (as expected). The flag seems to 
be ignored. 
https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af192613e1beec34824a94dc5f6fa1568?branch=master
 says "The latter needs binutils 2.29.1-12.fc28 or later. I understand that my 
binutils are too old (2.29 vs 2.29.1).

--
nosy: +vstinner
title: Undefined references when compiling ctypes -> Undefined references when 
compiling ctypes on binutils 2.29.1 with gcc -Wl,-z,undefs (Fedora 28)
versions: +Python 2.7 -Python 3.8

___
Python tracker 

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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5146

___
Python tracker 

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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5145

___
Python tracker 

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



[issue32637] Android: set sys.platform to android

2018-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

I propose to leave MACHDEP unchanged: keep MACHDEP="linux". Can it create 
inconsistencies? Is it an issue in practice?

My short term goal is to use sys.platform == 'android' has the reference test 
to check if we are running on Android.

--

___
Python tracker 

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



[issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt

2018-01-24 Thread Charalampos Stratakis

Change by Charalampos Stratakis :


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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-01-24 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-01-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset d69794f4df81de731cc66dc82136e28bee691e1e by Barry Warsaw (Bo 
Bayles) in branch '3.6':
[3.6] bpo-32502: Discard 64-bit (and other invalid) hardware addresses 
(GH-5254) (#5290)
https://github.com/python/cpython/commit/d69794f4df81de731cc66dc82136e28bee691e1e


--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes

2018-01-24 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Unfortunately when trying to reproduce it by compiling from source and adding 
the '-z defs' flag to the linker, undefined symbol issues appeared for all the 
extension modules of the stdlib.

--
components: +Extension Modules

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes

2018-01-24 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Relevant part from the build log:

running build_ext
building '_ctypes' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC 
-fwrapv -fPIC -I/usr/include -I. -IObjects -IInclude -IPython 
-I/usr/local/include -I/builddir/build/BUILD/Python-3.6.4/Include 
-I/builddir/build/BUILD/Python-3.6.4/build/optimized -c 
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.c -o 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.o
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC 
-fwrapv -fPIC -I/usr/include -I. -IObjects -IInclude -IPython 
-I/usr/local/include -I/builddir/build/BUILD/Python-3.6.4/Include 
-I/builddir/build/BUILD/Python-3.6.4/build/optimized -c 
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callbacks.c -o 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callbacks.o
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC 
-fwrapv -fPIC -I/usr/include -I. -IObjects -IInclude -IPython 
-I/usr/local/include -I/builddir/build/BUILD/Python-3.6.4/Include 
-I/builddir/build/BUILD/Python-3.6.4/build/optimized -c 
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callproc.c -o 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callproc.o
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC 
-fwrapv -fPIC -I/usr/include -I. -IObjects -IInclude -IPython 
-I/usr/local/include -I/builddir/build/BUILD/Python-3.6.4/Include 
-I/builddir/build/BUILD/Python-3.6.4/build/optimized -c 
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/stgdict.c -o 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/stgdict.o
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC 
-fwrapv -fPIC -I/usr/include -I. -IObjects -IInclude -IPython 
-I/usr/local/include -I/builddir/build/BUILD/Python-3.6.4/Include 
-I/builddir/build/BUILD/Python-3.6.4/build/optimized -c 
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/cfield.c -o 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/cfield.o
gcc -pthread -shared -Wl,-z,relro -Wl,-z,defs 
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.o
 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callbacks.o
 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/callproc.o
 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/stgdict.o
 
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/cfield.o
 -L. -L/usr/local/lib64 -lffi -lpython3.6m -o 
build/lib.linux-x86_64-3.6/_ctypes.cpython-36m-x86_64-linux-gnu.so
build/temp.linux-x86_64-3.6/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.o:
 In function `PyCFuncPtr_FromDll':
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.c:3391: undefined 
reference to `dlsym'
/builddir/build/BUILD/Python-3.6.4/Modules/_ctypes/_ctypes.c:3399: undefined 
reference to 

[issue32648] Wrong byte count with struct

2018-01-24 Thread Christian Heimes

Christian Heimes  added the comment:

Hardware restrictions, some CPUs require types to be aligned in certain ways. 
Doubles must be aligned by multiple of 8 bytes.

Please read https://en.wikipedia.org/wiki/Data_structure_alignment and use the 
Python users mailing list for further questions.

--

___
Python tracker 

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



[issue32648] Wrong byte count with struct

2018-01-24 Thread Róbert Lexmann

Róbert Lexmann  added the comment:

Thanks for a fast response. If I may ask, what is it good for to encode 
'id' in 16 bytes and 'di' in 12?

Rob

On 01/24/2018 12:00 PM, Christian Heimes wrote:
> Christian Heimes  added the comment:
>
> It's not a bug. Please read the section about padding.
>
 struct.calcsize('id')
> 16
 struct.calcsize('>id')
> 12
>
> --
> nosy: +christian.heimes
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue32649] complete C API doc debug and profile part with new PyTrace_OPCODE

2018-01-24 Thread Xiang Zhang

New submission from Xiang Zhang :

As the title, the new PyTrace_OPCODE event is not documented in C API doc yet.

--
assignee: docs@python
components: Documentation
messages: 310588
nosy: docs@python, ncoghlan, pablogsal, xiang.zhang
priority: normal
severity: normal
status: open
title: complete C API doc debug and profile part with new PyTrace_OPCODE
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



[issue17799] settrace docs are wrong about "c_call" events

2018-01-24 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset 131fd7f96c619bc7eaea956e45c6337175f4b27f by Xiang Zhang (Pablo 
Galindo) in branch 'master':
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)
https://github.com/python/cpython/commit/131fd7f96c619bc7eaea956e45c6337175f4b27f


--

___
Python tracker 

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



  1   2   >