Re: Communication between C++ server and Python app

2012-04-29 Thread Cameron Simpson
On 29Apr2012 11:42, Chris Angelico ros...@gmail.com wrote:
| On Sun, Apr 29, 2012 at 10:45 AM, kenk marcin.maksym...@googlemail.com 
wrote:
|  I've got a server process written in C++ running on Unix machine.
|  On the same box I'd like to run multiple Python scripts that will
|  communicate with this server.
| 
|  Can you please suggest what would be best was to achieve this ?
| 
| Personally, I would recommend a TCP socket, because that allows the
| flexibility of splitting across multiple computers.

And the pain of ensuring security, if you're in an open network.

| But for
| efficiency, you may want to consider a Unix socket too.

A UNIX socket or even a named pipe has the benefit of:
  - not being available remotely
  - access control with normal UNIX permissions
and of course efficiency as you say.

Generalising to a TCP socket later shouldn't be too hard if the need
arises.

Cheers,
-- 
Cameron Simpson c...@zip.com.au DoD#743
http://www.cskk.ezoshosting.com/cs/

Waiting for the bus is a bad idea if you turn out to be the bus driver.
- Michael M. Butler on the Singularity
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Cameron Simpson
On 29Apr2012 02:49, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 
wrote:
| On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote:
|  Learn Technical Writing from Unix Man in 10 Days
|  
|  Quote from man apt-get:
|  
|  remove
|  remove is identical to install except that packages are
|  removed
|  instead of installed.
| 
| Do you also expect the documentation to define except, instead, is, 
| to and the?

Of course he doesn't. But he may have expected something less trite from
the sentence, not that that would really make it more clear.

| If you don't know what install and remove means, then you need an 
| English dictionary, not a technical manual.

Well, the sentence _is_ on par with several Haynes manuals which say
after the remove/access motorcycle/car component: installation is the
reverse of the disassembly. Fair enough.

However, I notice that my Haynes manuals on livestock do not include
this sentence in the butchering chapters:-)

Cheers,
-- 
Cameron Simpson c...@zip.com.au DoD#743
http://www.cskk.ezoshosting.com/cs/

Ride Free, Ride Nude!   - David Jevans jev...@apple.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: confusing doc: mutable and hashable

2012-04-29 Thread Arnaud Delobelle
(sent from my phone)
On Apr 28, 2012 7:36 PM, Chris Rebert c...@rebertia.com wrote:
 Correct. Pedantically, you can define __hash__() on mutable objects;
 it's just not very useful or sensible, so people generally don't.

I find it's fine to define __hash__ on mutable objects as long as __eq__
only relies on immutable state (and then so should __hash__ of course).  A
typical example would be an object that does some caching.

-- 
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread John O'Hagan
On Sat, 28 Apr 2012 14:55:42 -0700 (PDT)
Xah Lee xah...@gmail.com wrote:

 Learn Technical Writing from Unix Man in 10 Days
 
 Quote from man apt-get:
 
 remove
 remove is identical to install except that packages are
 removed
 instead of installed.
 
 Translation:
 
 kicking
 kicking is identical to kissing except that receiver is kicked
 instead of kissed.
 

That's funny - out of context. Maybe you're trying out material for a stand-up
comedy routine, but I'm sure you're aware that the sentence you quote sensibly
obviates repeating the semantics of install, which have just been described
in detail in the immediately preceding paragraph. If it did repeat them,
wouldn't you mock the docs anyway, for redundancy?

Regards,
--
John 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: confusing doc: mutable and hashable

2012-04-29 Thread John O'Hagan
On Sat, 28 Apr 2012 11:35:12 -0700
Chris Rebert c...@rebertia.com wrote:

[...]
 Correct. Pedantically, you can define __hash__() on mutable objects;
 it's just not very useful or sensible, so people generally don't. As
 http://docs.python.org/reference/datamodel.html#object.__hash__ states
 [emphasis added]:
 
 If a class defines *mutable* objects and implements a __cmp__() or
 __eq__() method, it *should not* implement __hash__(), since hashable
 collection implementations require that a object’s hash value is
 immutable (if the object’s hash value changes, it will be in the wrong
 hash bucket).
[...]

How do function objects fit into this scheme? They have __hash__, __eq__, seem
to work as dict keys and are mutable. Is it because their hash value doesn't
change? Under what circumstances does an object's hash value change?
--
John


-- 
http://mail.python.org/mailman/listinfo/python-list


algorithm does python use to compare two strings

2012-04-29 Thread J. Mwebaze
I am just wondering which specific algorithm does python use to compare two
strings.  Could it be the  Longest common subsequence is the most u

Regards

-- 
*Mob UG: +256 (0) 70 1735800 | NL +31 (0) 6 852 841 38 | Gtalk: jmwebaze |
skype: mwebazej | URL: www.astro.rug.nl/~jmwebaze

/* Life runs on code */*
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Alan Mackenzie
Hello, Xah.

In comp.emacs Xah Lee xah...@gmail.com wrote:
 Learn Technical Writing from Unix Man in 10 Days

 Quote from man apt-get:

remove
remove is identical to install except that packages are
 removed
instead of installed.

 Translation:

kicking
kicking is identical to kissing except that receiver is kicked
instead of kissed.

Ha ha ha ha!!

You don't need to go as far as apt-get to see this.  Even worse is C-h f
car in Emacs.  Imagine it before the last paragraph got added.  This only
happened after a fairly long thread on emacs-devel.

There are far too many man pages which are suboptimal, to say the least.

 further readings:

[  ]

 DISAPPEARING URL IN DOC

 so, i was reading man git. Quote:

Formatted and hyperlinked version of the latest git documentation
 can
be viewed at http://www.kernel.org/pub/software/scm/git/docs/.

 but if you go to that url, it shows a list of over one hundred fourty
 empty dirs.

 I guess unix/linux idiots can't be bothered to have correct
 documentation. Inability to write is one thing, but they are unable to
 maintain a link or update doc?

Maintaining links is actually quite hard.  After the struggle to document
remove, one typically has insufficient energy left over to check all
the links.

 does this ever happens to Apple's docs? If it did, i don't ever recall
 seeing it from 18 years of using Mac.

Have you ever tried to set up CUPS, the printing system?  At one point,
you're supposed to enter the URI of the printer, without any explanation
of what the URI of a local printer is.  At another point you're prompted
to enter Name.  Name of what?  If you click on the help, you get
taken to a search box, not proper docs.  Typing name into the search
box isn't useful.  And so it goes on.

CUPS is an Apple product.

 more records of careless dead link:

[  ]

-- 
Alan Mackenzie (Nuremberg, Germany).

-- 
http://mail.python.org/mailman/listinfo/python-list


Minor issue with sqlite3 and datetime

2012-04-29 Thread Frank Millman
Hi all

I could not find a mailing list for sqlite3 - hope it is ok to post here.

My problem actually originates with a different problem relating to MS Sql 
Server. Python's datetime.datetime object uses a precision of microseconds. 
Sql Server's DATETIME type only uses a precision of milliseconds. When I try 
to insert a datetime object into a DATETIME column, the microsecond portion 
is rejected, but the rest succeeds, so the object is stored to the nearest 
second.

My current workaround is, instead of inserting the datetime object directly, 
I use the following -

  dtm = dtm.isoformat(sep=' ')[:23]

This converts it to a string, and strips off the last three digits of the 
microseconds, converting them to milliseconds. It is not elegant, but it 
works.

I also use PostgreSQL and sqlite3. I don't want to code different routines 
for each one, so I use the same workaround for all three. It works with 
PostgreSQL, but not with sqlite3. Here is why.

sqlite3/dbapi2.py contains the following -

def convert_timestamp(val):
[...]
if len(timepart_full) == 2:
microseconds = int(timepart_full[1])
else:
microseconds = 0

It assumes that 'timepart_full[1]' is a string containing 6 digits. After my 
workaround, it only contains 3 digits, so it gives the wrong result.

I think that it should right-pad the string with zeroes to bring it up to 6 
digits before converting to an int, like this -

microseconds = int('{:06}'.format(timepart_full[1]))

Any chance of this being accepted?

Frank Millman



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy

On 4/29/2012 3:59 AM, J. Mwebaze wrote:

I am just wondering which specific algorithm does python use to compare
two strings.


'Python' does not use algorithms, implementations do. CPython may check 
id and or hash before doing a character-by-char comparison (or perhaps 
multiple chars at a time).


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: confusing doc: mutable and hashable

2012-04-29 Thread Terry Reedy

On 4/29/2012 3:57 AM, John O'Hagan wrote:


How do function objects fit into this scheme? They have __hash__, __eq__, seem
to work as dict keys and are mutable. Is it because their hash value doesn't
change?


I suspect functions use the default equality and hash based on id, which 
does not change.



Under what circumstances does an object's hash value change?


When someone has written a buggy .__hash__ method. Or perhaps if someone 
is making a non-standard, non-dict use of hash().


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: Communication between C++ server and Python app

2012-04-29 Thread Tamer Higazi
Take the twisted library.
I used to write myself a socket server and client.

Socket is fast, but you need on the other hand to know how big the
dataset might be, that will be serialized and deserialized as well.



Tamer

Am 29.04.2012 08:24, schrieb Cameron Simpson:
 On 29Apr2012 11:42, Chris Angelico ros...@gmail.com wrote:
 | On Sun, Apr 29, 2012 at 10:45 AM, kenk marcin.maksym...@googlemail.com 
 wrote:
 |  I've got a server process written in C++ running on Unix machine.
 |  On the same box I'd like to run multiple Python scripts that will
 |  communicate with this server.
 | 
 |  Can you please suggest what would be best was to achieve this ?
 | 
 | Personally, I would recommend a TCP socket, because that allows the
 | flexibility of splitting across multiple computers.
 
 And the pain of ensuring security, if you're in an open network.
 
 | But for
 | efficiency, you may want to consider a Unix socket too.
 
 A UNIX socket or even a named pipe has the benefit of:
   - not being available remotely
   - access control with normal UNIX permissions
 and of course efficiency as you say.
 
 Generalising to a TCP socket later shouldn't be too hard if the need
 arises.
 
 Cheers,

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Communication between C++ server and Python app

2012-04-29 Thread Chris Angelico
On Sun, Apr 29, 2012 at 4:24 PM, Cameron Simpson c...@zip.com.au wrote:
 On 29Apr2012 11:42, Chris Angelico ros...@gmail.com wrote:
 | Personally, I would recommend a TCP socket, because that allows the
 | flexibility of splitting across multiple computers.

 And the pain of ensuring security, if you're in an open network.

You have that with all IPC. You can always bind to 127.0.0.1 or ::1 to
stop other hosts from connecting; and then it's minimal change to open
it up.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: why () is () and [] is [] work in other way?

2012-04-29 Thread Kiuhnm

On 4/28/2012 16:18, Adam Skutt wrote:

On Apr 28, 7:26 am, Kiuhnmkiuhnm03.4t.yahoo.it  wrote:

On 4/27/2012 19:15, Adam Skutt wrote:

On Apr 27, 11:01 am, Kiuhnmkiuhnm03.4t.yahoo.itwrote:

The abstraction is this:
- There are primitives and objects.
- Primitives are not objects. The converse is also true.
- Primitives can become objects (boxing).
- Two primitives x and y are equal iff x == y.
- Two objects x and y are equal iff x.equals(y).
- Two objects are the same object iff x == y.
- If x is a primitive, then y = x is a deep copy.
- If x is an object, then y = x is a shallow copy.
- ...



This is not an abstraction at all, but merely a poor explanation of
how things work in Java.  Your last statement is totally incorrect, as
no copying of the object occurs whatsoever.  The reference is merely
reseated to refer to the new object. If you're going to chide me for
ignoring the difference between the reference and the referent object,
then you shouldn't ignore it either, especially in the one case where
it actually matters!  If we try to extend this to other languages,
then it breaks down completely.


With shallow copy I meant exactly that. I didn't think that my using the
term with a more general meaning would cause such a reaction.


It has a very strict, well-defined meaning in these contexts,
especially in languages such as C++.


In C++ it's called memberwise copy (see the C++ spec), which is not 
equivalent to Java's shallow copy, thanks to copy constructors.



So you're saying that I said that Primitive constructs are references.
Right...


No, still wrong.


You said:
You have the first statement backwards.  References are a primitive
construct, not the other way around.
The other way around is Primitive construct are references, but I 
never said that.



 What I said is correct, References are a form of
primitive construct.  In C, an int is a primitive but not a
reference.  An int* is a pointer (reference), and is also
(essentially) a primitive.


I never said it isn't.


  While true, it's still a bad way
to think about what's going on.  It breaks down once we add C++ /
Pascal reference types to the mix, for example.


?


Assignment to a C++ reference (T) effects the underlying object, not
the reference itself.  A reference can never be reseated once it is
bound to an object.  Comparing equality on two references directly is
the same as comparing two values (it calls operator==).  Comparing
identity requires doing (x ==y), like one would do with a value.
However, unlike a value, the object is not destroyed when the
reference goes out of scope.  Most importantly, references to base
classes do not slice derived class objects, so virtual calls work
correctly through references.

As a result, normally the right way to think about a value is as a
temporary name for an object and not worry about any of the details
about how the language makes it work.


If you add C++ references to Java, the abstraction breaks down too, so I 
don't see your point.



Equality or equivalence is a relation which is:
- reflexive
- symmetric
- transitive
Everything else... is something else. Call it semi-equality,
tricky-equality or whatever, but not equality, please.



Sure, but then it's illegal to allow the usage of '==' with floating
point numbers, which will never have these properties in any usable
implementation[1].


???



The operator == is called the equality operator.  Floating-point
numbers don't really obey those properties in any meaningful fashion.


I say they do. Any counter-examples?


The result is that portions of your view contradict others.  Either we
must give '==' a different name, meaning what you consider equality is
irrelevant, or we must use method names like 'equals', which you find
objectionable.


If anything, you have that backwards.  Look at Python: all variables
in Python have pointer semantics, not value semantics.



When everything is white, the word white becomes redundant.
So the fact that everything in Python have reference semantics means
that we can't stop thinking about value and reference semantics.



Nope. The behavior of variables is absolutely essential to writing
correct programs.  If I write a program in Python that treats
variables as if they were values, it will be incorrect.


You misunderstood what I said. You wouldn't treat variables as if they
were values because you wouldn't even know what that means and that
that's even a possibility.


Well, one hopes that is true.  I think we have a misunderstanding over
language: you said value and reference semantics when you really
meant value vs. reference semantics.


Ok.


I've never heard an old C programmer talk about value semantics and
reference semantics. When everything is a value, your world is pretty
simple.


Except if that were true, the comp.lang.c FAQ wouldn't have this
question and answer: http://c-faq.com/ptrs/passbyref.html, and several
others.


That's why I said an /old/ C programmer.


Much as 

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Kiuhnm

On 4/28/2012 23:55, Xah Lee wrote:

Learn Technical Writing from Unix Man in 10 Days

Quote from man apt-get:

 remove
 remove is identical to install except that packages are
removed
 instead of installed.

Translation:

 kicking
 kicking is identical to kissing except that receiver is kicked
 instead of kissed.


Superficial as always.

Here's the part you misquoted:

---
install
   install is followed by one or more packages desired for
   installation or upgrading. Each package is a package name, not a
   fully qualified filename (for instance, in a Debian GNU/Linux
   system, libc6 would be the argument provided, not
   libc6_1.9.6-2.deb). All packages required by the package(s)
   specified for installation will also be retrieved and installed.
   The /etc/apt/sources.list file is used to locate the desired
   packages. If a hyphen is appended to the package name (with no
   intervening space), the identified package will be removed if it is
   installed. Similarly a plus sign can be used to designate a package
   to install. These latter features may be used to override decisions
   made by apt-get's conflict resolution system.

   A specific version of a package can be selected for installation by
   following the package name with an equals and the version of the
   package to select. This will cause that version to be located and
   selected for install. Alternatively a specific distribution can be
   selected by following the package name with a slash and the version
   of the distribution or the Archive name (stable, testing,
   unstable).

   Both of the version selection mechanisms can downgrade packages and
   must be used with care.

   This is also the target to use if you want to upgrade one or more
   already-installed packages without upgrading every package you have
   on your system. Unlike the upgrade target, which installs the
   newest version of all currently installed packages, install will
   install the newest version of only the package(s) specified. Simply
   provide the name of the package(s) you wish to upgrade, and if a
   newer version is available, it (and its dependencies, as described
   above) will be downloaded and installed.

   Finally, the apt_preferences(5) mechanism allows you to create an
   alternative installation policy for individual packages.

   If no package matches the given expression and the expression
   contains one of '.', '?' or '*' then it is assumed to be a POSIX
   regular expression, and it is applied to all package names in the
   database. Any matches are then installed (or removed). Note that
   matching is done by substring so 'lo.*' matches 'how-lo' and
   'lowest'. If this is undesired, anchor the regular expression with
   a '^' or '$' character, or create a more specific regular
   expression.

remove
   remove is identical to install except that packages are removed
   instead of installed. Note the removing a package leaves its
   configuration files in system. If a plus sign is appended to the
   package name (with no intervening space), the identified package
   will be installed instead of removed.
---

Kiuhnm
--
http://mail.python.org/mailman/listinfo/python-list


Help with how to combine two csv files

2012-04-29 Thread Sammy Danso





Hello Experts,
I am new to python and I have been trying to merge two csv files, and upon 
several hours of unsuccessful attempts, I have decided to seek for help.
 
the format of the file is as follows. file A has  columns a, b, c and values 
1,2,3 for several rows. File B also has columns d,e and values 4,5  for same 
number of rows as A. the files however do not have any unique column between 
the two. 
I want an output file C to have columns  a,b,c,d,e with values 1,2,3,4,5
 
I would be very grateful for your help with some code.
 
Thanks very much,
Sammy-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help with how to combine two csv files

2012-04-29 Thread Chris Angelico
On Mon, Apr 30, 2012 at 1:49 AM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
        What do you want done if one file has fewer records than the other?

The OP did state that the files had the same number of rows. I'd say
this issue is outside the scope of the question.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: syntax for code blocks

2012-04-29 Thread Peter Pearson
On Fri, 27 Apr 2012 13:24:35 +0200, Kiuhnm kiuhnm03.4t.yahoo.it wrote:
 I'd like to change the syntax of my module 'codeblocks' to make it more 
 pythonic.

 Current Syntax:

  with res  func(arg1)  'x, y':
  print(x, y)

  with res  func(arg1)  block_name  'x, y':
  print(x, y)

 New Syntax:

  with res == func(arg1) .taking_block (x, y):
  print(x, y)

  with res == func(arg1) .taking_block (x, y) as block_name:
  print(x, y)
[snip]

Hey, guys, am I the only one here who can't even guess what
this code does?  When did Python become so obscure?

-- 
To email me, substitute nowhere-spamcop, invalid-net.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: syntax for code blocks

2012-04-29 Thread Temia Eszteri
 Current Syntax:

  with res  func(arg1)  'x, y':
  print(x, y)

  with res  func(arg1)  block_name  'x, y':
  print(x, y)

 New Syntax:

  with res == func(arg1) .taking_block (x, y):
  print(x, y)

  with res == func(arg1) .taking_block (x, y) as block_name:
  print(x, y)
[snip]

Hey, guys, am I the only one here who can't even guess what
this code does?  When did Python become so obscure?

-- 
To email me, substitute nowhere-spamcop, invalid-net.

No, it's pretty impenetratable to me at a passing glance too. Not sure
if I'd get anywhere handtracing it, though.

~Temia
--
When on earth, do as the earthlings do.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy

On 4/29/2012 6:05 AM, Terry Reedy wrote:

On 4/29/2012 3:59 AM, J. Mwebaze wrote:

I am just wondering which specific algorithm does python use to compare
two strings.


'Python' does not use algorithms, implementations do. CPython may check
id and or hash before doing a character-by-char comparison (or perhaps
multiple chars at a time).


I think all the sequence comparisons check for equality of len() before 
doing item by item comparison.



--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python interface of Stanford Parser

2012-04-29 Thread ac27037
Dear Stefan, 

Because I am a very new beginner of python, even I don't know how to install
the package. I just copied the whole directory to the Lib dictionary. I need
steps to follow. Could you please help me? My system is Windows xp, thank
you!

Sincerely,
Vinco

--
View this message in context: 
http://python.6.n6.nabble.com/Python-interface-of-Stanford-Parser-tp4901977p4938837.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


convert integer to string

2012-04-29 Thread Andres Soto
I have already
 import string

 from string import *

but I can not still convert an integer to string
 str(42)
Traceback (most recent call last):
  File pyshell#20, line 1, in module
    str(42)
TypeError: 'module' object is not callable
 
What is it wrong?
Thank you
 
Prof. Dr. Andrés Soto
DES DACI
UNACAR-- 
http://mail.python.org/mailman/listinfo/python-list


Re: algorithm does python use to compare two strings

2012-04-29 Thread Robert Kern

On 4/29/12 5:34 PM, Terry Reedy wrote:

On 4/29/2012 6:05 AM, Terry Reedy wrote:

On 4/29/2012 3:59 AM, J. Mwebaze wrote:

I am just wondering which specific algorithm does python use to compare
two strings.


'Python' does not use algorithms, implementations do. CPython may check
id and or hash before doing a character-by-char comparison (or perhaps
multiple chars at a time).


Identity is checked first, but hashes aren't.


I think all the sequence comparisons check for equality of len() before doing
item by item comparison.


== does, but != and the ordering comparisons don't, at least in the 2.x str 
implementation. unicode objects don't compare lengths first because the rich 
comparison function really just defers to an old-style -1,0,+1 compare function. 
In Python 3.x, bytes objects behave the same, but str objects *do* the length 
comparison for both == and != (but not the others, naturally). phew


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list


Re: CPython thread starvation

2012-04-29 Thread John Nagle

On 4/28/2012 1:04 PM, Paul Rubin wrote:

Roy Smithr...@panix.com  writes:

I agree that application-level name cacheing is wrong, but sometimes
doing it the wrong way just makes sense.  I could whip up a simple
cacheing wrapper around getaddrinfo() in 5 minutes.  Depending on the
environment (both technology and bureaucracy), getting a cacheing
nameserver installed might take anywhere from 5 minutes to a few days to ...


IMHO this really isn't one of those times.  The in-app wrapper would
only be usable to just that process, and we already know that the OP has
multiple processes running the same app on the same machine.  They would
benefit from being able to share the cache, so now your wrapper gets
more complicated.  If it's not a nameserver then it's something that
fills in for one.  And then, since the application appears to be a large
scale web spider, it probably wants to run on a cluster, and the cache
should be shared across all the machines.  So you really probably want
an industrial strength nameserver with a big persistent cache, and maybe
a smaller local cache because of high locality when crawling specific
sites, etc.


Each process is analyzing one web site, and has its own cache.
Once the site is analyzed, which usually takes about a minute,
the cache disappears.  Multiple threads are reading multiple pages
from the web site during that time.

A local cache is enough to fix the huge overhead problem of
doing a DNS lookup for every link found.  One site with a vast
number of links took over 10 hours to analyze before this fix;
now it takes about four minutes.  That solved the problem.
We can probably get an additional minor performance boost with a real
local DNS daemon, and will probably configure one.

We recently changed servers from Red Hat to CentOS, and management
from CPanel to Webmin.  Before the change, we had a local DNS daemon
with cacheing, so we didn't have this problem.  Webmin's defaults
tend to be on the minimal side.

The DNS information is used mostly to help decide whether two URLs
actually point to the same IP address, as part of deciding whether a
link is on-site or off-site.  Most of those links will never be read.
We're not crawling the entire site, just looking at likely pages to
find the name and address of the business behind the site.  (It's
part of our Know who you're dealing with system, SiteTruth.)

John Nagle

--
http://mail.python.org/mailman/listinfo/python-list


Re: convert integer to string

2012-04-29 Thread MRAB

On 29/04/2012 18:18, Andres Soto wrote:

I have already

 import string
 from string import *

but I can not still convert an integer to string

 str(42)

Traceback (most recent call last):
File pyshell#20, line 1, in module
str(42)
TypeError: 'module' object is not callable



What is it wrong?


At some point you have bound str to a module.

Normally you would be getting this:

 str is __builtins__.str
True
--
http://mail.python.org/mailman/listinfo/python-list


Re: convert integer to string

2012-04-29 Thread Chris Rebert
On Sun, Apr 29, 2012 at 10:18 AM, Andres Soto soto_and...@yahoo.com wrote:
 I have already
 import string
 from string import *
 but I can not still convert an integer to string

There is no need to import the `string` module to do that. Most of the
`string` module is deprecated.
`str` is the *built-in* type for character strings; so no import is necessary

Also, imports of the form `from X import *` are generally to be avoided.

 str(42)

That should work.

 Traceback (most recent call last):
   File pyshell#20, line 1, in module
     str(42)
 TypeError: 'module' object is not callable

 What is it wrong?

Presumably, at some point you did:
import string
str = string
Or similar, thus shadowing the built-in type. As I said, there's no
need to `import string`, and the `str` type is built-in, so both these
lines are unnecessary.

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython thread starvation

2012-04-29 Thread Roy Smith
In article 7xipgj8vxh@ruckus.brouhaha.com,
 Paul Rubin no.email@nospam.invalid wrote:

 Roy Smith r...@panix.com writes:
  I agree that application-level name cacheing is wrong, but sometimes 
  doing it the wrong way just makes sense.  I could whip up a simple 
  cacheing wrapper around getaddrinfo() in 5 minutes.  Depending on the 
  environment (both technology and bureaucracy), getting a cacheing 
  nameserver installed might take anywhere from 5 minutes to a few days to ...
 
 IMHO this really isn't one of those times.  The in-app wrapper would
 only be usable to just that process, and we already know that the OP has
 multiple processes running the same app on the same machine.  They would
 benefit from being able to share the cache, so now your wrapper gets
 more complicated.

So, use memcache.  Trivial to set up, easy Python integration, and it 
has the expiration mechanism built in.  Not to mention it has a really 
cute web site (http://memcached.org/).

 Also, since this is a production application, doing something in 5
 minutes is less important than making it solid and configurable.

Maybe.  On the other hand, the time you save with a 5 minute solution 
can be spent solving other, harder, problems.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Communication between C++ server and Python app

2012-04-29 Thread Marcin Maksymiuk
Failr point  - I should do that in original question.

The C++ server runs on Unix (Mac OS X as a matter of fact) and, as I'm the one 
who develops it, can use whthever technology is suitable. 
Currently it uses STL, Boost and Qt libraries.

The server is responsible for providing connectivity to stock exchange and will 
be used mainly to monitor price of certain financial instruments and 
placing/cancelling orders.
My idea is to keep this as simple tool that will execute whathever it's asked 
for.

On top of this server I plan to write some trading logic in Python - scripts 
that will trigger certain actions depending on situation on market.

I planned to exchange text commands between the C++ server and Python scripts 
as Python is really good in parsing text and on server side Boost/STL also do 
the trick.
Communication between 'logic' and the server won't be high frequency - I plan 
to talk to teh server ~10 times a minute.

Will appreciate suggestions.

M.



On 29 Apr 2012, at 05:00, Rodrick Brown wrote:
   
 Sent from my iPad
 
 On Apr 28, 2012, at 8:45 PM, kenk marcin.maksym...@googlemail.com wrote:
 
 Hi,
 
 I've got a server process written in C++ running on Unix machine.
 On the same box I'd like to run multiple Python scripts that will
 communicate with this server.
 
 Can you please suggest what would be best was to achieve this ?
 
 Kind regards and thanks in advance!
 M.
 -- 
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: why () is () and [] is [] work in other way?

2012-04-29 Thread John Nagle

On 4/28/2012 4:47 AM, Kiuhnm wrote:

On 4/27/2012 17:39, Adam Skutt wrote:

On Apr 27, 8:07 am, Kiuhnmkiuhnm03.4t.yahoo.it wrote:

Useful... maybe, conceptually sound... no.
Conceptually, NaN is the class of all elements which are not numbers,
therefore NaN = NaN.


NaN isn't really the class of all elements which aren't numbers. NaN
is the result of a few specific IEEE 754 operations that cannot be
computed, like 0/0, and for which there's no other reasonable
substitute (e.g., infinity) for practical applications .

In the real world, if we were doing the math with pen and paper, we'd
stop as soon as we hit such an error. Equality is simply not defined
for the operations that can produce NaN, because we don't know to
perform those computations. So no, it doesn't conceptually follow
that NaN = NaN, what conceptually follows is the operation is
undefined because NaN causes a halt.


Mathematics is more than arithmetics with real numbers. We can use FP
too (we actually do that!). We can say that NaN = NaN but that's just an
exception we're willing to make. We shouldn't say that the equivalence
relation rules shouldn't be followed just because *sometimes* we break
them.


This is what programming languages ought to do if NaN is compared to
anything other than a (floating-point) number: disallow the operation
in the first place or toss an exception.


   If you do a signaling floating point comparison on IEEE floating
point numbers, you do get an exception.  On some FPUs, though,
signaling operations are slower.  On superscalar CPUs, exact
floating point exceptions are tough to implement.  They are
done right on x86 machines, mostly for backwards compatibility.
This requires an elaborate retirement unit to unwind the
state of the CPU after a floating point exception.  DEC Alphas
didn't have that; SPARC and MIPS machines varied by model.
ARM machines in their better modes do have that.
Most game console FPUs do not have a full IEEE implementation.

   Proper language support for floating point exceptions varies
with the platform.  Microsoft C++ on Windows does support
getting it right.  (I had to deal with this once in a physics
engine, where an overflow or a NaN merely indicated that a
shorter time step was required.)  But even there, it's
an OS exception, like a signal, not a language-level
exception.  Other than Ada, which requires it, few
languages handle such exceptions as language level
exceptions.


John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


numpy (matrix solver) - python vs. matlab

2012-04-29 Thread someone

Hi,

Notice cross-post, I hope you bear over with me for doing that (and I 
imagine that some of you also like python in the matlab-group like 
myself)...


--
Python vs. Matlab:
--

Python:

from numpy import matrix
from numpy import linalg
A = matrix( [[1,2,3],[11,12,13],[21,22,23]] )
print A=
print A
print A.I (inverse of A)=
print A.I

A.I (inverse of A)=
[[  2.81466387e+14  -5.62932774e+14   2.81466387e+14]
 [ -5.62932774e+14   1.12586555e+15  -5.62932774e+14]
 [  2.81466387e+14  -5.62932774e+14   2.81466387e+14]]


Matlab:

 A=[1 2 3; 11 12 13; 21 22 23]

A =

 1 2 3
111213
212223

 inv(A)
Warning: Matrix is close to singular or badly scaled.
 Results may be inaccurate. RCOND = 1.067522e-17.

ans =

   1.0e+15 *

0.3002   -0.60050.3002
   -0.60051.2010   -0.6005
0.3002   -0.60050.3002

--
Python vs. Matlab:
--

So Matlab at least warns about Matrix is close to singular or badly 
scaled, which python (and I guess most other languages) does not...


Which is the most accurate/best, even for such a bad matrix? Is it 
possible to say something about that? Looks like python has a lot more 
digits but maybe that's just a random result... I mean Element 1,1 = 
2.81e14 in Python, but something like 3e14 in Matlab and so forth - 
there's a small difference in the results...


With python, I would also kindly ask about how to avoid this problem in 
the future, I mean, this maybe means that I have to check the condition 
number at all times before doing anything at all ? How to do that?


I hope you matlabticians like this topic, at least I myself find it 
interesting and many of you probably also program in some other language 
and then maybe you'll find this worthwhile to read about.

--
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread Kiuhnm

On 4/30/2012 0:17, someone wrote:

Hi,

Notice cross-post, I hope you bear over with me for doing that (and I
imagine that some of you also like python in the matlab-group like
myself)...

--
Python vs. Matlab:
--

Python:

from numpy import matrix
from numpy import linalg
A = matrix( [[1,2,3],[11,12,13],[21,22,23]] )
print A=
print A
print A.I (inverse of A)=
print A.I

A.I (inverse of A)=
[[ 2.81466387e+14 -5.62932774e+14 2.81466387e+14]
[ -5.62932774e+14 1.12586555e+15 -5.62932774e+14]
[ 2.81466387e+14 -5.62932774e+14 2.81466387e+14]]


Matlab:

  A=[1 2 3; 11 12 13; 21 22 23]

A =

1 2 3
11 12 13
21 22 23

  inv(A)
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.067522e-17.

ans =

1.0e+15 *

0.3002 -0.6005 0.3002
-0.6005 1.2010 -0.6005
0.3002 -0.6005 0.3002

--
Python vs. Matlab:
--

So Matlab at least warns about Matrix is close to singular or badly
scaled, which python (and I guess most other languages) does not...


A is not just close to singular: it's singular!


Which is the most accurate/best, even for such a bad matrix? Is it
possible to say something about that? Looks like python has a lot more
digits but maybe that's just a random result... I mean Element 1,1 =
2.81e14 in Python, but something like 3e14 in Matlab and so forth -
there's a small difference in the results...


Both results are *wrong*: no inverse exists.


With python, I would also kindly ask about how to avoid this problem in
the future, I mean, this maybe means that I have to check the condition
number at all times before doing anything at all ? How to do that?


If cond(A) is high, you're trying to solve your problem the wrong way. 
You should try to avoid matrix inversion altogether if that's the case. 
For instance you shouldn't invert a matrix just to solve a linear system.


Kiuhnm
--
http://mail.python.org/mailman/listinfo/python-list


Re: Communication between C++ server and Python app

2012-04-29 Thread Cameron Simpson
On 29Apr2012 21:08, Chris Angelico ros...@gmail.com wrote:
| On Sun, Apr 29, 2012 at 4:24 PM, Cameron Simpson c...@zip.com.au wrote:
|  On 29Apr2012 11:42, Chris Angelico ros...@gmail.com wrote:
|  | Personally, I would recommend a TCP socket, because that allows the
|  | flexibility of splitting across multiple computers.
| 
|  And the pain of ensuring security, if you're in an open network.
| 
| You have that with all IPC. You can always bind to 127.0.0.1 or ::1 to
| stop other hosts from connecting; and then it's minimal change to open
| it up.

I'm as concerned with other users as with other hosts. Hence the pleasures of
UNIX permissions on a socket. You're right, I did say open network, didn't
I? Nonetheless, my preference stands unless a new use case arises.

Cheers,
-- 
Cameron Simpson c...@zip.com.au DoD#743
http://www.cskk.ezoshosting.com/cs/

Just because Unix is a multiuser system doesn't mean I want to share it with
anybody!- Paul Tomblin, in rec.aviation.military
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread someone

On 04/30/2012 12:39 AM, Kiuhnm wrote:


So Matlab at least warns about Matrix is close to singular or badly
scaled, which python (and I guess most other languages) does not...


A is not just close to singular: it's singular!


Ok. When do you define it to be singular, btw?


Which is the most accurate/best, even for such a bad matrix? Is it
possible to say something about that? Looks like python has a lot more
digits but maybe that's just a random result... I mean Element 1,1 =
2.81e14 in Python, but something like 3e14 in Matlab and so forth -
there's a small difference in the results...


Both results are *wrong*: no inverse exists.


What's the best solution of the two wrong ones? Best least-squares 
solution or whatever?



With python, I would also kindly ask about how to avoid this problem in
the future, I mean, this maybe means that I have to check the condition
number at all times before doing anything at all ? How to do that?


If cond(A) is high, you're trying to solve your problem the wrong way.


So you're saying that in another language (python) I should check the 
condition number, before solving anything?



You should try to avoid matrix inversion altogether if that's the case.
For instance you shouldn't invert a matrix just to solve a linear system.


What then?

Cramer's rule?
--
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread Nasser M. Abbasi

On 04/29/2012 05:17 PM, someone wrote:


I would also kindly ask about how to avoid this problem in
the future, I mean, this maybe means that I have to check the condition
number at all times before doing anything at all ? How to do that?



I hope you'll check the condition number all the time.

You could be designing a building where people will live in it.

If do not check the condition number, you'll end up with a building that 
will fall down when a small wind hits it and many people will die all 
because you did not bother to check the condition number when you solved 
the equations you used in your design.


Also, as was said, do not use INV(A) directly to solve equations.

--Nasser
--
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread Paul Rubin
someone newsbo...@gmail.com writes:
 A is not just close to singular: it's singular!
 Ok. When do you define it to be singular, btw?

Singular means the determinant is zero, i.e. the rows or columns
are not linearly independent.  Let's give names to the three rows:

  a = [1 2 3]; b = [11 12 13]; c = [21 22 23].

Then notice that c = 2*b - a.  So c is linearly dependent on a and b.
Geometrically this means the three vectors are in the same plane,
so the matrix doesn't have an inverse.

 Which is the most accurate/best, even for such a bad matrix? 

What are you trying to do?  If you are trying to calculate stuff
with matrices, you really should know some basic linear algebra.
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread someone

On 04/30/2012 02:38 AM, Nasser M. Abbasi wrote:

On 04/29/2012 05:17 PM, someone wrote:


I would also kindly ask about how to avoid this problem in
the future, I mean, this maybe means that I have to check the condition
number at all times before doing anything at all ? How to do that?



I hope you'll check the condition number all the time.


So how big can it (cond-number) be before I should do something else? 
And what to do then? Cramers rule or pseudoinverse or something else?



You could be designing a building where people will live in it.

If do not check the condition number, you'll end up with a building that
will fall down when a small wind hits it and many people will die all
because you did not bother to check the condition number when you solved
the equations you used in your design.

Also, as was said, do not use INV(A) directly to solve equations.


In Matlab I used x=A\b.

I used inv(A) in python. Should I use some kind of pseudo-inverse or 
what do you suggest?




--
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread Nasser M. Abbasi

On 04/29/2012 07:59 PM, someone wrote:



 Also, as was said, do not use INV(A) directly to solve equations.


In Matlab I used x=A\b.



good.


I used inv(A) in python. Should I use some kind of pseudo-inverse or
what do you suggest?



I do not use python much myself, but a quick google showed that pyhton 
scipy has API for linalg, so use, which is from the documentation, the 
following code example


  X = scipy.linalg.solve(A, B)

But you still need to check the cond(). If it is too large, not good. 
How large and all that, depends on the problem itself. But the rule of 
thumb, the lower the better. Less than 100 can be good in general, but I 
really can't give you a fixed number to use, as I am not an expert in 
this subjects, others who know more about it might have better 
recommendations.


--Nasser



--
http://mail.python.org/mailman/listinfo/python-list


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

2012-04-29 Thread Nasser M. Abbasi

On 04/29/2012 07:17 PM, someone wrote:


Ok. When do you define it to be singular, btw?



There are things you can see right away about a matrix A being singular 
without doing any computation. By just looking at it.


For example, If you see a column (or row) being a linear combination of 
other column(s) (or row(s)) then this is a no no.


In your case you have

 1 2 3
 111213
 212223

You can see right away that if you multiply the second row by 2, and 
subtract from that one times the first row, then you obtain the third row.


Hence the third row is a linear combination of the first row and the 
second row. no good.


When you get a row (or a column) being a linear combination of others 
rows (or columns), then this means the matrix is singular.


--Nasser
--
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Jason Earl
On Sat, Apr 28 2012, Steven D'Aprano wrote:

 On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote:

 Learn Technical Writing from Unix Man in 10 Days
 
 Quote from man apt-get:
 
 remove
 remove is identical to install except that packages are
 removed
 instead of installed.


 Do you also expect the documentation to define except, instead, is, 
 to and the?

 If you don't know what install and remove means, then you need an 
 English dictionary, not a technical manual.

It is considerably worse than that.  If you look at what the
documentation for apt-get actually says, instead of just the badly
mangled version that Xah shares you would realize that the post was
basically a bald-face troll.

The rest of Xah's links in this particular article was even worse.  For
the most part he was criticizing documentation flaws that have
disappeared years ago.

Heck, his criticism of Emacs' missing documentation has been fixed since
Emacs 21 (the Emacs developers are currently getting ready to release
Emacs 24).  His criticism of git's documentation is also grossly
misleading.  kernel.org still has the empty directories, but git-scm.org
has been the official home for git's documentation for years.

I am sure that the rest of the examples are just as ridiculous.  I tend
to like Xah's writing.  Heck, I even sent a few bucks his way as thanks
for his Emacs Lisp tutorials.  However, that particular post was simply
ridiculous.

Jason
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: syntax for code blocks

2012-04-29 Thread Serhiy Storchaka

29.04.12 19:05, Peter Pearson написав(ла):

Hey, guys, am I the only one here who can't even guess what
this code does?  When did Python become so obscure?


This isn't Python at all. It's Ruby.

--
http://mail.python.org/mailman/listinfo/python-list


Re: syntax for code blocks

2012-04-29 Thread Ben Finney
Peter Pearson ppearson@nowhere.invalid writes:

 On Fri, 27 Apr 2012 13:24:35 +0200, Kiuhnm kiuhnm03.4t.yahoo.it wrote:

  I'd like to change the syntax of my module 'codeblocks' to make it
  more pythonic.

The “chained callable” style isn't very Pythonic, IMO. Even worse is the
penchant for ‘foo .bar()’, the space obscures the fact that this is
attribute access.

Far from Pythonic, this seems to be an attempt to write some other
language in Python code.

  Current Syntax:
 
   with res  func(arg1)  'x, y':
   print(x, y)
 
   with res  func(arg1)  block_name  'x, y':
   print(x, y)
 
  New Syntax:
 
   with res == func(arg1) .taking_block (x, y):
   print(x, y)
 
   with res == func(arg1) .taking_block (x, y) as block_name:
   print(x, y)
 [snip]

 Hey, guys, am I the only one here who can't even guess what
 this code does?  When did Python become so obscure?

No, you're not alone; I think that code is pretty poor at communicating
the intent.

AFAICT the above code is a proposal. I don't know who (other than the
original poster) thinks it's any good.

-- 
 \   “I cannot be angry at God, in whom I do not believe.” —Simone |
  `\   De Beauvoir |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Chris Angelico
On Mon, Apr 30, 2012 at 12:43 PM, Jason Earl je...@notengoamigos.org wrote:
 It is considerably worse than that.  If you look at what the
 documentation for apt-get actually says, instead of just the badly
 mangled version that Xah shares you would realize that the post was
 basically a bald-face troll.

Not only that, but a completely off-topic one... like a lot of his
trolls. What has 'man apt-get' to do with Python? For all I know, the
package may be written in Python, or the man page could be generated
on-the-fly by a Python script, but unless you say how it's relevant to
python-list/c.l.p, it's not obvious. Now, if that were 'man python'
that he's criticizing, then sure. But it's not.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Xah Lee
On Apr 29, 7:43 pm, Jason Earl je...@notengoamigos.org wrote:
 On Sat, Apr 28 2012, Steven D'Aprano wrote:
  On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote:

  Learn Technical Writing from Unix Man in 10 Days

  Quote from man apt-get:

      remove
          remove is identical to install except that packages are
  removed
          instead of installed.

  Do you also expect the documentation to define except, instead, is,
  to and the?

  If you don't know what install and remove means, then you need an
  English dictionary, not a technical manual.

 It is considerably worse than that.  If you look at what the
 documentation for apt-get actually says, instead of just the badly
 mangled version that Xah shares you would realize that the post was
 basically a bald-face troll.

 The rest of Xah's links in this particular article was even worse.  For
 the most part he was criticizing documentation flaws that have
 disappeared years ago.

 Heck, his criticism of Emacs' missing documentation has been fixed since
 Emacs 21 (the Emacs developers are currently getting ready to release
 Emacs 24).  His criticism of git's documentation is also grossly
 misleading.  kernel.org still has the empty directories, but git-scm.org
 has been the official home for git's documentation for years.

 I am sure that the rest of the examples are just as ridiculous.  I tend
 to like Xah's writing.  Heck, I even sent a few bucks his way as thanks
 for his Emacs Lisp tutorials.  However, that particular post was simply
 ridiculous.

 Jason

jason, are you trolling me, or me you?

☺

 Xah
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Temia Eszteri
jason, are you trolling me, or me you?

?

 Xah

Depends on what you classify as trolling these days. In all honesty,
the original concept of trolling seems to have become a lost art, with
only a few people even knowing what the act actually was anymore, and
in its absence everyone seems to draw their own definitions and
conclusions of the term where it can be applied to whoever is
antagonistic towards them at the time.

In one definition, that being the one defined by common sense of
getting a reaction out of people, you in fact succeeded rather well
by getting a reaction in general, though it was mostly mockery and
heckling. In another definitions calling trolling an attempt at
getting upset reactions specifically, I'd have to say there isn't so
much of that unless your inquiry into who's trolling whom was because
you felt as if you had been slighted by Jason's statement.

So really, it's a crapshoot at this point. Who's trolling whom indeed.

~Temia
--
When on earth, do as the earthlings do.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Chris Angelico
On Mon, Apr 30, 2012 at 2:50 PM, Xah Lee xah...@gmail.com wrote:
 jason, are you trolling me, or me you?

Am I Turing dreaming I am a machine, or a machine dreaming I am Turing?

Personally, I've never Turred.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue1739648] zipfile.testzip() using progressive file reads

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

I'm not sure about new tests, but the changes in the docstring and old tests 
look necessary.

--
Added file: http://bugs.python.org/file25402/testzip-patch4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1739648
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14315] zipfile.ZipFile() unable to open zip File

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Anyone can look at the patch? This same problem reported in 
http://bugs.python.org/msg73317 .

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14315
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14657] Avoid two importlib copies

2012-04-29 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Uploaded new bootstrapping patch that handles the fully explicit import 
machinery.

I also tweaked a couple of things so it plays nicely in terms of building an 
initial version with the checked in importlib.h. Specifically: pythonrun still 
calls _frozen_importlib._install and can tolerate that function returning None. 
Longer term, we'd give the two hooks different names and returning None will 
become a fatal error, but for the moment, the current behaviour makes the patch 
much easier to work with.

Order is still wrong relative to the zipimport machinery and I haven't 
benchmarked the startup time overheads.

--
Added file: 
http://bugs.python.org/file25403/issue14657_bootstrap_from_disk_v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14657
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] re: Docstring for \s and \S doesn’t mention Unicode

2012-04-29 Thread py.user

py.user bugzilla-mail-...@yandex.ru added the comment:

\S is equivalent to [^\s]
like \d with \D

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14558] Documentation for unittest.main does not describe some keyword arguments.

2012-04-29 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Here's a patch.

--
assignee: docs@python - ezio.melotti
keywords: +patch
stage: needs patch - commit review
Added file: http://bugs.python.org/file25404/issue14558.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14558
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers

2012-04-29 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b26471a2a115 by Ezio Melotti in branch '2.7':
#14519: fix the regex used in the scanf example.
http://hg.python.org/cpython/rev/b26471a2a115

New changeset e317d651ccf8 by Ezio Melotti in branch '3.2':
#14519: fix the regex used in the scanf example.
http://hg.python.org/cpython/rev/e317d651ccf8

New changeset 7cc1cddb378d by Ezio Melotti in branch 'default':
#14519: merge with 3.2.
http://hg.python.org/cpython/rev/7cc1cddb378d

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14519
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers

2012-04-29 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Fixed, thanks for the report and the suggestions!

--
assignee: docs@python - ezio.melotti
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14519
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14691] a code example not highlighted in http://docs.python.org/dev/library/stdtypes.html#memoryview

2012-04-29 Thread Ramchandra Apte

New submission from Ramchandra Apte maniandra...@gmail.com:

A code example is not highlighted in the 3.3 docs for memoryview 
(http://docs.python.org/dev/library/stdtypes.html#memoryview)
Only 3.3 is affected by this bug as the code example is for a feature in 3.3.

--
assignee: docs@python
components: Documentation
messages: 159590
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: a code example not highlighted in 
http://docs.python.org/dev/library/stdtypes.html#memoryview
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14428] Implementation of the PEP 418

2012-04-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

test_process_time_threads is failing on one of the buildbots:

==
FAIL: test_process_time_threads (test.test_time.TimeTestCase)
--
Traceback (most recent call last):
  File 
/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/test/test_time.py,
 line 408, in test_process_time_threads
self.assertGreater(t2 - t1, 0.1)
AssertionError: 0.0804141256118 not greater than 0.1


The test is a bit too optimistic: a thread is looping for 0.2s, and the test 
checks that the process time (user + system) increased of at least 0.1s. If the 
thread is preempted, there's a high chance you won't get even as low as 0.1s.
I see two options: either increase the total running time, to make it really 
likely you'll get a chance to run (or decrase the lower threshold), or use 
times(2), and check the result against that (does Windows have such a syscall?).

--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14428
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14690] Use monotonic time for sched, trace and subprocess modules

2012-04-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

LGTM.
Juste one nitpick: why do you sometimes import the clock source as get_time() 
and others _time()? _time() looks fine to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14690
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-04-29 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Is there a way to add a :keep-doctest-flags: options to literal blocks?

--
stage: test needed - needs patch
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12947
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Support lines in zipfile looks contradictory and buggy. This complicates the 
code and makes the behavior of zipfile.ZipExtFile incompatible with the 
interface of other file-like objects. For example, the behavior of the read, 
read1 and peek differ from one described in io module.

If we are working with binary data, conversion of newlines is meaningless (and 
how about newlines in comments?). If we are working with text, the bytes must 
be decoded to str. This will help io.TextIOWrapper.

I suggest two alternatives:

1. Deprecate universal newline support in zipfile. zipfile.ZipExtFile should 
always work with non-modified bytes, and who need the text, let wraps 
zipfile.ZipExtFile with io.TextIOWrapper.

2. Automatically wrap a zipfile.ZipExtFile with io.TextIOWrapper if universal 
newlines mode is enabled. In this case, the data type will change from bytes to 
str. Add modes t and b to explicitly specify the data type. Add an encoding 
parameter (and other parameters if needed).

--
nosy: +storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6759
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11352] Update cgi module doc

2012-04-29 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

What is the reason for this one to languish for over a year now? Lack of proper 
patch? It’s marked “high priority”, so let’s get moving.

--
nosy: +hynek, sandro.tosi

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Jakob Simon-Gaarde

New submission from Jakob Simon-Gaarde jako...@gmail.com:

Hi
It seems like the parse_constant keyword parameter for registering a callback 
function is no longer called in Python 2.7.

http://docs.python.org/library/json.html#json.load

I am using Python 2.7.3 on Ubuntu 12.04

I have created and attached a script that shows the problem.
Output in Python 2.6:
Met an int!
Met a constant!
{u'a': None, u'b': None}

Output in Python 2.7:
Met an int!
{u'a': None, u'b': False}

So parse_int callback still works btw.

Best Regards Jakob Simon-Gaarde

--
components: Extension Modules
files: test_parse_constant.py
messages: 159596
nosy: Jakob.Simon-Gaarde
priority: normal
severity: normal
status: open
title: json.joads parse_constant callback not working anymore
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file25405/test_parse_constant.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] re: Docstring for \s and \S doesn’t mention Unicode

2012-04-29 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Good point.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] re: Docstring for \s and \S doesn’t mention Unicode

2012-04-29 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 23d5b457dc71 by Ezio Melotti in branch '3.2':
#14236: fix docs for \S.
http://hg.python.org/cpython/rev/23d5b457dc71

New changeset 9165774a8055 by Ezio Melotti in branch 'default':
#14236: merge with 3.2.
http://hg.python.org/cpython/rev/9165774a8055

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-29 Thread Q

Q abon...@gmail.com added the comment:

thanks, that's rather convenient

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14671
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

This behavior was changed in changeset f686aced02a3 three year ago. If this 
change is intentional, then you need edit documentation.

--
nosy: +storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Hi Jakob,

parse_constant has been changed as of d95e5add3ca4 to be called only on 
-Infinity, Infinity, NaN:

``parse_constant``, if specified, will be called with one of the
following strings: -Infinity, Infinity, NaN.
This can be used to raise an exception if invalid JSON numbers
are encountered.

And indeed, if you change your example to Infinity, it gets called.

That said, neither the 2.7 nor the dev docs reflect that. So it seems like a 
documentation bug to me.

--
assignee:  - docs@python
components: +Documentation -Extension Modules
nosy: +docs@python, eric.araujo, georg.brandl, hynek
versions: +Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file25406/json_parse_constant_doc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14315] zipfile.ZipFile() unable to open zip File

2012-04-29 Thread Yuval Greenfield

Yuval Greenfield ubershme...@gmail.com added the comment:

If we're modifying zipfile, please consider adding the reviewed patch for 
ZipFile.remove at http://bugs.python.org/issue6818

--
nosy: +ubershmekel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14315
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10376] ZipFile unzip is unbuffered

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Actually reading from the zip file is buffered (at least 4 KiB of uncompressed 
data at a time).

Can you give tests, scripts and data, which show the problem?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10376
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14671
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14692] json.joads parse_constant callback not working anymore

2012-04-29 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

The original changeset is at [0], and the commit message just says even more 
decoder optimizations.  The official website[1] and the RFC[2] don't list any 
constant, so I guess the definition of what a constant is is not well defined.

[0]: http://code.google.com/p/simplejson/source/detail?spec=svn103r=103
[1]: http://www.json.org/
[2]: http://tools.ietf.org/html/rfc4627

--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8767] Configure: Cannot disable unicode

2012-04-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8767
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14643] Security page out of date

2012-04-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14643
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14313] zipfile should raise an exception for unsupported compression methods

2012-04-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +patch
Added file: 
http://bugs.python.org/file25407/zipfile_unsupported_compression.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14672] Windows installer: add desktop shortcut(s)

2012-04-29 Thread Daniel Swanson

Daniel Swanson popcorn.tomato.d...@gmail.com added the comment:

Never mind. I think I used the start menu to do it myself.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14672
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-04-29 Thread Dov Feldstern

New submission from Dov Feldstern dfeldst...@nds.com:

Python has its own implementations of various hash functions, that can be used 
as fallbacks when openssl is not available. However, if openssl *is* available 
at build time, then these fallbacks don't get built.

It would be nice if they would get built even if openssl *was* found at build 
time:

  (1) for (perceived?) licensing issues, one might choose to run without 
linking with openssl (see 
http://mail.python.org/pipermail/python-dev/2011-March/109053.html; that 
message requests that a bug be opened about this, but I wasn't able to find it?)

  (2) for portable builds: build onto portable or shared storage, and run on 
multiple machines, even if openssl happens not to be available on some of the 
machines.

--
components: Build
messages: 159606
nosy: dov
priority: normal
severity: normal
status: open
title: hashlib fallback modules should be built even if openssl *is* available 
at build time
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4653] Patch to fix typos in C code

2012-04-29 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy:  -mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4653
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-04-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 that message requests that a bug be opened about this, but I wasn't able to 
 find it?

Probably because no-one opened an issue.

 build onto portable or shared storage, and run on multiple machines,
 even if openssl happens not to be available on some of the machines.

For portable builds, I would suggest you ship OpenSSL as part of the build.

--
nosy: +gregory.p.smith, pitrou
type:  - enhancement
versions: +Python 3.3 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2012-04-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Deprecate universal newline support in zipfile. zipfile.ZipExtFile
 should always work with non-modified bytes, and who need the text, let 
 wraps zipfile.ZipExtFile with io.TextIOWrapper.

This would be fine with me.

--
nosy: +pitrou
stage: patch review - needs patch
type: behavior - enhancement
versions: +Python 3.3 -Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6759
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-04-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14417] dict RuntimeError workaround

2012-04-29 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

I could check it in, but I probably would mess up something (which branches are 
affected?).  Let me know if you want me to.

The priorities after that would be:

1) update docs (the warning about RuntimeError needs to be moderated)
2) convert stress tests to unittests

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-29 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset c468511fc887 by Mark Dickinson in branch 'default':
Issue #14521: Make result of float('nan') and float('-nan') more consistent 
across platforms.  Further, don't rely on Py_HUGE_VAL for float('inf').
http://hg.python.org/cpython/rev/c468511fc887

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Now fixed.

--
resolution:  - fixed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14417] dict RuntimeError workaround

2012-04-29 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

Actually my patch doesn't even apply cleanly.  I suspect the dict refactoring 
for shared keys interfered.  Someone please help!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2012-04-29 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 This would be fine with me.

It may be worth to deprecate PEP 278?  Oh, only ten years have passed
since 2.3, but it seems it was so long ago.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6759
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2012-04-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 It may be worth to deprecate PEP 278?  Oh, only ten years have passed
 since 2.3, but it seems it was so long ago.

Well, I don't know if PEPs ever get deprecated. In this case, PEP 3116
is probably the superseder.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6759
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14691] a code example not highlighted in http://docs.python.org/dev/library/stdtypes.html#memoryview

2012-04-29 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Is it a sphinx version problem? I could not figure out why that particular code 
is not highlighted. The syntax looks correct.

--
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11352] Update cgi module doc

2012-04-29 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
assignee: docs@python - orsenthil
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14462] In re's named group the name cannot contain unicode characters

2012-04-29 Thread Matthew Barnett

Matthew Barnett pyt...@mrabarnett.plus.com added the comment:

It doesn't work in regex, but it probably should. IMHO, if it's a valid 
identifier, then it should be allowed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14462
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-04-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Actually, the modules are always compiled when in debug mode. Here is a patch 
to always compile them.

--
keywords: +patch
Added file: http://bugs.python.org/file25408/hashlibfallbacks.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14157] time.strptime without a year fails on Feb 29

2012-04-29 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
keywords: +needs review
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14157
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14082] shutil doesn't copy extended attributes

2012-04-29 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14082
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-29 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
components: +Library (Lib) -None
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14662
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9009] Improve quality of Python/dtoa.c

2012-04-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Dropping this due to lack of time;  unless anyone else wants to pick it up, it 
should probably be closed as won't fix.

--
assignee: mark.dickinson - 
priority: normal - low

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-29 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11012] Add log1p(), exp1m(), gamma(), and lgamma() to cmath

2012-04-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Unassigning.  I'm not planning to work on this in the forseeable future, though 
I'd be happy to review patches.

--
assignee: mark.dickinson - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11012
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10433] Document unique behavior of 'getgroups' on OSX

2012-04-29 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

This one LGTM, still applies cleanly against current tip and is languishing for 
a way to long time.

Commit  close?

--
nosy: +hynek
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10433
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14610] configure script hangs on pthread verification and PTHREAD_SCOPE_SYSTEM verification on Ubuntu

2012-04-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

I'm closing as invalid.
If you decide to fill a bug report to your distribution (or directly to the 
libc in this case), it'd be interesting to post a link to the bug report here.

Thanks.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type: crash - compile error

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14610
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-04-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 Anybody working on this one? I’d give it a shot otherwise.

Go ahead.
You could - should? - probably use the new os.fwalk() to walk
directories in a safe maner.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4489
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14694] Option to show leading zeros for bin/hex/oct

2012-04-29 Thread endolith

New submission from endolith endol...@gmail.com:

Suggestion: Add an option to bin/hex/oct functions to format binary output with 
a minimum fixed width, including leading zeros.  Also might be useful for hex 
and oct.

Currently, bin(18) produces '0b10010'

with this change, something like bin(18, foo=8) would produce '0b00010010'


Examples of people wanting this:

http://stackoverflow.com/questions/3258330/converting-from-hex-to-binary-without-losing-leading-0s-python

http://stackoverflow.com/questions/1002116/can-bin-be-overloaded-like-oct-and-hex-in-python-2-6

http://stackoverflow.com/a/1425558/125507

https://www.linuxquestions.org/questions/programming-9/in-python-printing-leading-zero-for-hex-numbers-0-through-f-719426/

--
components: Interpreter Core
messages: 159623
nosy: endolith
priority: normal
severity: normal
status: open
title: Option to show leading zeros for bin/hex/oct
type: enhancement
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14694] Option to show leading zeros for bin/hex/oct

2012-04-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

-1. str.format already does this quite effectively;  I don't see a real need to 
complicate the bin, hex and oct signatures.

 '{:016b}'.format(324)
'000101000100'
 '{:016o}'.format(324)
'0504'
 '{:016x}'.format(324)
'0144'

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14694] Option to show leading zeros for bin/hex/oct

2012-04-29 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
versions: +Python 3.3 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >