Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: Sounds like a useful technique. The text snippets that I'm compressing are indeed mostly English words, and 7-bit ascii, so it would be practical to use a compression library that just uses the same good-enough encodings every time, so that you don't

Re: syntax for code blocks

2012-05-04 Thread Ben Finney
alex23 wuwe...@gmail.com writes: The examples here are a wonder to behold as well: http://mtomassoli.wordpress.com/2012/04/20/code-blocks-in-python/ Wow. “What really happens is that rewrite rewrites the code, executes it and quits.” Please keep this far away from anything resembling Python.

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 3, 11:03 pm, Paul Rubin no.em...@nospam.invalid wrote: Steve Howell showel...@yahoo.com writes: Sounds like a useful technique.  The text snippets that I'm compressing are indeed mostly English words, and 7-bit ascii, so it would be practical to use a compression library that just

[image-SIG] img.show() does not seem to work.

2012-05-04 Thread Neru Yumekui
I am trying to get Image.show() to work, but seem to struggle with it. Thus far I have been using PIL on Windows, and it has worked fine and all - But I recently installed it on a Linux-machine, where img.show does not seem to work (All other features apart from screengrab seems to work well).

python sandbox question

2012-05-04 Thread viral shah
Hi Can anyone answer these two questions : I have two questions regarding Pysandbox: 1.) How do I achieve the functionality of eval? I understand sandbox.execute() is equivalent to exec, but I can't find anything such that if the code entered were 2 + 2, then it would return 4, or something to

Re: ![CDATA[]] vs. BeautifulSoup

2012-05-04 Thread Stefan Behnel
Ian Kelly, 04.05.2012 01:02: BeautifulSoup is supposed to parse like a browser would Not at all, that would be html5lib. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: compressor = zlib.compressobj() s = compressor.compress(foobar) s += compressor.flush(zlib.Z_SYNC_FLUSH) s_start = s compressor2 = compressor.copy() I think you also want to make a decompressor here, and initialize it with s and

Re: key/value store optimized for disk storage

2012-05-04 Thread Dan Stromberg
On Thu, May 3, 2012 at 11:03 PM, Paul Rubin no.email@nospam.invalid wrote: Sort of as you suggest, you could build a Huffman encoding for a representative run of data, save that tree off somewhere, and then use it for all your future encoding/decoding. Zlib is better than Huffman in my

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 3, 11:59 pm, Paul Rubin no.em...@nospam.invalid wrote: Steve Howell showel...@yahoo.com writes:     compressor = zlib.compressobj()     s = compressor.compress(foobar)     s += compressor.flush(zlib.Z_SYNC_FLUSH)     s_start = s     compressor2 = compressor.copy() I think you

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: Makes sense. I believe I got that part correct: https://github.com/showell/KeyValue/blob/master/salted_compressor.py The API looks nice, but your compress method makes no sense. Why do you include s.prefix in s and then strip it off? Why do you

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 4, 1:01 am, Paul Rubin no.em...@nospam.invalid wrote: Steve Howell showel...@yahoo.com writes: Makes sense.  I believe I got that part correct:  https://github.com/showell/KeyValue/blob/master/salted_compressor.py The API looks nice, but your compress method makes no sense.  Why do

Re: Create directories and modify files with Python

2012-05-04 Thread Hans Mulder
On 1/05/12 17:34:57, ru...@yahoo.com wrote: from __future__ import print_function #1 #1: Not sure whether you're using Python 2 or 3. I ran this on Python 2.7 and think it will run on Python 3 if you remove this line. You

Re: pyjamas / pyjs

2012-05-04 Thread Terry Reedy
On 5/4/2012 12:52 AM, John O'Hagan wrote: Just read the thread on pyjamas-dev. Even without knowing anything about the lead-up to the coup, its leader's linguistic contortions trying to justify it And what is the name of the miscreant, so we know who to have nothing to with? -- Terry Jan

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: You should be able to just get the incremental bit. This is fixed now. Nice. It it's in the header, wouldn't it be part of the output that comes before Z_SYNC_FLUSH? Hmm, maybe you are right. My version was several years ago and I don't remember it

Re: pyjamas / pyjs

2012-05-04 Thread james hedley
On Thursday, 3 May 2012 12:52:36 UTC+1, alex23 wrote: Anyone else following the apparent hijack of the pyjs project from its lead developer? Yes, me. The guy now in control got the owner of the domain name to turn it over to him, which is probably ok legally, but he had no public mandate or

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Peng Yu
On Thu, May 3, 2012 at 11:16 PM, Terry Reedy tjre...@udel.edu wrote: On 5/3/2012 8:36 PM, Peng Yu wrote: Hi, list(a_set) When convert two sets with the same elements to two lists, are the lists always going to be the same (i.e., the elements in each list are ordered the same)? Is it

Re: pyjamas / pyjs

2012-05-04 Thread james hedley
By the way, there's a lot more to say on this, which I'll cover another time. There are arguments for and against what's happened; at this stage I'm just trying to flag up that there is *not* unanimity and we are not just carrying on as normal. --

Re: syntax for code blocks

2012-05-04 Thread Kiuhnm
On 5/4/2012 4:44, alex23 wrote: On May 4, 2:17 am, Kiuhnmkiuhnm03.4t.yahoo.it wrote: On 5/3/2012 2:20, alex23 wrote: locals() is a dict. It's not injecting anything into func's scope other than a dict so there's not going to be any name clashes. If you don't want any of its content in your

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Chris Angelico
On Fri, May 4, 2012 at 8:14 PM, Peng Yu pengyu...@gmail.com wrote: Thanks. This is what I'm looking for. I think that this should be added to the python document as a manifestation (but nonnormalized) of what A set object is an unordered collection of distinct hashable objects means. There

Re: syntax for code blocks

2012-05-04 Thread Chris Angelico
On Fri, May 4, 2012 at 9:12 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: If I and my group of programmers devised a good and concise syntax and semantics to describe some applicative domain, then we would want to translate that into the language we use. Unfortunately, Python doesn't

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 6:21 AM, Chris Angelico ros...@gmail.com wrote: On Fri, May 4, 2012 at 8:14 PM, Peng Yu pengyu...@gmail.com wrote: Thanks. This is what I'm looking for. I think that this should be added to the python document as a manifestation (but nonnormalized) of what A set object

set PYTHONPATH for a directory?

2012-05-04 Thread Neal Becker
I'm testing some software I'm building against an alternative version of a library. So I have an alternative library in directory L. Then I have in an unrelated directory, the test software, which I need to use the library version from directory L. One approach is to set PYTHONPATH whenever

Re: numpy (matrix solver) - python vs. matlab

2012-05-04 Thread someone
On 05/04/2012 05:52 AM, Steven D'Aprano wrote: On Thu, 03 May 2012 19:30:35 +0200, someone wrote: So how do you explain that the natural frequencies from FEM (with condition number ~1e6) generally correlates really good with real measurements (within approx. 5%), at least for the first 3-4

Re: numpy (matrix solver) - python vs. matlab

2012-05-04 Thread someone
On 05/04/2012 06:15 AM, Russ P. wrote: On May 3, 4:59 pm, someonenewsbo...@gmail.com wrote: On 05/04/2012 12:58 AM, Russ P. wrote: Ok, but I just don't understand what's in the empirical category, sorry... I didn't look it up, but as far as I know, empirical just means based on experiment,

Re: pyjamas / pyjs

2012-05-04 Thread Duncan Booth
james hedley jameskhed...@gmail.com wrote: There's also an allegation, which I am not making myself at this point - only describing its nature, that a person may have lifted data from the original mail server without authorisation and used it to recreate the mailing list on a different

Re: set PYTHONPATH for a directory?

2012-05-04 Thread Dave Angel
On 05/04/2012 08:21 AM, Neal Becker wrote: I'm testing some software I'm building against an alternative version of a library. So I have an alternative library in directory L. Then I have in an unrelated directory, the test software, which I need to use the library version from

Re: set PYTHONPATH for a directory?

2012-05-04 Thread Pedro Larroy
Isn't virtualenv for this kind of scenario? Pedro. On Fri, May 4, 2012 at 3:46 PM, Dave Angel d...@davea.name wrote: On 05/04/2012 08:21 AM, Neal Becker wrote: I'm testing some software I'm building against an alternative version of a library.  So I have an alternative library in directory

Re: ![CDATA[]] vs. BeautifulSoup

2012-05-04 Thread Ian Kelly
On Fri, May 4, 2012 at 12:57 AM, Stefan Behnel stefan...@behnel.de wrote: Ian Kelly, 04.05.2012 01:02: BeautifulSoup is supposed to parse like a browser would Not at all, that would be html5lib. Well, I guess that depends on whether we're talking about BeautifulSoup 3 (a regex-based screen

Re: syntax for code blocks

2012-05-04 Thread Michael Torrie
On 05/04/2012 05:12 AM, Kiuhnm wrote: Hand-wavy, no real example, doesn't make sense. Really? Then I don't know what would make sense to you. Speaking as as an observer here, I've read your blog post, and looked at your examples. They don't make sense to me either. They aren't real

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 3, 6:10 pm, Miki Tebeka miki.teb...@gmail.com wrote: I'm looking for a fairly lightweight key/value store that works for this type of problem: I'd start with a benchmark and try some of the things that are already in the standard library: - bsddb - sqlite3 (table of key, value,

Re: syntax for code blocks

2012-05-04 Thread Temia Eszteri
You know what I find rich about all of this? [ ... ] I'd like to change the syntax of my module 'codeblocks' to make it more [ ... ] pythonic. Kiuhnm posted a thread to the group asking us to help him make it more Pythonic, but he has steadfastly refused every single piece of help he was

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 10:27, Steve Howell wrote: On May 3, 6:10 pm, Miki Tebeka miki.teb...@gmail.com wrote: I'm looking for a fairly lightweight key/value store that works for this type of problem: I'd start with a benchmark and try some of the things that are already in the standard library: -

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
On 5/4/2012 8:00 AM, Peng Yu wrote: On Fri, May 4, 2012 at 6:21 AM, Chris Angelicoros...@gmail.com wrote: On Fri, May 4, 2012 at 8:14 PM, Peng Yupengyu...@gmail.com wrote: Thanks. This is what I'm looking for. I think that this should be added to the python document as a manifestation (but

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 12:22, Steve Howell wrote: Which variant do you recommend? anydbm is a generic interface to variants of the DBM database — dbhash (requires bsddb), gdbm, or dbm. If none of these modules is installed, the slow-but-simple implementation in module dumbdbm will be used. If

RE: most efficient way of populating a combobox (in maya)

2012-05-04 Thread Prasad, Ramit
I'm making a GUI in maya using python only and I'm trying to see which is more efficient. I'm trying to populate an optionMenuGrp / combo box whose contents come from os.listdir(folder). Now this is fine if the folder isn't that full but the folder has a few hundred items (almost in the

Re: key/value store optimized for disk storage

2012-05-04 Thread Emile van Sebille
On 5/4/2012 10:46 AM Tim Chase said... I hit a few snags testing this on my winxp w/python2.6.1 in that getsize wasn't finding the file as it was created in two parts with .dat and .dir extension. Also, setting key failed as update returns None. The changes I needed to make are marked

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 14:14, Emile van Sebille wrote: On 5/4/2012 10:46 AM Tim Chase said... I hit a few snags testing this on my winxp w/python2.6.1 in that getsize wasn't finding the file as it was created in two parts with .dat and .dir extension. Hrm...must be a Win32 vs Linux thing. Also,

pickle question: sequencing of operations

2012-05-04 Thread Russell E. Owen
What is the sequence of calls when unpickling a class with __setstate__? From experimentation I see that __setstate__ is called and __init__ is not, but I think I need more info. I'm trying to pickle an instance of a class that is a subclass of another class that contains unpickleable objects.

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 12:43 PM, Terry Reedy tjre...@udel.edu wrote: On 5/4/2012 8:00 AM, Peng Yu wrote: On Fri, May 4, 2012 at 6:21 AM, Chris Angelicoros...@gmail.com  wrote: On Fri, May 4, 2012 at 8:14 PM, Peng Yupengyu...@gmail.com  wrote: Thanks. This is what I'm looking for. I think

Re: key/value store optimized for disk storage

2012-05-04 Thread Emile van Sebille
On 5/4/2012 12:49 PM Tim Chase said... On 05/04/12 14:14, Emile van Sebille wrote: On 5/4/2012 10:46 AM Tim Chase said... I hit a few snags testing this on my winxp w/python2.6.1 in that getsize wasn't finding the file as it was created in two parts with .dat and .dir extension. Hrm...must

for loop: weird behavior

2012-05-04 Thread ferreirafm
Hi there, I simply can't print anything in the second for-loop bellow: # #!/usr/bin/env python import sys filename = sys.argv[1]

Re: for loop: weird behavior

2012-05-04 Thread Terry Reedy
On 5/4/2012 4:33 PM, ferreirafm wrote: Hi there, I simply can't print anything in the second for-loop bellow: # #!/usr/bin/env python import sys filename = sys.argv[1] outname = filename.split('.')[0] + '_pdr.dat' begin = 'Distance distribution' end =

Re: recruiter spam

2012-05-04 Thread Chris Withers
Please don't spam the list with job adverts, post to the job board instead: http://www.python.org/community/jobs/howto/ cheers, Chris On 03/05/2012 22:13, Preeti Bhattad wrote: Hi there, If you have USA work visa and if you reside in USA; -- Simplistix - Content Management, Batch

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Cameron Simpson
On 04May2012 15:08, Peng Yu pengyu...@gmail.com wrote: | On Fri, May 4, 2012 at 12:43 PM, Terry Reedy tjre...@udel.edu wrote: | On 5/4/2012 8:00 AM, Peng Yu wrote: | On Fri, May 4, 2012 at 6:21 AM, Chris Angelicoros...@gmail.com  wrote: | On Fri, May 4, 2012 at 8:14 PM, Peng

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 6:12 PM, Cameron Simpson c...@zip.com.au wrote: On 04May2012 15:08, Peng Yu pengyu...@gmail.com wrote: | On Fri, May 4, 2012 at 12:43 PM, Terry Reedy tjre...@udel.edu wrote: | On 5/4/2012 8:00 AM, Peng Yu wrote: | On Fri, May 4, 2012 at 6:21 AM, Chris

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Mark Lawrence
On 05/05/2012 00:37, Peng Yu wrote: My point is if something is said in the document, it is better to be substantiated by an example. I don't think that this has anything with learn the spec from behaviour. I side with the comments made by Terry Reedy and Cameron Simpson so please give it a

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
Peng, I actually am thinking about it. Underlying problem: while unordered means conceptually unordered as far as the collection goes, the items in the collection, if homogenous enough, may have a natural order, which users find hard to ignore. Even if not comparable, an implementation such

[issue14719] Lists: [[0]*N]*N != [[0 for _ in range(N)] for __ in range(N)]

2012-05-04 Thread Yuval Greenfield
Yuval Greenfield ubershme...@gmail.com added the comment: This isn't a bug and should be closed. It's more of a stack overflow question. If you'd like to change this fundamental behavior of a very common operation in python you should make a proposal to the python ideas mailing list at

[issue14719] Lists: [[0]*N]*N != [[0 for _ in range(N)] for __ in range(N)]

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It's actually fairly easy to explain. Just think about it harder (and consider Yuval's explanation). -- nosy: +loewis resolution: - invalid status: open - closed ___ Python tracker

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: bba131e48852 causes crashes on Windows. The attached patch fixes the crash and makes test_os pass for me. However, using PyErr_ExceptionMatches(PyExc_RuntimeError) to check whether to try again using narrow strings is ugly. Maybe

[issue14720] sqlite3 microseconds

2012-05-04 Thread Frank Millman
New submission from Frank Millman fr...@chagford.com: sqlite3/dbapi2.py contains the following - def convert_timestamp(val): datepart, timepart = val.split(b ) timepart_full = timepart.split(b.) [...] if len(timepart_full) == 2: microseconds =

[issue14719] Lists: [[0]*N]*N != [[0 for _ in range(N)] for __ in range(N)]

2012-05-04 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list http://python.net/crew/mwh/hacks/objectthink.html -- nosy: +ezio.melotti stage: - committed/rejected ___

[issue14654] Faster utf-8 decoding

2012-05-04 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: title: More fast utf-8 decoding - Faster utf-8 decoding Éric, there is already an issue (#4868) with this title. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14654

[issue14654] Faster utf-8 decoding

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: There is nothing wrong with two issues having the same title. Of course, it would be best if the title reflected the *actual* defect or change, such as specialize UTF-8 decoding by character width, or some such. In any case, the title

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: TBH I don't understand why it should crash, and therefore how your patch helps. Trying again using narrow strings should always work; indeed, the code did that before I touched it. Can you describe how it crashes? The important part

[issue14654] Faster utf-8 decoding

2012-05-04 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Thank you, Martin, this is what I had in mind. Lost in translation. ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14654 ___

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Without the check for RuntimeError os.utime(foo, times=(5,5), ns=(5,5)) raises TypeError(TypeError: 'str' does not support the buffer interface) because we have fallen through to the narrow path. The correct error is

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Let me recap, just to make sure I have it straight. There are two errors on Windows: * The ! on (what is currently) line 3770 is wrong: if (!utime_read_time_arguments(ua)) { * If you pass in a Unicode string but also pass in both times

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Let me recap, just to make sure I have it straight. There are two errors on Windows: That's right. The patch looks good and passes for me on Windows. -- ___ Python tracker

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset fc5d2f4291ac by Larry Hastings in branch 'default': Issue #14127: Fix two bugs with the Windows implementation. http://hg.python.org/cpython/rev/fc5d2f4291ac -- ___

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
New submission from Arve Knudsen arve.knud...@gmail.com: httplib doesn't specify the HTTP header 'content-length' for POST requests without data. Conceptually this makes sense, considering the empty content. However, IIS (7.5) servers don't accept such requests and respond with a 411 status

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: The patch looks good to me. Are there any places in the current code base that would use P? p seems the more useful case. Are you planning on changing existing code to use P or p, or just use it going forward? -- nosy: +eric.smith

[issue14572] 2.7.3: sqlite module does not build on centos 5 and Mac OS X 10.4

2012-05-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Mac OS X 10.4 is also affected and for the same reason. SQLite builds fine for Python 2.5 and 2.6, but not for 2.7. -- nosy: +lemburg title: 2.7.3: sqlite module does not build on centos 5 - 2.7.3: sqlite module does not build on

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I also think that 'P' looks too strict to be really useful. I can't think of too many cases where I'd really want to insist on a boolean argument (and reject values of 0 or 1). Maybe implement just 'p' for now and consider 'P' later?

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: There is another problem causing a fatal error in test_posix on Unix. The attached patch fixes it: *ua-path should be decrefed not ua-path. -- Added file: http://bugs.python.org/file25452/utime_read_time_arguments.patch

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Looks good to me. You're a core contributor, yes? If not let me know and I'll commit it. Though I must admit I'm baffled how I haven't seen that crash. I've run the unit tests a zillion times on this patch. --

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Looks good to me. You're a core contributor, yes? If not let me know and I'll commit it. I will commit. Though I must admit I'm baffled how I haven't seen that crash. I've run the unit tests a zillion times on this patch. Were you

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: By the unit tests I meant I ran the whole suite: Lib/test/regrtest.py. I know that runs test_os, and I assume it runs test_posix too. I just ran test_posix by hand and it passed. I'm developing on Linux (64-bit) in case that helps.

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I looked through the Python sources and couldn't find any instances of a function or method with an argument that only allowed you to pass in either True or False. Serily already said he would use 'P' over 'p', although I too am

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I'm developing on Linux (64-bit) in case that helps. I tested it on 32 bit Linux. I have committed it, but I forgot to put the issue number in the commit message. -- ___ Python tracker

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Revision 4deb7c1f49b9 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14127 ___ ___

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think there should be a test case also where PyObject_IsTrue gives an exception (which I think can happen if __bool__ raises an exception). -- nosy: +loewis ___ Python tracker

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I think there should be a test case also where PyObject_IsTrue gives an exception (which I think can happen if __bool__ raises an exception). I'd be happy to add such a test, but I don't know of any types like that. Can anyone suggest

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think there should be a test case also where PyObject_IsTrue gives an exception (which I think can happen if __bool__ raises an exception). I'd be happy to add such a test, but I don't know of any types like that. Can anyone suggest

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Added test forcing a failure for 'p' (and 'P'). This made me have to handle errors a little differently, so it was definitely good to test it. Thanks for the suggestion, Martin! Also changed wording in documentation ever-so-slightly.

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: Now that I think about this some more, I think I'd structure the 'p' tests as: for expr in [False, None, True, 1, 0]: # add the rest self.assertEqual(bool(expr), getargs_p(expr)) Since the salient point is that 'p' returns the same value

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Serily: why would you unhesitatingly prefer 'P' to 'p'? My name is Serhiy. :) 'P' has the advantage that you can safely backward-compatibly remove the restriction by replacing 'P' on 'p'. :) I also found some funny in-between cases.

[issue14720] sqlite3 microseconds

2012-05-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ghaering versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14720 ___

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Since the salient point is that 'p' returns the same value as bool(), right? Yes, and bool_new() is a candidate number one for using new feature. -- ___ Python tracker rep...@bugs.python.org

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: If bool_new() is going to use 'p', then my suggestion shouldn't be the only test of 'p'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14705

[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: In this line in the patch (Python/getargs.c): +if (val == -1 || PyErr_Occurred()) { Isn't that call to PyErr_Occurred() redundant? -- ___ Python tracker rep...@bugs.python.org

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Could you provide a patch? Does this affect 3.x too? -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721 ___

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - test needed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721 ___

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: I can look into patch and 3.x tonight I think. Should I provide a test with an eventual patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721

[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-04 Thread Serhiy Storchaka
New submission from Serhiy Storchaka storch...@gmail.com: In function convertsimple() in Python/getargs.c possible converting out of float range value from double to float. Fortunately, 'f' format character is not used in CPython source code. But it can be used in the extensions. Tests will

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Patch with test, please :-). I know it is a pain in the ass, but the result is having a higher quality python. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721

[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I don't think this change should be made for 2.7 or 3.2, since it has potential to break existing code. Though technically, conversion of an out-of-range double to a float gives undefined behaviour (C99 6.3.1.5p2), I'm willing to bet that

[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14722 ___ ___ Python-bugs-list mailing

[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I was just remembering that I was *sure* I'd seen the double-float avoiding undefined behaviour issue mentioned on a C mailing list not so long ago. Turns out that there was a good reason for me remembering that...

[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14722 ___ ___

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +orsenthil stage: test needed - needs patch versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721 ___

[issue14720] sqlite3 microseconds

2012-05-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Can be reproduced with: con = sqlite3.connect(:memory:, detect_types=sqlite3.PARSE_DECLTYPES) cur = con.cursor() cur.execute(CREATE TABLE t (x TIMESTAMP)) sqlite3.Cursor object at 0x7f90a4f69ea0 cur.execute(INSERT INTO t (x) VALUES

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Piotr Dobrogost
Piotr Dobrogost p...@bugs.python.dobrogost.net added the comment: Fiddler reports that it receives the following headers for the POST request Python 3.2.3 on Windows Vista 64bit gives the same output for import http.client conn = http.client.HTTPConnection('localhost',) conn.request(POST,

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721 ___ ___ Python-bugs-list

[issue14710] pkgutil.get_loader is broken

2012-05-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14710 ___ ___ Python-bugs-list

[issue14093] Mercurial version information not appearing in Windows builds

2012-05-04 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: I'd like to commit this soon. Any chance of a review? It's a very small patch, so it shouldn't need much time. -- keywords: +needs review -patch ___ Python tracker rep...@bugs.python.org

[issue14654] Faster utf-8 decoding

2012-05-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: 64-bit Linux, Intel Core i5-2500K CPU @ 3.30GHz: vanilla 3.3 patch 2 patch 3 utf-8 'A'*1 6931 (+3%)7115 (+0%) 7117 utf-8 'A'*+'\x80'

[issue14703] Update PEP metaprocesses to describe PEP czar role

2012-05-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14703 ___ ___ Python-bugs-list

[issue14693] hashlib fallback modules should be built even if openssl *is* available at build time

2012-05-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14693 ___ ___ Python-bugs-list

[issue14093] Mercurial version information not appearing in Windows builds

2012-05-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Please go ahead and apply it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14093 ___ ___

  1   2   >