ANN: eGenix mxODBC Connect 2.0.5 - Python ODBC Database Interface

2014-04-28 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python ODBC Database Interface Version 2.0.5 mxODBC Connect is our commercially supported client-server product

Wing IDE 5.0.6 released

2014-04-28 Thread Wingware
Hi, Wingware has released version 5.0.6 of Wing IDE, our cross-platform integrated development environment for the Python programming language. Wing IDE includes a professional quality code editor with vi, emacs, visual studio, and other key bindings, auto-completion, call tips,

ANN: Python Meeting Düsseldorf - 29.04.2014

2014-04-28 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen

Inconsistent viewkeys behaviour

2014-04-28 Thread Joshua Landau
Is there any reference for this strange behaviour on Python 2: set() dict().viewkeys() Traceback (most recent call last): File stdin, line 1, in module TypeError: can only compare to a set dict().viewkeys() set() False ? --

Re: Sorting list alphabetically

2014-04-28 Thread Kev Dwyer
Terry Reedy wrote: On 4/27/2014 6:40 AM, Kev Dwyer wrote: Igor Korot wrote: Hi, ALL, I need to perform a subj. Looking at the Google I found following thread with explanation: http://stackoverflow.com/questions/36139/how-do-i-sort-a-list-of- strings- in-python However, doing this in my

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-28 Thread Steven D'Aprano
On Mon, 28 Apr 2014 12:19:02 +1000, Chris Angelico wrote: On Mon, Apr 28, 2014 at 12:11 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Suppose we could pass variables directly to the constructor, like this: a = b = 2 L = [1, 2, 3] dctA = dict(a, b, L[1], 2, 1+1)

Re: Unicode in Python

2014-04-28 Thread wxjmfauth
Le samedi 26 avril 2014 15:38:29 UTC+2, Ian a écrit : On Apr 26, 2014 3:46 AM, Frank Millman fr...@chagford.com wrote: wxjm...@gmail.com wrote in message news:03bb12d8-93be-4ef6-94ae-4a02789ae...@googlegroups.com... == I wrote once 90 % of Python 2 apps (a

Re: possible bug in re expression?

2014-04-28 Thread Robin Becker
On 25/04/2014 19:32, Terry Reedy wrote: .. I suppose that one could argue that '{' alone should be treated as special immediately, and not just when a matching '}' is found, and should disable other special meanings. I wonder what JS does if there is no matching '}'? well in fact I

Re: Inconsistent viewkeys behaviour

2014-04-28 Thread Terry Reedy
On 4/28/2014 2:22 AM, Joshua Landau wrote: Is there any reference for this strange behaviour on Python 2: set() dict().viewkeys() Traceback (most recent call last): File stdin, line 1, in module TypeError: can only compare to a set dict().viewkeys() set()

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-28 Thread Duncan Booth
Chris Angelico ros...@gmail.com wrote: # Snapshot of keys: for k in list(d): if f(k): del d[k] No extra loop at the end, no switching out and in of contents, just one little change in the loop header. Obviously you don't want to do this when you're deleting two out of three billion,

Re: possible bug in re expression?

2014-04-28 Thread Steven D'Aprano
On Mon, 28 Apr 2014 10:47:54 +0100, Robin Becker wrote: Does this in fact that almost any broken regexp specification will silently fail because re will reset and consider any metacharacter as literal? Well, I don't know about almost any, but at least some broken regexes will explicitly

problem with regex

2014-04-28 Thread dimmaim
i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple quotes

problem with regex

2014-04-28 Thread dimmaim
i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple quotes

Re: problem with regex

2014-04-28 Thread Roy Smith
In article caeba811-441e-42a0-9b2b-c743205b1...@googlegroups.com, dimm...@gmail.com wrote: i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple

Convert numpy array to single number

2014-04-28 Thread mboyd02255
I have a numpy array consisting of 1s and zeros for representing binary numbers: e.g. binary array([ 1., 0., 1., 0.]) I wish the array to be in the form 1010, so it can be manipulated. I do not want to use built in binary converters as I am trying to build my own. --

Re: possible bug in re expression?

2014-04-28 Thread Robin Becker
On 28/04/2014 12:49, Steven D'Aprano wrote: .. Well, I don't know about almost any, but at least some broken regexes will explicitly fail: py import re sre_constants.error: nothing to repeat (For brevity I have abbreviated the traceback.) so there is intent to catch some

Re: Convert numpy array to single number

2014-04-28 Thread Steven D'Aprano
On Mon, 28 Apr 2014 06:04:02 -0700, mboyd02255 wrote: I have a numpy array consisting of 1s and zeros for representing binary numbers: e.g. binary array([ 1., 0., 1., 0.]) I wish the array to be in the form 1010, so it can be manipulated. I do not want to use built in

Significant digits in a float?

2014-04-28 Thread Roy Smith
I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have between 0 and 4 decimal digits of precision, and I want to be

Re: Significant digits in a float?

2014-04-28 Thread Ned Batchelder
On 4/28/14 12:00 PM, Roy Smith wrote: Fundamentally, these numbers have between 0 and 4 decimal digits of precision, and I want to be able to intuit how many each has, ignoring the obvious floating point roundoff problems. Thus, I want to map: 38.0 == 0 41.2586 == 4 40.752801 == 4

Re: Significant digits in a float?

2014-04-28 Thread Chris Angelico
On Tue, Apr 29, 2014 at 2:00 AM, Roy Smith r...@panix.com wrote: I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have between 0

Heartbleed and the windows distributions on python.org

2014-04-28 Thread Timothy McDonald
I am building a cherrypy app that is testing as vulnerable to the heartbleed exploit. The app is running on the 64 bit 3.3.5 Windows distribution of python. An updated version of 64 bit Python 3.3.x for Windows or an updated pyopenssl? I am kind of surprised the distribution on python.org

Re: Significant digits in a float?

2014-04-28 Thread Roy Smith
On Monday, April 28, 2014 12:28:59 PM UTC-4, Chris Angelico wrote: Terminology question: Why do you count only what's after the decimal point? I would describe these as having between 2 and 6 significant figures. Will they always have two digits before the decimal, or does your precision

Re: Significant digits in a float?

2014-04-28 Thread Roy Smith
On Monday, April 28, 2014 12:07:14 PM UTC-4, Ned Batchelder wrote: On 4/28/14 12:00 PM, Roy Smith wrote: 38.0 == 0 [...] Is there any clean way to do that? The best I've come up with so far is to str() them and parse the remaining string to see how many digits it put after the decimal

Re: Significant digits in a float?

2014-04-28 Thread Ned Batchelder
On 4/28/14 2:39 PM, Roy Smith wrote: On Monday, April 28, 2014 12:07:14 PM UTC-4, Ned Batchelder wrote: On 4/28/14 12:00 PM, Roy Smith wrote: 38.0 == 0 [...] Is there any clean way to do that? The best I've come up with so far is to str() them and parse the remaining string to see how many

Re:Significant digits in a float?

2014-04-28 Thread Dave Angel
Roy Smith r...@panix.com Wrote in message: I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have

Re: Heartbleed and the windows distributions on python.org

2014-04-28 Thread Ned Deily
In article d576956a-5bcc-4508-bac1-87e954b7e...@googlegroups.com, Timothy McDonald tmcdon...@gmail.com wrote: I am building a cherrypy app that is testing as vulnerable to the heartbleed exploit. The app is running on the 64 bit 3.3.5 Windows distribution of python. An updated version of 64

Re:Convert numpy array to single number

2014-04-28 Thread Dave Angel
mboyd02...@gmail.com Wrote in message: I have a numpy array consisting of 1s and zeros for representing binary numbers: e.g. binary array([ 1., 0., 1., 0.]) I wish the array to be in the form 1010, so it can be manipulated. I do not want to use built in binary

Re:problem with regex

2014-04-28 Thread Dave Angel
dimm...@gmail.com Wrote in message: i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple quotes

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-28 Thread Ned Batchelder
On 4/27/14 5:51 PM, Andrew Konstantaras wrote: I guess I am missing something big as I am looking for a shorthand way of doing the following: dctA = dict(x=x, y=y, ... n=n) Yes, your makeDict(x, y) is a shorthand for dict(x=x, y=y), but there are many things you can do with dict

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-28 Thread Andrew Konstantaras
On Apr 28, 2014, at 12:36 PM, Ned Batchelder n...@nedbatchelder.com wrote: On 4/27/14 5:51 PM, Andrew Konstantaras wrote: I guess I am missing something big as I am looking for a shorthand way of doing the following: dctA = dict(x=x, y=y, ... n=n) Yes,

Re: Sorting list alphabetically

2014-04-28 Thread Terry Reedy
On 4/28/2014 2:33 AM, Kev Dwyer wrote: Hello Terry, Regarding your second point, my mistake in not checking the link: I'd seen a similar one elsewhere and assumed they were the same. This link should work: http://msdn.microsoft.com/en-us/library/hzz3tw78 As to your first point, you're

Re: Soap list and soap users on this list

2014-04-28 Thread Burak Arslan
Hi Joseph, Sorry for the late response, I seem to have missed this post. On 04/17/14 21:34, Joseph L. Casale wrote: I've been looking at Spyne to produce a service that can accept a request formatted as follows: ?xml version='1.0' encoding='UTF-8'? SOAP-ENV:Envelope

RE: Soap list and soap users on this list

2014-04-28 Thread Joseph L. Casale
https://gist.github.com/plq/11384113 Unfortunately, you need the latest Spyne from https://github.com/arskom/spyne, this doesn't work with 2.10 2.11 is due around end of may, beginning of june. Ping back if you got any other questions. Burak, Thanks a ton! I've just pulled this down

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-28 Thread Chris Angelico
On Tue, Apr 29, 2014 at 5:50 AM, Andrew Konstantaras akon...@icloud.com wrote: Actually, that is one of the nice features of using a dictionary, I can check if the key is there and if it is pull it out. As I was dusting off this old code, I considered trying to implement this functionality

Re: MacOS 10.9.2: threading error using python.org 2.7.6 distribution

2014-04-28 Thread Matthew Pounsett
On Sunday, 27 April 2014 10:33:38 UTC-4, Chris Angelico wrote: In most contexts, thread unsafe simply means that you can't use the same facilities simultaneously from two threads (eg a lot of database connection libraries are thread unsafe with regard to a single connection, as they'll

Re: MacOS 10.9.2: threading error using python.org 2.7.6 distribution

2014-04-28 Thread Chris Angelico
On Tue, Apr 29, 2014 at 8:50 AM, Matthew Pounsett matt.pouns...@gmail.com wrote: Thanks, I'll keep all that in mind. I have to wonder how much of a problem it is here though, since I was able to demonstrate a functioning fork inside a new thread further up in the discussion. Yeah, it's

Re: Inconsistent viewkeys behaviour

2014-04-28 Thread Gregory Ewing
Terry Reedy wrote: The left operand determines the result. The manual specifies that and do not have to be consistent. But I suspect that when 3.x dict.keys() was backported to 2.7.0, no one thought to update set, whereas the backported key view code already had the comparison. The

Re: Significant digits in a float?

2014-04-28 Thread Steven D'Aprano
On Mon, 28 Apr 2014 12:00:23 -0400, Roy Smith wrote: [...] Fundamentally, these numbers have between 0 and 4 decimal digits of precision, I'm surprised that you have a source of data with variable precision, especially one that varies by a factor of TEN THOUSAND. The difference between 0

Re: Significant digits in a float?

2014-04-28 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: By the way, you contradict yourself here. Earlier, you described 38.0 as having zero decimal places (which is wrong). Here you describe it as having one, which is correct, and then in a later post you describe it as having zero

Re: Significant digits in a float?

2014-04-28 Thread Steven D'Aprano
On Tue, 29 Apr 2014 13:23:07 +1000, Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: By the way, you contradict yourself here. Earlier, you described 38.0 as having zero decimal places (which is wrong). Here you describe it as having one, which is correct, and

[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-28 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for the ticket and patch, xapple! I updated the patch to address the compiler warning and use assertEqual. While testing, I noticed that slicing with steps wasn't supported, so I expanded the sqlite3.Row slicing code to support steps, and added some

[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-28 Thread Jessica McKellar
Jessica McKellar added the comment: I've also uploaded a short script that sets up an in-memory sqlite database that fetches Rows, for easy manual testing. -- Added file: http://bugs.python.org/file35071/sqlite3_slicing_demo.py ___ Python tracker

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: That was a design decision. What would be the advantage of having the TarFile class offer the compression itself? -- assignee: - lars.gustaebel ___ Python tracker rep...@bugs.python.org

[issue18472] Update PEP 8 to encourage modern conventions

2014-04-28 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18472 ___ ___ Python-bugs-list

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: It looks like Windows supports also lazy initialization of memory pages initialized to zero. According to my microbenchmark on Linux and Windows, only bytes(n) and bytearray(n) are really faster with use_calloc.patch. Most changes of use_calloc.patch are

[issue21372] multiprocessing.util.register_after_fork inconsistency

2014-04-28 Thread Marc Schlaich
New submission from Marc Schlaich: multiprocessing.util.register_after_fork does not behave consistently on Windows because the `_afterfork_registry` is not transferred to the subprocess. The following example fails on Windows while it works perfectly on Linux: import multiprocessing.util

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Changes on the pickle module don't look like an interesting optimization. It even looks slower. $ python perf.py -b fastpickle,fastunpickle,pickle,pickle_dict,pickle_list,slowpickle,slowunpickle,unpickle ../default/python.orig ../default/python.calloc ...

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5. This patch is ready for a review. Summary of calloc-5.patch: - add the following functions: * void* PyMem_RawCalloc(size_t nelem, size_t elsize) * void* PyMem_Calloc(size_t nelem, size_t elsize) * void* PyObject_Calloc(size_t nelem,

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-04-28 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +lizhenhua ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20305 ___ ___

[issue21371] struct lconv does not have decimal_point on android platform

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: This looks like a duplicate. -- nosy: +skrah resolution: - duplicate stage: - resolved status: open - closed superseder: - Android's incomplete locale.h implementation prevents cross-compilation ___ Python tracker

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Demo of calloc-5.patch on Linux. Thanks to calloc(), bytes(50 * 1024 * 1024) doesn't allocate memory for null bytes and so the RSS memory is unchanged (+148 kB, not +50 MB), but tracemalloc says that 50 MB were allocated. $ ./python -X tracemalloc Python

[issue5404] Cross-compiling Python

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Ping. Is this still an issue for anyone in 3.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5404 ___ ___

[issue21220] Enhance obmalloc allocation strategy

2014-04-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: This significantly helps fragmentation in programs with dynamic memory usage, e.g. long running programs. On which programs? The fragmentation of the memory depends a lot on how the program allocates memory. For example, if a program has no

[issue20188] ALPN support for TLS

2014-04-28 Thread Cory Benfield
Changes by Cory Benfield c...@lukasa.co.uk: -- nosy: +Lukasa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20188 ___ ___ Python-bugs-list mailing

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Sworddragon
Sworddragon added the comment: The TarFile class provides more options. Alternatively a file object could be used but this means additional code (and maybe IO overhead). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: We should not overcomplicate this. I suggest that we simply use utf-8 under the C locale. Do you mean utf8/strict or utf8/surrogateescape? utf8/strict doesn't work (os.listdir raises an unicode error) if your system is configured to use latin1 (ex:

[issue13559] Use sendfile where possible in httplib

2014-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- dependencies: +Add a new socket.sendfile() method versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13559

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Interesting. It seems pw_gecos isn't mandated by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pwd.h.html I wonder if there's a better way to do this (autoconf check?) than an Android-specific #ifdef, though. -- nosy: +pitrou

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: With the latest patch the decimal benchmark with a lot of small allocations is consistently 2% slower. Large factorials (where the operands are initialized to zero for the number-theoretic transform) have the same performance with and without the patch. It would

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: You can pass keyword arguments to tarfile.open(), which will be passed to the TarFile constructor. You can also use pass fileobj arguments to tarfile.open(). -- ___ Python tracker rep...@bugs.python.org

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the patch, Jessica. It seems to work under Windows here. -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13204 ___

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7052fdd90a11 by Antoine Pitrou in branch '3.4': Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it raises a TypeError. http://hg.python.org/cpython/rev/7052fdd90a11 New changeset a14012352f65 by Antoine Pitrou in branch

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Sworddragon
Sworddragon added the comment: Interesting, after reading the documentation again I would now assume that is what **kwargs is for. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369 ___

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patch to 3.4 and 3.5. I'm closing the issue, I don't think fixing 2.7 is important at this point. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: Jup. That's it. -- priority: normal - low resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: Depleting /dev/urandom isn't actually a thing. /dev/urandom on all modern *nix OSs uses a fast PRNG which is secure as long as it has received enough bytes of initial entropy. -- ___ Python tracker

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Depleting /dev/urandom isn't actually a thing. /dev/urandom on all modern *nix OSs uses a fast PRNG which is secure as long as it has received enough bytes of initial entropy. I didn't say deplete /dev/urandom, I said that when reading from

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Is accessing _fields a common operation? Personally I'd use a PyGetSetDef and generate the tuple on access (perhaps cache the result). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820

[issue13096] ctypes: segfault with large POINTER type names

2014-04-28 Thread Meador Inge
Meador Inge added the comment: Thanks for the review and reminder about this issue, jesstess. I will apply the patch later today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13096 ___

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2014-04-28 Thread Shiz
Shiz added the comment: Ah, yes, if it's not actually mandated by POSIX, something like HAVE_PASSWD_PW_GECOS would be more appropriate. I'll rework the patch into something more generic. -- ___ Python tracker rep...@bugs.python.org

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: I don't think what you're worrying about here is something that has a high chance of happening, if it even occurs in the wild at all. To be clear in order for that to matter at all in the context of this ticket, some software would need to be reading from

[issue21373] robotparser: Automatically call modified function in read()

2014-04-28 Thread Maxime Lorant
New submission from Maxime Lorant: For the moment, RobotFileParser (on both Python 2.x and 3.x) has a method modified, but it is never called in the class itself, hence the last_checked attribute is always at 0 if the user doesn't call modified() explicitly. I would suggest to add a call to

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread William Tisäter
William Tisäter added the comment: That makes sense. I proceeded and updated `Lib/gzip.py` to use `io.DEFAULT_BUFFER_SIZE` instead. This will change the existing behaviour in two ways: * Start using 1024 * 8 as buffer size instead of 1024. * Add one more kwarg (`buffer_size`) to

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Using os.urandom is the *right* thing to do for getting random in an application, but the current implementation effectively punishes people who use it if their application is highly concurrent. And I argue that this scenario is almost as likely

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread akira
akira added the comment: I've updated the patch: - fixed the code example in the documentation to use int instead of float result - removed assertion on the int returned type (float won't lose precision for the practical dates but guaranteeing an integer would be nice) - reworded the scary

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: But backporting always has a risk, which has to be balanced. Sure, which is why a PEP was written, discussed and accepted to find that balance. -- ___ Python tracker rep...@bugs.python.org

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: With the latest patch the decimal benchmark with a lot of small allocations is consistently 2% slower. Does your benchmark use bytes(int) or bytearray(int)? If not, I guess that your benchmark is not reliable because only these two functions are changed by

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: I confirm the bug. The patch looks good. -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21362 ___

[issue8776] Bytes version of sys.argv

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: I'd like to revisit this after PEP 432 is in place, since having to do this dance for arg processing when running on Linux in the POSIX locale is somewhat lame: argv = sys.argv encoding = locale.getpreferredencoding() # Hope nobody changed the locale!

[issue1599254] mailbox: other programs' messages can vanish without trace

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: pinging David Watson: What is the status? If I understand correctly, (and I may well not), you have already opened other issues for parts of this, and (only) the final patch is ready for patch (and hopefully) commit review. Is this correct? --

[issue20974] email module docs say not compatible with current python version

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: I don't know for sure if the compatibility claims are correct, but the patch looks good. -- stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20974

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Hmm, obmalloc.c changed as well, so already the gcc optimizer can take different paths and produce different results. Also I did set mpd_callocfunc to PyMem_Calloc(). 2% slowdown is far from being a tragic result, so I guess we can ignore that. The bytes()

[issue21374] DecimalTuple.__module__ is set to _frozen_importlib

2014-04-28 Thread Stefan Krah
New submission from Stefan Krah: x = Decimal(9).as_tuple() import pickle pickle.dumps(x) Traceback (most recent call last): File stdin, line 1, in module _pickle.PicklingError: Can't pickle class '_frozen_importlib.DecimalTuple': attribute lookup DecimalTuple on _frozen_importlib failed

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Also I did set mpd_callocfunc to PyMem_Calloc(). 2% slowdown is far from being a tragic result, so I guess we can ignore that. Agreed. The bytes() speedup is very nice. Allocations that took one second are practically instant now. Indeed. Victor,

[issue19354] test_format fails on RHEL-6

2014-04-28 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- resolution: - out of date stage: - resolved status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19354 ___

[issue21370] segfault from simple traceback.format_exc call

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: I cannot reproduce this. Which platform? Does it happen with Python 3.4? -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21370 ___

[issue21354] PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers

2014-04-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Ok, I'll take a look. Sorry, probably I've missed python3.def file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21354 ___

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: Victor was referring to code like print(os.listdir()). Those are the motivating cases for ensuring round trips from system APIs to the standard streams work correctly. There's also the problem that sys.argv currently relies on the locale encoding directly,

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: The conclusion I have come to is that any further decoupling of Python 3 from the locale encoding will actually depend on getting the PEP 432 bootstrapping changes implemented, reviewed and the PEP approved, so we have more interpreter infrastructure in

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: Antoine Pitrou added the comment: Yeah. My proposal had more to do with the fact that we should some day switch to utf-8 by default on all POSIX systems, regardless of what the system advertises as best encoding. Yeah, that seems like a plausible future to me

[issue1533105] NetBSD build with --with-pydebug causes SIGSEGV

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Given msg84518 and msg118909 I think this can be closed. -- resolution: - out of date stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1533105

[issue21375] Fix and test overflow behavior in the C version of heapq

2014-04-28 Thread Raymond Hettinger
New submission from Raymond Hettinger: The Py_ssizet indexes can overflow the childpos variable: childpos = 2*pos + 1;/* leftmost child position */ while (childpos endpos) ... http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html --

[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Philip Sequeira
New submission from Philip Sequeira: Example: https://docs.python.org/3.4/library/asyncio-task.html TimeoutError is mentioned several times, and links to the OSError subclass. However, the actual TimeoutError raised by asyncio stuff is the one from concurrent.futures, which is not compatible.

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: So I'd suggest, instead of using an hardcoded value, to simply reuse io.DEFAULT_BUFFER_SIZE. That way, if some day we decide to change it, all user code wil benefit from the change. I don't think io.DEFAULT_BUFFER_SIZE makes much sense as a heuristic for

[issue1284316] Win32: Security problem with default installation directory

2014-04-28 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- nosy: +steve.dower ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1284316 ___ ___

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the updated patch, Akira! I'm gonna take a look right now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19940 ___

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: I don't think io.DEFAULT_BUFFER_SIZE makes much sense as a heuristic for the gzip module (or compressed files in general). Perhaps gzip should get its own DEFAULT_BUFFER_SIZE? Do you mean from a namespace point of vue, or from a performance point

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patch. Thank you very much for contributing! -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19940

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sure, it might not be optimal for compressed files, but I gues that the optimal value is function of the compression-level block size and many other factors which are just too varied to come up with a reasonable heuristic. Well, I think that compressed

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7191c37238d5 by Antoine Pitrou in branch 'default': Issue #19940: ssl.cert_time_to_seconds() now interprets the given time string in the UTC timezone (as specified in RFC 5280), not the local timezone. http://hg.python.org/cpython/rev/7191c37238d5

  1   2   >