[issue17528] Implement dumps/loads for lru_cache

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, the idea did have some merit and I appreciate your submitting it.

The issues are that the net gain likely isn't worth the API complication, that 
it opens a can worms (about manipulating the cache contents beyond load and 
store), and that it is at odds with the core notion of being transparent.

FWIW, the C version of OrderedDict now makes it trivially easy to roll your own 
highly performant variants of the LRU cache.

--

___
Python tracker 

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



[issue17528] Implement dumps/loads for lru_cache

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Marking this as rejected for the reasons mentions by me and Antoine.

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

___
Python tracker 

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



[issue5384] mmap and exception type

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Though the changes look like they would nicely harmonize mmap with other 
modules, I'm going to decline this patch.  No one else has stepped forward to 
offer agreement and it likely isn't worth the disruption that would come from 
breaking existing code.  Unfortunately, the time the fix-up an API is when it 
is proposed rather than years after the ship has already sailed.

Charles-François, thank you for the patch.

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

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2016-11-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue17577] Add lookahead/peek wrapper to itertools

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This doesn't seem to have gained any traction and I haven't interest in the 
subject for years.  Marking this as closed.  If the topic takes on a new life, 
this can be reopened and we can revisit the idea.

I don't think it would be hard to patch itertools.tee() to support indexing 
modeled on the patch above, but it is unclear whether it would be useful in 
practice or whether it would just be an attractive nuisance.  (Note, we added 
copy support to tee() based on similar requests however this feature turned out 
to be ignored in practice).

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

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

No one has submitted a patch for this or has expressed an interest in a long 
time.  Perhaps the use case is already served by re.finditer()

Unassigning.  Feel free to push this forward or to close due to lack on 
interest.

--
assignee: rhettinger -> 
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28777] asinc iter queue

2016-11-22 Thread Georgy

New submission from Georgy:

adding to asyncio.Queue class following methods:
def __aiter__(self): return self
async def __anext__(self): return await self.get()
let use asyncio.Queue follow:
queue = asyncio.Queue()
...
async for item in queue: do_something_with(item)

--
components: asyncio
messages: 281536
nosy: RekGRpth, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: asinc iter queue
type: enhancement
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



[issue10414] Python does not work on an IPv6 only host

2016-11-22 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Reopening to expand upon this issue which is still a large problem:

If you run on an IPv6-only Linux host, the following standard library tests all 
fail:

test_asynchat, test_asyncio, test_asyncore, test_docxmlrpc, test_epoll, 
test_httpservers, test_logging, test_multiprocessing_fork, 
test_multiprocessing_forkserver, test_os, test_poplib, test_pydoc, 
test_robotparser, test_ssl, test_support, test_telnetlib, 
test_urllib2_localnet, test_urllib_response, test_uuid, test_xmlrpc

I won't attempt to paste all of the errors into here but the errors have a few 
themes, here's a couple examples:

ERROR: test_arp_getnode (test.test_uuid.TestUUID)
--
Traceback (most recent call last):
  File "lib/python3.4/test/test_uuid.py", line 324, in test_arp_getnode
node = uuid._arp_getnode()
  File "lib/python3.4/uuid.py", line 364, in _arp_getnode
ip_addr = socket.gethostbyname(socket.gethostname())
socket.gaierror: [Errno -2] Name or service not known


ERROR: test_getwelcome (test.test_poplib.TestPOP3Class)
--
Traceback (most recent call last):
  File "lib/python3.4/test/test_poplib.py", line 246, in setUp
self.server = DummyPOP3Server((HOST, PORT))
  File "lib/python3.4/test/test_poplib.py", line 199, in __init__
self.create_socket(af, socket.SOCK_STREAM)
  File "lib/python3.4/asyncore.py", line 289, in create_socket
sock = socket.socket(family, type)
  File "lib/python3.4/socket.py", line 126, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

(yes I know those are from an old 3.4 test suite run but code inspection of 3.6 
shows that the underlying issues appear to remain)

Someone will need to setup an IPv6 only host in order to work on these and can 
generate the full modern list of errors.

It appears we have things that explicitly use IPv4 specific socket flags when 
unwarranted or use old API calls that don't deal with IPv6 at all, and 
represent IP addresses as strings within most of our standard library rather 
than adopting our own high level ipaddress module for API compatibility 
reasons.  (see https://bugs.python.org/issue20215 regarding TCPServer not 
supporting IPv6 at all)

Taking this on will keep Python relevant for the future without forcing people 
to jump through hoops or abandon the stdlib and only use third party networking 
libraries.

--
nosy: +gregory.p.smith
resolution: wont fix -> 
status: closed -> open
title: socket.gethostbyname  doesn't return an ipv6 address -> Python does not 
work on an IPv6 only host
type:  -> behavior
versions: +Python 2.7, 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



[issue28757] Installation Failure

2016-11-22 Thread Ned Deily

Ned Deily added the comment:

Just FYI, older python.org installer downloads for macOS, such as those 
provided for Python 3.2.x, used a now-obsolete installation package format that 
is no longer supported by the macOS installer app.  Those installer downloads 
have file names that end with .dmg.  More recent installer downloads are files 
ending with .pkg and should work OK.  As Eric notes 3.2 is very old by Python 3 
standards and its use should avoided.

--
nosy: +ned.deily

___
Python tracker 

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



[issue28772] Bus error in Python 3.6.0beta

2016-11-22 Thread Julien Palard

Julien Palard added the comment:

I can't reproduce the issue:

   $ ./python
   Python 3.6.0b4+ (default, Nov 23 2016, 00:23:59)
   [GCC 5.4.1 20160904] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> open('./python', 'rb')
   <_io.BufferedReader name='./python'>
   >>>

But you may try, as Chi Hsuan Yen, with --with-pydebug, also try with 
faulthandler, and we'll gladly read the output for something like:

   $ strace /tmp/py36/bin/python -c "open('/tmp/py36/lib/libpython3.6m.so.1.0', 
'rb')" 2>&1 | tail -n 20

Also, running it in gdb may provide a nice stacktrace, if you have nothing 
interesting from strace and faulthandler.

--
nosy: +mdk

___
Python tracker 

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



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Manuel Krebber

Manuel Krebber added the comment:

I updated the patch to add reflect the covariance.

--
Added file: http://bugs.python.org/file45606/frozenset-doc.patch

___
Python tracker 

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



[issue28757] Installation Failure

2016-11-22 Thread Eric V. Smith

Eric V. Smith added the comment:

Thanks for the bug report. However, 3.2 is no longer supported. If you can 
reproduce this with 3.5 or 3.6, then please list the exact steps, including:

OS version
where you got the file you downloaded
what steps you took to install it

I'm closing this, but feel free to re-open it if you can reproduce with a 
supported version of Python.

--
nosy: +eric.smith
resolution:  -> rejected
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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread Peter Inglesby

Peter Inglesby added the comment:

OK, I'll defer to your collective decades of experience and wisdom!  Thanks for 
all you all do for Python.

--

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread R. David Murray

R. David Murray added the comment:

It isn't ignored.  The first definition is entered into the class dictionary, 
then the second definition replaces it.  That's why Victor talked about 
redefining a method, because that's what happens.  You can't really disentangle 
the two cases except by source inspection (a linter).  In the parameter list 
case, the parser has the information it needs to detect it in hand, and more 
importantly there is no meaning to "replacing" a parameter, so we can and do 
generate an error in that case.

--

___
Python tracker 

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



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

The patch looks good, I left just one small comment in Rietveld.

--
nosy: +levkivskyi

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread Peter Inglesby

Peter Inglesby added the comment:

Victor, I'm not talking about redefining a method, and David, I don't think I'm 
talking about changing dynamic nature of the class dictionary.

All I'm suggesting is that if some code contains a class whose body defines the 
same method twice, Python should treat it as an error.  At the moment, as far 
as I can tell, the first method is ignored.  Is there any situation where this 
behaviour is useful?

Python already handles a somewhat similar situation by raising a SyntaxError 
when it encounters a function whose parameter list contains duplicates:

>>> def f(a, a):
...   pass
... 
  File "", line 1
SyntaxError: duplicate argument 'a' in function definition

--

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Yes, IMO this is something that needs to go into a linter,
> not Python itself.

I concur with David Murray.  This would break too many classes and is at odds 
with the design of Python where code inside a class definition is executed in 
its own namespace where it has the same rights and privileges as code execed 
elsewhere.

--
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

sre_compile_remove_groups.patch removes the groups parameter from 
_sre.compile(). A first step to simplify the API.

I prefer to keep most of the code in pure Python, to have code easier to 
maintain. So I prefer to not accept only groupindex. I prefer to build both 
(indexgroup, groupindex) in pure Python and pass them to the C code.

I pushed my patch sre_types.patch.

--

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1addc5d2c246 by Victor Stinner in branch 'default':
Issue #28765: _sre.compile() now checks the type of groupindex and indexgroup
https://hg.python.org/cpython/rev/1addc5d2c246

--
nosy: +python-dev

___
Python tracker 

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



[issue28770] Update python-gdb.py for fastcalls

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

I keep the issue open until the 3.6 branch is reopened for regular bug fixes, 
like this one. Then I will backport the fix to 3.6.

--

___
Python tracker 

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



[issue28770] Update python-gdb.py for fastcalls

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 752863f96fb8 by Victor Stinner in branch 'default':
Issue #28770: Update python-gdb.py for fastcalls
https://hg.python.org/cpython/rev/752863f96fb8

--
nosy: +python-dev

___
Python tracker 

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



[issue28752] datetime object fails to restore from reduction

2016-11-22 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Thanks all! So pleased to see this fixed.

--

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

> No need to backport it to 3.6 (if I didn't miss something).

Sorry, I misunderstood the issue. It's an enhancement, so for 3.7 only.

Right, 3.6 is now almost frozen, only major bug fixes blocking the release are 
accepted now (in short). Regular bugfixes should wait for 3.6.1.

--

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is not a bug itself. It seems to me that at worst case the current code is 
less efficient with non-standard error handler than it can be. I would commit 
the path to the 3.6 branch before beta 4 as it is nice and simple additional to 
already added optimization. But it is too late now, at last beta.

Xiang can commit his patch to 3.7. No need to backport it to 3.6 (if I didn't 
miss something).

--
assignee: serhiy.storchaka -> xiang.zhang
stage: patch review -> commit review

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread R. David Murray

R. David Murray added the comment:

Yes, IMO this is something that needs to go into a linter, not Python itself.  
The dynamic nature of the class dictionary is too important to many programs to 
change it at this point.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Without modifying the language, I guess that it's already technically possible 
to implement that in Python 3 in an application. Using the __prepare__() method 
of a metaclass and a custom dict subclass, I think that you can build what you 
want. I mean that you would have to modify your classes to inherit from a base 
class (which uses the metaclass) and/or use the metaclass everywhere, to catch 
such bug...

I'm not sure that it's worth it. You don't want to have to modify your code to 
catch a single class of kind. Linters exist to check the code without having to 
modify it.

--

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

> LGTM. But it is too late for beta 4. I'll commit the patch either after 
> releasing 3.6.0 or in the 3.7 branch only.

Right now, I suggest to only commit into 3.7. Such minor bug can wait for 
Python 3.6.1.


> And while we are here I noticed that handling non-ASCII replacement string 
> could be simpler

I also suggest to first commit unicode_encode_ucs1_error_pos.patch and then 
commit the other part of unicode_encode_ucs1_error_pos2.patch in a separated 
commit. I will be easy to backport the fix to the 3.6 branch later.

Serhiy: Xiang became a core developer, are you ok if he push himself  
unicode_encode_ucs1_error_pos.patch to default tomorrow, and later you rebase 
your patch on top of that?

I'm not super confident because the fix doesn't come with an unit test, but 
it's ok if Serhiy reviewed it :-)

--

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Redefine a method is a common practice indirectly using decorators:

  @staticmethod
  def method(): pass

is like:

  def method(): pass
  method = staticmethod(method)

So you can clarify what do you mean by "redefining"?

Some linters already can such common mistake (very common mistake in unit tests 
when using copy & paste).

--
nosy: +haypo

___
Python tracker 

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



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Manuel. Looks like FrozenSet is in PEP 484 and has been 
added to typing.__all__ in https://github.com/python/typing/pull/261 (already 
synced with the stdlib version of typing module)

The patch looks good to me. Adding Guido to nosy list for a commit review.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +berker.peksag, docs@python, gvanrossum
stage:  -> patch review

___
Python tracker 

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



[issue28776] Duplicate method names should be an error

2016-11-22 Thread Peter Inglesby

New submission from Peter Inglesby:

It should be an error for a class to define a method twice.

That is, Python should raise an exception when the following code is loaded:

class C:
def m(self):
# do something
def m(self):
# do something

I have just witnessed a beginner get very confused by this!

(Apologies if this is a duplicate of an existing issue.)

--
messages: 281513
nosy: inglesp
priority: normal
severity: normal
status: open
title: Duplicate method names should be an error

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Nov 22, 2016, at 07:28 PM, Serhiy Storchaka wrote:

>The reason for disallowing some undefined escapes is the same as in pattern
>strings: this would allow as to introduce new special escape sequences.

I'll note that technically speaking, you can still introduce new escapes for
repl without breaking the documented contract.  All the docs say are that
"unknown escapes such as \& are left alone", but that doesn't list what are
unknown escapes.  So if new escapes are added in Python 3.7, and they are
transformed in repl, that would be allowed.

I'll also note that not *all* unknown sequences are rejected now, only
backslashes followed by an ASCII letter.  So \& is still probably left alone,
while \s is now rejected.  That does add to the confusion, although the
deprecation note in the re.sub() documentation does document the new behavior
correctly.

On Nov 22, 2016, at 07:55 PM, R. David Murray wrote:

>There is still the argument that we shouldn't break 2.7 compatibility
>unnecessarily until 2.7 is out of maintenance.  That is: warnings are good,
>removals are bad.  (I haven't read through this issue, so I may be off base.)

This is also a reasonable argument, but not one I've thought about since I'm
using Python 2 only rarely these days.

On Nov 22, 2016, at 07:34 PM, Serhiy Storchaka wrote:

>If you insist I could revert converting warnings to errors (only in
>replacement string or all?) in 3.6.

pattern is a regular expression string so it already follows the syntax as
described in $6.2.1 Regular Expression Syntax.  But I think a reading of that
section (and the "special sequences" bit that follows) could also argue that
unknown escapes shouldn't throw an error.

>But I think they should left errors in 3.7. The earlier we make undefined
>escapes the errors, the earlier we can define new special escape sequences
>without confusing users. It is bad if the escape sequence is valid in two
>Python versions but has different meaning.

Perhaps so, but I do think this is a tricky question from a compatibility
point of view.  One possible optional, although it's late in the cycle, would
be to introduce a new flag so the user could tell re exactly what behavior
they want.  The default would have to be backward compatible (i.e. leave
unknown sequences alone), but there could be say an re.STRICTESCAPES flag that
would cause the error to be thrown.

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread R. David Murray

R. David Murray added the comment:

There is still the argument that we shouldn't break 2.7 compatibility 
unnecessarily until 2.7 is out of maintenance.  That is: warnings are good, 
removals are bad.  (I haven't read through this issue, so I may be off base.)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Yuri, do you want to do the same for async-with?

--
assignee: rhettinger -> yselivanov
priority: release blocker -> normal

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 749c5d6c4ba5 by Raymond Hettinger in branch '3.6':
Issue #27100:  Fix ref leak
https://hg.python.org/cpython/rev/749c5d6c4ba5

--

___
Python tracker 

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



[issue28573] Python 3.6.0b4 64-bit has no sys._mercurial info

2016-11-22 Thread Steve Dower

Steve Dower added the comment:

Ned approved this last night on IRC, so now it's in.

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

___
Python tracker 

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



[issue28573] Python 3.6.0b4 64-bit has no sys._mercurial info

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 089886be06df by Steve Dower in branch '3.6':
Issue #28573: Missing sys._mercurial info and other build issues.
https://hg.python.org/cpython/rev/089886be06df

New changeset d0958078bcb6 by Steve Dower in branch 'default':
Issue #28573: Missing sys._mercurial info and other build issues.
https://hg.python.org/cpython/rev/d0958078bcb6

--

___
Python tracker 

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



[issue28573] Python 3.6.0b4 64-bit has no sys._mercurial info

2016-11-22 Thread Steve Dower

Steve Dower added the comment:

Attaching the patch here for visibility.

In short, rather than relying on PATH to find hg.exe, we now precalculate it 
and pass it in to the build. This completely avoids the problem where modifying 
PATH multiple times for different builds was causing Mercurial to fall off.

This patch also fixes two other issues with my build script - the PGOOPTS need 
to come before CERTOPTS, as they are parsed by different scripts, and the debug 
build command fell off somewhere which resulted in the debug builds not being 
rebuilt for 3.6.0b4 - they are still the 3.6.0b3 debug build.

--
keywords: +patch
Added file: http://bugs.python.org/file45605/28573_1.patch

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM.

--
assignee: serhiy.storchaka -> rhettinger

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Matthew Barnett

Matthew Barnett added the comment:

@Barry: repl already supports some escapes, e.g. \g for named groups, 
although not \xXX et al, so deprecating unknown escapes like in the pattern 
makes sense to me.

BTW, the regex module already supports \xXX, \N{XXX}, etc.

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If you insist I could revert converting warnings to errors (only in replacement 
string or all?) in 3.6. But I think they should left errors in 3.7. The earlier 
we make undefined escapes the errors, the earlier we can define new special 
escape sequences without confusing users. It is bad if the escape sequence is 
valid in two Python versions but has different meaning.

--

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The reason for disallowing some undefined escapes is the same as in pattern 
strings: this would allow as to introduce new special escape sequences. For 
example:

* \N{...} for named character escape.
* Perl and extended PCRE use \L and \U for making lower and upper casing of the 
replacement. \U is already used for other purpose, but you have an idea.

Of course the need in new special escape sequences in template string is much 
less then in pattern string.

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
priority: release blocker -> normal
status: open -> closed

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The deprecation was documented in 3.5.

https://docs.python.org/3.5/library/re.html#re.sub

Deprecated since version 3.5, will be removed in version 3.6: Unknown escapes 
consist of '\' and ASCII letter now raise a deprecation warning and will be 
forbidden in Python 3.6.

--

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I disagree that the documentation is at fault.  This is known to break existing 
code, e.g. http://bugs.python.org/msg281496

I think it's not correct to change the documentation but leave the 
error-raising behavior for 3.6 because the deprecation was never documented in 
3.5 so this will look like a gratuitous regression.  issue27030 for reference.

I also question whether it makes sense for such escapes to be illegal in the 
repl argument of re.sub().  I could understand for this limitation in the 
pattern argument, but that's not what's causing the error.

--
nosy: +barry

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Maybe just remove the phrase "Unknown escapes such as \& are left alone"?

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This part of the documentation was just overlooked. Issue28450 is opened for 
this.

--

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Serhiy, do you care to double check this patch?

Martin, I'll leave the async_with for Yuri to fix-up.  I believe that is his 
code, so he should do the honors.

--
assignee: rhettinger -> serhiy.storchaka
nosy: +serhiy.storchaka, yselivanov

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file45604/fix_with_refleak.diff

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +ned.deily
priority: normal -> release blocker
status: closed -> open

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Nov 22, 2016, at 04:13 PM, Serhiy Storchaka wrote:

>Could Mailman be fixed? Undefined combinations of \ + ASCII emitted warnings
>in 3.5. And now they emit warnings even just in string literals
>(issue27364). If Mailman use undefined escape combinations, it could suffer
>from issue27364 too.

No, I think this is a valid bug/regression.

The Mailman code is basically trying to do this:

p = re.compile('%\d*d')
p.sub(r'\s*\d+\s*', some_string)

And so we get the error:

sre_constants.error: bad escape \s at position 0

But this directly contradicts the documentation for re.sub():

"... if it is a string, any backslash escapes in it are processed. That is, \n
is converted to a single newline character, \r is converted to a carriage
return, and so forth. Unknown escapes such as \& are left alone."

Clearly \s is not being left alone, so this is a real regression.

--

___
Python tracker 

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



[issue28775] Option to set startup directory in IDLE

2016-11-22 Thread Raymond Hettinger

New submission from Raymond Hettinger:

In my Python courses, Windows users frequently ask about how to set a startup 
directory so they can run from their Desktop or a custom directory.  

The usual answer is to create a short-cut and then alter the properties on that 
shortcut.  However, other programs they are used to will allow the startup 
directory to be specified from within the program (in our case, the preferences 
menu).

Also, we should change the default directory from C:\\Python27 which is almost 
never the right place.  A documents directory would be more appropriate.

--
assignee: terry.reedy
components: IDLE
messages: 281494
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: Option to set startup directory in IDLE
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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Martin, do you want to make a patch?

--

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-11-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue4347] Circular dependency causes SystemError when adding new syntax

2016-11-22 Thread Brett Cannon

Brett Cannon added the comment:

Ah, the fact parsetok.c gets compiled twice into different object files is the 
detail I was overlooking. Thanks for the clarification.

--

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2016-11-22 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue22298] Lib/warnings.py _show_warning does not protect against being called with a file like object which is closed

2016-11-22 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue28772] Bus error in Python 3.6.0beta

2016-11-22 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

A common cause of bus error is mis-aligned memory access. Which architecture 
are you on and how did you compile Python? (compiler flags, etc.)

FWIW, configure python with --with-pydebug may bring you more debugging 
information

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could Mailman be fixed? Undefined combinations of \ + ASCII emitted warnings in 
3.5. And now they emit warnings even just in string literals (issue27364). If 
Mailman use undefined escape combinations, it could suffer from issue27364 too.

--

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. But it is too late for beta 4. I'll commit the patch either after 
releasing 3.6.0 or in the 3.7 branch only.

And while we are here I noticed that handling non-ASCII replacement string 
could be simpler.

--
Added file: 
http://bugs.python.org/file45603/unicode_encode_ucs1_error_pos2.patch

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

If I understood correctly, the patch fix the ASCII encoder to handle correctly 
error handlers which return non-ASCII text replacement strings. Right?

I am not aware of such error handler, so I guess that it's a more a theorical 
fix?

I really hate the code (in each encoder) which handles non-ASCII replacement 
strings. The code in the charmap encoder is just a mess: it uses a reentrant 
call to the encoder... I never understood this crazy behaviour. I guess that 
nobody relies on the behaviour. I hesitate to simply raise an error instead of 
using different rules depending on the code. Ah yes, by the way, each codec 
behaves differently on non-ASCII replacement strings...

--

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Naoki for the fix ;-) gdb scripts are a little bit weird sometimes, and 
the API has subtle changes in each minor GDB release :-/

--

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
priority: normal -> low

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue28635] Update What's New for 3.6

2016-11-22 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

On second thought `-VV` isn't really a porting change, so probably a new 
section under "Build and C API Changes".  Something like "Other Improvements".

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Specifically, point #2; undefined combinations of \ + ASCII becoming an error.

--

___
Python tracker 

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



[issue27030] Remove deprecated re features

2016-11-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

FWIW, this breaks Mailman 3.1 (and probably 2.1)

--
nosy: +barry

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "&& left->codesize && right->codesize)"

Ooops! Fixed!

"While we are here, it perhaps worth to add a fast path for self == other."

Done.

--
status: open -> closed

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b43d15fd2d7 by Victor Stinner in branch '3.6':
Issue #28727: Fix typo in pattern_richcompare()
https://hg.python.org/cpython/rev/6b43d15fd2d7

New changeset c2cb70c97163 by Victor Stinner in branch '3.6':
Issue #28727: Optimize pattern_richcompare() for a==a
https://hg.python.org/cpython/rev/c2cb70c97163

--

___
Python tracker 

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



[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread Xiang Zhang

New submission from Xiang Zhang:

unicode_encode_ucs1 now recognizes as many characters as it can one time 
instead of one character a time. But the unicodeerror positions still only 
count 1(the second time). A similar problem reported in #28561.

--
components: Interpreter Core
files: unicode_encode_ucs1_error_pos.patch
keywords: patch
messages: 281482
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Better start and end position for unicodeerror in unicode_encode_ucs1
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45602/unicode_encode_ucs1_error_pos.patch

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-22 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

https://docs.python.org/3.6/whatsnew/3.6.html#changes-in-python-command-behavior
 seems appropriate.

--

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

While we are here, it perhaps worth to add a fast path for self == other.

--

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

+   && left->codesize && right->codesize);

There is a typo. Should be:

+   && left->codesize == right->codesize);

--
status: closed -> open

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Ah nice, it seems like test_gdb pass again.

--

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

> But I failed to reproduce it.

Hey, performance issues with code placement is a mysterious secret :-)
Nobody understands it :-D

The server runner the benchmark is a Intel Xeon CPU of 2011. It seems
like code placement issues are more important on this CPU than my more
recent laptop or desktop PC.

--

___
Python tracker 

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



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Manuel Krebber

New submission from Manuel Krebber:

The typing.FrozenSet is missing in the typing module documentation. I have 
attached a patch that adds it similar to the typing.Set which is already in the 
documentation.

--
components: Library (Lib)
files: frozenset-doc.patch
keywords: patch
messages: 281476
nosy: Wheerd
priority: normal
severity: normal
status: open
title: typing.FrozenSet missing in documentation.
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45601/frozenset-doc.patch

___
Python tracker 

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



[issue28772] Bus error in Python 3.6.0beta

2016-11-22 Thread Stefan Scherfke

New submission from Stefan Scherfke:

Hi all,

I am trying to build a custom Conda installer for Python 3.6.0b4.

I could successfully build an run Python.  However, when I run
the generated Conda installer, it dies with a "Bus error".

It happens when Conda's meta-installer script tries to replace
the build-prefix (e.g., /home/stefan/conda/asdf) with the prefix
of the actual installation (e.g., /tmp/py36).

Therefore, it opens all files in binary mode, reads their contents, replaces 
stuff, and writes the new contents back to the original file.

This works fine with text files but it dies when it hits the first binary file.

Here is a minimal example that reproduces the error:

$ /tmp/py36/bin/python
Python 3.6.0b4 (default, Nov 22 2016, 10:32:29)
[GCC 6.2.1 20160916 (Red Hat 6.2.1-2)] on linux
>>>
>>> path = '/tmp/py36/lib/libpython3.6m.so.1.0'
>>> f = open(path, 'wb')
BusError

Can anyone reproduce this?  Is this a compilation error or an issue
with Python itself?  It works without issues with Python 3.5.

Cheers,
Stefan

PS: If need, I can upload the Conda installer somewhere.  It's ~40MiB.

--
messages: 281475
nosy: Stefan Scherfke
priority: normal
severity: normal
status: open
title: Bus error in Python 3.6.0beta
type: crash
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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread INADA Naoki

INADA Naoki added the comment:

Thanks a lot!

I hope I can run test on multiple environment before merge,
after we move to Github.

--

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-22 Thread INADA Naoki

INADA Naoki added the comment:

I setup Ubuntu 14.04 on Azure, built python without neither PGO nor LTO.
But I failed to reproduce it.

@haypo, would you give me two binaries?

$ ~/local/py-2a143/bin/python3 -c 'import sys; print(sys.version)'
3.7.0a0 (default:2a14385710dc, Nov 22 2016, 12:02:34) 
[GCC 4.8.4]

$ ~/local/py-acde8/bin/python3 -c 'import sys; print(sys.version)'  
  
3.7.0a0 (default:acde821520fc, Nov 22 2016, 11:31:16) 
[GCC 4.8.4]

$ ~/local/py-2a143/bin/python3 bm_call_method.py 
.
call_method: Median +- std dev: 16.1 ms +- 0.6 ms

$ ~/local/py-acde8/bin/python3 bm_call_method.py
  
.
call_method: Median +- std dev: 16.1 ms +- 0.7 ms

--

___
Python tracker 

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



[issue28768] Warning: implicit declaration of function '_setmode'

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

include-io.h.patch LGTM.

2.7-include-io.h.patch: Cygwin is not currently officially supported in 
CPython. I suggest to focus efforts on supporting Cygwin in the default branch 
(future 3.7) only, as we are doing with Android.

--
nosy: +haypo

___
Python tracker 

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



[issue28771] Update documented signatures of tp_get/setattr

2016-11-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-22 Thread Martin Panter

Changes by Martin Panter :


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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b974f988c95 by Victor Stinner in branch '3.6':
Issue #28023: Fix python-gdb.py on old GDB versions
https://hg.python.org/cpython/rev/9b974f988c95

--

___
Python tracker 

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



[issue28768] Warning: implicit declaration of function '_setmode'

2016-11-22 Thread Martin Panter

Martin Panter added the comment:

The Modules/main.c change at least looks reasonable as a bug fix.

In the long term, it would be nice to clean up some of the conditions for 
including . Currently it is unconditional via PC/pyconfig.h, configure.ac 
optionally enables HAVE_IO_H, and there are various other conditions in 
different files, like as QUICKWIN, PYCC_VACPP and MS_WINDOWS || __CYGWIN__.

--
components: +Windows
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> patch review

___
Python tracker 

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



[issue26072] pdb fails to access variables closed over

2016-11-22 Thread Chun-Yu Tseng

Chun-Yu Tseng added the comment:

Hey xdegaye, have you confirmed it?

--

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

Naoki: "Wow. It's sad that tagged version is accidentally slow..."

If you use PGO compilation, for example use "./configure
--enable-optimizations" as suggested by configure if you don't enable
the option, you don't get the issue.

I hope that most Linux distribution use PGO compilation. I'm quite
sure that it's the case for Ubuntu. I don't know for Fedora.

--

___
Python tracker 

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



[issue28771] Update documented signatures of tp_get/setattr

2016-11-22 Thread Martin Panter

New submission from Martin Panter:

https://docs.python.org/3.7/c-api/typeobj.html#c.PyTypeObject.tp_getattr

tp_getattr and tp_setattr take a non-const char pointer in their signatures, 
but the documentation points to PyObject_GetAttrString() etc which were changed 
to take const char pointers a long time ago: revision 2f19b981ac24.

This patch fixes the documentation of those two methods for Python 3. There 
could be more fixes needed for Python 2.

--
assignee: docs@python
components: Documentation
files: typeobj-sigs.patch
keywords: patch
messages: 281468
nosy: docs@python, martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Update documented signatures of tp_get/setattr
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45600/typeobj-sigs.patch

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

2016-11-22 12:07 GMT+01:00 INADA Naoki :
> I want to reproduce it and check `perf record -e L1-icache-load-misses`.
> But IaaS (EC2, GCE, Azure VM) doesn't support CPU performance counter.

You don't need to go that far to check performances: just run
call_method and check timings. You need to compare on multiple
revisions.

speed.python.org Timeline helps to track performances, to have an idea
of the "average performance" and detect spikes.

--

___
Python tracker 

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



[issue28770] Update python-gdb.py for fastcalls

2016-11-22 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file45599/gdb_fastcall-2.patch

___
Python tracker 

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



[issue28770] Update python-gdb.py for fastcalls

2016-11-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue28770] Update python-gdb.py for fastcalls

2016-11-22 Thread STINNER Victor

New submission from STINNER Victor:

Python 3.6 has a new C calling convention: "fast calls".

python-gdb.py was disabled when compact dict was merged, see issue #27350.

Sadly, I missed that fast calls also broke python-gdb.py.

Attached patch fixes python-gdb.py, but I failed to fix test_gdb.py. With fast 
calls and patched python-gdb.py, python-gdb.py is now able to detect the Python 
frame of the call to the builtin id() function. It's a new feature compared to 
Python 3.5, but test_gdb.py should be updated to handle that.

I will try to fix that later, but in the meanwhile I was interrupted because 
the fix for compact dict in python-gdb.py failed on buildbots, see:
http://bugs.python.org/issue28023#msg281464

--
files: gdb_fastcall.patch
keywords: patch
messages: 281465
nosy: haypo
priority: normal
severity: normal
status: open
title: Update python-gdb.py for fastcalls
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45598/gdb_fastcall.patch

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread STINNER Victor

STINNER Victor added the comment:

test_gdb failed on a lot of buildbots. Examples:

* http://buildbot.python.org/all/builders/PPC64%20Fedora%203.x/builds/2089
* http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%203.6/builds/330
* 
http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.6/builds/287

Extract of the Gentoo non-debug:

(...)
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
(...)
==
FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.nondebug/build/Lib/test/test_gdb.py", 
line 490, in test_NULL_ob_type
'set v->ob_type=0')
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.nondebug/build/Lib/test/test_gdb.py", 
line 461, in assertSane
cmds_after_breakpoint=cmds_after_breakpoint)
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.nondebug/build/Lib/test/test_gdb.py", 
line 240, in get_gdb_repr
import_site=import_site)
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.nondebug/build/Lib/test/test_gdb.py", 
line 218, in get_stack_trace
self.assertEqual(unexpected_errlines, [])
AssertionError: Lists differ: ["Python Exception  Can[663 
chars].: "] != []

First list contains 10 additional elements.
First extra element 0:
"Python Exception  Cannot convert value to int.: "

Diff is 745 characters long. Set self.maxDiff to None to see it.

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

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-22 Thread INADA Naoki

INADA Naoki added the comment:

Wow. It's sad that tagged version is accidentally slow...

I want to reproduce it and check `perf record -e L1-icache-load-misses`.
But IaaS (EC2, GCE, Azure VM) doesn't support CPU performance counter.

--

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f6fb9e47f6b by INADA Naoki in branch '3.6':
Issue #28023: Fix python-gdb.py didn't support new dict implementation
https://hg.python.org/cpython/rev/4f6fb9e47f6b

New changeset c51045920410 by INADA Naoki in branch 'default':
Issue #28023: Fix python-gdb.py didn't support new dict implementation
https://hg.python.org/cpython/rev/c51045920410

--

___
Python tracker 

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



[issue28763] Use en-dashes for ranges in docs

2016-11-22 Thread Mark Dickinson

Mark Dickinson added the comment:

> I read this recommendation in many books about TeX, and also in other 
> typographic resources.

Same here. I'd add Apple's Style Guide and the Chicago Manual of Style to that 
list.

--

___
Python tracker 

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



[issue28023] python-gdb.py must be updated for the new Python 3.6 compact dict

2016-11-22 Thread INADA Naoki

INADA Naoki added the comment:

https://mail.python.org/pipermail/python-committers/2016-November/004065.html
> The 3.6 branch in the cpython repo is now available again but, as noted, 
> *only* for reviewed release critical fixes appropriate for the 3.6.0 final 
> and for final 3.6.0 doc updates!

So now I think I can commit this for now.

--

___
Python tracker 

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



  1   2   >