Is this O(N) or O(N^2) because of recopying of "s"?
I just want a sense of what's unusually inefficient in the
current implementation. Thanks.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
that, but wasn't sure. That's the kind of answer I was
looking for.
That kind of optimization is a huge win.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
open_https of class URLopener
with a local, patched version.
Does that actually work? When I've tried to do that in other code, it
seems to have no effect. In fact, I can write
URLopener.open_https = None
and nothing changes.
John Nagle
--
James Stroud wrote:
> John Nagle wrote:
>> The intent of this is to replace method open_https of class URLopener
>> with a local, patched version.
>>
>> Does that actually work? When I've tried to do that in other code, it
>> seems to
he namespace. I'm trying to avoid that; it causes obscure
aliasing problems.
On Python 2.4 under Windows 2000, importing from a subdirectory
appears to work. Is that a Python 2.3.4 thing, or a Linux thing,
or something else?
(The idea is to be able to run (mostly) the same Python co
teger, which fails.
M2Crypto is supposed to work with Python 2.3, so this should work.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Is "long" supposed to operate on C objects?
John Nagle
John Nagle wrote:
> I've been running M2Crypto successfully using Python 2.4 on Windows 2000,
> and now I'm trying to get it to work on Python 2.3.4 on Linux.
>
> Att
Gabriel Genellina wrote:
> At Thursday 18/1/2007 04:41, John Nagle wrote:
> On a previous version of M2Crypto that line said: map()[self.ctx] =
> self, and that failed too ("unhashable object", I think).
> I changed the class _ctxmap (the map() above returns an instance of
Heikki Toivonen wrote:
> John Nagle wrote:
>
>>Actually, at the moment I'm having an M2Crypto problem related
>>to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an
>>include file that needs __i386__ defined, which is something GCC
>>does based on
Heikki Toivonen wrote:
> John Nagle wrote:
>
>>OpenSSL version: "OpenSSL 0.9.7a Feb 19 2003"
>
>
> Hmm, I've never actually used that old OpenSSL myself, just assumed from
> the original author's notes that anything from 0.9.7 onward worked
should have
been fixed by now.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Harry George wrote:
> John Nagle <[EMAIL PROTECTED]> writes:
> You experience isn't shared by everyone. Some of us find Python the
> most functional and portable of the candidates you mention.
The language is fine. It's the bindings to other packages that
are the
Chris Mellon wrote:
> On 1/24/07, John Nagle <[EMAIL PROTECTED]> wrote:
>
>> Harry George wrote:
>> > John Nagle <[EMAIL PROTECTED]> writes:
> Just to be clear: The problem here is "my personal itch is not being
> scratched by other people for me&q
thon from within Python via concurrency errors?
Does the garbage collector run concurrently or does it freeze
all threads? What's different depending upon whether you're using
real OS threads or simulated Python threads?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ng
point mode when you leave, if you want. This is probably
only worth doing under a debugger, because otherwise you just end
up with an aborted instance of Python.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
John Pye wrote:
> Hi John,
>
> On Jan 25, 3:43 pm, John Nagle <[EMAIL PROTECTED]> wrote:
>
>>Python is probably running with floating point exceptions disabled,
>>but you can enable them in your C code, and restoring the floating
>>point mode when you leave, i
l never figure Blender out.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
em as event-driven systems in Twisted. Yet the
main packages aren't seriously broken. It's just that the learning curve
to make a small fix to any of them is substantial, so nobody new takes
on the problem.
John Nagle
Animats
--
http://mail.python.org/mailman/listinfo/python-list
ork with the built-in SSL module, and 4) get rid of SWIG.
If somebody will do 1), I'll take a look at 2).
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> John Nagle <[EMAIL PROTECTED]> writes:
>
>>That's the problem. We now have four SSL implementations for
>>Python, none of which let you do all the things OpenSSL can do.
>
>
> I'm aware of some OpenSSL wrappers plus TLSlite. A
AKA gray asphalt wrote:
> "John Nagle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>AKA gray asphalt wrote:
>>
>>>I downloaded Blender but there was no link for python. Am I on the right
>>>track?
>>
>>
AKA gray asphalt wrote:
> "John Nagle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Is the manual you refer to the group project on blender.org or the $ manual
> like the one on Ebay?
>
The "Blender 2.3 Guide" book. Also,
on glue code for SSL doesn't seem to have the
machinery to seed SSL with randomness. I suspect that on
platforms without '/dev/urandom', Python's SSL package may
be using the same keys every time. This needs to be looked
at by a crypto expert.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Scripter47 wrote:
> Hey
>
> It got a problem with python to connect to my SQL DBs, that's installed
> on my apache server. how do i connect to sql? Gettting data? Insert into
> it?
You need a third-party open source package called "MySQLdb".
time systems
have some form of stall timer like that; there's often a stall
timer in hardware.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
if the next thing to see that XML is a program,
not a human, why bother?
John Nagle
Justin Ezequiel wrote:
> On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote:
>
>>For example the raw data is as follows
>>
>>SomeText >Description>PassorFail
ule.
This requires a browser emulator, a browser without a renderer.
Useful for spam filters and such.
It's not clear if the original poster needs that much capability,
though.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
, but maybe the
> following place is of interest for you:
>
> http://www.opensourcexperts.com
>
> Ralf Schoenian
I'd recommend against Rent-A-Coder. I put a job out there
(overhauling "rwhois.py"), and three "coders" in succession
tried it and gave up.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
uch. Work on the tree, not a file with the text of the indented
output.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
, you're leaking memory.
On servers, this sometimes matters.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
that the fastest way to divide
by 7 is to use the divide instruction. You'd have to go down
to a really old 8-bit microprocessor like the Intel 8051 to
find something where bit-twiddling like that pays off.
And no way would this be a win in Python, which is
interpreted.
d these are companies that say they support Python.
Python still isn't ready for prime time in the web hosting world.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ession testing with each new Python distribution, but they don't
really need to be part of the main build. Right now, SSL is too
far inside, while the other two are too far outside. A middle
ground would help.
Otherwise, you get version hell.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
else:
raise # unexpected error, reraise
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
Mister Newbie wrote:
> I have no programming experience. I want to learn Python so I can make
> simple, 2D games. Where should I start? Can you recommend a good book?
>
> Thank you.
Blender GameKit.
John Nagle
--
http://mail.python
How do I suppress "DeprecationWarning: Old style callback, use cb_func(ok,
store) instead". A library is triggering this message, the library is being
fixed, but I need to make the message disappear from the output of a CGI
program.
John Nagl
Gabriel Genellina wrote:
> En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]>
> escribió:
>
>> John Nagle wrote:
>>
>>>How do I suppress "DeprecationWarning: Old style callback, use
>>>cb_func(ok,
>>> store) i
one with
dependencies on other components, can be a big deal.
So, focus on problems with modules which have C
components.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
To replicate, run
http://www.bankofamerica.com
or
http://www.gm.com
through BeautifulSoup.
Something about this code doesn't like big companies. Web sites of smaller
companies are going through OK.
Also reported as a bug:
[ 1651995 ] sgmllib _convert_ref UnicodeDecodeError exception, new in 2.5
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
nsaction program is launched in a separate process, and,
once done with one transaction, can be used to do another one
without reloading. When things are slow, the extra transaction processes
are told to exit; when load picks up, more of them are forked.
Security is comparable to CGI.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
I think the code is trying to
handle single quotes inside of double quotes, or something like that.
To replicate, run
http://www.bankofamerica.com
or
http://www.gm.com
through BeautifulSoup.
Something about this code doesn't like big companies. Web sites of smaller
compan
[EMAIL PROTECTED] wrote:
> John Nagle wrote:
>
>>Graham Dumpleton wrote:
>>
>>>On Feb 4, 1:05 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>>"Paul Boddie" <[EMAIL PROTECTED]> writes:
>> Rea
ioning issues between Python, SWIG, gcc, and OpenSSL,
and getting everything to play together can be difficult. This is
a packaging issue; major Linux distros aren't shipping a compatible set of
components.
But my own pure Python code is working fine in both version of Python,
and on both W
I'm trying to clean up a bad ASCII string, one read from a
web page that is supposedly in the ASCII character set but has some
characters above 127. And I get this:
File "D:\projects\sitetruth\InfoSitePage.py", line 285, in httpfetch
sitetext = sitetext.encode('ascii','replace') # for
John Nagle wrote:
> (Was prevously posted as a followup to something else by accident.)
>
>I'm running a website page through BeautifulSoup. It parses OK
> with Python 2.4, but Python 2.5 fails with an exception:
>
> Traceback (most recent call last):
>File &q
ectly to multicore desktops
and laptops.
I went to a talk at Stanford last week by one of Intel's
CPU architects, and he said we're going have hundreds of
CPUs per chip reasonably soon. Python needs to get ready.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
g excess
baggage.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
In the GCC world, any compiler since 3.2 should generate interchangeable
output.
http://gcc.gnu.org/onlinedocs/gcc/Compatibility.html
In the Windows world, I'm not sure about compatibility across the
VC6/.NET transition, but I think you only need one version for either
side of that
eleted from the object? Is behavior
the same for both old and new classes?
I'm trying to break cycles to fix some memory usage problems.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
s it. It's a non-trivial
> task.
There's a US address normalizer written in Perl available.
http://cpan.uwinnipeg.ca/htdocs/Geo-StreetAddress-US/Geo/StreetAddress/US.html
Not too big, too; it's mostly tables. Might not be too bad to convert.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
bly in some non-Python component; you shouldn't
be able to force a memory protection error from within Python code.
Also note that the "marshal" module may be unsafe.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
irect}) are other regular expressions,
being used here as subexpressions. Those have already been converted
to forms like "Addr_Match.direct" in Python. But how to call them?
Is that possible in Python, and if so, where is it documented?
Jo
Gabriel Genellina wrote:
> En Wed, 14 Feb 2007 01:07:33 -0300, John Nagle <[EMAIL PROTECTED]>
> escribió:
>
>> Here's a large Perl regular expression, from a Perl address parser in
>> CPAN:
>>
>> use re 'eval';
>> $Addr_Matc
t my scipy and Numeric aren't quite up-to-date:
> scipy version 0.3.2, Numeric v 24.2
That sounds like the case where the array has to be reallocated from
4-byte floats to 8-byte doubles is being botched.
Take a look at
"http://www.mail-archive.com/numpy-discussion@lists.sourc
If locking is expensive on x86, it's implemented wrong.
It's done right in QNX, with inline code for the non-blocking
case. Not sure about the current libraries for Linux, but
by now, somebody should have gotten this right.
John Nagle
Paul R
Paul Rubin wrote:
> John Nagle <[EMAIL PROTECTED]> writes:
>
>>If locking is expensive on x86, it's implemented wrong.
>>It's done right in QNX, with inline code for the non-blocking case.
>
>
> Acquiring the lock still takes an expensive instruc
t for
seven years now. The user base just wasn't interested.
Perl 5 was good enough, and users migrated to PHP for the
little stuff and other languages for the bigger stuff.
As Wikipedia says, "As of 2007, Perl 6 was still under development,
with no planned completion date."
Paul Rubin wrote:
> John Nagle <[EMAIL PROTECTED]> writes:
>
>> There's always the possiblity that Python 3 won't happen. Look at
>>what happened with Perl 6. That's been talked about for
>>seven years now. The user base just wasn't intere
BeautifulSoup would be a good test case for the PyPy crowd to
work on. It really needs the speedup.
John Nagle
sofeng wrote:
> On Feb 8, 11:43 am, "metaperl" <[EMAIL PROTECTED]> wrote:
>>On Feb 8, 2:38 pm, "mtuller" <[EMAIL
reaks the loops
that give reference counting trouble.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote:
> Are weak refs slower than strong refs? I've been considering making the
> "parent" links in BeautifulSoup into weak refs, so the trees will release
> immediately when they're no longer needed. In general, all links back
> towards the root of
Is there some way to get a strong ref to the original object back
from a weakref proxy object? I can't find any Python function to do this.
".ref()" doesn't work on proxy objects.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
go into a stream
of 8-bit bytes, not a Unicode string.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> En Sun, 25 Feb 2007 19:07:38 -0300, John Nagle <[EMAIL PROTECTED]>
> escribió:
>
>> Is there some way to get a strong ref to the original object back
>> from a weakref proxy object? I can't find any Python function to do
>
find Lisp programmers.
As someone who knows both languages, I'd stay with Python, although
trying to do heavy number crunching in a naive interpreter may be a problem.
That's a tough scheduling problem. It took about a year for the
NetJets people to develop their applic
rprocess
communication message passing system. There's the cost of one extra
copy for every I/O operation, but you don't notice it much in practice.
I've run 640x480x15FPSx24bits video through QNX messaging and only used
2% of an 1.5GHZ x86 CPU doing it.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
od idea.
Can you get some corporate support? It would be good to have
some organization behind this. Binaries are a security issue;
you need an organization or a reputation to distribute binaries.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
n charset
codec = None
try:
codecs.lookup(charset)
codec = charset
except (LookupError, ValueError):
pass
return codec
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
//bugs.python.org/issue960874
How did you find that? I put "codecs.lookup" into the tracker's
search box, and it returned five hits, but not that one.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ach update.
And can this be done portably across UNIX and Windows? Thanks.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
SQL and OpenSSL on a
shared hosting server and see how far you get. Or try to install
the same set of modules on both Linux and Windows.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
pen" doesn't support an "encoding" parameter. (It
probably should, for consistency.) Is there some way to do this?
Is it possible to express "unzip, then decode utf8" via
"codecs.open"?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
s huge.
Worst HTML I've seen in a while.
(We use BeautifulSoup to parse hostile web sites in bulk,
so we tend to discover more hard cases than most users.)
John Nagle
SiteTruth
--
http://mail.python.org/mailman/listinfo/python-list
I need to do a non-standard DNS server in Python. This
is for a spam blacklist type DNS server, not for IP lookup.
"dnspython" seems to be client side only. Oak DNS is
deprecated. Suggestions?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
age." So that's
what's possible.
I'm surprised that Google management isn't pushing Guido towards
doing something about the performance problem.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Had a Python program stall, using no time, after running OK for four days.
Python 2.4, Windows. Here's the location in Python where it's stalled.
Any idea what it's waiting for?
John Nagle
77FA1428 mov ecx,dword ptr [ebp-10h]
wonderful world of parsing hostile
sites
in Python. This is from a phishing attack, and that URL is in PhishTank.)
John Nagle
SiteTruth
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote:
> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed.
...
Simpler example:
import urlparse
s = 'http://www.example.com.mx?https://www.example.com'
print urlparse.urlparse(s)
produces
('http', 'www
Matt Nordhoff wrote:
> John Nagle wrote:
>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed.
>>
...
>
> It's breaking on the first slash, which just happens to be very late in
> the URL.
>
>>>> urlparse
John Nagle wrote:
> Matt Nordhoff wrote:
>> John Nagle wrote:
>>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed.
>>>
> ...
>
>>
>> It's breaking on the first slash, which just happens to be very late i
John Nagle wrote:
> John Nagle wrote:
>> Matt Nordhoff wrote:
>>> John Nagle wrote:
>>>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed.
>>>>
>> ...
>>
>>>
>>> It's breakin
A, for example, and in theory
you can script OpenOffice and Gnome via CORBA. But nobody does that.
Exercise: write a Python program to convert a ".doc" file to a ".pdf"
file by invoking OpenOffice via CORBA. At least in theory, this is
possible. All the necessary parts supposedly exist. Somebody
tried back in 2003, but gave up. See
"http://mail.python.org/pipermail/python-list/2003-April/198094.html";
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Eric S. Johansson wrote:
> John Nagle wrote:
>> Yes. One of the basic design flaws of UNIX was that interprocess
>> communication was originally almost nonexistent, and it's still not
>> all that
>> great. It's easy to run other programs, and easy to
p things by any field, which is the whole
point of having a database.
(The database looks up much faster if you specify that
some fields are INDEX fields. But that can come later.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
rom different
accounts. If you wanted to allow duplicate names from the same account,
you could write
UNIQUE INDEX (name,characcount)
which requires that the combo of name and characcount be unique.
With that rule in the database, an INSERT that tries to insert
a duplicate name will raise
John Nagle wrote:
>>>>> Here's a hostile URL that "urlparse.urlparse" seems to have
>>>>> mis-parsed.
>>>>>
Added to tracker, with proposed fix:
http://bugs.python.org/issue1637
J
from setting attributes on "their"
> instances.
Agreed.
I'd like to hear more about what kind of performance gain can be
obtained from "__slots__". I'm looking into ways of speeding up
HTML parsing via BeautifulSoup. If a significant speedup can be
ob
Fredrik Lundh wrote:
> John Nagle wrote:
>
>> I'd like to hear more about what kind of performance gain can be
>> obtained from "__slots__". I'm looking into ways of speeding up
>> HTML parsing via BeautifulSoup. If a significant speedup can b
al time process had its text output labeled, timestamped, and transmitted
using QNX interprocess communication to a lower priority logging process
on a different machine. Text output never blocked; if a queue
filled, "..." appeared in the log file. That's a special real-time situation.
; encoding, for
example), or ignoring unexpected characters, or converting them
to "?".
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
uage spec tied to CPython, the
other implementations are always playing catch-up and run far behind the
CPython implementation.
As languages, C# and Java are reasonably good. They tend to come
with too much excess baggage in the form of frameworks, run-time systems,
and packagers, but as lang
the problem has to do with tab indention,
It really should be a syntax error in Python to mix
leading tabs and leading spaces in the same file. One can argue over
which to use, but a file with both usually leads to trouble.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ver sent, while "http://www.example.com";
yields a proper web page.
Even Firefox doesn't time this out properly. Try "http://soton.ac.uk";
in Firefox, and be prepared for a long wait.
There was some active work in the urllib timeout area last summer.
What happened to t
ked very strictly typed
languages like Ada and Modula. Python actually does unusually well
without declarations. Most languages that don't have declarations
run into difficulties. Consider Basic, TCL, and Matlab, to name
three rather diverse examples. Python managed to avoid the problems
those la
Does
text = unicode(text)
make a copy of a Unicode string, or is that essentially a
free operation if the input is already Unicode?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
e" tries to convert "1234567" into
a Unicode character with that decimal number, and gets a
Unicode overflow.
For our own purposes, I rewrote "htmldecode" to require a
sequence ending in ";", which means some bogus HTML escapes won't
be recognized, but correct
them? Is there
any way to find out what the 'function object' is from within Python?
(I'm looking for a possible memory leak, obviously.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
> John Nagle <[EMAIL PROTECTED]> wrote:
>
>> I'm printing out each entry in "gc.garbage" after a garbage collection in
>> DEBUG_LEAK mode, and I'm seeing many entries like
>>
>>
>>
>> That's the output
Francesco Guerrieri wrote:
> On Jan 11, 2008 6:20 PM, John Nagle <[EMAIL PROTECTED]> wrote:
>> Tried:
>> print item.dir()
>> got:
>> 'cell' object has no attribute 'dir'
It's a problem inside MySQLdb's "con
501 - 600 of 1270 matches
Mail list logo