[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

> Should these be cherry-picked too?

We discuss with Guido and Yury to only include "critical" changes, so in short: 
yes, all commits related to asyncio should be cherrry-picked into RC2. It 
should also be easier for you to include all changes, to avoid conflicts. And 
the code should be the same in default and RC2 for asyncio.

--

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

changeset:   89300:c3abdf016b18
tag: tip
user:Victor Stinner 
date:Thu Feb 20 10:12:59 2014 +0100
files:   Lib/asyncio/subprocess.py
description:
asyncio.subprocess: Fix a race condition in communicate()

Use self._loop instead of self._transport._loop, because transport._loop is set
to None at process exit.

--

___
Python tracker 

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



[issue20699] Behavior of ZipFile with file-like object and BufferedWriter.

2014-02-20 Thread Henning von Bargen

New submission from Henning von Bargen:

Regression: Behavior of ZipFile with file-like object and BufferedWriter.

The following code worked with Python 2.6:


LOB_BLOCKSIZE = 1024*1024 # 1 MB

class UnbufferedBlobWriter(io.RawIOBase):
"""
A file-like wrapper for a write-only cx_Oracle BLOB object.
"""
def __init__(self, blobLocator):
self.blobLocator = blobLocator
self.offset = 0
self.blobLocator.open()

def seekable(self):
return True

def seek(self, offset, whence):
if whence == 0:
self.offset = offset
elif whence == 1:
self.offset += offset
if self.offset < 0:
self.offset = 0
elif whence == 2:
if offset <= 0 and -offset <= self.blobLocator.size():
self.offset = self.blobLocator.size() + offset
else:
raise IOError(96, "Invalid offset for BlobWriter")
else:
self._unsupported("seek")
return self.offset

def writable(self):
return True

def write(self, data, offset=None):
if offset is None:
offset = self.offset
self.blobLocator.write(bytes(data), offset + 1)
self.offset = offset + len(data)
return len(data)

def close(self):
self.flush()
self.blobLocator.close()


def BlobWriter(blobLocator):
"""
A file-like wrapper (buffered) for a write-only cx_Oracle BLOB object.
"""
return io.BufferedWriter(UnbufferedBlobWriter(blobLocator), 
LOB_BLOCKGROESSE)


Note: The cx_Oracle BLOB object is used to store binary content inside a 
database.
It's basically a file-like-like object.

I'm using it in conjunction with a ZipFile object to store a ZipFile as a BLOB
inside the DB, like this:

curs.execute("""
 insert into ...  values (..., Empty_BLOB())
 returning BDATA into :po_BDATA
 """,
 [..., blobvar])
blob = BlobWriter(blobvar.getvalue())
archive = ZipFile(blob, "w", ZIP_DEFLATED)
for filename in ...:
self.log.debug("Saving to ZIP file in the DB: %s", filename)
archive.write(filename, filename)
archive.close()

This used to work with Python 2.6.

With Python 2.7.5 however, somethin like this gets written into the blob:


Digging deeper, I found out that when using the UnbufferedBlobWriter directly
(without BufferedWriter), the problem does not occur.

It seems like the behaviour of the BufferedWriter class changed from 2.6 to 2.7,
most probably caused by the internal optimization of using the memoryview class.

As a workaround, I had to change my write method, calling tobytes() if 
necessary:

def write(self, data, offset=None):
if offset is None:
offset = self.offset
if hasattr(data, "tobytes"):
self.blobLocator.write(data.tobytes(), offset + 1)
else:
self.blobLocator.write(bytes(data), offset + 1)
self.offset = offset + len(data)
return len(data)


I'm not sure if this is actually a bug in 2.7 or if my usage of BufferedWriter
is incorrect (see remark).

For understanding the problem it is important to know that the ZipFile.write
method often calls write and seek.

Remark:
If I am mis-using BufferedWriter: What precisely is wrong? And if so,
why is it so complicated to support a buffered-random-writer?
I cannot use io.BufferedRandom because I don't have a read method
(and ZipFile.write does not need that).

--
components: IO
messages: 211714
nosy: Henning.von.Bargen
priority: normal
severity: normal
status: open
title: Behavior of ZipFile with file-like object and BufferedWriter.
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

changeset:   89302:3e19634b396f
tag: tip
user:Victor Stinner 
date:Thu Feb 20 10:37:27 2014 +0100
files:   Lib/asyncio/events.py Lib/asyncio/futures.py Lib/asyncio/tasks.py 
Lib/asyncio/test_utils.py Lib/asyncio/unix_events.py Lib/a
description:
asyncio: remove unused imports and unused variables noticed by pyflakes


changeset:   89301:c412243b9d61
user:Victor Stinner 
date:Thu Feb 20 10:33:01 2014 +0100
files:   Lib/asyncio/proactor_events.py
description:
asyncio: Fix _ProactorWritePipeTransport._pipe_closed()

The "exc" variable was not defined, pass a BrokenPipeError exception instead.

--

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I found new bugs /o\

You may skip 3e19634b396f if the last commit to cherry-pick, it's just cleanup.

--

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

> You may skip 3e19634b396f if the last commit to cherry-pick, it's just 
> cleanup.

(Ooops, "if *it is* the last commit")

--

___
Python tracker 

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



[issue20687] Change in expectedFailure breaks testtools

2014-02-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Antoine: would it be reasonable to rework the implementation of
> subTest in a way that permitted us to revert the changes to
> expectedFailure?

I can't tell you for sure, but certainly not in an easy way. Expected failures 
were the most delicate feature to keep compatible when adding subtests.
(in other words: not for 3.4, IMO)

--

___
Python tracker 

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



[issue19974] tarfile doesn't overwrite symlink by directory

2014-02-20 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the preliminary patch to address Serhiy's concern. I added some 
regression tests as well. Give me a time to think how to refactor the code 
(especially the test).

--
Added file: 
http://bugs.python.org/file34152/fix_tarfile_overwrites_symlink_v4.patch

___
Python tracker 

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



[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1

2014-02-20 Thread Gregory P. Smith

Gregory P. Smith added the comment:

there's a separate issue open for you with the necessary rollback patch to 
apply to your 3.4 release branch.  http://bugs.python.org/issue20651

This particular issue is actually solved in default, 3.3 and 2.7 as benjamin 
did the backouts/rollbacks of the problematic changes.

i'll be figuring out the bugs and redoing those only after finding appropriate 
test cases back in #19081.

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



[issue20686] Confusing statement

2014-02-20 Thread Daniel U. Thibault

Daniel U. Thibault added the comment:

"It seems to me the statement is correct as written.  What experiments indicate 
otherwise?"

Here's a simple one:

>>> print «1»

The guillemets are certainly not ASCII (Unicode AB and BB, well outside ASCII's 
7F upper limit) but are rendered as guillemets.  (Guillemets are easy for me 
'cause I use a French keyboard)  I haven't actually checked yet what happens 
when writing to a file.  If Python is unable to write anything but ASCII to 
file, it becomes nearly useless.

--

___
Python tracker 

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



[issue20698] 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder methods on instances

2014-02-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Feb 20, 2014, at 06:13 AM, Larry Hastings wrote:

>Benjamin, Barry: I take it #20261 should go in to 3.4.0?

Yes please!

--
title: 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder methods on 
instances -> 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder 
methods on instances

___
Python tracker 

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



[issue20653] Pickle enums by name

2014-02-20 Thread Eli Bendersky

Eli Bendersky added the comment:

Ethan, the patch you committed here seems obscure to me. Why __reduce_ex__ and 
not __reduce__? Where are the accompanying documentation changes? Can you 
clarify more how the full logic of pickling now works - preferably in comments 
withing the code?

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Eli Bendersky

Eli Bendersky added the comment:

I left some comments in #20653

As for cherry-picking this into 3.4, I'm not sure. Ethan - what is the worst 
scenario this patch enables to overcome? Someone getting locked in to by-value 
pickling with certain enums in 3.4?

--

___
Python tracker 

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



[issue20199] status of module_for_loader and utils._module_to_load

2014-02-20 Thread R. David Murray

R. David Murray added the comment:

I think the docs are accurate (but I haven't been *all* the way down the NEWS 
chain yet).  I have a fix for whatsnew in my buffer that I haven't applied yet. 
 Probably this weekend.  But as a doc change, I don't see this as a release 
blocker anyway.

--

___
Python tracker 

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



[issue20686] Confusing statement

2014-02-20 Thread R. David Murray

R. David Murray added the comment:

Thanks, yes, Georg already pointed out the issue with print.  I suppose that 
this is something that changed at some point in Python2's history but this bit 
of the docs was not updated.

Python can write anything to a file, you just have to tell it what encoding to 
use, either by explicitly encoding the unicode to binary before writing it to 
the file, or by using codecs.open and specifying an encoding for the file.  
(This is all much easier in python3, where the unicode support is part of the 
core of the language.)

--
versions: +Python 2.7

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2014-02-20 Thread Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue19748] test_time failures on AIX

2014-02-20 Thread David Edelsohn

David Edelsohn added the comment:

>>> time.mktime((-100, 1, 10) + (0,)*6)
-897577382.0
>>> time.mktime((100, 1, 10) + (0,)*6)
111922.0
>>> time.mktime((1900, 1, 10) + (0,)*6)
2086784896.0
>>> time.mktime((1930, 1, 10) + (0,)*6)
-1261497600.0
>>> time.mktime((1969,12,31, 23,59,59, 0,0,0))
28799.0

--

___
Python tracker 

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



[issue19748] test_time failures on AIX

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

@David Edelsohn: Oh nice, mktime() has an integer overflow on AIX. Could you 
please try to apply attached mktime_aix.patch, run test_time and try again my 
examples of msg211616? Thanks.

--
Added file: http://bugs.python.org/file34153/mktime_aix.patch

___
Python tracker 

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



[issue20700] Docs sidebar scrolls strangely in 3.4 docs

2014-02-20 Thread David Felix

New submission from David Felix:

On longer documentation pages, the sidebar is scrolling out of view and in an 
unexpected manner when the main page is scrolled. Seems to only affect 3.4 
docs, but I'm not positive.

http://docs.python.org/3.4/whatsnew/3.4.html is a good example. Using Firefox 
27.0.1 I view this page and scroll down. When I scroll down in the main area 
(the page is moving upwards in my view) past the summary section, the left side 
bar/navigation begins scrolling in the opposite direction, presumably to keep 
up with my scrolling. Its movement is not proportional to my downward scrolling 
and it is quickly lost "below" the view.

--
assignee: docs@python
components: Documentation
messages: 211729
nosy: David.Felix, docs@python
priority: normal
severity: normal
status: open
title: Docs sidebar scrolls strangely in 3.4 docs
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



[issue20693] Sidebar scrolls down 2x as fast as page content

2014-02-20 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +David.Felix

___
Python tracker 

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



[issue20700] Docs sidebar scrolls strangely in 3.4 docs

2014-02-20 Thread Zachary Ware

Zachary Ware added the comment:

Hi David,

Thanks for the report, but this has already been reported in issue20693.  I've 
added you to the nosy list on that issue.

--
assignee: docs@python -> 
nosy: +zach.ware
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> Sidebar scrolls down 2x as fast as page content

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

changeset:   89303:d1f0ec5a9317
tag: tip
user:Victor Stinner 
date:Thu Feb 20 16:43:09 2014 +0100
files:   Lib/asyncio/base_events.py
description:
asyncio: Fix _check_resolved_address() for IPv6 address

--

___
Python tracker 

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



[issue20693] Sidebar scrolls down 2x as fast as page content

2014-02-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, pitrou
stage:  -> needs patch

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

changeset:   89304:03b14690a9be
tag: tip
user:Victor Stinner 
date:Thu Feb 20 17:01:11 2014 +0100
files:   Lib/test/test_asyncio/test_events.py
description:
asyncio: ops, and now fix also the unit test for IPv6 address:
test_sock_connect_address()

--

___
Python tracker 

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



[issue20701] warning in compileall.rst

2014-02-20 Thread Antoine Pitrou

New submission from Antoine Pitrou:

When building the docs, I get the following message:

/home/antoine/cpython/default/Doc/library/compileall.rst:23: WARNING: Malformed 
option description u'[directory|file]...', should look like "-opt args", "--opt 
args" or "/opt args"

--
assignee: docs@python
components: Documentation
messages: 211733
nosy: docs@python, pitrou
priority: normal
severity: normal
status: open
title: warning in compileall.rst
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



[issue20702] warning in cmdline.rst

2014-02-20 Thread Antoine Pitrou

New submission from Antoine Pitrou:

When building the docs, I get the following message:

/home/antoine/cpython/default/Doc/using/cmdline.rst:167: WARNING: Malformed 
option description u'-?', should look like "-opt args", "--opt args" or "/opt 
args"

--
assignee: docs@python
components: Documentation
messages: 211734
nosy: docs@python, pitrou
priority: normal
severity: normal
status: open
title: warning in cmdline.rst
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



[issue20693] Sidebar scrolls down 2x as fast as page content

2014-02-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Doesn't seem to happen with a local build of the doc tree, using Sphinx 1.2.1.

--

___
Python tracker 

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



[issue20628] csv.DictReader

2014-02-20 Thread Sean Rodman

Sean Rodman added the comment:

I just realized that my two last updates on this ticket could be sort of 
confusing. So here is what I did for the 2.7 patch. First I copied the wording 
that I used for the 3.3/4 patch and then I created a relative link using the 
syntax `sequence `_ because I couldn't find a way to get the 
:ref: syntax to work correctly. I have applied this patch to the 2.7 branch and 
compiled the html documentation. When I tested it the link does work correctly. 
It goes to the collections page of the documentation. If you have time could 
you review the patch for 2.7 for me? (The patch is named 
DictReader_DictWriter_python2_NewWording.patch.)

--

___
Python tracker 

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



[issue20703] RuntimeError caused by lazy imports in pdb

2014-02-20 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Issuing the 'continue' pdb command with a lazy_import.py script as:

# START of lazy_import.py
import sys, pdb

for m in sys.modules:
if m == 'sys':
pdb.set_trace()

# END of lazy_import.py


gives the following output:

$ python lazy_import.py
> lazy_import.py(3)()
-> for m in sys.modules:
(Pdb) continue
Traceback (most recent call last):
  File "lazy_import.py", line 3, in 
for m in sys.modules:
RuntimeError: dictionary changed size during iteration

--
components: Library (Lib)
messages: 211737
nosy: georg.brandl, xdegaye
priority: normal
severity: normal
status: open
title: RuntimeError caused by lazy imports in pdb
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



[issue20628] csv.DictReader

2014-02-20 Thread R. David Murray

R. David Murray added the comment:

I figured out what you meant, but thanks for the clarification.

The section of interest in 2.7 is near the bottom of the page you linked to.  
It already has a Sphinx section reference (collections-abstract-base-classes), 
so you can use :ref: to link to it.

--

___
Python tracker 

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



[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman

Ethan Furman added the comment:

When I implemented pickle support I did not have a complete understanding of 
the pickle protocols nor how to best use them.  As a result, I picked 
__getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet).

Serhiy came along and explained a bunch of it to me, so now I know that 
__reduce_ex__ is the best choice [1] as it supports all the protocol levels, 
and is always used.  The patch removes __getnewargs__ and makes __reduce_ex__ 
The One Obvious Way, but if it does not go in to 3.4.0 then I won't be able to 
remove it because of backwards compatibility.


[1] Due to what I consider a bug in pickle (still need to create an issue for 
it, I think) if:

  class BaseClass:
 def __reduce_ex__(self, proto):
return some_tuple

  class SubClass(BaseClass):
 def __reduce__(self):
return a_different_tuple

  huh = SubClass()
  pickle.dumps(huh)

the dumps call will use BaseClass.__reduce_ex__ and not SubClass.__reduce__.  
For this reason Enum uses __reduce_ex__.

--

___
Python tracker 

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



[issue20704] asyncio: Implement debug API

2014-02-20 Thread Yury Selivanov

New submission from Yury Selivanov:

This is a proxy issue for https://code.google.com/p/tulip/issues/detail?id=136

--
assignee: haypo
messages: 211740
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
stage: committed/rejected
status: open
title: asyncio: Implement debug API
type: enhancement
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



[issue20704] asyncio: Implement debug API

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

NEWS updates:

changeset:   89305:db749f0c6567
tag: tip
user:Yury Selivanov 
date:Thu Feb 20 13:59:14 2014 -0500
files:   Misc/NEWS
description:
Misc/NEWS: Add some missing news items re asyncio.

--

___
Python tracker 

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



[issue20704] asyncio: Implement debug API

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Relevant commits: 549f451aa4c3 and dbf13a7d3987

--

___
Python tracker 

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



[issue20705] distutils.extension.Extension with empty 'sources' list

2014-02-20 Thread Rémi Rampin

New submission from Rémi Rampin:

While this is obviously a programming error, distutils currently has no check 
for the 'sources' list being empty, which might or might not result in a 
self-explanatory error message once the CCompiler's link() method is called 
(the exact error depends on the subclass's implementation).

It seems that some code had been put in initially to handle this case ('objects 
or []' constructs) but this has been broken since (objects[0] used by most 
subclasses).

Since objects can only be empty if sources was empty, I think catching this 
case in build_extension() (only caller of link_shared_object) makes sense.

Trivial patch attached, should apply on all versions.

--
components: Distutils
files: distutils-catch-empty-sources.diff
keywords: patch
messages: 211743
nosy: remram
priority: normal
severity: normal
status: open
title: distutils.extension.Extension with empty 'sources' list
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file34154/distutils-catch-empty-sources.diff

___
Python tracker 

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



[issue20696] asyncio.docs: Document StreamReader an other streams module APIs

2014-02-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c35d3114ea1 by Yury Selivanov in branch 'default':
asyncio.docs: Improve documentation of Streams. Issue #20696.
http://hg.python.org/cpython/rev/1c35d3114ea1

--
nosy: +python-dev

___
Python tracker 

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



[issue20696] asyncio.docs: Document StreamReader an other streams module APIs

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> committed/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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Again, documentation update.

changeset:   89306:1c35d3114ea1
tag: tip
user:Yury Selivanov 
date:Thu Feb 20 14:10:02 2014 -0500
files:   Doc/library/asyncio-stream.rst
description:
asyncio.docs: Improve documentation of Streams. Issue #20696.

--

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-02-20 Thread Zachary Ware

Zachary Ware added the comment:

Ok, I had missed that the warnings in your two separate cases were in fact 
different.  I still don't understand why VC++ sees the two cases so differently 
(throwing different warnings), but it at least explains the different results 
in your two cases.

I don't see how this change can actually break anything, so I'll go ahead and 
commit so this makes it into 3.3.5 (and hopefully 3.4.0, but that will be up to 
Larry Hastings).

--

___
Python tracker 

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



[issue20628] csv.DictReader

2014-02-20 Thread Sean Rodman

Sean Rodman added the comment:

Great! Thank you for the reference name. I have changed the patch to use a ref 
link. Here is the new patch.

--
Added file: 
http://bugs.python.org/file34155/DictReader_DictWriter_python2_ref.patch

___
Python tracker 

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



[issue20628] csv.DictReader

2014-02-20 Thread Sean Rodman

Changes by Sean Rodman :


Removed file: 
http://bugs.python.org/file34141/DictReader_DictWriter_python2_NewWording.patch

___
Python tracker 

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



[issue20687] Change in expectedFailure breaks testtools

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

Then I'm marking this as 3.5 and clearing the regression keyword.  From here we 
can either fix it in 3.5 or not bother (and just close this issue as wontfix).

--
keywords:  -3.4regression
priority: high -> normal
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

changeset:   89307:96e078663083
tag: tip
user:Victor Stinner 
date:Thu Feb 20 21:59:38 2014 +0100
files:   Lib/asyncio/base_events.py Lib/test/test_asyncio/test_events.py
description:
asyncio: _check_resolved_address() must also accept IPv6 without flow_info and
scope_id: (host, port).

--

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

I finished the second preview of rc2 just before you posted 96e078663083.  
That'll go in the third preview.

Also, I found another revision you forgot about (something about improving 
debug info).  With that, and the other revisions I mentioned, asyncio in the 
rc2 preview now has no diffs against the equivalent default revision.

rc2 cherry-picks 58 revisions.  Thank god I spent a couple days automating the 
process.

--

___
Python tracker 

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



[issue20706] asyncio.docs: Fix wording in 'this method returns a coroutine object'

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue20706] asyncio.docs: Fix wording in 'this method returns a coroutine object'

2014-02-20 Thread Yury Selivanov

New submission from Yury Selivanov:

Codereview: https://codereview.appspot.com/66430046/

--
assignee: yselivanov
messages: 211751
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.docs: Fix wording in 'this method returns a coroutine object'
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



[issue20706] asyncio.docs: Fix wording in 'this method returns a coroutine object'

2014-02-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd23d0c3f850 by Yury Selivanov in branch 'default':
asyncio.docs: Improve wordings; add a note to the Coroutines section. Issue 
#20706
http://hg.python.org/cpython/rev/cd23d0c3f850

--
nosy: +python-dev

___
Python tracker 

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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Hopefully, the last one from me ;) Again, some documentation updates.

Thank you, Larry, for accepting these last minute fixes.

changeset:   89308:cd23d0c3f850
tag: tip
user:Yury Selivanov 
date:Thu Feb 20 16:20:44 2014 -0500
files:   Doc/library/asyncio-eventloop.rst Doc/library/asyncio-stream.rst 
Doc/library/asyncio-sync.rst Doc/library/asyncio-task.rst
description:
asyncio.docs: Improve wordings; add a note to the Coroutines section. Issue 
#20706

--

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-02-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9aedb876c2d7 by Zachary Ware in branch '3.3':
Issue #20221: Removed conflicting (or circular) hypot definition
http://hg.python.org/cpython/rev/9aedb876c2d7

New changeset bf413a97f1a9 by Zachary Ware in branch 'default':
Issue #20221: Removed conflicting (or circular) hypot definition
http://hg.python.org/cpython/rev/bf413a97f1a9

--
nosy: +python-dev

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-02-20 Thread Zachary Ware

Zachary Ware added the comment:

Fixed, thanks for the report and patch!

--
assignee:  -> zach.ware
resolution:  -> fixed
stage: patch review -> committed/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



[issue20707] 3.4 cherry-pick: bf413a97f1a9 fix conflicting hypot definition with VS 2010

2014-02-20 Thread Zachary Ware

New submission from Zachary Ware:

PC/pyconfig.h does "#define hypot _hypot", but VS 2010 and above already define 
a hypot function (implemented by _hypot), which results in a warning if you 
have warning 4211 enabled (which warning level 4 does) or a recursive 
definition which results in a crash at runtime, depending on how you use 
Python.h.  Python itself doesn't suffer from the runtime crash, but Blender 
does because of Python.

bf413a97f1a9 fixes it by guarding the #define with #if _MSC_VER < 1600.

This one is kind of borderline for RC phase in my mind, so I leave it up to you 
to decide, Larry.  It is a serious issue for at least Blender and one other 
extension author.  On the other hand, this issue has been around since 3.3.0 
(the first VS 2010-supporting release) and was only reported this January.

--
assignee: larry
components: Build, Windows
messages: 211756
nosy: larry, zach.ware
priority: release blocker
severity: normal
status: open
title: 3.4 cherry-pick: bf413a97f1a9 fix conflicting hypot definition with VS 
2010
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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

Extract of the POSIX standard for recvmsg():
http://pubs.opengroup.org/onlinepubs/009695399/functions/recvmsg.html

"""
DESCRIPTION

(...) The recvmsg() function shall return the total length of the message. 
(...) If a message is too long to fit in the supplied buffers, and MSG_PEEK is 
not set in the flags argument, the excess bytes shall be discarded, and 
MSG_TRUNC shall be set in the msg_flags member of the msghdr structure. (...)

ERRORS

[EMSGSIZE] The msg_iovlen member of the msghdr structure pointed to by message 
is less than or equal to 0, or is greater than {IOV_MAX}.
"""

I don't see EMSGSIZE in the Linux manual page of recvmsg(). So it looks like 
Linux truncates, whereas OpenBSD raises an error. It's probably safe to accept 
in the unit test that the OS can raise OSError(EMSGSIZE).

--

___
Python tracker 

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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Patch is attached, please review.

--
keywords: +patch
Added file: http://bugs.python.org/file34156/asyncio_subp_docs_01.patch

___
Python tracker 

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



[issue20708] commands has no "RANDOM" environment?

2014-02-20 Thread Yanming Xiao

New submission from Yanming Xiao:

I saw this issue on Python 2.7.3 running on FreeBSD 9.1-64 and ubuntu 12.04-64. 
All under BASH. 

It seems that the shell for the external script does not have the access to 
RANDOM environment variable. If I run the script directly, 
the results are OK. 


# python -V
Python 2.7.3

# ls *.sh
arquery.sh  randomnumber.sh
#  ./commands_bug.py
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION0.log
# ./randomnumber.sh
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION0.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION279970795912919.log
# ./randomnumber.sh
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION0.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION279970795912919.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION30960807371.log
# ./randomnumber.sh
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION0.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION2681632594.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION279970795912919.log
-rw-r--r--  1 root  netvcr  9 Feb 20 17:31 SESSION30960807371.log

# 
# randomnumber.sh
#set -x
#
randomnumber=$((RANDOM*100+RANDOM*10+RANDOM))
sid=SESSION${randomnumber}
echo "whatever" > ${sid}.log
ls -l SESSION*.log



#!/usr/local/bin/python
#
# bug_in_python.py
#
import os
import commands

def main():
cmdString = './randomnumber.sh'
outputString =  commands.getstatusoutput(cmdString)
print outputString[1]

#
# program starts 
#
if __name__ == '__main__':
main()
os._exit(0)

--
components: Library (Lib)
files: commands_bug.py
messages: 211759
nosy: addict2tux
priority: normal
severity: normal
status: open
title: commands has no "RANDOM" environment?
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file34157/commands_bug.py

___
Python tracker 

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



[issue20709] os.utime(path_to_directory): wrong documentation for Windows.

2014-02-20 Thread Jan-Philip Gehrcke

New submission from Jan-Philip Gehrcke:

The os.utime() docs for Python 2 
(http://docs.python.org/2/library/os.html#os.utime) and 3 
(http://docs.python.org/3/library/os.html#os.utime) both contain the sentence

"Whether a directory can be given for path depends on whether the operating 
system implements directories as files (for example, *Windows does not*)"

"Windoes does not" is wrong. CPython 2.7 on Windows 7:

>>> os.utime(".", (100, 100))
>>> os.stat(".").st_mtime
100.0

We should
- either name a specific system for which this does not work
- or remove this example.

Windows XP and newer support this operation via SetFileTime 
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms724933%28v=vs.85%29.aspx):
 "Sets the date and time that the specified file or directory was created, last 
accessed, or last modified."

I have grepped myself through a couple of CPython source trees and found

posixmodule.c:if (!SetFileTime(hFile, NULL, &atime, &mtime)

in 2.5, 2.6, 2.7. I guess the statement comes from 2.4 times, where 
`SetFileTime` only appears in `PC/bdist_wininst/extract.c`.

So, do we just remove the hint or does someone have an example at hand for 
which combination of Python and platform this does not work for directories? 
Once we have a decision, I will be happy to provide the mini patch.

--
assignee: docs@python
components: Documentation
messages: 211760
nosy: docs@python, jgehrcke
priority: normal
severity: normal
status: open
title: os.utime(path_to_directory): wrong documentation for Windows.
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue20708] commands has no "RANDOM" environment?

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

I'm not sure that commands.getstatusoutput() will use the same shell than your 
shell. Try to display $SHELL environment variable to know your shell.

--
nosy: +haypo

___
Python tracker 

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



[issue20709] os.utime(path_to_directory): wrong documentation for Windows.

2014-02-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +larry

___
Python tracker 

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



[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

recvmsg_trunc_emsgsize.patch: modify recvmsg() tests checking for truncated 
data to ignore the test on OSError(EMSGSIZE).

--
keywords: +patch
Added file: http://bugs.python.org/file34158/recvmsg_trunc_emsgsize.patch

___
Python tracker 

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



[issue20707] 3.4 cherry-pick: bf413a97f1a9 fix conflicting hypot definition with VS 2010

2014-02-20 Thread Larry Hastings

Changes by Larry Hastings :


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



[issue20707] 3.4 cherry-pick: bf413a97f1a9 fix conflicting hypot definition with VS 2010

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

ok.  it's a low-risk fix.

--

___
Python tracker 

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



[issue20682] test_create_ssl_unix_connection() of test_asyncio failed on "x86 Tiger 3.x"

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

Oh, AIX has the same issue. I propose broken_unix_getsockname.patch to skip 
also the check on 'sockname' extra info on AIX.

The fix can wait Python 3.4.1.

http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/1757/steps/test/logs/stdio

==
FAIL: test_create_ssl_unix_connection 
(test.test_asyncio.test_events.PollEventLoopTests)
--
Traceback (most recent call last):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_asyncio/test_events.py",
 line 603, in test_create_ssl_unix_connection
self._basetest_create_ssl_connection(conn_fut, check_sockname)
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_asyncio/test_events.py",
 line 574, in _basetest_create_ssl_connection
self.assertIsNotNone(tr.get_extra_info('sockname'))
AssertionError: unexpectedly None

--
keywords: +patch
priority: release blocker -> 
Added file: http://bugs.python.org/file34159/broken_unix_getsockname.patch

___
Python tracker 

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



[issue20685] 3.4 cherry pick: 9f76adbac8b7 better handling of missing SSL/TLS in ensurepip

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

ok.

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



[issue20639] pathlib.PurePath.with_suffix() does not allow removing the suffix

2014-02-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you! Unfortunately, it is too late for 3.4, but I will make sure the fix 
is included in 3.4.1 (and 3.5).

--
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2014-02-20 Thread STINNER Victor

STINNER Victor added the comment:

For failing "FD pass" tests, see issue #12958: these tests are also skipped on 
Mac OS X. We should maybe also skip these tests on OpenBSD.

--

___
Python tracker 

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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


Added file: http://bugs.python.org/file34160/asyncio_subp_docs_02.patch

___
Python tracker 

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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


Added file: http://bugs.python.org/file34161/asyncio_subp_docs_03.patch

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

New submission from Larry Hastings:

inspect has a bug:
* inspect.ismethod() returns False for bound methods on builtins.

If I fix that, that exposes a bug in pydoc:
* pydoc's two docroutine() functions assume that bound methods
  have a __func__; bound builtins do not.

The only reason pydoc assumed the __func__ attribute was so it could use that 
instead of the bound function when getting the signature.  I don't know why it 
cared, but: when it does so, that means it displays "self" for bound methods 
implemented in Python.

However, since it doesn't do that for bound methods implemented in C, now the 
behavior is inconsistent.  Should it display self or not?  The consensus was, 
it should not.  This would make pydoc consistent with inspect.signature.

This patch therefore changes a third thing:

* pydoc: don't display "self" for bound methods implemented in Python.

I propose to merge this for 3.4.0rc2.

--
assignee: larry
components: Library (Lib)
files: larry.fix.help.on.bound.methods.1.diff
keywords: patch
messages: 211768
nosy: larry, ncoghlan, yselivanov
priority: release blocker
severity: normal
status: open
title: Make inspect and pydoc consistent about bound methods
versions: Python 3.4
Added file: 
http://bugs.python.org/file34162/larry.fix.help.on.bound.methods.1.diff

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Changes by Larry Hastings :


--
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry, I think you can use undocumented and private (but still heavily tested) 
'inspect._signature_internal(skip_bound_arg=False)', instead of signature.  
That will give you a Signature object with 'self' parameter always included.

And in 3.5 we'll probably make this option (renamed, hopefully), public, and 
switch pydoc to use new API again.

What do you think?

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

(The thing with my proposal, is that pydoc will handle everything that 
'inspect.signature' supports + it's behaviour won't change at all)

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

Whoops, the test suite hadn't finished when I posted that, and it had an error. 
 Here's an updated patch that fixes the tests.

Also, there's one more minor fix in the patch.  pydoc has cut-and-pasted code 
for HTML versus text rendering, and they had fallen out of sync.  This patch 
brings them into sync.

--
Added file: 
http://bugs.python.org/file34163/larry.fix.help.on.bound.methods.2.diff

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

I don't think we should touch 'inspect.isbuiltin' at this stage.
Please consider my proposal instead.

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

We discussed it in python-dev:
  https://mail.python.org/pipermail/python-dev/2014-January/132051.html

And the overwhelming majority voted +1 for "don't show self for bound methods". 
 So I'd like to change it for 3.4.  (I meant to get it in earlier but lacked 
the time.)

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

I'm not proposing to modify isbuiltin.  Rather, I'm proposing to fix a bug in 
ismethod.

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

> Rather, I'm proposing to fix a bug in ismethod.
Oh, sorry, that's what I meant. I don't think it's good to fix it either.

But please hold on, I think I found a bug in inspect.signature.

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Indeed, here it is: #20711

--

___
Python tracker 

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



[issue20711] inspect.getfullargspec does not correctly work with builtin module-level functions

2014-02-20 Thread Yury Selivanov

New submission from Yury Selivanov:

current behaviour:


>>> import inspect
>>> import os
>>> inspect.getfullargspec(os.stat)

FullArgSpec(args=['module', 'path'], varargs=None, varkw=None, defaults=None, 
kwonlyargs=['dir_fd', 'follow_symlinks'], kwonlydefaults={'dir_fd': None, 
'follow_symlinks': True}, annotations={})


'module' argument should not be there.

Patch is attached, please review.

--
assignee: yselivanov
files: sig_bound_01.patch
keywords: patch
messages: 211776
nosy: larry, ncoghlan, yselivanov
priority: release blocker
severity: normal
status: open
title: inspect.getfullargspec does not correctly work with builtin module-level 
functions
versions: Python 3.4
Added file: http://bugs.python.org/file34164/sig_bound_01.patch

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

So why is it necessary (and a release blocker) to fix a bug in 
inspect._signature_fromstr, but a terrible idea to fix a bug in 
inspect.ismethod?

--

___
Python tracker 

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



[issue20710] Make inspect and pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

> So why is it necessary (and a release blocker) to fix a bug in 
> inspect._signature_fromstr, but a terrible idea to fix a bug in 
> inspect.ismethod?

I was actually writing a comment, when I received this on my email ;) Let me 
explain my point of view.

> And the overwhelming majority voted +1 for "don't show self for bound 
> methods".  So I'd like to change it for 3.4.

Sorry, I didn't know about it. I lost track of the relevant issue, and thought 
that we still need to keep the old behaviour in tact.

> inspect.ismethod() returns False for bound methods on builtins.

I'm +1 in principle, the only thing that bugs me, is that 'ismethod' is 
probably 100x more popular API then signature, and event getfullargspec. I'm 
just not sure what are the consequences.  Maybe, it's possible to fix pydoc 
without touching 'ismethod'?  My 2 cents.

Now, about the newly discovered bug in getfullargspec() [and 
_signature_fromstr]. I put a "release blocker" on that issue because it's a new 
change, that 'getfullargspec' now uses 'inspect.signature', and I don't think 
we should ship this new feature broken. But certainly, it's up to you to let 
this in 3.4.0.

--

___
Python tracker 

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



[issue20711] inspect.getfullargspec does not correctly work with builtin module-level functions

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


--
stage:  -> patch review

___
Python tracker 

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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec3a70ef759d by Yury Selivanov in branch 'default':
asyncio.docs: Document subprocess_exec and subprocess_shell. Issue #20694.
http://hg.python.org/cpython/rev/ec3a70ef759d

--
nosy: +python-dev

___
Python tracker 

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



[issue20694] asyncio.docs: Document subprocess_exec and subprocess_shell

2014-02-20 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Last bit of documentation from me.

I, personally, don't have any more changes in mind, so this one is probably the 
last from me on the asyncio front in this thread.

changeset:   89312:ec3a70ef759d
tag: tip
user:Yury Selivanov 
date:Thu Feb 20 20:10:28 2014 -0500
files:   Doc/library/asyncio-eventloop.rst
description:
asyncio.docs: Document subprocess_exec and subprocess_shell. Issue #20694.

--

___
Python tracker 

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



[issue20710] Make pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

Okay, that's a fair point.  I checked, and the documentation specifically says 
that ismethod only returns true on bound methods implemented in Python.  I 
think that's a bad API, it should be agnostic about the implementation 
language.  But I'll remove the change to ismethod and rework the patch to pydoc 
around it.

--
title: Make inspect and pydoc consistent about bound methods -> Make pydoc 
consistent about bound methods

___
Python tracker 

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



[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-20 Thread Larry Hastings

New submission from Larry Hastings:

Some of the methods on the inspect module behave differently depending on 
whether the callable passed in was implemented in C or in Python.  For example, 
ismethod() only returns True for bound methods implemented in Python.

I assert that the interface presented by inspect should be agnostic about the 
underlying implementation.  So for example ismethod() should return True for 
bound methods on builtin classes.

--
assignee: larry
messages: 211783
nosy: larry, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: Make inspect agnostic about whether functions are implemented in Python 
or C
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



[issue20710] Make pydoc consistent about bound methods

2014-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

> I think that's a bad API, it should be agnostic about the implementation 
> language.

Agree.

Re #20711: Please take a look at the patch I wrote. It's your code I modified, 
you know it and the __text_signature__ quirks better than anyone.

--

___
Python tracker 

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



[issue20710] Make pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

Here's a revised patch that doesn't modify inspect.

--

___
Python tracker 

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



[issue20710] Make pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Changes by Larry Hastings :


Added file: 
http://bugs.python.org/file34165/larry.fix.help.on.bound.methods.3.diff

___
Python tracker 

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



[issue20710] Make pydoc consistent about bound methods

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

A slight tweak to the patch.  Previously I was just using truth testing on the 
value I got from "__self__", but that's wrong if the object is considered false 
(e.g. ''.zfill).  (Yury got this right in #20711, and I copied from him!)

--
Added file: 
http://bugs.python.org/file34166/larry.fix.help.on.bound.methods.4.diff

___
Python tracker 

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



[issue20713] 3.4 cherry-pick: d57df3f72715 Upgrade pip to 1.5.3

2014-02-20 Thread Donald Stufft

New submission from Donald Stufft:

Please pull in the upgrade from pip 1.5.2 to 1.5.3 into CPython 3.4.0, the 
revision is d57df3f72715

--
assignee: larry
messages: 211787
nosy: dstufft, larry, ncoghlan
priority: release blocker
severity: normal
status: open
title: 3.4 cherry-pick: d57df3f72715 Upgrade pip to 1.5.3
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



[issue20570] Bundle pip 1.5.3 in Python 3.4rc2

2014-02-20 Thread Donald Stufft

Donald Stufft added the comment:

I created issue20713

--

___
Python tracker 

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



[issue20053] venv and ensurepip are affected by default pip config file

2014-02-20 Thread Donald Stufft

Donald Stufft added the comment:

pip 1.5.3 is released and I've requested larry cherry-pick it into 3.4.0 with 
issue20713

--

___
Python tracker 

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



[issue20713] 3.4 cherry-pick: d57df3f72715 Upgrade pip to 1.5.3

2014-02-20 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--

___
Python tracker 

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



[issue20713] 3.4 cherry-pick: d57df3f72715 Upgrade pip to 1.5.3

2014-02-20 Thread Larry Hastings

Changes by Larry Hastings :


--
resolution:  -> fixed
stage:  -> committed/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



[issue20714] Please allow for ]]> in CDATA in minidom.py

2014-02-20 Thread Artur R. Czechowski

New submission from Artur R. Czechowski:

Current support for ]]> inside CDATA is to raise an Exception. However, it 
could be solved by dividing the ]]> to two strings:
- ]]
- >
and each one is a separate CDATA inside elemement. So, to put ]]> inside CDATA 
one can write:




--
components: XML
files: minidom.patch
keywords: patch
messages: 211791
nosy: arturcz
priority: normal
severity: normal
status: open
title: Please allow for ]]> in CDATA in minidom.py
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file34167/minidom.patch

___
Python tracker 

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



[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman

Changes by Ethan Furman :


--
Removed message: http://bugs.python.org/msg211739

___
Python tracker 

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



[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman

Ethan Furman added the comment:

When I implemented pickle support I did not have a complete understanding of 
the pickle protocols nor how to best use them.  As a result, I picked 
__getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet).

Serhiy came along and explained a bunch of it to me, so now I know that 
__reduce_ex__ is the best choice as it supports all the protocol levels, and is 
always used [1].  The patch removes __getnewargs__ and makes __reduce_ex__ The 
One Obvious Way, but if it does not go in to 3.4.0 then I won't be able to 
remove __getnewargs__ because of backwards compatibility.

All the tests still pass, and the new test for subclassing to pickle by name 
passes.


[1] pickle supports two low-level methods: __reduce__ and __reduce_ex__; 
__reduce_ex__ is more powerful and is the preferred method.  If a mix-in class 
to Enum defines __reduce_ex__ and Enum only defines __reduce__, Enum's 
__reduce__ will not be called.

--

___
Python tracker 

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



[issue20653] Pickle enums by name

2014-02-20 Thread Ethan Furman

Ethan Furman added the comment:

When I implemented pickle support I did not have a complete understanding of 
the pickle protocols nor how to best use them.  As a result, I picked 
__getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet).

Serhiy came along and explained a bunch of it to me, so now I know that 
__reduce_ex__ is the best choice [1] as it supports all the protocol levels, 
and is always used.  The patch removes __getnewargs__ and makes __reduce_ex__ 
The One Obvious Way, but if it does not go in to 3.4.0 then I won't be able to 
remove __getnewargs__ because of backwards compatibility.

All the tests still pass, and the new test for subclassing to pickle by name 
passes.


[1] pickle supports two low-level methods: __reduce__ and __reduce_ex__; 
__reduce_ex__ is more powerful and is the preferred method.  If a mix-in class 
to Enum defines __reduce_ex__ and Enum only defines __reduce__, Enum's 
__reduce__ will not be called.

--
priority: normal -> high
resolution: fixed -> 
stage: committed/rejected -> commit review
status: closed -> open
versions: +Python 3.4 -Python 3.5

___
Python tracker 

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



  1   2   >