Karlsruhe (Germany) Python User Group, December 19th 2014, 7pm

2014-12-12 Thread Jürgen A . Erhard
The Karlsruhe Python User Group (KaPy) meets again. Friday, 2014-12-19 (December 19th) at 19:00 (7pm) in the rooms of Entropia eV (the local affiliate of the CCC). See http://entropia.de/wiki/Anfahrt on how to get there. For your calendars: meetings are held monthly, on the 3rd Friday. There's

ANN: pandas v0.15.2

2014-12-12 Thread Jeff Reback
Hello, We are proud to announce v0.15.2 of pandas, a minor release from 0.15.1. This release includes a small number of API changes, several new features, enhancements, and performance improvements along with a large number of bug fixes. This was a short release of 4 weeks with 137 commits by

Call for speakers for the first PyCon Belarus. Python-announce

2014-12-12 Thread Alina Dolgikh
Hello, dear community! I represent Belarusian Python community. We have regular monthly meet-ups for 70-100 persons and we are going to develop further. We are planning to make the first Belarusian PyCon on the 31st of January and looking for speakers. We will be glad to meet at our event

Re: Extension of while syntax

2014-12-12 Thread Mark Lawrence
On 12/12/2014 02:21, Nelson Crosby wrote: I was thinking a bit about the following pattern: value = get_some_value() while value in undesired_values: value = get_some_value() I've always hated code that looks like this. Partly due to the repetition, but partly also due to the fact that

Re: Extension of while syntax

2014-12-12 Thread Chris Angelico
On Fri, Dec 12, 2014 at 7:00 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: It won't happen as different format loops have been discussed and rejected umpteen times over the last 20 odd years, mainly because the code can be restructured using break as others have already pointed out. Unless

Re: Extension of while syntax

2014-12-12 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Fri, Dec 12, 2014 at 6:10 PM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: You could deduplicate it by shifting the condition: while True: value = get_some_value() if value not in undesired_values: break But I'm not

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread KK Sasa
Mark Lawrence於 2014年12月12日星期五UTC+8下午3時17分43秒寫道: On 12/12/2014 06:22, KK Sasa wrote: Hi there, The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a function returning a list, say [x1,x2,x3,x4] for one example. So results is a list consisting of 1000

Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-12 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: And I don't remember how Java did things, except that I struggled to find basic fundamental primitives like semaphores, and had to use synchronized functions/objects instead. Java now has a diverse set of synchornization facilities, but the builtin object

How to make subprocess run for 60 sec?

2014-12-12 Thread Robert Clove
Hi All, I have the following python script that runs. I want is to run the subprocess to run for 60 sec and then send the SIGINT signal to subprocess and write the output in file. #!/usr/bin/python import os import subprocess PIPE = subprocess.PIPE import signal import time def handler(signum,

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Christian Gollwitzer
Am 12.12.14 09:30, schrieb KK Sasa: Mark Lawrence於 2014年12月12日星期五UTC+8下午3時17分43秒寫道: Hi Mark and Yotam, Thanks for kind reply. I think I didn't make my problem clear enough. The slow part is [d2(t[k]) for k in xrange(1000)]. In addition, I don't need to construct a list of 1000 lists inside, but

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Peter Otten
KK Sasa wrote: Mark Lawrence於 2014年12月12日星期五UTC+8下午3時17分43秒寫道: On 12/12/2014 06:22, KK Sasa wrote: Hi there, The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a function returning a list, say [x1,x2,x3,x4] for one example. So results is a list

Re: Extension of while syntax

2014-12-12 Thread cl
Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: You could deduplicate it by shifting the condition: while True: value = get_some_value() if value not in undesired_values: break But I'm not sure how common this idiom actually is. Extremely common,

encoding name mappings in codecs.py with email/charset.py

2014-12-12 Thread Stefanos Karasavvidis
I've hit a wall with mailman which seems to be caused by pyhon's character encoding names. I've narrowed the problem down to the email/charset.py file. Basically the following happens: given an encoding name as 'iso-8859-X' it is transformed to 'iso8859-X' (without the first dash). This happens

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread KK Sasa
Peter Otten於 2014年12月12日星期五UTC+8下午5時13分58秒寫道: KK Sasa wrote: Mark Lawrence於 2014年12月12日星期五UTC+8下午3時17分43秒寫道: On 12/12/2014 06:22, KK Sasa wrote: Hi there, The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a function returning a list, say

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Steven D'Aprano
KK Sasa wrote: Hi there, The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a function returning a list, say [x1,x2,x3,x4] for one example. So results is a list consisting of 1000 lists, each of length four. Here, what I want to get is the sum of 1000 lists,

Re: Extension of while syntax

2014-12-12 Thread Marko Rauhamaa
c...@isbd.net: Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: You could deduplicate it by shifting the condition: while True: value = get_some_value() if value not in undesired_values: break But I'm not sure how common this idiom actually is.

Re: [newbie] how to make program suggest to install missing modules

2014-12-12 Thread hugocoolens
On Monday, December 8, 2014 9:00:13 PM UTC+1, sohca...@gmail.com wrote: On Monday, December 8, 2014 10:46:47 AM UTC-8, Jean-Michel Pichavant wrote: - Original Message - From: sohcahto...@gmail.com try: import someModule except ImportError: print Module is missing

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Jussi Piitulainen
KK Sasa writes: def p(x,t,point,z,obs): d = x[0] tau = [0]+[x[1:point]] a = x[point:len(x)] at = sum(i*j for i, j in zip(a, t)) nu = [exp(z[k]*(at-d)-sum(tau[k])) for k in xrange(point)] de = sum(nu, axis=0) probability = [nu[k]/de for k in xrange(point)]

Re: is_whatever_you_are_testing_for as method or property?

2014-12-12 Thread Mateusz Loskot
On 11 December 2014 at 19:20, Chris Angelico ros...@gmail.com wrote: On Fri, Dec 12, 2014 at 4:34 AM, Mateusz Loskot mate...@loskot.net wrote: If a class member function simply tests something and returns a b::oolean call it def is_whatever_you_are_testing_for(): pass like 'is_even'.

Re: is_whatever_you_are_testing_for as method or property?

2014-12-12 Thread Chris Angelico
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote: I've got several cases which are not obvious to me. For instance, class Foo has a boolean attribute, read-write, which I see a couple of realisations for possible: 0) Attribute only. class Foo: pass Foo().default

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Peter Otten
Jussi Piitulainen wrote: KK Sasa writes: def p(x,t,point,z,obs): d = x[0] tau = [0]+[x[1:point]] a = x[point:len(x)] at = sum(i*j for i, j in zip(a, t)) nu = [exp(z[k]*(at-d)-sum(tau[k])) for k in xrange(point)] de = sum(nu, axis=0) probability = [nu[k]/de

Run Programming ?????

2014-12-12 Thread Delgado Motto
I travel alot, if not just interested in things of pocketable portability, and was curious if you can tell me if Python can be LEARNED from beginner on an IOS device ( with interest of being able to test my code, possibly even if a free website is capable of reviewing scripts ) but if not then I

Re: [newbie] how to make program suggest to install missing modules

2014-12-12 Thread Chris Warrick
On Dec 12, 2014 11:56 AM, hugocoolens hugocool...@gmail.com wrote: On Monday, December 8, 2014 9:00:13 PM UTC+1, sohca...@gmail.com wrote: On Monday, December 8, 2014 10:46:47 AM UTC-8, Jean-Michel Pichavant wrote: - Original Message - From: sohcahto...@gmail.com try:

Re: Run Programming ?????

2014-12-12 Thread Chris Warrick
On Dec 12, 2014 1:40 PM, Delgado Motto riskyay...@gmail.com wrote: I travel alot, if not just interested in things of pocketable portability, and was curious if you can tell me if Python can be LEARNED from beginner on an IOS device ( with interest of being able to test my code, possibly even if

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread KK Sasa
Jussi Piitulainen於 2014年12月12日星期五UTC+8下午7時12分39秒寫道: KK Sasa writes: def p(x,t,point,z,obs): d = x[0] tau = [0]+[x[1:point]] a = x[point:len(x)] at = sum(i*j for i, j in zip(a, t)) nu = [exp(z[k]*(at-d)-sum(tau[k])) for k in xrange(point)] de = sum(nu,

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread KK Sasa
Peter Otten於 2014年12月12日星期五UTC+8下午8時32分55秒寫道: Jussi Piitulainen wrote: KK Sasa writes: def p(x,t,point,z,obs): d = x[0] tau = [0]+[x[1:point]] a = x[point:len(x)] at = sum(i*j for i, j in zip(a, t)) nu = [exp(z[k]*(at-d)-sum(tau[k])) for k in xrange(point)]

Python REST API Wrapper framework?

2014-12-12 Thread Alec Taylor
It's not overly difficult to build a wrapper of someones RESTfull HTTP API using something like: urllib2 or requests. However, there is still a decent amount of generic boilerplate required. Are there any decent frameworks around which reduce the amount of boilerplate required to consume

Re: beautifulsoup VS lxml

2014-12-12 Thread iMath
在 2014年12月12日星期五UTC+8上午10时19分56秒,Michael Torrie写道: On 12/11/2014 07:02 PM, iMath wrote: which is more easy and elegant for pulling data out of HTML? Beautiful Soup is specialized for HTML parsing, and it can deal with badly formed HTML, but if I recall correctly BeautifulSoup can use

Re: Run Programming ?????

2014-12-12 Thread William Ray Wing
On Dec 12, 2014, at 8:03 AM, Chris Warrick kwpol...@gmail.com wrote: On Dec 12, 2014 1:40 PM, Delgado Motto riskyay...@gmail.com mailto:riskyay...@gmail.com wrote: I travel alot, if not just interested in things of pocketable portability, and was curious if you can tell me if

Re: Run Programming ?????

2014-12-12 Thread Chris Angelico
On Sat, Dec 13, 2014 at 2:03 AM, William Ray Wing w...@mac.com wrote: A MacBook Air is within a fraction of being as portable as an iPad, and can easily do everything you want. If you are currently traveling with an iPad, you _might_ even discover you prefer traveling with the MacBook. Or get

Re: Run Programming ?????

2014-12-12 Thread Delgado Motto
I was specifically talking POCKETABLE devices so Phablet or Telephone preferably, simply hopeful as smaller machines continue to become more capable, but I expected as much of this being a problem. Thanks. On Friday, December 12, 2014, William Ray Wing w...@mac.com wrote: On Dec 12, 2014, at

Re: Run Programming ?????

2014-12-12 Thread Chris Angelico
On Sat, Dec 13, 2014 at 2:43 AM, Delgado Motto riskyay...@gmail.com wrote: I was specifically talking POCKETABLE devices so Phablet or Telephone preferably, simply hopeful as smaller machines continue to become more capable, but I expected as much of this being a problem. Thanks. Those usually

Re: Call for speakers for the first PyCon Belarus. Python-announce

2014-12-12 Thread serge Guelton
On Fri, Dec 12, 2014 at 04:32:26PM +0300, Alina Dolgikh wrote: Hello, dear community! I represent Belarusian Python community. We have regular monthly meet-ups for 70-100 persons and we are going to develop further. We are planning to make the first Belarusian PyCon on the 31st of January

Re: encrypt the http request url on the local machine

2014-12-12 Thread iMath
在 2014年12月9日星期二UTC+8下午2时58分36秒,iMath写道: my software on the local machine needs to send http request to a specific web server , is there any way to protect the http request url from being found by Packet analyzer software like Wireshark and fiddler. The sever is not mine, so I can do nothing

Re: encrypt the http request url on the local machine

2014-12-12 Thread Chris Angelico
On Sat, Dec 13, 2014 at 2:53 AM, iMath redstone-c...@163.com wrote: After some retinking on my question ,I found what I am really want is not let any other guys using packet analyzer software know the server name (host name) my software is sending data to . so I translate the host name to

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Peter Otten
KK Sasa wrote: Peter Otten於 2014年12月12日星期五UTC+8下午8時32分55秒寫道: Jussi Piitulainen wrote: KK Sasa writes: def p(x,t,point,z,obs): d = x[0] tau = [0]+[x[1:point]] a = x[point:len(x)] at = sum(i*j for i, j in zip(a, t)) nu = [exp(z[k]*(at-d)-sum(tau[k])) for k

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Oscar Benjamin
On 12 December 2014 at 06:22, KK Sasa genwei...@gmail.com wrote: Hi there, The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a function returning a list, say [x1,x2,x3,x4] for one example. So results is a list consisting of 1000 lists, each of length four.

Re: How to make subprocess run for 60 sec?

2014-12-12 Thread Dan Stromberg
On Fri, Dec 12, 2014 at 12:48 AM, Robert Clove cloverob...@gmail.com wrote: Hi All, I have the following python script that runs. I want is to run the subprocess to run for 60 sec and then send the SIGINT signal to subprocess and write the output in file. #!/usr/bin/python import os

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-12 Thread Mark Roberts
So, I'm more than aware of how to write Python 2/3 compatible code. I've ported 10-20 libraries to Python 3 and write Python 2/3 compatible code at work. I'm also aware of how much writing 2/3 compatible code makes me hate Python as a language. It'll be a happy day when one of the two languages

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-12 Thread Petr Viktorin
Also keep in mind that not all Python libraries are on PyPI. For non-Python projects with Python bindings (think video players, OpenCV, systemd, Samba), distribution via PyPI doesn't make much sense. And since the Python bindings are usually second-class citizens, the porting doesn't have a high

Re: Run Programming ?????

2014-12-12 Thread sohcahtoa82
On Friday, December 12, 2014, William Ray Wing w...@mac.com wrote: On Dec 12, 2014, at 8:03 AM, Chris Warrick kwpol...@gmail.com wrote: On Dec 12, 2014 1:40 PM, Delgado Motto riskyay...@gmail.com wrote: I travel alot, if not just interested in things of pocketable

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-12 Thread Matthew Ruffalo
On 12/11/2014 09:48 PM, Terry Reedy wrote: A possible reason: one is developing an app expected to be released fall 2015 after the 3.5 release and the app depends on something new in 3.5. I must admit though that I cannot think of any such thing now for 3.5. For 3.3 there was the new

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-12 Thread Barry Warsaw
On Dec 12, 2014, at 08:07 PM, Petr Viktorin wrote: If anyone is wondering why their favorite Linux distribution is stuck with Python 2 – well, I can only speak for Fedora, but nowadays most of what's left are CPython bindings. No pylint --py3k or 2to3 will help there... It's true that some of

Re: How to make subprocess run for 60 sec?

2014-12-12 Thread Akira Li
Dan Stromberg drsali...@gmail.com writes: On Fri, Dec 12, 2014 at 12:48 AM, Robert Clove cloverob...@gmail.com wrote: Hi All, I have the following python script that runs. I want is to run the subprocess to run for 60 sec and then send the SIGINT signal to subprocess and write the output in

Re: is_whatever_you_are_testing_for as method or property?

2014-12-12 Thread Mateusz Loskot
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote: On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote: I've got several cases which are not obvious to me. For instance, class Foo has a boolean attribute, read-write, which I see a couple of realisations

Re: is_whatever_you_are_testing_for as method or property?

2014-12-12 Thread Chris Angelico
On Sat, Dec 13, 2014 at 8:03 AM, Mateusz Loskot mate...@loskot.net wrote: On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote: On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote: I've got several cases which are not obvious to me. For instance, class Foo

Re: is_whatever_you_are_testing_for as method or property?

2014-12-12 Thread Mateusz Loskot
On 12 December 2014 at 22:14, Chris Angelico ros...@gmail.com wrote: On Sat, Dec 13, 2014 at 8:03 AM, Mateusz Loskot mate...@loskot.net wrote: On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote: On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote: I've

Re: encrypt the http request url on the local machine

2014-12-12 Thread Michael Torrie
On 12/12/2014 08:53 AM, iMath wrote: After some retinking on my question ,I found what I am really want is not let any other guys using packet analyzer software know the server name (host name) my software is sending data to . so I translate the host name to IP address format, it somewhat

Re: Python Script to convert firewall rules

2014-12-12 Thread Jason Friedman
Thanks for the reply. Yes I can make the all possible keywords/values for both formate. But after that what gonna be the logic to convert one format to other format. Like to convert one line below are the keywords: set interface ethernet2/5 ip 10.17.10.1/24 (format 1) set interfaces

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread KK Sasa
Sorry, i should say I'm using pythonxy, maybe it imports other things. -- https://mail.python.org/mailman/listinfo/python-list

Re: Fatal Python error: PyCOND_WAIT(gil_cond) failed

2014-12-12 Thread dieter
keepplearningpython krishna2pra...@gmail.com writes: I am running ipython3 on Unix and constantly see this crash - It happens when i try to issue commands on the ipython interactive shell. I have tried to set the PYTHONDIR to /var/tmp/ in case there was an issue accessing the default

[issue21793] httplib client/server status refactor

2014-12-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: rhettinger - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21793 ___ ___

[issue22477] GCD in Fractions

2014-12-12 Thread gladman
gladman added the comment: I notice on the documentation for Python 3.5 that this proposed addition is not mentioned. Is it still the intention to add this proposed change to Python 3.5? -- ___ Python tracker rep...@bugs.python.org

[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2014-12-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9536 ___

[issue15178] Doctest should handle situations when test files are not readable

2014-12-12 Thread Bohuslav Slavek Kabrda
Bohuslav Slavek Kabrda added the comment: Attaching a new version of patch: - Rebased to latest default branch - Simplified prints - Using OSError instead of IOError Hopefully this is the final version :) -- Added file:

[issue21793] httplib client/server status refactor

2014-12-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21793 ___

[issue22477] GCD in Fractions

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: I see that the issue #22486 is still open. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22477 ___ ___

[issue22486] Add math.gcd()

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: What's the status of this issue? See also the issue #22477. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22486 ___

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Ned Deily
Ned Deily added the comment: The changes for 3.4 are incomplete: import ssl Traceback (most recent call last): File stdin, line 1, in module File /py/dev/34/source/Lib/ssl.py, line 122, in module from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1 ImportError: cannot

[issue22486] Add math.gcd()

2014-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which addresses both Mark's suggestions. * math.gcd() now work with arbitrary Python objects implementing __index__. * fractions.gcd() and Fraction's constructor now use math.gcd() if both arguments are int, but also support non-ints (e.g.

[issue22486] Add math.gcd()

2014-12-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file37422/lehmer_gcd_8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22486 ___

[issue17914] add os.cpu_count()

2014-12-12 Thread Mark Summerfield
Mark Summerfield added the comment: In message http://bugs.python.org/issue17914#msg188626 Victor Stenner says On Windows, GetSystemInfo() is called instead of reading an environment variable. I suppose that this function is more reliable. From my reading, and based on feedback from one of my

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 773e55c95703 by Victor Stinner in branch '3.4': Issue #22935: Fix ssl module when SSLv3 protocol is not supported https://hg.python.org/cpython/rev/773e55c95703 New changeset fb1ffd40d33e by Victor Stinner in branch 'default': Issue #22935: Fix

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f0297263a1e8 by Victor Stinner in branch '3.4': Issue #22935: Fix test_ssl when the SSLv3 protocol is not supported https://hg.python.org/cpython/rev/f0297263a1e8 -- ___ Python tracker

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: The changes for 3.4 are incomplete Ok, I fixed most obvious issues. There is a major severe issue in Lib/ssl.py: def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None): ... This line fails if PROTOCOL_SSLv3 name does not

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: Oh, in Python 3.4, create_default_context() uses PROTOCOL_SSLv23, SSLSocket, wrap_socket() and _create_unverified_context() use PROTOCOL_SSLv23 by default. In Python 3.5, get_server_certificate() now uses PROTOCOL_SSLv23 by default because test_ssl failed on

[issue17914] add os.cpu_count()

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: From my reading, and based on feedback from one of my customers, I believe he is correct and that GetSystemInfo() ought to be used on Windows. (It is available in pywin32 win32api.) Please open a new issue to suggest this enhancement, this issue is closed.

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: get_server_certificate_sslv23.patch: Patch to use PROTOCOL_SSLv23 by default in get_server_certificate(), as done in Python 2.7 and 3.5. -- Added file: http://bugs.python.org/file37424/get_server_certificate_sslv23.patch

[issue23036] Crash Error?

2014-12-12 Thread E Roberts
New submission from E Roberts: New to the world of Python. The picture attached is an error that a teacher at my school is receiving when he tries to run anything in IDLE. I know nothing about coding/python/idle or anything of that nature. Sorry I am of little help. Please can someone help

[issue23036] Crash Error?

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: The problem is that your student created a file called random.py which conflicts with the module random of the Python standard library. Please rename the random.py file to random.py and remove .pyc files (ex: random.pyc or __pycache__/random*pyc). --

[issue15267] tempfile.TemporaryFile and httplib incompatibility

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: Catching TypeError on len() looks as an ugly test to check if body is a string. Why not doing the opposite: first to call fileno() and call AttributeError? Or even use hasattr(body, fileno)? -- nosy: +haypo ___

[issue15267] tempfile.TemporaryFile and httplib incompatibility

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: issue15267.patch: I would feel more confortable if test_send_tempfile() ensures that the socket contains the file content. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15267

[issue18028] Warnings with -fstrict-aliasing

2014-12-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9565b56a4615 by Victor Stinner in branch '2.7': Issue #18028: Fix aliasing issue in READ_TIMESTAMP() of ceval.c on x86_64, https://hg.python.org/cpython/rev/9565b56a4615 New changeset adb445578995 by Victor Stinner in branch '3.4': Issue #18028:

[issue18028] Warnings with -fstrict-aliasing

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: 3 core developers reviewed Christian's patch, so it also looks good to me :-) Since Christian looks to be busy, I commited his patch. Thanks Christian for your fix. We might enable -fstrict-aliasing later, at least to compile Python core (not to build

[issue23035] python -c: Line causing exception not shown for exceptions other than SyntaxErrors

2014-12-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: -c: Line causing exception not shown for exceptions other than SyntaxErrors - python -c: Line causing exception not shown for exceptions other than SyntaxErrors ___ Python tracker

[issue23035] python -c: Line causing exception not shown for exceptions other than SyntaxErrors

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: SyntaxError exceptions have a text attribute which contains the line where the error occurred. It's really a special case. For other exceptions, Python only knows that the error occurred in the file called string. Being able to display the line for any

[issue23034] Dynamically control debugging output

2014-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Also this debug output should be printed on stderr, not stdout. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23034 ___

[issue23034] Dynamically control debugging output

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: Debugging output switched by Py_REF_DEBUG is now enabled only when -X showrefcount is specified (issue17323). Yes, I like the idea of doing that for other debug options. -- nosy: +haypo ___ Python tracker

[issue23037] cpu_count() unreliable on Windows

2014-12-12 Thread Mark Summerfield
New submission from Mark Summerfield: In message http://bugs.python.org/issue17914#msg188626 Victor Stenner says On Windows, GetSystemInfo() is called instead of reading an environment variable. I suppose that this function is more reliable. From my reading, and based on feedback from one of

[issue17914] add os.cpu_count()

2014-12-12 Thread Mark Summerfield
Mark Summerfield added the comment: Since this is closed I've created a new issue as requested: http://bugs.python.org/issue23037 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17914 ___

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please always use PROTOCOL_SSLv23 since this is the only forward compatible way of telling OpenSSL to use the best protocol available. Any of the other options such as PROTOCOL_TLSv1 will fix the protocol version to that one protocol version, whereas

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Kurt Roeckx
Kurt Roeckx added the comment: So this seems to be a function that just gets the certificate? You need to be careful with this since a server could perfectly decide to send a different certificate depending on the client hello it receives. Like if you support ECDSA it might decide to send

[issue23037] cpu_count() unreliable on Windows

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: The code getting the number of processors on Windows is different between the multiprocessing (Python 3.3) and os (Python 3.5) modules. multiprocessing (old code): try: num = int(os.environ['NUMBER_OF_PROCESSORS']) except

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: So this seems to be a function that just gets the certificate? You need to be careful with this since a server could perfectly decide to send a different certificate depending on the client hello it receives. (...) In any case, you should always use

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: Any of the other options such as PROTOCOL_TLSv1 will fix the protocol version to that one protocol version, whereas PROTOCOL_SSLv23 means to use any protocol starting with SSLv2. In the context options you can then disable SSLv2 and SSLv3 to e.g. have the

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Kurt Roeckx
Kurt Roeckx added the comment: SSLv3 does not support the TLS extensions so it's going to send a totally different Client Hello. It will for instance not indicate with elliptic curves it supports. So yes the behavior for SSLv3 and SSLv23 can be totally different. But even with both SSLv23

[issue22935] Disabling SSLv3 support

2014-12-12 Thread STINNER Victor
STINNER Victor added the comment: Do you have an example of server returning a different certificate depending on the protocol? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22935 ___

[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-12 Thread Brett Cannon
Brett Cannon added the comment: I don't think we really need to say anything. If people want default results, simply return None (which is handled for them by importlib.abc.Loader). The only thing changing here is that the method will now be required instead of optional. I'll post the patch

[issue23038] #python.web irc channel is dead

2014-12-12 Thread Collin Anderson
New submission from Collin Anderson: Can we remove references to #python.web? I assume it was a flourishing channel at some point. https://docs.python.org/3/howto/webservers.html#other-notable-frameworks -- assignee: docs@python components: Documentation messages: 232550 nosy:

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor added the comment: Any of the other options such as PROTOCOL_TLSv1 will fix the protocol version to that one protocol version, whereas PROTOCOL_SSLv23 means to use any protocol starting with SSLv2. In the context options you can then

[issue22935] Disabling SSLv3 support

2014-12-12 Thread Kurt Roeckx
Kurt Roeckx added the comment: Most such sites actually seem to have dropped support for SSLv3. One site where it depends on the cipher string is bugs.cdburnerxp.se -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22935

[issue23034] Dynamically control debugging output

2014-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is (conceivably incomplete) list of debugging and tracing output (but not error reporting) from C code. Controlled output. Import and shutdown details -- controlled by the -v flag. Parser tracing -- controlled by the -d flag. If Py_REF_DEBUG is defined

[issue23038] #python.web irc channel is dead

2014-12-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1edff7001f58 by Benjamin Peterson in branch '2.7': remove reference to dead irc channel (closes #23038) https://hg.python.org/cpython/rev/1edff7001f58 New changeset aba5f771f5ec by Benjamin Peterson in branch '3.4': remove reference to dead irc

[issue23039] File name restriction on Windows

2014-12-12 Thread Philip Lee
New submission from Philip Lee: when using open(filename, 'w') on Windows , File names are not allowed to contain any characters in \/:*?| , however open(filename, 'w') doesn't throw any exceptions when the file name contains these characters . I think some warning should be written in the

[issue23040] Better documentation for the urlencode safe parameter

2014-12-12 Thread Wojtek Ruszczewski
New submission from Wojtek Ruszczewski: The documentation for urlencode() [1] isn't very clear on how the safe parameter is used, it would better not list it together with encoding and error as only applying to strings. [1]

[issue23039] File name restriction on Windows

2014-12-12 Thread R. David Murray
R. David Murray added the comment: The argument to open is a path. Some of those characters have a meaning in a path. I ran a couple of quick experiments: ab*c.txt fails with an exception. :16.txt created a file, which I can do an 'ls' and cat (but not rm) on in git-bash, but I'm not sure

[issue23040] Better documentation for the urlencode safe parameter

2014-12-12 Thread R. David Murray
R. David Murray added the comment: The current documentation looks very clear to me, and I don't understand your changed version. Can you give an example of how the existing text is inaccurate or results in confusion? -- nosy: +r.david.murray ___

[issue23039] File name restriction on Windows

2014-12-12 Thread Tim Golden
Tim Golden added the comment: Agree with RDM: we're just passing the path through to the Windows API (on Windows). We don't generally carry out this kind of pre-emptive check. -- resolution: - not a bug stage: - resolved status: open - closed ___

[issue23041] csv needs more quoting rules

2014-12-12 Thread Samwyse
New submission from Samwyse: The csv module currently implements four quoting rules for dialects: QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC and QUOTE_NONE. These rules treat values of None the same as an empty string, i.e. by outputting two consecutive quotes. I propose the addition of two

[issue23041] csv needs more quoting rules

2014-12-12 Thread R. David Murray
R. David Murray added the comment: As an enhancement, this could be added only to 3.5. The proposal sounds reasonable to me. -- keywords: +easy nosy: +r.david.murray stage: - needs patch versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.6

  1   2   >