[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-29 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

I've updated the patches after review and implemented the checkup for 
llvm-profdata for both Linux and OSX.

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-29 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file40289/python3.6-pgo-v06.patch

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-29 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file40288/python2.7-pgo-v06.patch

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2015-08-29 Thread Simon Conseil

New submission from Simon Conseil:

Hi,

There is an issue in the webbrowser module for Mac OS when the BROWSER 
environment variable is set:

Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Jedi is not installed, falling back to readline
Python shell history: /Users/simon/.pythonhistory
>>> import webbrowser
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/webbrowser.py",
 line 669, in 
cmd = _synthesize(cmdline, -1)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/webbrowser.py",
 line 94, in _synthesize
if controller and name.lower() == controller.basename:
AttributeError: 'MacOSXOSAScript' object has no attribute 'basename'

If I unset BROWSER then it works fine. The issue is that the MacOSXOSAScript 
class overrides BaseBrowser's init without redifining the basename attribute. 
So a simple fix is to remove the __init__ from MacOSXOSAScript (and I guess the 
same applies to the MacOSX class). The same issue applies to python 3.4

--
components: Library (Lib), Macintosh
files: webbrowser.patch
keywords: patch
messages: 249316
nosy: ned.deily, ronaldoussoren, sconseil
priority: normal
severity: normal
status: open
title: webbrowser broken on Mac OS X when using the BROWSER variable
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file40290/webbrowser.patch

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2015-08-29 Thread Simon Conseil

Simon Conseil added the comment:

New version of the patch to rename the _name attribute to name as in other 
BaseBrowser subclasses.

--
Added file: http://bugs.python.org/file40291/webbrowser.patch

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2015-08-29 Thread Simon Conseil

Changes by Simon Conseil :


Removed file: http://bugs.python.org/file40290/webbrowser.patch

___
Python tracker 

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



[issue9625] argparse: Problem with defaults for variable nargs when using choices

2015-08-29 Thread Sworddragon

Changes by Sworddragon :


--
nosy: +Sworddragon

___
Python tracker 

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



[issue24956] Default value for an argument that is not in the choices list gets accepted

2015-08-29 Thread Sworddragon

New submission from Sworddragon:

Normally if a value to an argument is passed that is not in the choices list an 
error like "test.py: error: argument --test: invalid choice: 'c' (choose from 
'a', 'b')" is shown. But if the default is set to an invalid choice no error is 
shown.

--
components: Library (Lib)
messages: 249318
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Default value for an argument that is not in the choices list gets 
accepted
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



[issue24957] python3 -mpdb gets stuck in an unexitable infinite prompt loop when running some Python 2 code with syntax errors

2015-08-29 Thread Shlomi Fish

New submission from Shlomi Fish:

I tried Ctrl+C, Ctrl+D, "quit" and "exit", and "q" - nothing exits from the 
infinite prompt loop.

shlomif@telaviv1:~/Docs/homepage/homepage/trunk$ cd 
/home/shlomif/progs/riddles/project-euler/hg/project-euler/234
shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ ls
brute-force.pl   euler-234-description.txt   euler-234-v1.py
brute-force.pl~  euler-234-description.txt~  euler-234-v1.py~
shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ python3 
euler-234-v1.py 
  File "euler-234-v1.py", line 21
print "Found[] = ", n
 ^
SyntaxError: Missing parentheses in call to 'print'
shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ python3 
-mpdb euler-234-v1.py 1000
Traceback (most recent call last):
  File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript
self.run(statement)
  File "/usr/lib64/python3.4/bdb.py", line 431, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File 
"/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py",
 line 21
print "Found[] = ", n
 ^
SyntaxError: Missing parentheses in call to 'print'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> (1)()
(Pdb) 
(Pdb) exit
Post mortem debugger finished. The euler-234-v1.py will be restarted
Traceback (most recent call last):
  File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript
self.run(statement)
  File "/usr/lib64/python3.4/bdb.py", line 431, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File 
"/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py",
 line 21
print "Found[] = ", n   
 ^  
SyntaxError: Missing parentheses in call to 'print' 
Uncaught exception. Entering post mortem debugging  
Running 'cont' or 'step' will restart the program   
> (1)() 
(Pdb) quit  
Post mortem debugger finished. The euler-234-v1.py will be restarted
Traceback (most recent call last):  
  File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)  
  File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript  
self.run(statement) 
  File "/usr/lib64/python3.4/bdb.py", line 431, in run  
exec(cmd, globals, locals)  
  File "", line 1, in   
  File 
"/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py",
 line 21
print "Found[] = ", n
 ^
SyntaxError: Missing parentheses in call to 'print'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> (1)()
(Pdb) 
Post mortem debugger finished. The euler-234-v1.py will be restarted
Traceback (most recent call last):
  File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript
self.run(statement)
  File "/usr/lib64/python3.4/bdb.py", line 431, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File 
"/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py",
 line 21
print "Found[] = ", n
 ^
SyntaxError: Missing parentheses in call to 'print'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> (1)()
(Pdb) --KeyboardInterrupt--
(Pdb) --KeyboardInterrupt--
(Pdb) exit
Post mortem debugger finished. The euler-234-v1.py will be restarted
Traceback (most recent call last):
  File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript
self.run(statement)
  File "/usr/lib64/python3.4/bdb.py", line 431, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File 
"/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py",
 line 21
print "Found[] = ", n
 ^
SyntaxError: Missing parentheses in call to 'print'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart 

[issue24957] python3 -mpdb gets stuck in an unexitable infinite prompt loop when running some Python 2 code with syntax errors

2015-08-29 Thread Shlomi Fish

Shlomi Fish added the comment:

I should note that I am using python3-3.4.3-6.mga6 on Mageia Linux x86-64 
6/Cauldron.

--

___
Python tracker 

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



[issue11320] Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony))

2015-08-29 Thread Steve Dower

Steve Dower added the comment:

Seems like a fairly obvious bug. From 
https://docs.python.org/3/c-api/init.html#c.Py_SetPath

> This also causes ... sys.prefix and sys.exec_prefix to be empty.
> It is up to the caller to modify these if required after calling
> Py_Initialize().

Apparently you can't set `sys.[exec_]prefix` before calling Py_Initialize, and 
you can't call Py_Initialize without setting `sys.[exec_]prefix` (much like 
#20891, where you can't initialize threads without holding the GIL, and you 
can't acquire the GIL without having initialized threads.)

I don't know how to go about resolving this though (my changes were limited to 
getpathp.c - and I really need to go add the same changes to the non-Windows 
getpath.c too...). The best way seems to be forcing Nick to finish PEP 432, but 
unfortunately I have no leverage over him :)

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Shlomi Fish

New submission from Shlomi Fish:

After I run python3 (to run the REPL) and type "r" and then PgUp twice, I get a 
segfault. I'm on Mageia Linux x86-64 6 , but recall a similar problem happening 
before:

shlomif@telaviv1:~$ python3
Python 3.4.3 (default, Aug 13 2015, 21:40:54) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> rSegmentation fault
shlomif@telaviv1:~$ python3^C

I'm attaching the /etc/inputrc.

--
components: Interpreter Core
files: inputrc
messages: 249322
nosy: shlomif
priority: normal
severity: normal
status: open
title: Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux 
x86-64 6)
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file40293/inputrc

___
Python tracker 

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



[issue24959] unittest swallows part of stack trace using "raise from" with AssertionError

2015-08-29 Thread Chris Jerdonek

New submission from Chris Jerdonek:

unittest swallows some lines of the stack trace when raising an AssertionError 
using the "raise from" syntax inside a TestCase.  This marks it harder to 
pinpoint the source of test failures.  It is also confusing to see a stack 
trace like this because the error doesn't originate where the stack trace says 
it originates.

To reproduce:

import unittest

def foo():
raise Exception("foo")

class Test(unittest.TestCase):

def test_not_okay(self):
try:
foo()
except Exception as exc:
raise AssertionError("bar") from exc

def test_okay1(self):
try:
foo()
except Exception as exc:
raise ValueError("bar") from exc

def test_okay2(self):
try:
foo()
except Exception as exc:
raise Exception("bar") from exc

The result (observe how the display for "test_not_okay" differs from the other 
two):

==
ERROR: test_okay1 (error.Test)
--
Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 17, in test_okay1
foo()
  File "/Users/chris/dev/error.py", line 5, in foo
raise Exception("foo")
Exception: foo

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 19, in test_okay1
raise ValueError("bar") from exc
ValueError: bar

==
ERROR: test_okay2 (error.Test)
--
Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 23, in test_okay2
foo()
  File "/Users/chris/dev/error.py", line 5, in foo
raise Exception("foo")
Exception: foo

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 25, in test_okay2
raise Exception("bar") from exc
Exception: bar

==
FAIL: test_not_okay (error.Test)
--
Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 11, in test_not_okay
foo()
Exception: foo

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chris/dev/error.py", line 13, in test_not_okay
raise AssertionError("bar") from exc
AssertionError: bar

--
Ran 3 tests in 0.001s

FAILED (failures=1, errors=2)

--
components: Library (Lib)
messages: 249323
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: unittest swallows part of stack trace using "raise from" with 
AssertionError
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



[issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase

2015-08-29 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I guess this isn't limited just to the "raise from" syntax.  It also occurs if 
"from exc" is removed from the example above.

--
title: unittest swallows part of stack trace using "raise from" with 
AssertionError -> unittest swallows part of stack trace when raising 
AssertionError in a TestCase

___
Python tracker 

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



[issue24956] Default value for an argument that is not in the choices list gets accepted

2015-08-29 Thread R. David Murray

R. David Murray added the comment:

That might be intentional, and in any case fixing it would be backward 
incompatible.  I think we should just live with it.

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread R. David Murray

R. David Murray added the comment:

What makes you think this is a bug in Python?  Can you reduce the inputrc to 
the minimum that reproduces the problem?

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread R. David Murray

R. David Murray added the comment:

Sorry, should have been clearer "a bug in python as opposed to one in Mageia's 
readline".

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Shlomi Fish

Shlomi Fish added the comment:

I'm attaching here the reduced, minimal, inputrc. I think it's a bug in Python 
because it doesn't happen with any other program that uses readline (bash, perl 
-d, etc.) that I checked. I'll check with a vanilla readline compiled from 
source from the GNU site , though.

--
Added file: http://bugs.python.org/file40294/_inputrc

___
Python tracker 

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



[issue24960] Can't use pip or easy_install with embeddable zip file.

2015-08-29 Thread Oleg N

New submission from Oleg N:

Error: [Errno 2] No such file or directory: 
'...\\python35.zip\\lib2to3\\Grammar.txt'. Python35.zip from this archive: 
https://www.python.org/ftp/python/3.5.0/python-3.5.0rc2-embed-amd64.zip. Path 
is correct.

--
components: Library (Lib)
messages: 249329
nosy: Oleg N
priority: normal
severity: normal
status: open
title: Can't use pip or easy_install with embeddable zip file.
type: resource usage
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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread R. David Murray

R. David Murray added the comment:

I can't reproduce it on my Gentoo box using 3.4 tip.

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread eryksun

eryksun added the comment:

Maybe the problem is using escape characters (0x1b) instead of \e. Try using 
the following:

"\e[5~": history-search-backward

FWIW, your inputrc doesn't crash my system (64-bit Linux, readline 6.3 and 
Python 3.4).

--
nosy: +eryksun

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Shlomi Fish

Shlomi Fish added the comment:

Hi all!

Thanks for the investigation.

I have now built readline-6.3 from source using:

./configure --prefix="$HOME/apps/readline-TO_DEL" --with-curses=yes 
--enable-multibyte

and installed it. Then I built python 3.4.3 from source against it by setting 
LIBRARY_PATH/CPATH/etc. and by this patch to setup.py:

if True: # if cross_compiling:
self.add_gcc_paths()

After I built it and ran it, it still segfaults after I type "r" and press PgUp 
twice. I've attached the strace output (compressed with xz).

--
Added file: http://bugs.python.org/file40295/py3.strace.xz

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-29 Thread Skip Montanaro

Skip Montanaro added the comment:

The latest patch worked fine for me (Mac OS X Yosemite). I've only tried with 
2.7 so far. The only thing that was a bit mystifying were the errors during the 
initial profile run. There is so much that floats by in the terminal window 
that I completely missed the warnings about errors during the test run not 
being anything to worry about. I only noticed the messages when I took a look 
at the patch more closely.

Perhaps it would be worthwhile to add a short bit about the profile-opt target 
and its requirements to the README file.

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread eryksun

eryksun added the comment:

A gdb backtrace may be of more help than strace.

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Shlomi Fish

Shlomi Fish added the comment:

gdb by full attached.

--
Added file: http://bugs.python.org/file40296/py3.gdb-bt.txt

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-29 Thread Skip Montanaro

Skip Montanaro added the comment:

Not knowing a darn thing about this, I went ahead and made a provisional change 
to the README file.

--
Added file: http://bugs.python.org/file40297/README.pgo

___
Python tracker 

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



[issue24961] shell stdout broken after exiting interactive python prompt

2015-08-29 Thread Dave Hein

New submission from Dave Hein:

With 3.4.3 from an OS X terminal prompt, if I just enter the interactive Python 
REPL environment (by just entering the command "python" from the command line) 
and then exit (via "exit()" or Ctrl-D), then stdout appears to be broken ... I 
see no stdout output on the terminal from that point forward. I do see stderr 
output.

If I just run a python script, without the "-i" flag, then stdout is not 
damaged and the subsequent terminal interaction is normal.

I did not see this with 3.4.2 or any other version of Python.

I'm running OS X 10.9.5, have installed Python 3.4.3 with MacPorts, and use 
virtualenv.

--
components: IO
messages: 249337
nosy: datihein
priority: normal
severity: normal
status: open
title: shell stdout broken after exiting interactive python prompt
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



[issue24961] shell stdout broken after exiting interactive python prompt

2015-08-29 Thread Ned Deily

Ned Deily added the comment:

There have been other problems reported with MacPorts Python 3.4 using their 
default most recent version of the BSD libedit package.  As far as I know, 
those problems have not yet been resolved but I can't get to the MacPorts issue 
tracker at the moment to check.  The workaround has been to install the 
optional py34-readline port which modifies the MacPorts python3.4 to use GNU 
readline rather than libedit.  In any case, you can follow up on the MacPorts 
tracker (https://trac.macports.org) as this is not a problem seen with a 
vanilla Python 3.4.x on OS X using the Apple-supplied system version of libedit.

--
nosy: +ned.deily
resolution:  -> third party
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



[issue24941] Add classproperty as builtin class

2015-08-29 Thread Eric Snow

Eric Snow added the comment:

I've posted a counter-proposal on python-ideas:

https://mail.python.org/pipermail/python-ideas/2015-August/035614.html

Basically: instead of "classproperty", add a more lenient alternative to 
classmethod which allows composition.  I called it "classresolved".

class classresolved:
def __init__(self, wrapped):
self.wrapped = wrapped
def __get__(self, obj, cls):
try:
getter = self.wrapped.__get__
except AttributeError:
return self.wrapped
return getter(cls, type(cls))

--
nosy: +eric.snow

___
Python tracker 

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



[issue24941] Add classproperty as builtin class

2015-08-29 Thread Eric Snow

Eric Snow added the comment:

I also posted a broader proposal:

https://mail.python.org/pipermail/python-ideas/2015-August/035615.html

--

___
Python tracker 

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



[issue24961] shell stdout broken after exiting interactive python prompt

2015-08-29 Thread Dave Hein

Dave Hein added the comment:

Thanks. I installed py34-readline and rebuilt my virtualenv; all is well now.

I put in a MacPorts ticket when their bugtracker gets back online.

--

___
Python tracker 

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



[issue11320] Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony))

2015-08-29 Thread Nick Coghlan

Nick Coghlan added the comment:

I think the current situation is mainly an artifact of our relative dearth
of regression testing for embedded configurations, and the fact that we
have very few core developers working for companies embedding CPython in
larger applications.

I do care about that space (hence PEP 432), but operating system
integration, software distribution tools, and improved modularisation take
precedence on work time, and the science & education sectors on my personal
time.

I did recently file issue 24932 to propose investigating and adopting a C
level unit testing framework for the embedding tests, as one of the things
my preliminary work on PEP 432 highlighted is how limited our current
direct testing capabilities for the embedding API are - at this point,
we're mostly limited to testing it the way CPython uses it, which makes it
unfortunately fragile for embedders (as issues like this one show).

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Martin Panter

Martin Panter added the comment:

Well it looks like you’ve identified that PgUp triggers a history search. 
Perhaps it would be good to look at your /home/shlomif/.python_history file, 
assuming there is nothing sensitive in there. The strace output only indicates 
it is 411 bytes and gives the first one-and-a-half lines. My guess is there is 
something funny about a line beginning with “r”, or a nearby line.

But it still sounds like a Readline bug instead of a Python bug. If you clear 
or remove the history file, does the bug go away? Maybe you can replace the 
equivalent ~/.bash_history or Perl history file to see if it triggers a crash 
there.

--
nosy: +martin.panter

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Martin Panter

Martin Panter added the comment:

According to the GDB backtrace, _rl_kscxt is a null pointer at 
, 
while the _rl_dispatch_callback() function doesn’t handle null pointers. Maybe 
you would find the Readline people more knowledgeable about this.

--

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-08-29 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Well, yeah, that indeed sucks.

Not sure what the best solution is. Some options:

1) "Don't do that then"

2) Explicitly add a "__class__" property to every immutable type, that 
unconditionally errors out on assignment.

3) Add a hack to typeobject.c checking for the important immutable types

4) Something cleverer...? A new type flag?

The immutable types are: int, float, str, tuple, bool, frozenset, complex, 
bytes, and... anything else?

--

___
Python tracker 

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



[issue24962] Unnecessary space in using/mac

2015-08-29 Thread TAKASE Arihiro

New submission from TAKASE Arihiro:

https://docs.python.org/3.4/using/mac.html#configuration

A newline in the file path of the .plist file makes a space in the rendered 
result.
The attached patch fixes it.

--
assignee: docs@python
components: Documentation
files: using_mac.patch
keywords: patch
messages: 249346
nosy: artakase, docs@python
priority: normal
severity: normal
status: open
title: Unnecessary space in using/mac
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40298/using_mac.patch

___
Python tracker 

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



[issue24962] Unnecessary space in using/mac

2015-08-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3ef2d694e976 by Zachary Ware in branch '2.7':
Issue #24962: Remove space from filename
https://hg.python.org/cpython/rev/3ef2d694e976

New changeset 2de6fba18ff6 by Zachary Ware in branch '3.4':
Issue #24962: Remove space from filename
https://hg.python.org/cpython/rev/2de6fba18ff6

New changeset 84c3188f6e1e by Zachary Ware in branch '3.5':
Issue #24962: Merge 3.4
https://hg.python.org/cpython/rev/84c3188f6e1e

New changeset 5711ffc2292f by Zachary Ware in branch 'default':
Closes #24962: Merge with 3.5
https://hg.python.org/cpython/rev/5711ffc2292f

--
nosy: +python-dev
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



[issue24962] Unnecessary space in using/mac

2015-08-29 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the report and patch!

--
nosy: +zach.ware

___
Python tracker 

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



[issue24272] PEP 484 docs

2015-08-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 192c654a7c93 by Zachary Ware in branch '3.5':
Issue #24272: Remove usage of default reST role from typing docs
https://hg.python.org/cpython/rev/192c654a7c93

New changeset 10a63ded324c by Zachary Ware in branch 'default':
Issue #24272: Merge with 3.5
https://hg.python.org/cpython/rev/10a63ded324c

--

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-08-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Later I had got a crash.

>>> class S(str): __slots__ = ()
... 
>>> 'a'.__class__ = S
>>> 
>>> def f(a): pass
... 
Fatal Python error: non-string found in code slot

Current thread 0xb7583700 (most recent call first):
Aborted (core dumped)

The stdlib is full of implicit caches. Virtually any hashable object can be 
cached and shared. Why __class__ assignment is allowed at all? There are only 
two uses of __class__ assignment in the stdlib besides tests (in 
Lib/importlib/util.py and in Lib/xml/sax/saxutils.py), and in both cases it 
looks as optimization trick.

--

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-08-29 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Probably the patch on that bug should be reverted.

--

___
Python tracker 

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



[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread Shlomi Fish

Shlomi Fish added the comment:

Marting Panter: I'm getting the same problem with a completely empty 
~/.python_history file. Moreover, I was able to reproduce a similar bug in gdb. 
I'll try seeing if I can create a minimal GNU readline-using program here that 
reproduces it.

--

___
Python tracker 

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