Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread David M. Cotter
I see you are using Python 2 correct Firstly, in Python 2, the compiler assumes that the source code is encoded in ASCII gar, i must have been looking at doc for v3, as i thought it was all assumed to be utf8 # -*- coding: utf-8 -*- okay, did that, still no change you need to use u ...

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread Dave Angel
David M. Cotter wrote: Steven wrote: I see you are using Python 2 correct It's hard to say what *exactly* is happening here, because you don't explain how the python print statement somehow gets into your C++ Log code. Do I guess right that it catches stdout? yes, i'm redirecting stdout to

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Dave Angel
snarf wrote: Greetings, As I tread through my journey of OO I am trying to determine if there is a good approach for exception handling within classes. From my readings and gatherings - it seems I have found a common theme, but I am trying to solicit from the experts. Here is what I

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Ian Kelly
On Fri, Aug 23, 2013 at 9:30 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Is there a fast way to convert a Decimal into a pair of numbers numerator/ denominator? It *must* be exact, but it doesn't have to be simplest form. For example, Decimal(0.5) = (5, 10) would be okay,

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Ian Kelly
On Sat, Aug 24, 2013 at 1:37 AM, Ian Kelly ian.g.ke...@gmail.com wrote: I time this function at about 33% faster than your version for a six-digit decimal, and almost 50% faster for a 12-digit decimal. My guess would be because it's not calling str() on every individual digit. def

Re: Running a command line program and reading the result as it runs

2013-08-24 Thread Ian Simcock
Peter Otten wrote: Ian Simcock wrote: Greetings all. I'm using Python 2.7 under Windows and am trying to run a command line program and process the programs output as it is running. A number of web searches have indicated that the following code would work. import subprocess p =

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Steven D'Aprano
On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [...] * Seems like exception handing within Classes is largely avoided and is typically only used when calling external libraries. There is certainly no rule avoid exceptions inside classes. Methods often raise exceptions to signal an error,

Help regarding urllib

2013-08-24 Thread malhar vora
Hello All, I am simply fetching data from robots.txt of a url. Below is my code. siteurl = siteurl.rstrip(/) -- http://mail.python.org/mailman/listinfo/python-list

Re: Help regarding urllib

2013-08-24 Thread malhar vora
On Saturday, August 24, 2013 4:15:01 PM UTC+5:30, malhar vora wrote: Hello All, I am simply fetching data from robots.txt of a url. Below is my code. siteurl = siteurl.rstrip(/) Sorry for last complete. It was sent by mistake. Here is my code. siteurl = siteurl.rstrip(/)

Re: Python variable as a string

2013-08-24 Thread Jake Angulo
Thank you all for the reply. Actually yes this was a confusing question, and borne out of trying to make a shortcut. I didnt ask to convert the contents of var into a string. All I needed was to get the literal equivalent var because I needed to use it in another dict object - whose keys i named

Re: How to send broadcast IP address to network?

2013-08-24 Thread Irmen de Jong
On 23-8-2013 14:32, lightai...@gmail.com wrote: I want to send a broadcast packet to all the computers connected to my home router. The following 2 lines of code do not work; host=192.168.0.102 s.connect((host, port)) Can someone advise? Thank you. Use UDP (datagram) sockets. Use

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Peter Otten
Steven D'Aprano wrote: I have a need to convert arbitrary non-complex numbers into numerator/ denominator pairs. Numbers could be ints, floats, Fractions or Decimals. For example: 2 = (2, 1) 0.25 = (1, 4) Fraction(2, 3) = (2, 3) Decimal(0.5) = (1, 2) The first three cases are easy

Re: Help regarding urllib

2013-08-24 Thread Dave Angel
malhar vora wrote: On Saturday, August 24, 2013 4:15:01 PM UTC+5:30, malhar vora wrote: Hello All, I am simply fetching data from robots.txt of a url. Below is my code. siteurl = siteurl.rstrip(/) Sorry for last complete. It was sent by mistake. Here is my code. siteurl

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread random832
On Sat, Aug 24, 2013, at 2:45, David M. Cotter wrote: you need to use u ... delimiters for Unicode, otherwise the results you get are completely arbitrary and depend on the encoding of your terminal. okay, well, i'm on a mac, and not using terminal at all. but if i were, it would be utf8

Re: python interface to iMacros

2013-08-24 Thread Michael Torrie
On 08/23/2013 09:13 AM, inq1ltd wrote: Python help, I am running iMacros from linux/firefox and doing most of what I want. But, there are times when I want to do something of the net and then back to the iMacros script. Are there any projects out there that will connect python

Re: Exception Handling Practices / Patterns

2013-08-24 Thread MRAB
On 24/08/2013 11:27, Steven D'Aprano wrote: On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [snip] * Using Exception is typically a bad. More specific the better. Yes, you should always try to catch the specific exceptions you care about: # Best except ValueError, OverflowError,

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread David M. Cotter
What _are_ you using? i have scripts in a file, that i am invoking into my embedded python within a C++ program. there is no terminal involved. the print statement has been redirected (via sys.stdout) to my custom print class, which does not specify encoding, so i tried the suggestion above

how to read mixed from multiple csv file

2013-08-24 Thread Jia Hu
Hi, My 20 csv files has string header, and first two columns are string (e.g., 1999-01-02, 01:00:00) among the 50 columns. Other columns store numerical values (int, or float) I need to do data analysis for these data. For example, extract the each month data from each of the cvs files (each

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread wxjmfauth
Le samedi 24 août 2013 18:47:19 UTC+2, David M. Cotter a écrit : What _are_ you using? i have scripts in a file, that i am invoking into my embedded python within a C++ program. there is no terminal involved. the print statement has been redirected (via sys.stdout) to my custom print

Re: python interface to iMacros

2013-08-24 Thread inq1ltd
On 08/23/2013 09:13 AM, inq1ltd wrote: Python help, I am running iMacros from linux/firefox and doing most of what I want. But, there are times when I want to do something of the net and then back to the iMacros script. Are there any projects out there that will

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 9:47 AM, David M. Cotter m...@davecotter.com wrote: What _are_ you using? i have scripts in a file, that i am invoking into my embedded python within a C++ program. there is no terminal involved. the print statement has been redirected (via sys.stdout) to my

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Terry Reedy
On 8/24/2013 6:27 AM, Steven D'Aprano wrote: On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [...] * Seems like exception handing within Classes is largely avoided and is typically only used when calling external libraries. There is certainly no rule avoid exceptions inside classes. Methods

Re: Using PyQT with QT Designer

2013-08-24 Thread tausciam
Thanks. I probably will do exactly like you suggested later on. But, those two lines have solved the problem I had and I can work on the actual program now. I can come back to the GUI later. Here is what it looks like now: http://i.imgur.com/sLiSU6M.png On Friday, August 23, 2013 7:35:53 PM

Help in Nltk

2013-08-24 Thread projectfack
Can anyone help me for the tasks below in nltk 1. The system mustdemonstrate false positiveand false negativeexamples using any stemmer (Task 1.1) 2. The system mustdemonstrate the differences between successive layers

New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)

2013-08-24 Thread vasudevram
This may be of interest to readers of this newsgroup: Original article: http://lnkd.in/taAFNt Content (without links): A new way of writing socket servers has been introduced with the Linux kernel 3.9. It involves the ability to bind multiple listening sockets to the same port on the same

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Tim Delaney
On 24 August 2013 13:30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: def convert(d): sign, digits, exp = d.as_tuple() num = int(''.join([str(digit) for digit in digits])) if sign: num = -num return num, 10**-exp which is faster, but not fast enough. Any

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Tim Delaney
On 25 August 2013 07:59, Tim Delaney timothy.c.dela...@gmail.com wrote: Breakdown of the above (for 19 digits): d.as_tuple() takes about 35% of the time. The multiply and add takes about 55% of the time. The exponentiation takes about 10% of the time. Bah - sent before complete. Since

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Steven D'Aprano
On Sat, 24 Aug 2013 15:57:55 -0400, Terry Reedy wrote: # Worst except: Don't use the last one, except maybe in the interactive interpreter, Stick with never. except: means the same thing as except BaseException:, except that the latter indicates a deliberate choice rather than an

Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Hi Steven, Yea this is great. Thanks for the feedback. On Saturday, August 24, 2013 3:27:45 AM UTC-7, Steven D'Aprano wrote: On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [...] * Seems like exception handing within Classes is largely avoided and is typically only used when

Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Appreciate the feedback. I was hoping to get as much perspective as possible. On Saturday, August 24, 2013 12:18:59 AM UTC-7, Dave Angel wrote: snarf wrote: Greetings, As I tread through my journey of OO I am trying to determine if there is a good approach for exception

Re: Lambda function Turing completeness

2013-08-24 Thread Piet van Oostrum
Musical Notation musicdenotat...@gmail.com writes: Is it possible to write a Turing-complete lambda function (which does not depend on named functions) in Python? The wording of this question is questionable. Turing completeness is not an attribute of a function, but of a system (for example a

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread random832
On Sat, Aug 24, 2013, at 12:47, David M. Cotter wrote: What _are_ you using? i have scripts in a file, that i am invoking into my embedded python within a C++ program. there is no terminal involved. the print statement has been redirected (via sys.stdout) to my custom print class, which

Re: Lambda function Turing completeness

2013-08-24 Thread Piet van Oostrum
This is the second part of my posting on the Turing completeness of Python's lambda expressions. This time I am going to define a recursive function as a lambda expression (I use lambda when I am talking about Python's lambda expressions, and λ for the theory – λ calculus.) Now of course it is

Re: Setting the value of True

2013-08-24 Thread Gregory Ewing
Steven D'Aprano wrote: As for why None, True and False are treated differently than built-ins, if I remember the reason why, it is because they are considered fundamental to the inner workings of Python, unlike mere builtins like len, map, etc. and therefore should be protected. It's

Re: New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)

2013-08-24 Thread Michael Torrie
#Linux, #Python? This this hash tag stuff is getting out of hand, don't you think? -- http://mail.python.org/mailman/listinfo/python-list

List getting extended when assigned to itself

2013-08-24 Thread Krishnan Shankar
Hi Python Friends, I came across an example which is as below, var = [1, 12, 123, 1234] var [1, 12, 123, 1234] var[:0] [] var[:0] = var var [1, 12, 123, 1234, 1, 12, 123, 1234] Here in var[:0] = var we are assigning an entire list to the beginning of itself. So shouldn't it be something

Re: List getting extended when assigned to itself

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 8:52 PM, Krishnan Shankar i.am.song...@gmail.com wrote: Hi Python Friends, I came across an example which is as below, var = [1, 12, 123, 1234] var [1, 12, 123, 1234] var[:0] [] var[:0] = var var [1, 12, 123, 1234, 1, 12, 123, 1234] Here in var[:0] = var we

Re: New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 7:08 PM, Michael Torrie torr...@gmail.com wrote: #Linux, #Python? This this hash tag stuff is getting out of hand, don't you think? Didn't you hear? In an effort to redefine itself for the modern Internet, Usenet is adding support for hash tags and limiting posts to 140

Re: New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)

2013-08-24 Thread Michael Torrie
On 08/24/2013 10:06 PM, Benjamin Kaplan wrote: On Sat, Aug 24, 2013 at 7:08 PM, Michael Torrie torr...@gmail.com wrote: #Linux, #Python? This this hash tag stuff is getting out of hand, don't you think? Didn't you hear? In an effort to redefine itself for the modern Internet, Usenet is

Re: List getting extended when assigned to itself

2013-08-24 Thread Steven D'Aprano
On Sun, 25 Aug 2013 09:22:27 +0530, Krishnan Shankar wrote: Hi Python Friends, I came across an example which is as below, var = [1, 12, 123, 1234] var [1, 12, 123, 1234] var[:0] [] var[:0] = var var [1, 12, 123, 1234, 1, 12, 123, 1234] Here in var[:0] = var we are assigning an

Checking homogeneity of Array using List in Python

2013-08-24 Thread sahil301290
I am unable to check homogeneity of Array. I have take Array type Int to be default for my code. Instead of getting Error on NON-INT Values. I want to take input as string. Then check if all input is in (0-9) form, I typecast it into int and Accept. Else, I would like to skip that input. eg. my

[issue15125] argparse: positional arguments containing - in name not handled well

2013-08-24 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15125 ___ ___ Python-bugs-list

[issue17974] Migrate unittest to argparse

2013-08-24 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17974 ___ ___ Python-bugs-list

[issue17741] event-driven XML parser

2013-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Using tulip-inspired method names (when tulip hasn't landed) to duplicate existing data input functionality (feed() and close()) seems a rather dubious design decision to me. Given how popular lxml.etree is as an alternative to the standard library's etree

[issue5876] __repr__ returning unicode doesn't work when called implicitly

2013-08-24 Thread Armin Rigo
Armin Rigo added the comment: @Serhiy: it's a behavior change and as such not an option for a micro release. For example, the following legal code would behave differently: it would compute s = '\\u1234' instead of s = 'UTF8:\xe1\x88\xb4'. try: s = repr(x) except

[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2013-08-24 Thread Martin Panter
Martin Panter added the comment: I was surprised to discover that “option straddling” doesn’t work this way with nargs=*. It seems to work fine with most other kinds of positional arguments I have tried, and I imagine that this was by design rather than accident. Many Gnu CLI programs also

[issue14191] argparse doesn't allow optionals within positionals

2013-08-24 Thread Martin Panter
Martin Panter added the comment: It sounds like this bug might cover Issue 15112, which is only concerned with options between different positional parameters. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org

[issue17410] Generator-based HTMLParser

2013-08-24 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17410 ___ ___ Python-bugs-list

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch. Note that I'm still not sure whether it belong to the socket module or test.support. -- keywords: +needs review, patch stage: needs patch - patch review versions: +Python 3.4 Added file:

[issue18538] `python -m dis ` should use argparse

2013-08-24 Thread Michele Orrù
Michele Orrù added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18538 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18643] implement socketpair() on Windows

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: On Linux, many tests of test_socket are failing with the pure Python implementation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: On Linux, many tests of test_socket are failing with the pure Python implementation. The only failing tests I see are due to the fact that the Python implementation uses AF_INET instead of AF_UNIX, which is normal since Windows doesn't have AF_UNIX.

[issue18824] Adding LogRecord attribute traceback

2013-08-24 Thread Sworddragon
New submission from Sworddragon: On configuring a logger with logging.basicConfig() and using logging.exception() the traceback is always written implicitly to the end. This makes it not possible to create a formation that writes something beyond the traceback. For example it could be

[issue18825] Making msg optional on logging.exception() and similar variants

2013-08-24 Thread Sworddragon
New submission from Sworddragon: For logging.exception() and similar variants the msg argument must be passed but on a formation the LogRecord message is not mandatory. In this case wouldn't it be better to make the msg argument optional? At default it could be None or ''. --

[issue14019] Unify tests for str.format and string.Formatter

2013-08-24 Thread Francisco Freire
Francisco Freire added the comment: Thanks for the review. I corrected some issues in my code. Here is the new patch. -- Added file: http://bugs.python.org/file31453/mywork2.patch ___ Python tracker rep...@bugs.python.org

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, I've updated the patch to have a distinct selectors module, and with Guido's comments. Before I post it for final review, I have three more questions: 1) In the documentation, I don't know how to best refer to files object registered: is file

[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-24 Thread Tamas K
Tamas K added the comment: After a quick glance, I can't see how this patch would fix the problem. It still depends on threading's Thread.join, which is affected by the race condition in __bootstrap_inner. We already did a Thread.join before calling Py_EndInterpreter and still got bitten by

[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, that's a good point. It does bring in line subinterpreters with the main interpreter when it comes to automatically joining non-daemon threads, but it doesn't solve the race condition you talked about. I forgot a bit too fast about it :-) --

[issue18643] implement socketpair() on Windows

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: Do you see other failures? I applied your patch and I just replace the hasattr with: hasattr(_socket, Xsocketpair). test_socket failures: == FAIL: test_sendall_interrupted

[issue17741] event-driven XML parser

2013-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Reopening this as per discussion on python-dev. I haven't reverted anything at this point, as subsequent changes mean a simple hg backout is no longer sufficient. -- resolution: fixed - stage: committed/rejected - needs patch status: closed - open

[issue18538] `python -m dis ` should use argparse

2013-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 59f98b96607e by Nick Coghlan in branch 'default': Close #18538: ``python -m dis`` now uses argparse. http://hg.python.org/cpython/rev/59f98b96607e -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed

[issue17400] ipaddress should make it easy to identify rfc6598 addresses

2013-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Reopening this - rewording the issue title to cover the problem to be solved (i.e. accounting for RFC 6598 addresses) rather than a specific solution (which isn't appropriate, since the RFC *explicitly* states that shared addresses and private addresses aren't

[issue18803] Fix more typos in .py files

2013-08-24 Thread Févry Thibault
Févry Thibault added the comment: Ezio : Yes, I was just following Reddy's advice from another bug report (issue 18466) Terry : Yes, looks like I was tired while doing that... Should be fixed in the updated patch -- Added file: http://bugs.python.org/file31454/more_typos.diff

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: New changeset fe949918616c by Antoine Pitrou in branch 'default': Issue #18756: Improve error reporting in os.urandom() when the failure is due to something else than /dev/urandom not existing. http://hg.python.org/cpython/rev/fe949918616c

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Or more precisely, just run the test in a subprocess. That should fix the OS X failure if we don't restore the RLIMIT_NOFILE limits, and will make the test more robust (but you can't reuse the new test, since it won't work with lazy-opening).

[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch to remove the race condition. The patch is sufficiently delicate that I'd rather reserve this for 3.4, though. -- nosy: +neologix Added file: http://bugs.python.org/file31455/threadstate_join.patch

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9e62929460e by Antoine Pitrou in branch '3.3': Issue #18756: make test_urandom_failure more robust by executing its code in a subprocess http://hg.python.org/cpython/rev/b9e62929460e New changeset 68ff013b194c by Antoine Pitrou in branch

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, the tiger should feel better now :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18756 ___ ___

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Since nobody seems to object to the patch, I'm commit it :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18772 ___

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2f1bac39565a by Antoine Pitrou in branch 'default': Issue #18772: fix the gdb plugin after the set implementation changes http://hg.python.org/cpython/rev/2f1bac39565a -- ___ Python tracker

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, it should be ok now (at least now the test passes here). -- stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18772

[issue18826] reversed() requires a sequence - Could work on any iterator?

2013-08-24 Thread Donald Stufft
New submission from Donald Stufft: I noticed today that the builtin reversed() requires an explicit sequence and won't work with an iterator instead it throws a TypeError like: reversed(x for x in [1, 2, 3]) TypeError: argument to reversed() must be a sequence It would be really great if

[issue18826] reversed() requires a sequence - Could work on any iterator?

2013-08-24 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18826 ___ ___ Python-bugs-list

[issue16853] add a Selector to the select module

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Alright, I've updated the patch to have a distinct selectors module, and with Guido's comments. Didn't you forget to upload it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16853

[issue18826] reversed() requires a sequence - Could work on any iterator?

2013-08-24 Thread Donald Stufft
Donald Stufft added the comment: As an additional note this works how I would expect it to work if you're using sorted() instead of reversed() which I think is a stronger point in the favor of making reversed() work this way as well. sorted(x for x in [1, 2, 3]) [1, 2, 3] --

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: So, to come back to the original topic, is everyone sold on the idea of caching the urandom fd lazily? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18756

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Donald Stufft
Donald Stufft added the comment: Lazily opening urandom and holding it open sounds like a sane thing to do to me +1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18756 ___

[issue18746] test_threading.test_finalize_with_trace() fails on FreeBSD buildbot

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: It may be related to #18408 (changeset 5bd9db528aed) and #18664. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18746 ___

[issue18664] occasional test_threading failure

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: See also issue #18746. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18664 ___ ___ Python-bugs-list mailing

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Didn't you forget to upload it? I wanted to have answer to my questions first :-): Before I post it for final review, I have three more questions: -- ___ Python tracker rep...@bugs.python.org

[issue16853] add a Selector to the select module

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Didn't you forget to upload it? I wanted to have answer to my questions first :-): Ah, indeed, sorry! 1) In the documentation, I don't know how to best refer to files object registered: is file descriptor OK, or is it too low-level? Otherwise I'd be

[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2013-08-24 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15112 ___ ___ Python-bugs-list mailing list

[issue18827] mistake in the timedelta.total_seconds docstring

2013-08-24 Thread Alexander Schier
New submission from Alexander Schier: Return the total number of seconds contained in the duration. Equivalent to (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 computed with true division enabled. Should be Return the total number of seconds contained in the

[issue18827] mistake in the timedelta.total_seconds docstring

2013-08-24 Thread Tim Peters
Tim Peters added the comment: The docs look correct to me. For example, from datetime import * td = datetime.now() - datetime(1,1,1) td datetime.timedelta(735103, 61756, 484000) td.total_seconds() 63512960956.484 ^ What the

[issue18582] PBKDF2 support

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18582 ___ ___ Python-bugs-list

[issue17134] Use Windows' certificate store for CA certs

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17134 ___ ___ Python-bugs-list

[issue18827] mistake in the timedelta.total_seconds docstring

2013-08-24 Thread Alexander Schier
Alexander Schier added the comment: Err, sorry my fault. Too late in the evening ;). I saw the division by one million, but not the multiplation by one million before. Additionally i was confused, because i expected that seconds are added to each other in the parenthesis. closing.

[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if ssl imported before hashlib

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9146 ___ ___ Python-bugs-list

[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17128 ___ ___ Python-bugs-list

[issue18233] SSLSocket.getpeercertchain()

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18233 ___ ___ Python-bugs-list

[issue14518] Add bcrypt $2a$ to crypt.py

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14518 ___ ___ Python-bugs-list

[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18454 ___ ___ Python-bugs-list

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: self.assertEqual(sock.family, socket.AF_UNIX) AssertionError: 2 != 1 This is normal. == FAIL: test_sendall_interrupted (test.test_socket.GeneralModuleTests)

[issue8813] SSLContext doesn't support loading a CRL

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8813 ___ ___ Python-bugs-list

[issue13655] Python SSL stack doesn't have a default CA Store

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft donald.stu...@gmail.com: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13655 ___ ___ Python-bugs-list

[issue16113] Add SHA-3 (Keccak) support

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft don...@stufft.io: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16113 ___ ___ Python-bugs-list mailing

[issue8106] SSL session management

2013-08-24 Thread Donald Stufft
Changes by Donald Stufft don...@stufft.io: -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8106 ___ ___ Python-bugs-list mailing

[issue18807] Allow venv to create copies, even when symlinks are supported

2013-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset ffb01a6c0960 by Vinay Sajip in branch 'default': Closes #18807: pyvenv now takes a --copies argument allowing copies instead of symlinks even where symlinks are available and the default. http://hg.python.org/cpython/rev/ffb01a6c0960 --

[issue17741] event-driven XML parser

2013-08-24 Thread Eli Bendersky
Eli Bendersky added the comment: I like the idea of having .events() in a special target passed to a XMLParser, which already has feed() and close(). I read through Stefan's proposal and there are a couple of issues I wanted to raise: 1. Why have the event builder wrap a tree builder? Can't

[issue16611] Cookie.py does not parse httponly or secure cookie flags

2013-08-24 Thread Julien Phalip
Julien Phalip added the comment: Thanks for the review and new patch, David! Your approach makes sense and the patch looks good to me. However, regarding backwards-compatibility, is that really a concern? Currently the deserialization process systematically 1) Adds the 'httponly' and

  1   2   >