compiling matplotlib in virtual env

2015-10-02 Thread Rolston Jeremiah
Hello everyone,

I been trying to compile matplotlib in a python3.4 virtual env using 
pip version 1.7 on Fedora 22. I am in about 3 weeks learning python 
and Django so I am not clear on the error response to:


commmand
=

pip3 install matplotlib


error message
=


Traceback (most recent call last):
  File "", line 20, in 
  File "/tmp/pip-build-b_yuukm4/matplotlib/setup.py", line 155, in 
result = package.check()
  File "/tmp/pip-build-b_yuukm4/matplotlib/setupext.py", line 961, in check
min_version='2.3', version=version)
  File "/tmp/pip-build-b_yuukm4/matplotlib/setupext.py", line 445, in 
_check_for_pkg_config
if (not is_min_version(version, min_version)):
  File "/tmp/pip-build-b_yuukm4/matplotlib/setupext.py", line 173, in 
is_min_version
return found_version >= expected_version
  File "/usr/lib64/python3.4/distutils/version.py", line 76, in __ge__
c = self._cmp(other)
  File "/usr/lib64/python3.4/distutils/version.py", line 343, in _cmp
if self.version < other.version:
TypeError: unorderable types: str() < int()


Command "python setup.py egg_info" failed with error code 1 in 
/tmp/pip-build-b_yuukm4/matplotlib


Appreciate  your help
thanks

rjae



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: compiling matplotlib in virtual env

2015-10-02 Thread Miki Tebeka
> I been trying to compile matplotlib in a python3.4 virtual env using 
> pip version 1.7 on Fedora 22. I am in about 3 weeks learning python 
> and Django so I am not clear on the error response to:
> ...
>   File "/usr/lib64/python3.4/distutils/version.py", line 343, in _cmp
> if self.version < other.version:
> TypeError: unorderable types: str() < int()
Looks like a bug in distuils (which is a package used by pip). Maybe you can 
upgrade to a newer version of distutils? (pip3 install -U distutils) and try 
again?

As a side note, I find using conda to install scipy related packages a much 
easier way.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Nick Coghlan

Nick Coghlan added the comment:

Adding Georg directly to the nosy, as I think this kind of structural question 
falls under his domain as the docs lead :)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



I'm using Sphinx, but is there a UML auto generator

2015-10-02 Thread Gilcan Machado
Hi,

I'm using Sphinx as a doc tool.

Amazing.

But I need a way to describe, for example, that, inside a Person class,
there's a method called changePassword which depends of the execution of
the method checkPermissions, and checkPermissions depends on the execution
of two other methods.

I'm using a graphic tool like OpenDraw to do the job, but I guess there's a
better way of doing this.

Is there any UML auto generator for python that do that?

If not, any suggestion?

By the way, I don't know UML (only the very basic stuff), I'm only trying
to find a good way to describe the methods relations inside my class.

[]
Gil
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-02 Thread Chris Warrick
On 2 October 2015 at 15:10, Hedieh Ebrahimi  wrote:
> Thanks Laura,
>
> In my user interface I have many group boxes that are located inside the main 
> widget. All the group boxes and their child widgets have fixed sizes.
>
> How can I use the width and height I get from availableGeometry or 
> ScreenGeometry to multiply
>
> screenGeometry = QApplication.instance().desktop().screenGeometry()
> availGeometry = QApplication.instance().desktop().availableGeometry()
> width, height = availGeometry.width(), availGeometry.height()
>
> to resize my geometry by a ratio? Is this a good approach?
> --
> https://mail.python.org/mailman/listinfo/python-list

This is NOT a good approach.  A good approach involves using a layout.
See my previous e-mail for details.

Geometry is not going to help you here, especially since you would
need a ton of code to resize everything on **any** window size change
event.  And you especially do not need the screen size, because it
would still hinder changing window sizes.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25276] Intermittent segfaults on PPC64 AIX 3.x

2015-10-02 Thread David Edelsohn

David Edelsohn added the comment:

As we have seen with similar issues on other targets, this likely is due to the 
random order of tests.  In another case, the timezone was not being restored 
properly by GLIBC.  Another test is leaving the process in a state that somehow 
evokes this failure from test_decimal.

--

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

Davey Shafik added the comment:
> We (PHP) also have a more visual guide at 
> http://php.net/supported-versions.php which updates dynamically to show the 
> current status.

Great job! It's much easier to see the status with the summary in a
single picture.

--

___
Python tracker 

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



[issue25295] functools.lru_cache raises KeyError

2015-10-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know what was the actual cause of the error and if issue24483 fixed it 
or mask.

--

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue25276] Intermittent segfaults on PPC64 AIX 3.x

2015-10-02 Thread Stefan Krah

Stefan Krah added the comment:

If you have time, you could use an explicit seed (and gdb):

# test_email segfault:
./python -m test -j 1 -u all -W --randseed 5634141

--

___
Python tracker 

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



[issue25276] Intermittent segfaults on PPC64 AIX 3.x

2015-10-02 Thread Stefan Krah

Stefan Krah added the comment:

And the segfaults are apparently somewhat random. This is beginning
to look like an issue unrelated to decimal that was perhaps recently
introduced (in which case "hg bisect" would be the fastest
way to debug).


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

[129/399/3] test_email
Fatal Python error: Segmentation fault

Current thread 0x0001 (most recent call first):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/email/utils.py",
 line 57 in _has_surrogates
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/email/message.py",
 line 264 in get_payload
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_email/test_email.py",
 line 3463 in test_long_lines
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py",
 line 600 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py",
 line 648 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/support/__init__.py",
 line 1775 in _run_suite
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/support/__init__.py",
 line 1809 in run_unittest
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 159 in test_runner
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 160 in runtest_inner
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 113 in runtest
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/main.py",
 line 289 in run_tests_sequential
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/main.py",
 line 331 in run_tests
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/main.py",
 line 362 in main
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/main.py",
 line 404 in main
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/main.py",
 line 426 in main_in_temp_cwd
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/__main__.py",
 line 3 in 
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/runpy.py", 
line 85 in _run_code
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/runpy.py", 
line 170 in _run_module_as_main

--
title: test_decimal sometimes crash on PPC64 AIX 3.x -> Intermittent segfaults 
on PPC64 AIX 3.x

___
Python tracker 

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



Re: PySide window does not resize to fit screen

2015-10-02 Thread Hedieh Ebrahimi
Thanks Laura, 

In my user interface I have many group boxes that are located inside the main 
widget. All the group boxes and their child widgets have fixed sizes. 

How can I use the width and height I get from availableGeometry or 
ScreenGeometry to multiply 

screenGeometry = QApplication.instance().desktop().screenGeometry() 
availGeometry = QApplication.instance().desktop().availableGeometry() 
width, height = availGeometry.width(), availGeometry.height() 

to resize my geometry by a ratio? Is this a good approach?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25276] Intermittent segfaults on PPC64 AIX 3.x

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to isolate tests using -j1: see my issue #25285.

(Currently, -j1 doesn't use subprocesses.)

--

___
Python tracker 

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



[issue19006] UnitTest docs should have a single list of assertions

2015-10-02 Thread Nicholas H.Tollervey

Changes by Nicholas H.Tollervey :


--
nosy: +kushal.das, ntoll

___
Python tracker 

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



[issue25297] max_help_position is not works in argparse library

2015-10-02 Thread Alexander

Alexander added the comment:

Problem also described on http://stackoverflow.com/questions/3215/

--

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Ezio Melotti

Ezio Melotti added the comment:

I like that, in fact I used the same format in my talk "The development process 
of Python": 
http://wolfprojects.altervista.org/talks/development-process-of-python-2011/ 
(slides 20/21).

The main problem is where to put all this though.

--

___
Python tracker 

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



[issue24848] Warts in UTF-7 error handling

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

http://buildbot.python.org/all/builders/x86%20XP-4%202.7/builds/3431/steps/test/logs/stdio


==
FAIL: test_errors (test.test_codecs.UTF7Test)
--
Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_codecs.py",
 line 709, in test_errors
self.assertEqual(raw.decode('utf-7', 'replace'), expected)
AssertionError: u'a\u20ac\ufffd' != u'a\u20ac\ufffdb'
- a\u20ac\ufffd
+ a\u20ac\ufffdb
?+


==
FAIL: test_lone_surrogates (test.test_codecs.UTF7Test)
--
Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_codecs.py",
 line 743, in test_lone_surrogates
self.assertEqual(raw.decode('utf-7', 'replace'), expected)
AssertionError: u'a\ufffd' != u'a\ufffdb'
- a\ufffd
+ a\ufffdb
?   +

--

___
Python tracker 

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



[issue23640] int.from_bytes() is broken for subclasses

2015-10-02 Thread ashutosh

ashutosh added the comment:

hi

i am ashutosh. I am running kubuntu 14.04.
before applying the patch. It failed in 2 test i.e

test___all__ 
test_re

After applying patch. It again gave me 2 error
test___all__ 
test_re

So,it worked for me.

--
nosy: +singh_jug

___
Python tracker 

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



Re: Create a .lua fle from Python

2015-10-02 Thread jmp

On 10/01/2015 09:12 PM, Steven D'Aprano wrote:

On Wed, 30 Sep 2015 07:21 pm, jmp wrote:


Is Ariel's xml file user-supplied? If so, how does your suggestion
prevent the resulting lua script from executing arbitrary code?


It does not. Like it doesn't fulfill the millions of possible
requirements the OP could have written but did not. What if the OP want
a thread safe, super fast, multi core solution distributed on multiple
remote hosts ?


Then he should have said so.

We are not *required* to guess every last requirement that somebody might
have but didn't mention. But we do have a professional[1] duty of care to
warn an *obvious beginner* that he may be introducing a serious security
vulnerability into his code.


I agree with you and to some extend to Peter's answer, my solution is 
not safe but note that I didn't mean it to be nor did I claimed it was safe.


What I disagree with, is the suggestion that I should provide a safe 
version of my solution, just in case the OP forgot to mention that he 
was going public with his application while a simple "beware this 
solution is not safe" would have sufficed.


Safety is like speed optimization, you care about it only when it can be 
a problem. And the vast majority (there's a recent trolling thread about 
the equivalent percentage of vast majority if you want to have fun) of 
python code may run on trusted networks. Meaning it's probable you are 
wrong when assuming security of a python snippet is a concern.



JM

Note : becoming public on the internet is not even enough for security 
to be a concern. Consider the OP's request, someone around the world 
would need to be willing to hack into the OP's server, guess/find out 
that the xml is able to execute lua and then attack the server for a 
reason yet to be known. If the OP's name is google, yeah someone will 
want to do that. If you're a complete anonymous...


--
https://mail.python.org/mailman/listinfo/python-list


Re: Only getting the first 6 lines

2015-10-02 Thread Cecil Westerhof
On Friday  2 Oct 2015 00:50 CEST, Cameron Simpson wrote:

> On 01Oct2015 23:58, Cecil Westerhof  wrote:
>> I want to get the first 6 lines of ps output. For this I use:
>> 
>> from subprocess import check_output
>>
>> ps_command = ('ps', '-eo',
>> 'user,pid,pcpu,pmem,stat,start,time,cmd', '--sort') message =
>> '\n'.join(check_output(ps_command +
>> ('-%cpu',)).decode("utf-8").splitlines()[0:6])
>> 
>>
>> It works, but does not look very efficient. Is there a better way
>> to do this?
>
> It depends what you mean by inefficient. I'm presuming you mean that
> this:
>
> - sucks in all the output of ps instead of just the first 6 lines
>
> - sucks all the output into memory instead of just some of it
>
> - does more in-memory work in splitlines()

Yes.


> - needs ps to run to completion instead of just long enough to print
>   6 lines

No, because of the sort, ps has to generate all lines.
>
> You could just read six lines of output from ps. Something like this
> (untested):
>
>
> lines = []
> for lineno, line in \
> enumerate(Popen(ps_command + ('-%cpu',),
> stdin=NULL, stdout=PIPE).stdout,
> 1):
> lines.append(line.decode("utf-8"))
> if lineno >= 6:
> break


I wrote the following general function for it:

def log_resource_usage(command, resource_type, nr_of_lines):
lines   = []
process = Popen(command, stdin = None, stdout = PIPE, stderr = None)
for lineno, line in enumerate(process.stdout, 1):
lines.append(line.decode('utf-8').strip())
if lineno >= nr_of_lines:
break
message = '\n'.join(lines)
cursor.execute(insert_message, (resource_type, message))
process.wait()



> This approach is important if the output of your command is large or
> slow, as it does not need to suck the whole thing into memory or to
> wait for it to finish a long procedure. With "ps" these issues are
> pretty minor; with some other programs it can be significant,
> especially if the other program _doesn't_ terminate (consider "tail
> -f" of an active log file).

Well ps generates more as 400 lines. Not a real problem, but I like to
solve problems before they become a problem. ;-)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: compiling matplotlib in virtual env

2015-10-02 Thread Laura Creighton
Lots of egg problems can be fixed if you pip install this
package first.

https://pypi.python.org/pypi/ez_setup

However, you are trying to install matplotlib.
Your distro should have it already as a package (python-matplotlib
perhaps?  python3-matplotlib perhaps?) and you may want to get
it from there.  If you don't want to get it from there, you may
want to use conda instead of pip/easy_install and so on.
http://conda.pydata.org/docs/intro.html

If the scientific python stack, and not just matplotlib is in
your future, just use conda.  It is so much easier.

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25297] max_help_position is not works in argparse library

2015-10-02 Thread Alexander

New submission from Alexander:

Hi colleagues I have the code (max_help_position is 2000):

formatter_class=lambda prog: argparse.HelpFormatter(prog, 
max_help_position=2000)
parser = argparse.ArgumentParser(formatter_class=formatter_class)


subparsers = parser.add_subparsers(title="Commands", metavar="")

cmd_parser = subparsers.add_parser('long_long_long_long_long_long_long',
   help='- jksljdalkjda',
   formatter_class=formatter_class)

args = parser.parse_args(['-h'])
print args

Result:

we have

optional arguments:
  -h, --help  show this help message and exit

Commands:
  
long_long_long_long_long_long_long
  - jksljdalkjda
small - descr

instead

optional arguments:
  -h, --help  show this help message and exit

Commands:
  
long_long_long_long_long_long_long - jksljdalkjda
small  - descr

The code:

class MyFormatter(argparse.HelpFormatter):
def __init__(self, prog):
super(MyFormatter, self).__init__(prog, max_help_position=2000, 
width=2000)
self._max_help_position = 2000
self._action_max_length += 4

got same result.

The strings like:

formatter_class = lambda prog: argparse.HelpFormatter(prog,
  max_help_position=2000, width=2000)

formatter_class = lambda prog: argparse.HelpFormatter(prog,
  max_help_position=1000, width=2000)

formatter_class = lambda prog: argparse.HelpFormatter(prog,
  max_help_position=2000, width=1000)

got same result: we always have new line after command.

--
components: Library (Lib)
messages: 252093
nosy: morden2k
priority: normal
severity: normal
status: open
title: max_help_position is not works in argparse library
versions: Python 2.7

___
Python tracker 

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



[issue24483] Avoid repeated hash calculation in C implementation of functools.lru_cache()

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 3f4c319a822f by Serhiy Storchaka in branch '3.5':
> Issue #24483: C implementation of functools.lru_cache() now calculates key's
> https://hg.python.org/cpython/rev/3f4c319a822f

I didn't follow this issue, but I like the change. Good job :)

--

___
Python tracker 

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



Re: compiling matplotlib in virtual env

2015-10-02 Thread bayang
I ran into the same issue.
Check here
http://stackoverflow.com/questions/27024731/matplotlib-compilation-error-typeerror-unorderable-types-str-int
It worked for me on python 3 with virtualenv in ubuntu .  Libfreetype was
missing.
Le 2 oct. 2015 10:43, "Laura Creighton"  a écrit :

> Lots of egg problems can be fixed if you pip install this
> package first.
>
> https://pypi.python.org/pypi/ez_setup
>
> However, you are trying to install matplotlib.
> Your distro should have it already as a package (python-matplotlib
> perhaps?  python3-matplotlib perhaps?) and you may want to get
> it from there.  If you don't want to get it from there, you may
> want to use conda instead of pip/easy_install and so on.
> http://conda.pydata.org/docs/intro.html
>
> If the scientific python stack, and not just matplotlib is in
> your future, just use conda.  It is so much easier.
>
> Laura
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25278] Unexpected socket exception on SFTP 'STOR' command

2015-10-02 Thread Eric V. Smith

Eric V. Smith added the comment:

You'll need to reproduce this in a smaller piece of code that demonstrates the 
problem. The code you've included is very large, and imports libraries we don't 
have access to.

Otherwise, we can't reproduce it and we can't help.

--

___
Python tracker 

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



[issue25295] functools.lru_cache raises KeyError

2015-10-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue24483 fixes this issue.

--
dependencies: +Avoid repeated hash calculation in C implementation of 
functools.lru_cache()

___
Python tracker 

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



[issue16802] fileno argument to socket.socket() undocumented

2015-10-02 Thread Bar Harel

Bar Harel added the comment:

Here you go.

--
nosy: +bar.harel
Added file: http://bugs.python.org/file40656/Issue16802_rev2.patch

___
Python tracker 

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



Re: Python 3.5.0 (32-bit) Setup error

2015-10-02 Thread Laura Creighton
In a message of Fri, 02 Oct 2015 20:59:58 +1000, Hadassah Harland writes:
>[image: Inline image 1]
>For further clarification, this pop-up keeps appearing every time i use
>pycharm, it will restart every couple of seconds. If I choose repair, it
>will start a repair and while the repair is going it will open again, and
>without another response, after about a second will close itself and
>reopen, centre page every time. The program has rendered my computer
>unusable while pycharm is open.
>
>Regards, Hadassah

PyCharm is made by JetBrains, an independent company.  You will
have to talk to them about your problem.
https://intellij-support.jetbrains.com/hc/en-us

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Nikola project is deprecating Python 2.7 (+2.x/3.x user survey results)

2015-10-02 Thread Chris Warrick
On 2 October 2015 at 01:59, Terry Reedy  wrote:
> On 10/1/2015 12:26 PM, Chris Warrick wrote:
>>
>> The Nikola developers decided to deprecate Python 2.7 support.
>> Starting with v7.7.2, Nikola will display a warning if Python 2.7 is
>> used (but it will still be fully supported). In early 2016, Nikola
>> v8.0.0 will come out, and that release will not support Python 2.7
>> officially.
>
>
> How sane ;-)
>
>> The decision was made on the basis of a user survey, with 138
>> participants. The vast majority of them claimed that they either use
>> Python 3 already, or can switch really easily.
>
>
> From the survey and description below, 'using Python 3' means having Python
> 3 installed, not writing Python 3 code.  Correct?

Correct. We asked about Nikola users, who don’t really have to write
any Python code.  This is, however, an useful information for OSS
developers, who want to know if they can/should target Python 3
instead of Python 2.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25276] test_decimal sometimes crash on PPC64 AIX 3.x

2015-10-02 Thread Stefan Krah

Stefan Krah added the comment:

I've checked:  test_decimal does not require abnormal amounts of
memory or stack. On Linux/x86 a stack size of 256 (default 8192)
is sufficient, and memory requirements aren't that high.

We assumed that there is some memory limit on the buildbot, since
in a later run test #pwmx330 failed with MemoryError.


The easiest way to debug this is to rerun the whole test suite
under gdb with the same random seed as in


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

--

___
Python tracker 

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



[issue25295] functools.lru_cache raises KeyError

2015-10-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger, serhiy.storchaka
type:  -> behavior
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



[issue19884] Importing readline produces erroneous output

2015-10-02 Thread Yogesh Joshi

Yogesh Joshi added the comment:

I tried applying this patch and its failing and throwing the following error:

patching file Lib/test/test_readline.py
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 43.
2 out of 2 hunks FAILED -- saving rejects to file Lib/test/test_readline.py.rej
patching file Modules/readline.c
Hunk #1 FAILED at 1019.
1 out of 1 hunk FAILED -- saving rejects to file Modules/readline.c.rej

I'm using Mac Os El Captain

--
nosy: +iyogeshjoshi

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Davey Shafik

Davey Shafik added the comment:

We (PHP) also have a more visual guide at http://php.net/supported-versions.php 
which updates dynamically to show the current status.

It shows the current status (EOL, Security only, Active) of releases from PHP 
5.3, which is still the default for many LTS distros and still in common use.

--
nosy: +dshafik

___
Python tracker 

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



[issue25298] Add lock and rlock weakref tests

2015-10-02 Thread Nir Soffer

Changes by Nir Soffer :


--
components: Tests
files: 0001-Add-lock-rlock-weakref-tests.patch
keywords: patch
nosy: nirs
priority: normal
severity: normal
status: open
title: Add lock and rlock weakref tests
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file40655/0001-Add-lock-rlock-weakref-tests.patch

___
Python tracker 

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



[issue24483] Avoid repeated hash calculation in C implementation of functools.lru_cache()

2015-10-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread A. Skrobov

New submission from A. Skrobov:

Python 2.7.3 (default, Dec 18 2014, 19:10:20) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from argparse import ArgumentParser
>>> parser = ArgumentParser()
>>> parser.add_argument("--foo", help="foo", action='store_const')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/argparse.py", line 1281, in add_argument
action = action_class(**kwargs)
TypeError: __init__() takes at least 4 arguments (4 given)
>>> 



First, the exception message is entirely unhelpful (you wanted at least 4, you 
got 4, what's your problem?)

Second, adding "const=None" to the invocation makes it succeed; but,  according 
to https://docs.python.org/2/library/argparse.html#const this argument defaults 
to "None", so it shouldn't be necessary to specify it explicitly. Thus, either 
the documentation or the implementation is wrong.

--
assignee: docs@python
components: Documentation, Extension Modules
messages: 252106
nosy: A. Skrobov, docs@python
priority: normal
severity: normal
status: open
title: TypeError: __init__() takes at least 4 arguments (4 given)
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-10-02 Thread Xiang Zhang

Xiang Zhang added the comment:

Yes, there seems to still exist some defects not conforming to the
specification. I would like to investigate it. Maybe I can propose
a patch for it.

--

___
Python tracker 

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



[issue25298] Add lock and rlock weakref tests

2015-10-02 Thread Nir Soffer

New submission from Nir Soffer:

Same patch works also for 2.7

--

___
Python tracker 

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



[issue24848] Warts in UTF-7 error handling

2015-10-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3c13567ea642 by Serhiy Storchaka in branch '3.4':
Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:
https://hg.python.org/cpython/rev/3c13567ea642

New changeset a61fa2b08f87 by Serhiy Storchaka in branch '3.5':
Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:
https://hg.python.org/cpython/rev/a61fa2b08f87

New changeset 037253b7cd6d by Serhiy Storchaka in branch 'default':
Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:
https://hg.python.org/cpython/rev/037253b7cd6d

New changeset c6eaa722e2c1 by Serhiy Storchaka in branch '2.7':
Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:
https://hg.python.org/cpython/rev/c6eaa722e2c1

--
nosy: +python-dev

___
Python tracker 

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



[issue23640] int.from_bytes() is broken for subclasses

2015-10-02 Thread Yogesh Joshi

Yogesh Joshi added the comment:

I applied patch to module and ran all the tested on Mac Os El Captain, only 4 
tests were failing with or without applying patch, following are the tests 
failing:
test___all__ test_calendar test_re test_socket

--
nosy: +iyogeshjoshi

___
Python tracker 

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



Re: Only getting the first 6 lines

2015-10-02 Thread Cecil Westerhof
On Friday  2 Oct 2015 09:37 CEST, Peter Otten wrote:

> Cecil Westerhof wrote:
>
>> I want to get the first 6 lines of ps output. For this I use:
>> 
>> from subprocess import check_output
>>
>> ps_command = ('ps', '-eo',
>> 'user,pid,pcpu,pmem,stat,start,time,cmd', '--sort') message =
>> '\n'.join(check_output(ps_command +
>> ('-%cpu',)).decode("utf-8").splitlines()[0:6])
>> 
>>
>> It works, but does not look very efficient. Is there a better way
>> to do this?
>
> Efficiency be damned, readability counts ;)

The second is more important as the first, but if you can have both …
:-)

I already made a function for it. See my other response.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25125] "Edit with IDLE" does not work for shortcuts

2015-10-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Putting them under the current 'Open with >' would also be alright.  (It 
currently lists Notepad, Wordpad, and Py launcher for Windows (console), which 
I presume means run with default for Py.  What I was requesting is that the 
version be included with the entry wherever it is put.  The technical details 
of the different choices are not my concern.

--

___
Python tracker 

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



[issue24483] Avoid repeated hash calculation in C implementation of functools.lru_cache()

2015-10-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f4c319a822f by Serhiy Storchaka in branch '3.5':
Issue #24483: C implementation of functools.lru_cache() now calculates key's
https://hg.python.org/cpython/rev/3f4c319a822f

New changeset 5758b85627c9 by Serhiy Storchaka in branch 'default':
Issue #24483: C implementation of functools.lru_cache() now calculates key's
https://hg.python.org/cpython/rev/5758b85627c9

--
nosy: +python-dev

___
Python tracker 

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



Re: Create a .lua fle from Python

2015-10-02 Thread Stefan Behnel
jmp schrieb am 02.10.2015 um 11:03:
> Safety is like speed optimization, you care about it only when it can be a
> problem. And the vast majority (there's a recent trolling thread about the
> equivalent percentage of vast majority if you want to have fun) of python
> code may run on trusted networks. Meaning it's probable you are wrong when
> assuming security of a python snippet is a concern.

Writing code "for internal use only" is ok, but there is never a guarantee
that some of that code won't be reused elsewhere, in an entirely different
context. Or that someone comes up with the idea of adding a REST API
frontend, now that there is a command line interface [1]. If that happens,
I assure you that at least in some cases (be it the "vast majority" or not)
there will be no thorough security audit up-front. Because, you know - it's
code that works and is production proven already. Possibly for years and
years, and through generations of employees, all experienced and trusted.
What can possibly be wrong with such code?

So, it's acceptable to write such code under certain conditions, but at
least someone should leave a visible comment somewhere (as Peter rightfully
did in this case) that the input is not safely validated, so that future
generations of programmers can see immediately that a) security hasn't been
a concern when writing it and b) the author was in fact not a complete
moron, not knowing a bit about the basics of input validation.

It really helps in trust building to find such comments from time to time.

Stefan



[1] mainframes on the Internet, anyone?


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-02 Thread J Richard Snape

Changes by J Richard Snape :


--
nosy: +J Richard Snape

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread Florin Papa

Changes by Florin Papa :


Added file: http://bugs.python.org/file40658/mpx_enable_2_7.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread Florin Papa

New submission from Florin Papa:

Hi all,

My name is Florin Papa and I work in the Server Languages Optimizations Team at 
Intel Corporation.

I would like to submit a patch that enables the use of the Intel MPX (Memory 
Protection Extensions) feature on Python default and 2.7. Invalid memory access 
problem is commonly found in C/C++ programs and leads to time consuming 
debugging, program instability and vulnerability. Many attacks exploit software 
bugs related to invalid memory access caused by buffer overflow/underflow. 
Existing set of techniques to avoid such memory bugs represent software only 
solutions which result in poor protection and performance.

Intel MPX introduces new registers and new instructions that operate on these 
registers. Some of the registers added are bounds registers which store a 
pointer’s lower bound and upper bound limits. Whenever the pointer is used, the 
requested reference is checked against the pointer’s associated bounds, thereby 
preventing out-of-bound memory access (such as buffer overflows and overruns). 
Out-of-bounds memory references initiate a #BR exception which can then be 
handled in an appropriate manner.

MPX technology was introduced on the sixth generation of Intel Core processors, 
code name SkyLake, the successor to Broadwell microarchitecture (only desktop 
processor is available on the market, server has not been released). For older 
generations of Intel processors that do not support MPX, nop’s will be added to 
the instruction stream [1]. 

MPX enabled builds are only possible using gcc 5.1 and newer [2].

To apply the patch please follow these steps:
hg clone https://hg.python.org/cpython
cd cpython
copy mpx_enable.patch to the current directory
hg import --no-commit mpx_enable.patch
./configure –with-mpx
make –j #cores

[1] 
https://software.intel.com/en-us/articles/introduction-to-intel-memory-protection-extensions
[2] https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler

Regards,
Florin

--
components: Extension Modules
files: mpx_enable_3_6.patch
keywords: patch
messages: 252110
nosy: florin.papa
priority: normal
severity: normal
status: open
title: Enable Intel MPX (Memory protection Extensions) feature
type: security
versions: Python 3.6
Added file: http://bugs.python.org/file40657/mpx_enable_3_6.patch

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

It seems to me a link to this version independent info could logically appear 
on the docs front page.  I think we ought to add the devguide there already, 
for instance.  The 'Meta information' section seems perfectly 
appropriate...even though all the docs currently in there are maintained in the 
Docs directory, both 'about' and 'reporting bugs' are currently 
version-independent information.

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +skrah

___
Python tracker 

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



Re: I'm using Sphinx, but is there a UML auto generator

2015-10-02 Thread Littlefield, Tyler
> You can use Graphvix and Plant UML from inside Sphinx.
> http://build-me-the-docs-please.readthedocs.org/en/latest/Using_Sphinx/UsingGraphicsAndDiagramsInSphinx.html
> 
> Laura
> 

Keep this in mind: However you write your docs, they should be
accessible for everyone to use. That is to say, screen readers should be
able to use them as well--perhaps try explaining this dependency in a
format across all the docs in text as well?
HTH,
-- 
Take care,
Ty
twitter: @sorressean
web:http://tysdomain.com
pubkey: http://tysdomain.com/files/pubkey.asc
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Georg Brandl

Georg Brandl added the comment:

It should also be linked from the downloads page.

--

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

Oops, sorry, I missed the fact that you were pointing out a doc issue.

--
resolution: out of date -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



Re: Pandas Left Merge with xlsx with CSV producing null value columns in output

2015-10-02 Thread kbtyo
On Thursday, October 1, 2015 at 7:47:18 PM UTC-4, Mark Lawrence wrote:
> On 01/10/2015 16:03, kbtyo wrote:
> > I would appreciate any feedback on the following question that I have 
> > raised here:
> >
> > http://stackoverflow.com/questions/32889129/pandas-left-merge-with-xlsx-with-csv-producing-null-value-columns-in-output
> >
> > Thank you for your feedback and support.
> >
> 
> I was going to suggest that you ask on the pandas mailing list/google 
> group, but as you've all ready done so, is there anywhere that you 
> haven't asked?  Is there a subreddit for pandas you could also try just 
> in case?

I appreciate the suggestion. I was able to solve the issue. Thank you again. 

> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread Florin Papa

Florin Papa added the comment:

> Why not enablind the option by default if GCC 5.1 or newer is detected? Is 
> there a risk of breaking third-party extensions?
> Should we pass the MPX compiler options to third-party extensions by way?
On a processor that does not support MPX technology, MPX specific instructions 
will be replaced by nop's and will introduce a performance loss. Also, third 
party extensions might need to be patched in order to work with MPX. One 
example is the math module, which needed the bnd_legacy attribute to disable 
instrumentation when calling libc functions (which are not instrumented and 
generated compile errors).

> I'm not sure that it's ok to add such change to Python 2.7. It's border line 
> between new feature and supporting a new architecture.
I believe that Python 2.7 should benefit from this change, since it is still 
used in real life applications, one example being Openstack Swift.

--

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread paul j3

paul j3 added the comment:

A related issue is

http://bugs.python.org/issue24754
argparse add_argument with action="store_true", type=bool should not crash

In this case the user specified a parameter that the 'store_true' subclass did 
not accept.

In both cases, 'parser.add_argument' does minimal error checking (or catching), 
so the user ends up seeing the '__init__' argument error.

This line in the 'store_const' documentation is clearly wrong.  There's no 
default.

(Note that the const keyword argument defaults to the rather
unhelpful None.)

Possible fixes to the bigger issue:

- major addition to the documentation, documenting allowable subclass 
parameters (but the subclasses aren't part of the API).

- major addition to add_argument that filters parameters before passing them to 
the subclasses.  But can that be done without replicating information that is 
implicit in the subclass __init__?  Can we use advanced inspection?  What about 
user defined Action classes?

- minor addition to add_argument that catches the __init__ parameter errors and 
adds a mollifing explanation.

- somehow make Action (and its subclasses) responsible for a nice error 
message.  But how do you override the normal behavior of Python regarding 
function parameters?

--
nosy: +paul.j3

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

I think your second to last choice (catch the error) is the only practical 
solution.  It is also probably the best, since we need to support user-written 
action routines.

--

___
Python tracker 

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



[issue25297] max_help_position is not works in argparse library

2015-10-02 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread Stefan Krah

Stefan Krah added the comment:

In principle adding the option is fine, but do we have a buildbot
with a Skylake processor?  We have lots of options that are untested
and that break periodically.

--
nosy: +zach.ware

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread A. Skrobov

A. Skrobov added the comment:

Thank you for confirming that the mismatch between the documentation and the 
behaviour is preserved in Python 3!

Adding it to the list of affected versions.

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

I think Intel will make sure we do have one.

Florin: how does one determine if a processor supports mxp?  I don't know if 
the mac mini running the ICC buildbot is new enough to have a Skylake 
processor, but I suppose there's at least some chance it does.

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

To clarify this for other readers: the issue here is that the arguments to 
add_argument are passed through the action routine, which in this case is 
store_const, and store_const is the one that requires 'const' be 
specified...which isn't made clear by either the docs or the error message.

--

___
Python tracker 

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



[issue25302] Memory Leaks with Address Sanitizer

2015-10-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-02 Thread Vinay Sajip

Vinay Sajip added the comment:

I'm not able to build on Windows at the moment, unfortunately - did the change 
actually work for you?

--

___
Python tracker 

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



[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

I created issue #25301: "Optimize UTF-8 decoder with error handlers".

--

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Georg Brandl

Georg Brandl added the comment:

> It seems to me a link to this version independent info could logically appear 
> on the docs front page.

Yes, that sounds good. I do like the PHP graph of versions too...

--

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread STINNER Victor

STINNER Victor added the comment:

Why not enablind the option by default if GCC 5.1 or newer is detected? Is 
there a risk of breaking third-party extensions?

Should we pass the MPX compiler options to third-party extensions by way?

I'm not sure that it's ok to add such change to Python 2.7. It's border line 
between new feature and supporting a new architecture.

I would suggest to only modify Python 3.6.

--

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Carol Willing

Carol Willing added the comment:

And that would be EOL (end of life) not EOF. More coffee please...

--

___
Python tracker 

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



[issue25296] Simple End-of-life guide covering all unsupported versions

2015-10-02 Thread Carol Willing

Carol Willing added the comment:

+1 to adding the EOF info to the Docs front page and a link from the downloads 
page.

Also, +1 to David's suggestion to adding the devguide as well to the front 
page. In the future, it would be nice to add the devguide to the CPython repo 
instead of having it as a standalone. It would consolidate things in to one 
workflow instead of a different workflow for the devguide.

P.S. Ezio - nice slide deck content :)

--
nosy: +willingc

___
Python tracker 

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



[issue25290] csv.reader: minor docstring typo

2015-10-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3940f480ea16 by Berker Peksag in branch '3.4':
Issue #25290: Fix typo in csv.reader() docstring
https://hg.python.org/cpython/rev/3940f480ea16

New changeset 3b565295eba0 by Berker Peksag in branch '3.5':
Issue #25290: Fix typo in csv.reader() docstring
https://hg.python.org/cpython/rev/3b565295eba0

New changeset 7a3073921687 by Berker Peksag in branch 'default':
Issue #25290: Fix typo in csv.reader() docstring
https://hg.python.org/cpython/rev/7a3073921687

--
nosy: +python-dev

___
Python tracker 

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



[issue25290] csv.reader: minor docstring typo

2015-10-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ceff1babf66e by Berker Peksag in branch '2.7':
Issue #25290: Fix typo in csv.reader() docstring
https://hg.python.org/cpython/rev/ceff1babf66e

--

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-02 Thread STINNER Victor

New submission from STINNER Victor:

The issue #24870 optimized the ASCII decoder with error handlers:

New changeset 3c430259873e by Victor Stinner in branch 'default':
Issue #24870: Optimize the ASCII decoder for error handlers: surrogateescape,
https://hg.python.org/cpython/rev/3c430259873e

We should also optimize the UTF-8 decoder with error handlers.

I will work on a patch next days.

--
components: Unicode
messages: 252117
nosy: ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: Optimize UTF-8 decoder with error handlers
type: performance
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



[issue25295] functools.lru_cache raises KeyError

2015-10-02 Thread Peter Brady

Peter Brady added the comment:

As a sanity check I removed the stored hashvalue in Raymond Hettinger's 
backported lru_cache (which we use to support 2.6-3.2) and end up with errors 
as well.  So it seems like 24483 is the appropriate fix to restore the old 
behavior.  Thanks for looking into this.

--

___
Python tracker 

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



[issue25302] Memory Leaks with Address Sanitizer

2015-10-02 Thread Matt Clarkson

New submission from Matt Clarkson:

I have the following `main.cpp`

```
#include 

int main() {
  Py_Initialize();

  if (!Py_IsInitialized())
return 1;

  Py_Finalize();

  return 0;
}
```

Compiled with on Arch Linux 4.2.1 gcc 5.2.0 python 3.4.3:

```
g++ -fsanitize=address main.cpp -o main `python-config --includes --ldflags
```

I end up with 424764 byte(s) leaked in 316 allocation(s).

I can suppress the leaks in the following ways:

```
# These are the high level functions that leak (i.e. the *top* of the call 
stack)
#leak:Py_Initialize
#leak:Py_Finalize
#leak:PyEval_EvalCode

# Low level private functions that leak (i.e. the *bottom* of the call stack)
leak:new_keys_object
leak:type_new
leak:new_dict_with_shared_keys
leak:make_keys_shared
leak:_PyObject_Malloc
leak:PyList_New

# The closest to the leak public functions (i.e. closest to the *top* of the 
call stack)
#leak:PyUnicode_New
#leak:PyList_New
#leak:PyFrame_New
#leak:PyDict_New
#leak:PyBytes_FromStringAndSize
#leak:PyObject_Call
#leak:PyType_Ready
#leak:PyDict_Merge
#leak:PyDict_SetItemString
#leak:PyEval_EvalFrameEx
```

I read in the `PyInitalize` documentation that circular references, etc might 
not be freed but 424764 bytes seems a lot just for initializing the Python 
engine.

I would like to help out solving the memory leaks, if that is possible?

--
components: Interpreter Core
files: leak.log
messages: 252136
nosy: Matt Clarkson
priority: normal
severity: normal
status: open
title: Memory Leaks with Address Sanitizer
type: resource usage
versions: Python 3.4
Added file: http://bugs.python.org/file40659/leak.log

___
Python tracker 

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



[issue25290] csv.reader: minor docstring typo

2015-10-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Johannes! I forgot to update 2.7 docs, but should be OK 
now.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +berker.peksag, docs@python
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior
versions: +Python 3.4, Python 3.5

___
Python tracker 

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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

Yes, the python2 TypeErrors for mimatched arguments are sub-optimal.  This has 
been fixed in python3:

>>> parser.add_argument('--foo', help="foo", action='store_const')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/python/p36/Lib/argparse.py", line 1336, in add_argument
action = action_class(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'const'

--
nosy: +r.david.murray
resolution:  -> out of date
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



[issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

Hmm.  After looking at the code, it may also be desirable to improve that error 
message at the argparse level, since there's a bit of not-immediately-obvious 
indirection going on there.

--

___
Python tracker 

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



Re: I'm using Sphinx, but is there a UML auto generator

2015-10-02 Thread Laura Creighton
In a message of Fri, 02 Oct 2015 11:14:59 -0300, Gilcan Machado writes:
>Hi,
>
>I'm using Sphinx as a doc tool.
>
>Amazing.
>
>But I need a way to describe, for example, that, inside a Person class,
>there's a method called changePassword which depends of the execution of
>the method checkPermissions, and checkPermissions depends on the execution
>of two other methods.
>
>I'm using a graphic tool like OpenDraw to do the job, but I guess there's a
>better way of doing this.
>
>Is there any UML auto generator for python that do that?
>
>If not, any suggestion?
>
>By the way, I don't know UML (only the very basic stuff), I'm only trying
>to find a good way to describe the methods relations inside my class.
>
>[]
>Gil
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list

You can use Graphvix and Plant UML from inside Sphinx.
http://build-me-the-docs-please.readthedocs.org/en/latest/Using_Sphinx/UsingGraphicsAndDiagramsInSphinx.html

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-02 Thread R. David Murray

R. David Murray added the comment:

Well, since it is arguably security related, I think that pushes it toward the 
"yes" side.  And yes, I think we could end up "breaking" third party code, as 
well as python (thus the need for a buildbot), but that may not be a bad thing 
in this case (that security business again :).

--

___
Python tracker 

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



[issue25295] functools.lru_cache raises KeyError

2015-10-02 Thread Aaron Meurer

Aaron Meurer added the comment:

Does this mean that some SymPy object is giving different hash values on 
successive calls to hash()? We definitely need to look into this on the SymPy 
side.

--

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-10-02 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

My bad.  In this case, maybe Erik can review your latest patch?

--

___
Python tracker 

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



Re: Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Chris Angelico
On Sat, Oct 3, 2015 at 2:41 AM, Kenneth L  wrote:
> I'm a graphic designer. I'm new to Python. I know html, css, alittle 
> actioscript and little javascript. I actually build an iOS using Flash. I 
> understand programming concepts I believe.
>
> I'd like to build a Illustrator/Photoshop like program. Why, there are some 
> features that I'd like to personally have. Example, randomizing the rotation, 
> line height and sizing of text. You have to do this manually. It would be 
> cool have a little program that is dedicated building logos. Not trying to 
> reinvent the wheel. Just basic featuring of vector graphics program plus my 
> enhancements.
> Maybe this program could be base and it can export vector and bring into 
> Photoshop to add finishing touches.
>
> I heard Python is easy to learn. So my question is Python able to do this or 
> connect with libraries? Plus where do I start? I watched python tutorials but 
> they don't really show you how to build an application. How does one build a 
> graphics program? LOL where do you start? How do you draw graphics on the 
> screen?
>
> I'm just confused.

You basically have three options here.

1) Completely write a Photoshop-like program from scratch. There are
libraries that can do the heavy lifting for you (Pillow comes to
mind), but you'd be writing a big and complex UI. This is a huge job.
I recommend not doing this.

2) Find an existing open-source program that does what you want, and
hack on it; or find an existing program that has a plugin/extension
system, and write a plugin. This is a great option if one exists, but
bear in mind that you might have your choices restricted somewhat (eg
you might have to use a specific programming language, or you might
have to fit everything into a single menu item, etc).

3) Build a preprocessor or postprocessor for your images. You'd do
most of your work in a well-known program, and then when you get to
the very last step, you run your output file through a post-processor
(or you run your input files through a preprocessor prior to importing
them). This can work really well in some situations, but it isn't so
great for interactive work. But it's fairly straight-forward; you can
define your program purely in terms of its inputs and outputs, and you
can write it in any language you like.

Have a look into those options, and see what kind of job you're taking
on. (Hint: Options 2 and 3 are *much* smaller jobs than option 1 will
be.) Then decide whether it's within your time budget (don't forget
that you might have to learn some new technologies), and whether it'll
be worth the effort (and it's always more effort than you first think
it will be). And maybe, even if it's not really worth the effort,
it'll be enough fun that you barge ahead and do it anyway :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22080] Add windows_helper module helper

2015-10-02 Thread eryksun

Changes by eryksun :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden
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



[issue24848] Warts in UTF-7 error handling

2015-10-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Have no ideas why tests are failed and only on this buildbot.

--

___
Python tracker 

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



[issue25297] max_help_position is not works in argparse library

2015-10-02 Thread paul j3

paul j3 added the comment:

My testing shows that it's a problem with the subparsers listing.  When regular 
arguments are long, 'max_help_position' works (within limits allowed by 
'width').

--

___
Python tracker 

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



[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-02 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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



Re: Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Grant Edwards
On 2015-10-02, Kenneth L  wrote:

> I'm a graphic designer. I'm new to Python. I know html, css, alittle
> actioscript and little javascript. I actually build an iOS using
> Flash. I understand programming concepts I believe.

> I'd like to build a Illustrator/Photoshop like program.

Holy Cow.

I'd like to build something just like the Brooklyn Bridge, only with
more lanes.

I've got a shovel.

And some bricks and wire.

I know how to stack the two bricks one on top of another.

What do I do next?

I'm just confused.

-- 
Grant Edwards   grant.b.edwardsYow! PUNK ROCK!!  DISCO
  at   DUCK!!  BIRTH CONTROL!!
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Kenneth L
I'm a graphic designer. I'm new to Python. I know html, css, alittle 
actioscript and little javascript. I actually build an iOS using Flash. I 
understand programming concepts I believe.

I'd like to build a Illustrator/Photoshop like program. Why, there are some 
features that I'd like to personally have. Example, randomizing the rotation, 
line height and sizing of text. You have to do this manually. It would be cool 
have a little program that is dedicated building logos. Not trying to reinvent 
the wheel. Just basic featuring of vector graphics program plus my enhancements.
Maybe this program could be base and it can export vector and bring into 
Photoshop to add finishing touches.

I heard Python is easy to learn. So my question is Python able to do this or 
connect with libraries? Plus where do I start? I watched python tutorials but 
they don't really show you how to build an application. How does one build a 
graphics program? LOL where do you start? How do you draw graphics on the 
screen?

I'm just confused.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue16802] fileno argument to socket.socket() undocumented

2015-10-02 Thread Guido van Rossum

Guido van Rossum added the comment:

Patch looks good.

--

___
Python tracker 

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



Re: Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Laura Creighton
In a message of Fri, 02 Oct 2015 09:41:16 -0700, Kenneth L writes:

>I'd like to build a Illustrator/Photoshop like program. Why, there
 are some features that I'd like to personally have. Example,
 randomizing the rotation, line height and sizing of text. You have to
 do this manually. It would be cool have a little program that is
 dedicated building logos. Not trying to reinvent the wheel. Just
 basic featuring of vector graphics program plus my enhancements.


Do you know about GIMP?
http://www.gimp.org/

You can script it with Python.
http://www.gimp.org/docs/python/

Note: Play with GIMP first.  A whole lot.  Then learn Python -- a bit
with a tutorial here:
https://wiki.python.org/moin/BeginnersGuide/Programmers
or maybe here:
https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

or -- well, these days there are plenty more that aren't on either of
those lists.

Then try to script gimp using python.
It's not the ideal place to learn how to program in Python, as
the Python in the examples there is fairly atypical for normal
Python programs, but it works ...

Welcome, welcome!

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Kenneth L
I tried to use gimp but as a photoshop user it was horrible. I was trying to 
like it. That is a great idea tearing down gimp. that is how I learn html and 
css. Breakin down websites.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue12006] strptime should implement %G, %V and %u directives

2015-10-02 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> Also please let me know if this is not the proper way to respond to the code 
> review!

I believe Rietveld gives you a "done" button on each reviewer comment.  If all 
you do is to take the reviewer suggestion, you can just press it.

Responding with an issue note as you did is perfectly fine as well.

--

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-10-02 Thread Ashley Anderson

Changes by Ashley Anderson :


Added file: http://bugs.python.org/file40660/issue12006_10_complete.patch

___
Python tracker 

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



Re: Newbie: Designer Looking to Build Graphics Editor (PS/AI)

2015-10-02 Thread Kenneth L
Well 15 years ago when I was 15 I wanted to model cars in 3D. It took me 100 
hours and 5-10 years but I can modeling a realistic vehicle and other objects 
in 3d. It was time consuming and challenging but it was worth it. And honestly 
I've used my 3d modeling skills to build displays and products. It has helped 
me land jobs and keep jobs. It was a hobby.

I'm not afraid of the hard work. I just didn't know were to begin. If this 
takes me a few years that's fine, lol. I have 20-40 years on earth, hopefully.

I'm not sure about the plugin route. I'm not looking to build a plug, lol. Just 
a finger to point me where to go/start.

1&2 sound good to me.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question about regular expression

2015-10-02 Thread Denis McMahon
On Wed, 30 Sep 2015 23:30:47 +, Denis McMahon wrote:

> On Wed, 30 Sep 2015 11:34:04 -0700, massi_srb wrote:
> 
>> firstly the description of my problem. I have a string in the following
>> form: .
> 
> The way I solved this was to:
> 
> 1) replace all the punctuation in the string with spaces
> 
> 2) split the string on space
> 
> 3) process each thing in the list to test if it was a number or word
> 
> 4a) add words to the dictionary as keys with value of a default list, or
> 4b) add numbers to the dictionary in the list at the appropriate
> position
> 
> 5) convert the list values of the dictionary to tuples
> 
> It seems to work on my test case:
> 
> s = "fred jim(1) alice tom (1, 4) peter (2) andrew(3,4) janet( 7,6 )
> james ( 7 ) mike ( 9 )"
> 
> d = {'mike': (9, 0), 'janet': (7, 6), 'james': (7, 0), 'jim': (1, 0),
> 'andrew': (3, 4), 'alice': (0, 0), 'tom': (1, 4), 'peter': (2, 0),
> 'fred':
> (0, 0)}

Oh yeah, the code:

#!/usr/bin/python

import re

s = 'fred jim(1) alice tom (1, 4) peter (2) andrew(3,4) janet( 7,6 ) james
( 7 ) mike ( 9 ) jon  (  6  ,  3  )   charles(0,12)'

bits = s.replace('(', ' ').replace(',', ' ').replace(')', ' ').split(' ')

d = {}

namep = re.compile('^[A-Za-z]+$')
numbp = re.compile('^[0-9]+$')

for bit in bits:
if namep.match(bit):
d[bit] = [0,0]
w = bit
nums = 0
if numbp.match(bit):
n = int(bit)
d[w][nums] = n
nums += 1

d = {x:tuple(d[x]) for x in d}

print s
print d

It uses regex to determine if the list element being processed is a name 
or a number, which makes for 2 very simple patterns.

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25266] mako benchmark not working in Python 3.6

2015-10-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 85edb638dce6 by Brett Cannon in branch 'default':
Issue #25266: the mako benchmark does not work in Python 3.6.
https://hg.python.org/benchmarks/rev/85edb638dce6

--
nosy: +python-dev

___
Python tracker 

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



[issue25266] mako benchmark not working in Python 3.6

2015-10-02 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch!

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



[issue25258] HtmlParser doesn't handle void element tags correctly

2015-10-02 Thread Chenyun Yang

Chenyun Yang added the comment:

the example you give for  is a different case.

,  are void elements which are allowed to have no close tag;
 without  is a browser implementation detail, most browser
autocompletes .

Without the parser calls the handle_endtag(), the client code which uses
HTMLParser won't be able to know whether the a traversal is finished.

Do you have a strong reason why we should include the knowledge of  void
elements into the HTMLParser at this line?

https://github.com/python/cpython/blob/bdfb14c688b873567d179881fc5bb67363a6074c/Lib/html/parser.py#L341

if end.endswith('/>') or (end.endswith('>') and tag in VOID_ELEMENTS)

On Wed, Sep 30, 2015 at 7:05 PM, Martin Panter 
wrote:

>
> Martin Panter added the comment:
>
> My thinking is that the knowledge that  does not have a closing tag
> is at a higher level than the current HTMLParser class. It is similar to
> knowing where the following HTML implicitly closes the  elements:
>
> Item AItem B
>
> In both cases I would not expect the HTMLParser to report “virtual” empty
> or closing tags. I don’t think it should report an empty  or closing
>  tag just because that is easy to do, because it would be
> inconsistent with other implied HTML tags. But maybe see what other people
> say.
>
> I don’t know your particular use case, but I would suggest if you need to
> parse non-XML HTML  tags, use the handle_starttag() method and don’t
> rely on the end tag :)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



DistutilsPlatformError

2015-10-02 Thread garyr
I'm trying to build an extension for Python 3. I'm using the example code in 
the
book "Python Essential Reference", 4ed. I have it working for Python 2. But 
when
I try to build it for Python 3 I get the following error:

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 10.0 is 
required (
Unable to find vcvarsall.bat).

How can this be fixed?

I'm using Python 3.4.3, obtained from Anaconda, on Win XP

Thanks in advance
garyr

-
# setup.py
from setuptools import setup, Extension

setup(name="example",
version = "1.0",
ext_modules = [ Extension("_example", ["pyexample.c", "example.c"])
]
)


-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >