[ANN] mock 1.0.0 released

2012-10-08 Thread Michael Foord
Hey all, I'm pleased to announce that mock 1.0.0 has been released. This is the standard library version, mock 1.0.0 has feature parity with unittest.mock in the Python 3.3 standard library. mock is a library for testing in Python. It allows you to replace parts of your system under test with

Re: Reading properties file in Python, except using ConfigParser()

2012-10-08 Thread justmailharsh
On Friday, October 5, 2012 5:03:01 PM UTC+5:30, Günther Dietrich wrote: justmailha...@gmail.com wrote: How to read properties file in Python? I found ConfigParser() but it has a 'section' limitation, so looking for other alternatives. Have a look at PyYAML. Best

To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread iMath
To get the accurate value of 1 - 0.999 ,how to implement the python algorithm ? BTW ,Windows’s calculator get the accurate value ,anyone who knows how to implement it ? -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pylint 0.26 / logilab-astng 0.24.1

2012-10-08 Thread Sylvain Thénault
Hi all, I'm very pleased to announce new releases of Pylint and underlying ASTNG library, respectivly 0.26 and 0.24.1. The great news is that both bring a lot of new features and some bug fixes, mostly provided by the community effort. We're still trying to make it easier to contribute on our

Re: How to control the internet explorer?

2012-10-08 Thread yujian
Thank you On Mon, Oct 8, 2012 at 11:37 AM, alex23 wuwe...@gmail.com wrote: On Oct 8, 1:03 pm, yujian yujian4newsgr...@gmail.com wrote: I want to save all the URLs in current opened windows, and then close all the windows. Try mechanize or Selenium. --

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Dave Angel
On 10/08/2012 10:07 AM, iMath wrote: To get the accurate value of 1 - 0.999 ,how to implement the python algorithm ? BTW ,Windows’s calculator get the accurate value ,anyone who knows how to implement it ? Windows calculator is an application, not a programming language. Like

Re: Question on Python Split

2012-10-08 Thread subhabangalore
On Monday, October 8, 2012 1:00:52 AM UTC+5:30, subhaba...@gmail.com wrote: Dear Group, Suppose I have a string as, Project Gutenberg has 36000 free ebooks for Kindle Android iPad iPhone. I am terming it as, str1= Project Gutenberg has 36000 free ebooks for Kindle

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Chris Angelico
On Tue, Oct 9, 2012 at 1:48 AM, Dave Angel d...@davea.name wrote: import decimal a = decimal.Decimal(4.3) print(a) 5.0996447286321199499070644378662109375 Ah, the delights of copy-paste :) The Decimal class has the disadvantage that it's tons slower on any modern machine I

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Dave Angel
On 10/08/2012 11:00 AM, Chris Angelico wrote: On Tue, Oct 9, 2012 at 1:48 AM, Dave Angel d...@davea.name wrote: import decimal a = decimal.Decimal(4.3) print(a) 5.0996447286321199499070644378662109375 Ah, the delights of copy-paste :) The Decimal class has the disadvantage

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Chris Angelico
On Tue, Oct 9, 2012 at 2:13 AM, Dave Angel d...@davea.name wrote: On 10/08/2012 11:00 AM, Chris Angelico wrote: On Tue, Oct 9, 2012 at 1:48 AM, Dave Angel d...@davea.name wrote: The Decimal class has the disadvantage that it's tons slower on any modern machine I know of... Isn't it true,

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Ulrich Eckhardt
Am 08.10.2012 16:07, schrieb iMath: To get the accurate value of 1 - 0.999 ,how to implement the python algorithm ? Algorithms are generally language-agnostic, so what is your question BTW ,Windows’s calculator get the accurate value ,anyone who knows how to implement it ?

how to build Object for List data

2012-10-08 Thread moonhkt
Hi All I have Data call FM01. Each format have F1.. F50 Fields. And Global Program G1..Gn. The format like below as text file FM01 Fld #FieldValidation 1F1 N/A 2F2 N/A 3F3 Program1,1,2,3 # Add F1 and F2 value to F3 4F4

Re: how to build Object for List data

2012-10-08 Thread Laszlo Nagy
Seq validation 1 Program3,1,3,4 # max(F1,F3) to F4 .. n How to using python to Read the text file, Build the data as object class ? Open the file using the open() command. Then iterate over the lines within a stateful algorithm that parses the lines with regular expressions.

Re: how to build Object for List data

2012-10-08 Thread Joel Goldstick
On Mon, Oct 8, 2012 at 2:50 PM, Laszlo Nagy gand...@shopzeus.com wrote: Seq validation 1 Program3,1,3,4 # max(F1,F3) to F4 .. n How to using python to Read the text file, Build the data as object class ? Open the file using the open() command. Then iterate over the lines

Insert item before each element of a list

2012-10-08 Thread mooremathewl
What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in range(len(x y ['insertme', 1, 'insertme', 2, 'insertme', 3]

Re: Insert item before each element of a list

2012-10-08 Thread Ian Kelly
On Mon, Oct 8, 2012 at 1:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in

Re: Insert item before each element of a list

2012-10-08 Thread Chris Kaynor
On Mon, Oct 8, 2012 at 12:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i

Re: Insert item before each element of a list

2012-10-08 Thread MRAB
On 2012-10-08 20:28, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in

Re: Insert item before each element of a list

2012-10-08 Thread Joshua Landau
On 8 October 2012 20:28, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in

Re: Insert item before each element of a list

2012-10-08 Thread Ian Kelly
On Mon, Oct 8, 2012 at 1:52 PM, Joshua Landau joshua.landau...@gmail.com wrote: But it's not far. I wouldn't use Ian Kelly's method (no offence), because of len(x): it's less compatible with iterables. Others have ninja'd me with good comments, too. That's fair, I probably wouldn't use it

Re: Insert item before each element of a list

2012-10-08 Thread Agon Hajdari
On 10/08/2012 09:45 PM, Chris Kaynor wrote: [('insertme', i) for i in x] This is not enough, you have to merge it afterwards. y = [item for tup in y for item in tup] -- http://mail.python.org/mailman/listinfo/python-list

Re: Insert item before each element of a list

2012-10-08 Thread Peter Otten
mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in range(len(x y ['insertme',

RE: Insert item before each element of a list

2012-10-08 Thread Prasad, Ramit
Agon Hajdari wrote: Sent: Monday, October 08, 2012 3:12 PM To: python-list@python.org Subject: Re: Insert item before each element of a list On 10/08/2012 09:45 PM, Chris Kaynor wrote: [('insertme', i) for i in x] This is not enough, you have to merge it afterwards. Why do you say

Re: Insert item before each element of a list

2012-10-08 Thread Agon Hajdari
On 10/08/2012 11:15 PM, Prasad, Ramit wrote: Agon Hajdari wrote: Sent: Monday, October 08, 2012 3:12 PM To: python-list@python.org Subject: Re: Insert item before each element of a list On 10/08/2012 09:45 PM, Chris Kaynor wrote: [('insertme', i) for i in x] This is not enough, you have

Re: Unpaking Tuple

2012-10-08 Thread Thomas Bach
Hi there, On Sat, Oct 06, 2012 at 03:08:38PM +, Steven D'Aprano wrote: my_tuple = my_tuple[:4] a,b,c,d = my_tuple if len(my_tuple) == 4 else (my_tuple + (None,)*4)[:4] Are you sure this works as you expect? I just stumbled over the following: $ python Python 3.2.3 (default, Jun 25

RE: Insert item before each element of a list

2012-10-08 Thread Prasad, Ramit
Agon Hajdari wrote: On 10/08/2012 11:15 PM, Prasad, Ramit wrote: Agon Hajdari wrote: On 10/08/2012 09:45 PM, Chris Kaynor wrote: [('insertme', i) for i in x] This is not enough, you have to merge it afterwards. Why do you say that? It seems to work just fine for me. x [0, 1,

Re: Insert item before each element of a list

2012-10-08 Thread Paul Rubin
mooremath...@gmail.com writes: x = [1, 2, 3] .. y ['insertme', 1, 'insertme', 2, 'insertme', 3] def ix(prefix, x): for a in x: yield prefix yield a y = list(ix('insertme', x)) from itertools import * y = list(chain.from_iterable(izip(repeat('insertme'), x)))

Re: Unpaking Tuple

2012-10-08 Thread Joshua Landau
On 8 October 2012 22:45, Thomas Bach thb...@students.uni-mainz.de wrote: Hi there, On Sat, Oct 06, 2012 at 03:08:38PM +, Steven D'Aprano wrote: my_tuple = my_tuple[:4] a,b,c,d = my_tuple if len(my_tuple) == 4 else (my_tuple + (None,)*4)[:4] Are you sure this works as you expect?

Re: Insert item before each element of a list

2012-10-08 Thread Nobody
On Mon, 08 Oct 2012 12:28:43 -0700, mooremathewl wrote: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in range(len(x y ['insertme', 1, 'insertme', 2, 'insertme', 3] [i for j in [1,2,3] for i in ('insertme', j)]

RE: Unpaking Tuple

2012-10-08 Thread Prasad, Ramit
Thomas Bach wrote: Hi there, On Sat, Oct 06, 2012 at 03:08:38PM +, Steven D'Aprano wrote: my_tuple = my_tuple[:4] a,b,c,d = my_tuple if len(my_tuple) == 4 else (my_tuple + (None,)*4)[:4] Are you sure this works as you expect? I just stumbled over the following: $ python

Re: Plumbum (Shell Combinators) hits v1.0

2012-10-08 Thread Amirouche Boubekki
2012/10/6 Tomer Filiba tomerfil...@gmail.com http://plumbum.readthedocs.org/en/latest/index.html Ever wished the wrist-handiness of shell scripts be put into a real programming language? Say hello to Plumbum Shell Combinators. Plumbum (Latin for lead, which was used to create pipes back in

Re: Insert item before each element of a list

2012-10-08 Thread Alex
mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in range(len(x y

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Terry Reedy
On 10/8/2012 11:13 AM, Dave Angel wrote: Isn't it true, though, that Python 3.3 has a completely new implementation of decimal that largely removes this disadvantage? I wouldn't know, I'm on 3.2. However, I sincerely doubt if it's within a factor of 100 of the speed of the binary float, at

Re: Insert item before each element of a list

2012-10-08 Thread Terry Reedy
On 10/8/2012 3:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following: import itertools x = [1, 2, 3] y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in

Re: Insert item before each element of a list

2012-10-08 Thread Roy Smith
In article mailman.1976.1349747963.27098.python-l...@python.org, Terry Reedy tjre...@udel.edu wrote: On 10/8/2012 3:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following:

Re: To get the accurate value of 1 - 0.999999999999999 ,how to implement the python algorithm ?

2012-10-08 Thread Dave Angel
On 10/08/2012 09:45 PM, Terry Reedy wrote: On 10/8/2012 11:13 AM, Dave Angel wrote: Isn't it true, though, that Python 3.3 has a completely new implementation of decimal that largely removes this disadvantage? I wouldn't know, I'm on 3.2. However, I sincerely doubt if it's within a factor

Re: Insert item before each element of a list

2012-10-08 Thread rusi
On Oct 9, 7:06 am, Roy Smith r...@panix.com wrote: In article mailman.1976.1349747963.27098.python-l...@python.org,  Terry Reedy tjre...@udel.edu wrote: On 10/8/2012 3:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this?  Am I over-complicating it?  My

Re: Insert item before each element of a list

2012-10-08 Thread rusi
On Oct 9, 7:34 am, rusi rustompm...@gmail.com wrote: How about a 2-paren version? x = [1,2,3] reduce(operator.add,  [['insert', a] for a in x]) ['insert', 1, 'insert', 2, 'insert', 3] Or if one prefers the different parens on the other side: reduce(operator.add, (['insert', a] for a in

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread Token Type
yes, thanks all your tips. I did try sorted with itemgetter. However, the sorted results are same as follows whether I set reverse=True or reverse= False. Isn't it strange? Thanks. import nltk from nltk.corpus import wordnet as wn pairs = {'car':'automobile', 'gem':'jewel',

Re: Insert item before each element of a list

2012-10-08 Thread alex23
On Oct 9, 12:06 pm, Roy Smith r...@panix.com wrote: I'm going to go with this one.  I think people tend to over-abuse list comprehensions. I weep whenever I find `_ = [...]` in other people's code. -- http://mail.python.org/mailman/listinfo/python-list

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread Token Type
Dear all, the problem has been solved as follows. Thanks anyway: import nltk from nltk.corpus import wordnet as wn pairs = {'car':'automobile', 'gem':'jewel', 'journey':'voyage'} list_simi=[] for key in pairs: word1 = wn.synset(str(key) + '.n.01') word2 =

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread Ian Kelly
On Mon, Oct 8, 2012 at 9:13 PM, Token Type typeto...@gmail.com wrote: yes, thanks all your tips. I did try sorted with itemgetter. However, the sorted results are same as follows whether I set reverse=True or reverse= False. Isn't it strange? Thanks. First of all, sorted does not sort the

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread alex23
On Oct 9, 1:13 pm, Token Type typeto...@gmail.com wrote: yes, thanks all your tips. I did try sorted with itemgetter. However, the sorted results are same as follows whether I set reverse=True or reverse= False. Isn't it strange? Thanks. That's because you're sorting each entry individually,

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread Token Type
Thanks indeed for all your suggestions. When I try my above codes, what puzzles me is that when the data in the dictionary increase, some data become missing in the sorted result. Quite odd. In the pairs, we have {'journey':'voyage'} but in the sorted result no ('journey-voyage',0.25), which

Re: wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?

2012-10-08 Thread alex23
On Oct 9, 2:16 pm, Token Type typeto...@gmail.com wrote: When I try my above codes, what puzzles me is that when the data in the dictionary increase, some data become missing in the sorted result. Quite odd. In the pairs, we have {'journey':'voyage'} but in the sorted result no (

[issue13451] sched.py: speedup cancel() method

2012-10-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13451 ___ ___

[issue16099] robotparser doesn't support request rate and crawl delay parameters

2012-10-08 Thread Hynek Schlawack
Changes by Hynek Schlawack h...@ox.cx: -- nosy: +hynek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16099 ___ ___ Python-bugs-list mailing list

[issue12322] ElementPath 1.3 expressions documentation

2012-10-08 Thread Mike Hoy
Mike Hoy added the comment: It doesn't look like there are any errors to document. I'm attaching a patch that Patrick suggested. -- keywords: +patch Added file: http://bugs.python.org/file27481/issue12322_v1.diff ___ Python tracker

[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread Roger Serwy
Roger Serwy added the comment: Attached is a patch against 3.4 to solve the issue. The debugger was originally written for running IDLE without a subprocess. As a result, calls to idb.run() from Debugger.py would block until completed. If .interacting == 1 then clicking X would not close the

[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-08 Thread Charles-François Natali
Charles-François Natali added the comment: Yes . Charles, lest assume that all other issues with build system, are resolved and source tree is ready for use. So in this situation I could run python , I could build all and I could run tests with an additional patch TEMPDIR is relative to

[issue11245] Implementation of IMAP IDLE in imaplib?

2012-10-08 Thread Gereon Kremer
Gereon Kremer added the comment: I got the confirmation for my agreement. I'm not quite sure about the tests, as I'm not really familiar with the way this is done in cpython. The test_imaplib.py seems to cover all ways to connect to some server, but none of the actual imap commands. The patch

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Proposed patch attached. I verified that the tests included in the patch pass on 2.7, 3.2, 3.3, and default (replacing FileNotFoundError with OSError as necessary). I also verified that the tests pass on Windows for default. The patch also includes

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27484/profile-docs-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27485/profile-docs-2.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek
New submission from Chris Jerdonek: The link to Visual Studio 2008 in the devguide doesn't seem to work: http://docs.python.org/devguide/setup.html#windows https://www.microsoft.com/visualstudio/en-us/products/2008-editions/express This seems to be a better link:

[issue12947] doctest directive examples in library/doctest.html lack the flags

2012-10-08 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I see the other examples Chris is talking about now. Yes, the workaround should be applied in those cases as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12947

[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: It might also be good to say that vcsetup.exe is the file you're supposed to download (as opposed to, say, vcssetup.exe). Strangely, the files aren't labeled, and they're listed in a different order from the text below. --

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: I also checked the tests in the patch on Windows for 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16115 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: Looks like you missed *sort* parameter for .. function:: run(command, filename=None, sort=-1) Also it will be nice to insert link to Stats.sort_stats in doc text for run functions. -- ___ Python tracker

[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Marcus Gröber
Marcus Gröber added the comment: I came across this today as well. A short way of summarizing this error seems to be: Reading a file using readline (or for line in file) fails, if the following two conditions are true: • A codec (e.g. UTF-8) for a multi-byte encoding is used, and •

[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread Michael Vogt
New submission from Michael Vogt: The Py_FileSystemDefaultEncoding is very static right now and only set on interpreter statup AFAICT. There appears to be no way to switch that later. I think that Py_FileSystemDefaultEncoding should get updated when locale.setlocale() is run automatically and

[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread Berker Peksag
New submission from Berker Peksag: Name pkg is not defined. Related changeset: http://hg.python.org/cpython/rev/3987667bf98f#l2.89 -- components: Library (Lib) files: pkgutil-name.diff keywords: patch messages: 172374 nosy: berker.peksag priority: normal severity: normal status: open

[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread Alexander Belchenko
New submission from Alexander Belchenko: Why by default unittest.main (which uses unittest.TextTestRunner) prints everything to stderr. What the reason behind this behavior? It makes very inconvenient to run big test suite with less, i.e. python test.py | less or python test.py test.log

[issue16165] sched.scheduler.run() blocks scheduler

2012-10-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: sched.scheduler.run() blocks scheduler and prevents the addition of new events until all events added before start will not be processed. Canceling does not work too. Here is test script which reproduces the behavior differences. Output in Python 3.2:

[issue13451] sched.py: speedup cancel() method

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In principle this is the right approach. But the time of enter() is increased by 20%. Here is updated and slightly optimized patch that restores enter() performance (but a little slow down cancel()). Because enter() is executed for each event and cancel()

[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Christian Heimes
Christian Heimes added the comment: Meh, MS likes to invalidate or alter the meaning of an URL. Have you verified that vcsetup.exe is the right thing? I *guess* that vcsetup stands for Visual C++ setup and vcssetup for Visual C Sharp Setup but I'm not sure about it. -- assignee: -

[issue16165] sched.scheduler.run() blocks scheduler

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that releases lock for other threads. -- keywords: +patch Added file: http://bugs.python.org/file27490/sched_unblock.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16165

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: Hmm, I dislike Normally, *args* should be a sequence. From my perspective better to say something like: *args* should be a sequence if *shell* is *False* or string of *shell* is *True* or something like this. I would to directly recommend reader to follow that

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Christian Heimes
New submission from Christian Heimes: I propose the addition of three new macros in pyport.h #define PY_LITTLE_ENDIAN 1234 #define PY_BIG_ENDIAN 4321 #define PY_BYTE_ORDER either little or big endian that are either set by a configure test or implemented like brg_endian.h. pyconfig.h has

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- dependencies: +Add SHA-3 (Keccak) support nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16166 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27491/sort-argument-2.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27492/sort-argument-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: Jepp, I missed that. I hope the added patches clear that up. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Removed file: http://bugs.python.org/file27492/sort-argument-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27493/sort-argument-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Removed file: http://bugs.python.org/file27491/sort-argument-2.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide
Changes by Arne Babenhauserheide arne_...@web.de: Added file: http://bugs.python.org/file27494/sort-argument-2.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14900 ___

[issue11245] Implementation of IMAP IDLE in imaplib?

2012-10-08 Thread R. David Murray
R. David Murray added the comment: Yeah writing a good test case for this is a bit tricky, since we'll need some infrastructure (an Event?) so we can prove that the call has blocked without delaying the test for very long. I'm not sure when I'll be able to get to this...I'm not going to check

[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +haypo, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16162 ___ ___

[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16163 ___ ___ Python-bugs-list

[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread R. David Murray
R. David Murray added the comment: I think the reason is that this enables you to easily see if the tests generate any output to stdout. This was important when unittest was introduced into python, because some of our tests at that time were still written to check the stdout output against

[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, I cannot figure out what hg repo version should I use to apply sort-argument* patches. Can you prepare 2 cumulative patches for 2.7 and 3.2 which can be applied to current repo state? It's CPython team policy to send patches which can be applied to pure

[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread R. David Murray
R. David Murray added the comment: I'm pretty sure this should be closed as won't fix or invalid, but I'll leave that to Michael, who is the current maintainer of unittest. -- nosy: +michael.foord ___ Python tracker rep...@bugs.python.org

[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks for the report and patch. Can you also provide a test that fails using the current code (and that passes with the patch applied)? -- nosy: +chris.jerdonek ___ Python tracker rep...@bugs.python.org

[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Have you verified that vcsetup.exe is the right thing? I *guess* that vcsetup stands for Visual C++ setup and vcssetup for Visual C Sharp Setup but I'm not sure about it. Yes, after choosing wrong the first time (based partly on the ordering relative to

[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread Martin v . Löwis
Martin v. Löwis added the comment: It actually *is* possible to work with UTF-8-encoded file names even in an ASCII locale. It should work automatically, using the PEP 383 mechanism. I'm -0 on allowing changes to the file system encoding. It may lead to mojibake, if some file names were read

[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread STINNER Victor
STINNER Victor added the comment: I think that Py_FileSystemDefaultEncoding should get updated when locale.setlocale() is run automatically This is not a good idea. The two following expressions must be True on UNIX: os.fsencode(os.fsdecode(name)) == name os.fsdecode(os.fsencode(name)) ==

[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This error happens due to the fact that utf16* decoders do not properly partial decode truncated data. Exception raised if input data truncated on the second surrogate in the surrogate pair. For example codecs.utf_16_le_decode(b'\x00\xd8\x00') should return

[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are the patches. -- keywords: +patch Added file: http://bugs.python.org/file27495/utf16_partial_decode-3.3.patch Added file: http://bugs.python.org/file27496/utf16_partial_decode-3.2.patch Added file:

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks for the good suggestion and pointer to the relevant discussion, Andrew. I agree re: the sentence beginning with normally. Incidentally, that was existing language that I had preserved. I'm attaching an updated patch that incorporates your suggestion.

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: LGTM. Thanks, Chris. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16115 ___ ___ Python-bugs-list mailing

[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16162 ___

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree, it is worth bring order to work with endianess. We can get rod of BYTEORDER_IS_BIG_ENDIAN and BYTEORDER_IS_LITTLE_ENDIAN in Objects/unicodeobject.c, IS_LITTLE_ENDIAN in Objects/longobject.c, tests in other modules. I don't see the necessity in new

[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Radu Dan
New submission from Radu Dan: Classes that extend the builtin 'str' cannot be printed as is, and are automatically converted to string. #!/bin/env python class newstring(str): def __str__(self): return self a = newstring(hello world) print a Running this returns:

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which removes some unnecessary defines and tests. -- keywords: +patch Added file: http://bugs.python.org/file27499/endianess_cleanup.patch ___ Python tracker rep...@bugs.python.org

[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Incidentally, it was also odd that the VS executable wasn't obvious to locate. Scratch this last comment. A Visual C++ 2008 Express Edition folder was created under the Start menu. It just wasn't highlighted as having been newly added, as was a separate

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: This doesn't depend on #16113 (quite the contrary). -- dependencies: -Add SHA-3 (Keccak) support ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16166 ___

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: #define PY_LITTLE_ENDIAN 1234 #define PY_BIG_ENDIAN 4321 #define PY_BYTE_ORDER either little or big endian Ouch, sounds confusing. I would rather have PY_LITTLE_ENDIAN defined only on little-endian machines and PY_BIG_ENDIAN only on big-endian machines.

[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ouch, sounds confusing. I would rather have PY_LITTLE_ENDIAN defined only on little-endian machines and PY_BIG_ENDIAN only on big-endian machines. (and PY_BYTE_ORDER isn't necessary) Why use two complementary boolean variables for a single boolean value

[issue15991] BaseHTTPServer with ThreadingMixIn serving wrong data sometimes

2012-10-08 Thread Mikhail Afanasyev
Mikhail Afanasyev added the comment: The bug is not only wget-specific. It was discovered while making APT proxy, so at least Debian APT fetcher has the same problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15991

  1   2   >