Re: how to avoid leading white spaces

2011-06-04 Thread Chris Angelico
On Sat, Jun 4, 2011 at 12:30 PM, Roy Smith r...@panix.com wrote: Another nice thing about regexes (as compared to string methods) is that they're both portable and serializable.  You can use the same regex in Perl, Python, Ruby, PHP, etc.  You can transmit them over a network connection to a

Re: float(nan) in set or as key

2011-06-04 Thread Ethan Furman
Steven D'Aprano wrote: NANs are not necessarily errors, they're hardly silent, and if you don't want NANs, the standard mandates that there be a way to turn them off. So how does one turn them off in standard Python? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

python + php encrypt/decrypt

2011-06-04 Thread miamia
Hello, I would like to encrypt text in python and decrypt it in my PHP script. I tried to use pycrypto and some aes php scripts but the results are not the same. Please, is there any example (the best way source codes) how to do this in python and PHP? many thanks --

python + php encrypt/decrypt

2011-06-04 Thread Peter Irbizon
Hello, I would like to encrypt text in python and decrypt it in my PHP script. I tried to use pycrypto and some aes php scripts but the results are not the same. Please, is there any example (the best way source codes) how to do this in python and PHP? --

Re: float(nan) in set or as key

2011-06-04 Thread rusi
On Jun 4, 4:29 am, Nobody nob...@nowhere.com wrote: On Fri, 03 Jun 2011 14:52:39 +, Grant Edwards wrote: It's arguable that NaN itself simply shouldn't exist in Python; if the FPU ever generates a NaN, Python should raise an exception at that point. If you're fluent in IEEE-754,

Re: python + php encrypt/decrypt

2011-06-04 Thread hidura
Use xml to pass the encrypt text. On , Peter Irbizon peterirbi...@gmail.com wrote: Hello, I would like to encrypt text in python and decrypt it in my PHP script. I tried to use pycrypto and some aes php scripts but the results are not the same. Please, is there any example (the best way

Re: float(nan) in set or as key

2011-06-04 Thread Steven D'Aprano
On Fri, 03 Jun 2011 23:04:38 -0700, Ethan Furman wrote: Steven D'Aprano wrote: NANs are not necessarily errors, they're hardly silent, and if you don't want NANs, the standard mandates that there be a way to turn them off. So how does one turn them off in standard Python? Turn them off?

Re: float(nan) in set or as key

2011-06-04 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: What makes you think that Python supports IEEE-754 for floats? That would be an easy impression to get from this long rambling thread. The argument that Python's ‘float’ type is not meant to be anything *but* an IEEE 754 floating

Re: A simple way to print few line stuck to the same position

2011-06-04 Thread TheSaint
Hans Mulder wrote: A minimalist solution would be to print the labels (This count, etc.) only once, and position the cursor after it to update the report. Generally a good point. Similar sequences are working for coloring and formatting text. I don't know whether the program would behave to

Re: Determine attributes of calling method

2011-06-04 Thread Richard Thomas
On Jun 3, 9:35 pm, Joe joe.cwi...@gmail.com wrote: Hello, I'm trying to implement a way to restrict method usage based on the caller's attributes.  In the following example I'd like to execute the server method bar only if the caller's method has a blue value for it's color attribute. The

how update MultipartPostHandler pypi

2011-06-04 Thread none
Hi, As Wrote in http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306 http://pypi.python.org/pypi/MultipartPostHandler/0.1.0 is not updated , the author email doesn't not exist , how I send a comment update MultipartPostHandler anyway patch attach Only in MultipartPostHandler-0.1.0:

Re: how to avoid leading white spaces

2011-06-04 Thread Roy Smith
I wrote: Another nice thing about regexes (as compared to string methods) is that they're both portable and serializable. You can use the same regex in Perl, Python, Ruby, PHP, etc. In article 4de9bf50$0$29996$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano

py2exe: executable is slower than code run from the interpreter

2011-06-04 Thread Massi
Hi everyone, I'm writing a big program (windows 7, python 2.6.6) which includes lots of python libraries (SQLalchemy, PyQt, SocketServer, Matplotlib,...). Now I'm trying to build a stand alone executable with py2exe (0.6.9) and everything works great. The only issue is that the executable seems to

Re: py2exe: executable is slower than code run from the interpreter

2011-06-04 Thread Miki Tebeka
One thing that comes to mind is importing. py2exe packs libraries in a zip file so importing might be a bit slower. But this should slow only at the beginning until everything is loaded to memory. The other usual suspect is the anti virus :) --

Re: how to avoid leading white spaces

2011-06-04 Thread rusi
The efficiently argument is specious. [This is a python list not a C or assembly list] The real issue is that complex regexes are hard to get right -- even if one is experienced. This is analogous to the fact that knotty programs can be hard to get right even for experienced programmers. The

how update MultipartPostHandler pypi

2011-06-04 Thread sergio
Hi, As Wrote in http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306 http://pypi.python.org/pypi/MultipartPostHandler/0.1.0 is not updated , the author email doesn't not exist , how I send a comment update MultipartPostHandler anyway patch attach -- Sérgio M.B. Only in

Lambda question

2011-06-04 Thread jyoung79
I was surfing around looking for a way to split a list into equal sections. I came upon this algorithm: f = lambda x, n, acc=[]: f(x[n:], n, acc+[(x[:n])]) if x else acc f(Hallo Welt, 3) ['Hal', 'lo ', 'Wel', 't']

Re: Lambda question

2011-06-04 Thread Chris Angelico
On Sun, Jun 5, 2011 at 3:46 AM, jyoun...@kc.rr.com wrote: It doesn't work with a huge list, but looks like it could be handy in certain circumstances.  I'm trying to understand this code, but am totally lost.  I know a little bit about lambda, as well as the ternary operator, but how does

Re: Lambda question

2011-06-04 Thread Mel
jyoun...@kc.rr.com wrote: I was surfing around looking for a way to split a list into equal sections. I came upon this algorithm: f = lambda x, n, acc=[]: f(x[n:], n, acc+[(x[:n])]) if x else acc f(Hallo Welt, 3) ['Hal', 'lo ', 'Wel', 't']

Generator Frustration

2011-06-04 Thread TommyVee
I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of the code in my programs is very complex and contains several repeating sequences of yield statements. I

Re: Lambda question

2011-06-04 Thread Ian Kelly
On Sat, Jun 4, 2011 at 12:09 PM, Chris Angelico ros...@gmail.com wrote: Python doesn't seem to have an inbuilt function to divide strings in this way. At least, I can't find it (except the special case where n is 1, which is simply 'list(string)'). Pike allows you to use the division operator:

Re: float(nan) in set or as key

2011-06-04 Thread Nobody
On Sat, 04 Jun 2011 00:52:17 -0700, rusi wrote: If you're fluent in IEEE-754, then you won't find its behaviour unexpected. OTOH, if you are approach the issue without preconceptions, you're likely to notice that you effectively have one exception mechanism for floating-point and another for

Re: Lambda question

2011-06-04 Thread Vito 'ZeD' De Tullio
jyoun...@kc.rr.com wrote: I was surfing around looking for a way to split a list into equal sections. non-recursive, same-unreadeable (worse?) one liner alternative: def chunks(s, j): return [''.join(filter(None,c))for c in map(None,*(s[i::j]for i in range(j)))] -- By ZeD --

Re: how to avoid leading white spaces

2011-06-04 Thread Nobody
On Sat, 04 Jun 2011 13:41:33 +1200, Gregory Ewing wrote: Python might be penalized by its use of Unicode here, since a Boyer-Moore table for a full 16-bit Unicode string would need 65536 entries But is there any need for the Boyer-Moore algorithm to operate on characters? Seems to me

Re: Determine attributes of calling method

2011-06-04 Thread Ian Kelly
On Fri, Jun 3, 2011 at 2:35 PM, Joe joe.cwi...@gmail.com wrote:    foo.__dict__['color']='blue'    fu.__dict__['color']='red' You don't need to use __dict__ to set function attributes. Just do: foo.color = 'blue' -- http://mail.python.org/mailman/listinfo/python-list

Re: how to avoid leading white spaces

2011-06-04 Thread Nobody
On Sat, 04 Jun 2011 05:14:56 +, Steven D'Aprano wrote: This fails to support non-ASCII letters, and you know quite well that having to spell out by hand regexes in both upper and lower (or mixed) case is not support for case-insensitive matching. That's why Python's re has a case

Re: float(nan) in set or as key

2011-06-04 Thread Ethan Furman
Steven D'Aprano wrote: On Fri, 03 Jun 2011 23:04:38 -0700, Ethan Furman wrote: Steven D'Aprano wrote: NANs are not necessarily errors, they're hardly silent, and if you don't want NANs, the standard mandates that there be a way to turn them off. So how does one turn them off in standard

Re: float(nan) in set or as key

2011-06-04 Thread Robert Kern
On 6/4/11 4:28 PM, Ethan Furman wrote: Steven D'Aprano wrote: On Fri, 03 Jun 2011 23:04:38 -0700, Ethan Furman wrote: Steven D'Aprano wrote: NANs are not necessarily errors, they're hardly silent, and if you don't want NANs, the standard mandates that there be a way to turn them off. So how

Re: except KeyError, everywhere -- memoization

2011-06-04 Thread Wilbert Berendsen
Hi, Many thanks for everyone's explanations and pointers! thanks! Wilbert Berendsen -- http://www.wilbertberendsen.nl/ You must be the change you wish to see in the world. -- Mahatma Gandhi -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple way to print few line stuck to the same position

2011-06-04 Thread Hans Mulder
On 4/06/11 13:14:05, TheSaint wrote: Hans Mulder wrote: A minimalist solution would be to print the labels (This count, etc.) only once, and position the cursor after it to update the report. Generally a good point. Similar sequences are working for coloring and formatting text. As I

Re: how to avoid leading white spaces

2011-06-04 Thread Steven D'Aprano
On Sat, 04 Jun 2011 09:39:24 -0400, Roy Smith wrote: To be sure, if you explore the edges of the regex syntax space, you can write non-portable expressions. You don't even have to get very far out to the edge. But, as you say, if you limit yourself to a subset, you can write portable ones.

Re: Generator Frustration

2011-06-04 Thread Steven D'Aprano
On Sat, 04 Jun 2011 14:27:32 -0400, TommyVee wrote: I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of the code in my programs is very complex and contains

Re: how to avoid leading white spaces

2011-06-04 Thread Steven D'Aprano
On Sat, 04 Jun 2011 21:02:32 +0100, Nobody wrote: On Sat, 04 Jun 2011 05:14:56 +, Steven D'Aprano wrote: This fails to support non-ASCII letters, and you know quite well that having to spell out by hand regexes in both upper and lower (or mixed) case is not support for case-insensitive

Re: Generator Frustration

2011-06-04 Thread Gregory Ewing
Steven D'Aprano wrote: A nice piece of syntax that has been proposed for Python is yield from, which will do the same thing, but you can't use that yet. Unless you're impatient enough to compile your own Python with my patch applied:

Re: float(nan) in set or as key

2011-06-04 Thread Steven D'Aprano
On Sat, 04 Jun 2011 16:49:40 -0500, Robert Kern wrote: Steven is being a little hyperbolic. Python does not fully conform to all of the details of the IEEE-754 specification, though it does conform to most of them. I'm not sure that most is correct, but that depends on how you count the

Re: Generator Frustration

2011-06-04 Thread Jack Diederich
On Sat, Jun 4, 2011 at 9:43 PM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Steven D'Aprano wrote: A nice piece of syntax that has been proposed for Python is yield from, which will do the same thing, but you can't use that yet. You can also patch the library to always return lists

How does this work?

2011-06-04 Thread jyoung79
I was surfing around looking for a way to split a list into equal sections. I came upon this algorithm: f = lambda x, n, acc=[]: f(x[n:], n, acc+[(x[:n])]) if x else acc f(Hallo Welt, 3) ['Hal', 'lo ', 'Wel', 't']

Re: How does this work?

2011-06-04 Thread Ben Finney
jyoun...@kc.rr.com writes: I was surfing around looking for a way to split a list into equal sections. I came upon this algorithm: f = lambda x, n, acc=[]: f(x[n:], n, acc+[(x[:n])]) if x else acc f(Hallo Welt, 3) ['Hal', 'lo ', 'Wel', 't']

RE: A simple way to print few line stuck to the same position

2011-06-04 Thread Sarcar, Shourya C (GE Healthcare)
A way to do this on DOS/Windows console would be: import sys for r in range(0,2**16): line = Count : %d % r sys.stdout.write(line) sys.stdout.flush() # do something that consumes time backup = \b * len(line) # The backspace character; this will prevent

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: abs() behavior show below. type(abs(-1)) class 'int' type(abs(-1.0)) class 'float' we should fix this problem if write Return abs(x) with the sign of y I'd like to try this problem if need fix. I'm going to attach the patch. --

[issue11583] os.path.isdir() is slow on windows

2011-06-04 Thread Tim Golden
Tim Golden m...@timgolden.me.uk added the comment: Code looks good and tests pass. Only one thing: the code in the patched lib\ntpath.py still refers to FindFirstFile -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11583

[issue12234] unittest2 could enable regex debugging for more information

2011-06-04 Thread Domen Kožar
Domen Kožar ielect...@gmail.com added the comment: I see, currently re module does not support debugging for matching a string. Even the upcoming new regex implementation does not support it. -- ___ Python tracker rep...@bugs.python.org

[issue12224] problem with siginterrupt

2011-06-04 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Actually, it's part of a more general problem with EINTR being returned by many posix/socket module functions, see for example issue #7978. On the one hand, having to retry manually on EINTR is cumbersome, on the other hand, some code

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: I've taken the sdist.patch and wrote some tests for it. The resulting patch is attached as 'manifest-respect.patch'. -- nosy: +jerub Added file: http://bugs.python.org/file22242/manifest-respect.patch

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: This patch is tested against the 3.1 and default branches, the previous patch attached was against the 2.7 branch. -- Added file: http://bugs.python.org/file22243/manifest-respect-3.patch ___

[issue12224] problem with siginterrupt

2011-06-04 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Victor, I understand your response as saying that there is no bug, which would suggest closing this. Correct? If not, what is the requested action? siginterrupt(False) has no effect on select(). I listed some solutions to not

[issue12185] Decimal documentation lists first and second arguments, should be self and other

2011-06-04 Thread Francisco Martín Brugué
Francisco Martín Brugué franci...@email.de added the comment: Hi Adam, I couldn’t see that from the threat context, I'm new to this and just wanted to learn the work flow and tools so I've just picked up an easy issue to start with. Anyway your patch seems more complete. --

[issue12257] Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK

2011-06-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I don't think the name should be changed. If anything should be done, we should reconsider whether this flag is actually needed, or whether some other approach to selecting a compiler can be taken. --

[issue12224] problem with siginterrupt

2011-06-04 Thread Zhiping Deng
Zhiping Deng kofreesty...@gmail.com added the comment: I think the problem is that after a user calles signal.siginterrupt(False), he would expect that the socket.recv should handles EINTR properly for him because it's the behaviour in c level. He doesn't know socket.recv() calles select(2)

[issue12226] use secured channel for uploading packages to pypi

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I think there should be a warning that the connection is unauthenticated (i.e. not secure). Users tend to be upset if they see 'https' and later find out that no certificates were verified. Thanks Stephan, that was on my mind but I forgot it.

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: We do not want to create a directory under $prefix before installation. This would be a sort of dirty half-installation. When you have an uninstalled, unconfigured Python, you cannot install modules without giving a prefix option: this sounds

[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: File name, class name, method name unless I misremember. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12231 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: How about something like: Return a float with the magnitude of x but the sign of y.? The behaviour of math.copysign with respect to non-float inputs matches that of almost all the other math module functions: integer arguments are first

[issue12257] Rework/replace use of DISTUTILS_USE_SDK in packaging

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Agreed. Thanks for the insight. -- title: Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK - Rework/replace use of DISTUTILS_USE_SDK in packaging ___ Python tracker rep...@bugs.python.org

[issue12185] Decimal documentation lists first and second arguments, should be self and other

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12185 ___ ___

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Here’s my try at making the spec more explicit about str subclasses. -- keywords: +patch Added file: http://bugs.python.org/file22244/pep--no-subclasses.diff ___ Python tracker

[issue11557] Increase coverage in logging module

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I saw this commit pass by and noticed a few instances of non-idiomatic unittest code, like unnecessary lambdas or overuse of assertEqual where other methods would give more useful messages in case of failure. Here’s a patch to better it.

[issue11557] Increase coverage in logging module

2011-06-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- assignee: trentm - vinay.sajip nosy: -trentm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11557 ___

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the patches! Here's a slight expansion of the wording on your second patch: Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been

[issue12127] Inconsistent leading zero treatment

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Closing, based on feedback in the comments. Maybe one day... -- resolution: - later status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12127

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: float_info.rounds is a bit of an odd fish, and I think it was probably a mistake to include it in sys.float_info in the first place. All the other float_info fields relate to parameters of the floating-point format, which is fixed, useful

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: Using sorted() makes sense to me. Note that I've at least accomplished one goal, which is to have a tracker issue that discusses the merits of the change. That way, no matter what the RM decides, I can at least point to an issue for

[issue8286] distutils: path '[...]' cannot end with '/' -- need better error message

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: There is a simple way to fix this: change one line in sdist to catch ValueErrors in addition to DistutilsTemplateError. Users will get a on-line warning message with the ill-formed manifest line number instead of a wall of traceback. This is

[issue8286] distutils: path '[...]' cannot end with '/' -- need better error message

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: a one-line* I’ll have a patch up for review shortly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8286 ___

[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-06-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Isn’t zlib built by setup.py anyway? -- nosy: +eric.araujo resolution: invalid - status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11934

[issue12232] embedded python import cmath

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12232 ___ ___

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12245 ___ ___

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: docs@python - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12245 ___

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset c3fe54781244 by Mark Dickinson in branch 'default': Issue #12080: Fix a performance issue in Decimal._power_exact that causes some corner-case Decimal.__pow__ calls to take an unreasonably long time.

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 78d79499e7de by Mark Dickinson in branch '2.7': Issue #12080: Fix a performance issue in Decimal._power_exact that caused some corner-case Decimal.__pow__ calls to take an unreasonably long time.

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed for 3.3 and 2.7. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12080 ___

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Mark Dickinson rep...@bugs.python.org wrote: Here's a patch. Stefan, could you please review? Mark, sorry for not replying earlier. The patch looks great. I've also tested the patch in practice: I ran 700,000,000 random tests with an

[issue12014] str.format parses replacement field incorrectly

2011-06-04 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: PEP 3101 defines format strings as intermingled character data and markup. Markup defines replacement fields and is delimited by braces. Only after markup is extracted does the PEP talk about interpreting the contents of the markup. So,

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: What do you think? Sounds very good to my native Finnish ears :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12164 ___

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file22246/dir.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12248 ___

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12164 ___ ___

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen so...@linux2go.dk added the comment: When I first investigated this problem (I reported the original bug on Launchpad), my first attempt to address this issue in pymox had me quite stumped. The class in question has a __getattr__ method. Up until now, this hasn't affected the use

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/6/4 Soren Hansen rep...@bugs.python.org: Soren Hansen so...@linux2go.dk added the comment: When I first investigated this problem (I reported the original bug on Launchpad), my first attempt to address this issue in pymox had me

[issue12262] Not Inheriting File Descriptors on Windows?

2011-06-04 Thread sbt
sbt shibt...@gmail.com added the comment: Although Windows fds are not inheritable, the handles associated with fds can be made inheritable. A workaround for the fact fds are not inheritable is the following pattern: 1) The parent process converts the fd to a handle using _get_osfhandle(fd).

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-06-04 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: That change to the spec is fine, though you might also want to add something like, Like all other WSGI specification types, since *all* types specified in WSGI are 'type()' not 'isinstance()'. --

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen so...@linux2go.dk added the comment: 2011/6/4 Benjamin Peterson rep...@bugs.python.org: 2011/6/4 Soren Hansen rep...@bugs.python.org: So my question is: If this change stays (which seems clear given that the only changes proposed here are ways of relaxing the type requirement of

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/6/4 Soren Hansen rep...@bugs.python.org: Soren Hansen so...@linux2go.dk added the comment: 2011/6/4 Benjamin Peterson rep...@bugs.python.org: 2011/6/4 Soren Hansen rep...@bugs.python.org: So my question is: If this change stays

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen so...@linux2go.dk added the comment: 2011/6/5 Benjamin Peterson rep...@bugs.python.org: 2011/6/4 Soren Hansen rep...@bugs.python.org: ...I end up with a RuntimeError: maximum recursion depth exceeded. I can't say I'm surprised :) Ah, sorry I should have thought before writing

[issue12263] punycode codec ignores the error handler argument

2011-06-04 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: b'abc\xff'.decode('punycode', 'ignore') raises the same error than b'abc\xff'.decode('punycode', 'replace') or b'abc\xff'.decode('punycode'): it uses the strict error handler, and simply ignores the error handler. punycodec, as

[issue12263] punycode codec ignores the error handler argument

2011-06-04 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: base64_codec.py uses an assertion to check the error handler: it should use an if+raise (assertions are ignored in optimized mode, python -O). -- ___ Python tracker

[issue12264] parser.expr(): reference count error if more than one argument is passed

2011-06-04 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: import parser; parser.expr(a, b) raises a TypeError('expr() takes at most 1 argument (2 given)') but corrupt also the reference count of an object (I don't know which one): python: Modules/gcmodule.c:327: visit_decref: Assertion

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Return a float with the magnitude of x but the sign of y. This appears to describe both current behavior and what I believe was the intention. I would go with a doc patch based on this. umedoblock, go ahead and make one. It occurred to me,

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: But this part of the code runs only when you want to install a 3rd party module isn't it? What you are proposing simply adds a delay, for the use will have to then add that directory manually. Or is there something I'm missing here?

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: s/use/user -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12246 ___ ___

[issue12232] embedded python import cmath

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: {It you reply by mail, please snip off the message you are replying to.} From what I have read, Windows is not a very pleasant environment for extending and embedding. 1. It works best if both Python and the extender or embedder are compiled

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: I made the patch. But it cannot pass testCopysign(). math.copysign(1, -0.) returns 1. I hope to return -1. But I don't know how to realize -0. as negative value. Please help me. -- components: +Library (Lib) -Documentation keywords:

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Removed file: http://bugs.python.org/file22249/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Added file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Removed file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: umedoblock: David, Mark, and I agree that this should be a doc issue, and so I suggested a DOC patch. So I do not know why you are screwing around with the code, or what you are trying to do with it, or why you are messing around with the

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: sorry. I fix my bug. but this patch contain new fail... math.copysign(-1., 0.) returns 1. -- Added file: http://bugs.python.org/file22251/math_copysign.patch ___ Python tracker

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
New submission from Benjamin Peterson benja...@python.org: This patch completely rewrites errors given for positional error mismatches. The goal is to give more informative and correct errors. Some examples: def f(): pass ... f(1) Traceback (most recent call last): File stdin, line 1, in

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: Removed file: http://bugs.python.org/file22252/argerror.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12265 ___

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: Added file: http://bugs.python.org/file22253/argerror.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12265 ___

[issue12264] parser.expr(): reference count error if more than one argument is passed

2011-06-04 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 3ffd8dea77bf by Benjamin Peterson in branch 'default': only clear the parser error if it's set (closes #12264) http://hg.python.org/cpython/rev/3ffd8dea77bf -- nosy: +python-dev resolution: - fixed stage: -

  1   2   >