language, with different libraries, and lots of
things that still don't work. Many old applications will never
be converted.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
st has some users. OurSQL has a different
API than MySQLdb, and isn't quite ready for prime time yet.
That's why I'm still on Python 2.7.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
e four
serial ports. Is some device emulating a serial port?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ct
only at well-defined points. That's un-Pythonic.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
Adding a datetime.time to a datetime.timedelta isn't that
useful. It would have to return a value error if the result
crossed a day boundary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
the last one.
Google Voice isn't a very good SMS gateway. I used to use it,
but switched to Twilio (which costs, but works) two years ago.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
all the crawler processes lose their database
connections, abort, and are restarted. This allows multiple
servers to coordinate through one database.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
the same problem, for exactly the
same reason - boolean types were an afterthought there, too.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
en code does something unexpected
to other code, the backup interpreter is used to get control out of
the trouble spot so that the JIT compiler can then recompile the
code. (I think; I've read the paper but haven't looked at the
internals.)
This is hard to implement and hard to get right.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
t
ought to help.
You might be better off building Python 2.7, but you asked about 2.6.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
pages/pdate
says:
"Unfortunately there is no easy way to parse full ISO 8601 dates using
the Python standard library."
It looks like this was taken out of "xml" at some point,
but not moved into "datetime".
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 9/6/2012 12:51 PM, Paul Rubin wrote:
> John Nagle writes:
>> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been
>> updated since 2007 and has many outstanding issues.
>
> Hmm, I have some code that uses ISO date/time strings and just c
On 9/8/2012 5:20 PM, John Gleeson wrote:
>
> On 2012-09-06, at 2:34 PM, John Nagle wrote:
>> Yes, it should. There's no shortage of implementations.
>> PyPi has four. Each has some defect.
>>
>> PyPi offers:
>>
>> iso8601 0.1.4 Simpl
s an API, but you have to ask to use it.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ve some modules which contain nothing but big
constants, written by a program in Python format.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
e of subprocesses where, in other
languages, you'd use threads. Of course, you load a new copy of the
interpreter in each thread, so this bloats memory usage.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
You are doing it wrong. Do NOT use the "%" operator when
putting SQL queries together. Let "cursor.execute" fill them
in. It knows how to escape special characters in the input fields,
which will fix your bug and prevent SQL injection.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
t sys
first.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
;s new language. Rust doesn't have the "spaghetti stack"
needed to implement closures, so it has more limited closure
semantics. It's more like some of the C add-ons for closures,
but sounder.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
antics. They've made some progress.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 2/10/2012 9:52 PM, 8 Dihedral wrote:
在 2012年2月11日星期六UTC+8上午2时57分34秒,John Nagle写道:
On 2/10/2012 10:14 AM, Nathan Rice wrote:
Lets also not forget that knowing an object is immutable lets you do a
lot of optimizations; it can be inlined, it is safe to convert to a
contiguous block of
is just a
collection of links). They have packaging standards (PyPi
does not.) CPAN tends not to be full of low-quality modules
that do roughly the same thing.
If you want to find a Python module, Google is more useful
than PyPi.
John Nagle
--
http
t the error message you're
getting.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
n the
WSDL is provided without class generation."
I think that somewhere in "suds", they subclass the "unicode" type.
That's almost too cute.
The proper test is
isinstance(s,unicode)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
de", or catch the undocumented TypeError exception
afterward.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
s is all different in Python 3.x, where "str" is Unicode and
"bytes" really are a distinct type.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
es before installing." Does this include the keyboard and mouse?
They also warn "The device driver can not be easily removed from the
system."
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
" of "bytes" should
require an encoding. But because of the bytes/str ambiguity
in Python 2.6/2.7, the behavior couldn't be type-based.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 3/9/2012 4:57 PM, Steven D'Aprano wrote:
On Fri, 09 Mar 2012 10:11:58 -0800, John Nagle wrote:
This demonstrates a gross confusion about both Unicode and Python. John,
I honestly don't mean to be rude here, but if you actually believe that
(rather than merely expressing yourself poo
that.
But html5lib calls the XML SAX parser. Is that thread-safe?
Or is there more trouble down at the bottom?
(I run a multi-threaded web crawler, and currently use BeautifulSoup,
which is thread safe, although dated. I'm looking at converting to
html5lib.)
On 3/11/2012 2:45 PM, Cameron Simpson wrote:
On 11Mar2012 13:30, John Nagle wrote:
| "html5lib" is apparently not thread safe.
| (see "http://code.google.com/p/html5lib/issues/detail?id=189";)
| Looking at the code, I've only found about three problems.
| They'
On 3/12/2012 3:05 AM, Stefan Behnel wrote:
John Nagle, 11.03.2012 21:30:
"html5lib" is apparently not thread safe.
(see "http://code.google.com/p/html5lib/issues/detail?id=189";)
Looking at the code, I've only found about three problems.
They're all the usu
ot;http://www.youtube.com/watch?v=5lHqEwk7YHs";)
(A test with a heavy object:
"http://www.youtube.com/watch?v=-DaWIHc1VLY";. Most physics engines
don't do heavy objects well. Everything looks too light. We call
this the "boink problem.")
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
;, type=int, default=100)
Does this seem like a reasonable enhancement to argparse?
default=None
presents some problems.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone run PyPy in production?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
can create a dict full of function names and lambdas, but
it's clunky looking.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
to negotiate a SSL connection
results in the SSL protocol reaching a point where the host end
is supposed to finish the handshake, but it doesn't.
The odds are against this being the problem. I see problems
like that in maybe 1 in 100,000 URLs.
John Nag
On 3/23/2012 10:12 PM, Jon Clements wrote:
ROBOT Framework
Would people please stop using robotic names for
things that aren't robots? Thank you.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
h the ascii portions and keep anything
else unchanged.
So why let the data get into a "str" type at all? Do everything
end to end with "bytes" or "bytearray" types.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
from other
sources. (http://www.lfd.uci.edu/~gohlke/pythonlibs/) But those
are just blind builds; they haven't been debugged.
MySQL Connector (http://forge.mysql.com/projects/project.php?id=302)
is still pre-alpha.
John Nagle
--
http://mail.python.org/ma
, with the parameters expressed
differently. It's a good approach, but very incompatible.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
set up their DNS to exploit this.
And, of course, it has nothing to do with browser toolbars. This
is at a much lower level.
If you can make this happen, report back the CentOS version and
the library version, please.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 3/31/2012 9:26 PM, Owen Jacobson wrote:
On 2012-03-31 22:58:45 +, John Nagle said:
Some versions of CentOS 6 seem to have a potential
getaddrinfo exploit. See
To test, try this from a command line:
ping example
If it fails, good. If it returns pings from "example.com"
On 4/1/2012 9:26 AM, Michael Torrie wrote:
On 03/31/2012 04:58 PM, John Nagle wrote:
If you can make this happen, report back the CentOS version and
the library version, please.
CentOS release 6.2 (Final)
glibc-2.12-1.47.el6_2.9.x86_64
example does not ping
example.com does not resolve to
On 3/31/2012 10:54 PM, Tim Roberts wrote:
John Nagle wrote:
On 3/30/2012 2:32 PM, Irmen de Jong wrote:
Try Oursql instead http://packages.python.org/oursql/
"oursql is a new set of MySQL bindings for python 2.4+, including python 3.x"
Not even close to being compatible wit
On 4/1/2012 1:41 PM, John Nagle wrote:
On 4/1/2012 9:26 AM, Michael Torrie wrote:
On 03/31/2012 04:58 PM, John Nagle wrote:
Removed all "search" and "domain" entries from /etc/resolve.conf
It's a design bug in glibc. I just submitted a bug report.
http:
ed on the
index sizes, how to do the join.
All of these approaches are roughly O(N log N), which
beats the O(N^2) approach you have now.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 4/2/2012 6:53 PM, John Nagle wrote:
On 4/1/2012 1:41 PM, John Nagle wrote:
On 4/1/2012 9:26 AM, Michael Torrie wrote:
On 03/31/2012 04:58 PM, John Nagle wrote:
Removed all "search" and "domain" entries from /etc/resolve.conf
It's a design bug in glibc. I ju
ion. This can
stall servers.
9. Some libraries aren't thread-safe. Guess which ones.
10. Python 3 isn't upward compatible with Python 2.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
is method to support more appropriate behavior
if needed."
A related "gotcha" is knowing that "urllib" sucks and you should use
"urllib2".
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
t on the EDVAC", for
background on how things work down at the bottom. But they're
no longer essential desk references for most programmers.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
works.
Don't use the "rotten egg" distribution system.
(http://packages.python.org/distribute/easy_install.html)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 4/12/2012 10:41 AM, Roy Smith wrote:
Is there a simple way to deep merge two dicts? I'm looking for Perl's
Hash::Merge (http://search.cpan.org/~dmuey/Hash-Merge-0.12/Merge.pm)
in Python.
def dmerge(a, b) :
for k in a :
v = a[k]
if isinstance(v, dict) and k in b:
s, like "None". You can't assign
to None, but you can assign to True, usually with
unwanted results. It's not clear why True and False
weren't locked down when None was.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ings in everything in the other module, which often
results in a name clash.
Just do
import file_1
and, if desired
localnamefora = file_1.a
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 4/22/2012 3:17 PM, John Roth wrote:
On Sunday, April 22, 2012 1:43:36 PM UTC-6, John Nagle wrote:
On 4/20/2012 9:34 PM, john.tant...@gmail.com wrote:
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote:
I believe it says somewhere in the Python docs that it's
undefine
On 4/22/2012 9:34 PM, Steven D'Aprano wrote:
On Sun, 22 Apr 2012 12:43:36 -0700, John Nagle wrote:
On 4/20/2012 9:34 PM, john.tant...@gmail.com wrote:
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote:
I believe it says somewhere in the Python docs that it's und
t; have to force the creation of a temporary boxed object?
The concept of "object" vs. the implementation of objects is
one reason you don't necessarily want to expose the implementation.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 4/26/2012 4:45 AM, Adam Skutt wrote:
On Apr 26, 1:48 am, John Nagle wrote:
On 4/25/2012 5:01 PM, Steven D'Aprano wrote:
On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote:
Though, maybe it's better to use a different keyword than 'is' though,
due to the plain Eng
re
copies of the Python interpreter. The threads are usually I/O bound,
but when they hit unusually long web pages, they go compute-bound
during parsing.)
Setting "sys.setcheckinterval" from the default to 1 seems
to have little effect. This is on Windows 7.
On 4/27/2012 6:25 PM, Adam Skutt wrote:
On Apr 27, 2:54 pm, John Nagle wrote:
I have a multi-threaded CPython program, which has up to four
threads. One thread is simply a wait loop monitoring the other
three and waiting for them to finish, so it can give them more
work to do. When the
On 4/27/2012 9:20 PM, Paul Rubin wrote:
John Nagle writes:
The code that stored them looked them up with "getaddrinfo()", and
did this while a lock was set.
Don't do that!!
Added a local cache in the program to prevent this.
Performance much improved.
Better to r
On 4/27/2012 9:55 PM, Paul Rubin wrote:
John Nagle writes:
I may do that to prevent the stall. But the real problem was all
those DNS requests. Parallizing them wouldn't help much when it took
hours to grind through them all.
True dat. But building a DNS cache into the applic
ot;Know who you're dealing with" system, SiteTruth.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
r than Ada, which requires it, few
languages handle such exceptions as language level
exceptions.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
data storage.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
edorahosted.org/suds/
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
An HTML page for a major site (http://www.chase.com) has
some incorrect HTML. It contains
That's awful. There's no point in compressing six characters
with zlib. Zlib has a minimum overhead of 11 bytes. You just
made the data bigger.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
system for a
million item db is ridiculous even for prototyping.
Right. Steve Bellovin wrote that back when UNIX didn't have any
database programs, let alone free ones.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 5/7/2012 9:09 PM, Steve Howell wrote:
On May 7, 8:46 pm, John Nagle wrote:
On 5/6/2012 9:59 PM, Paul Rubin wrote:
Javierwrites:
Or not... Using directories may be a way to do rapid prototyping, and
check quickly how things are going internally, without needing to resort
to complex
9,200 baud is enough for you, don't worry about it.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 5/22/2012 2:07 PM, Paul Rubin wrote:
John Nagle writes:
If a device is registered as /dev/ttyUSBnn, one would hope that
the Linux USB insertion event handler, which assigns that name,
determined that the device was a serial port emulator. Unfortunately,
the USB standard device classes
ase of the first.
For a quoted alternative to regular expression syntax, see
SNOBOL or Icon. SNOBOL allows naming patterns, and those patterns
can then be used as components of other patterns. SNOBOL
is obsolete, but that approach produced much more readable
code.
It matches anything that looks like a mail user name followed by
an @ followed by anything that looks more or less like a domain name.
The domain name must contain at least one ".", and cannot end with
a ".", which is not strictly correct but usually works.
able, you may be approaching the
problem incorrectly.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ters in position
0-5: ordinal not in range(128)
>>>
The HTTP library is trying to put the URL in the header as ASCII. Why
isn't "urllib2" handling that?
What does "urllib2" want? Percent escapes? Punycode?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 6/12/2012 11:42 PM, Andrew Berg wrote:
On 6/13/2012 1:17 AM, John Nagle wrote:
What does "urllib2" want? Percent escapes? Punycode?
Looks like Punycode is the correct answer:
https://en.wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
I haven't t
On 6/2/2011 4:40 AM, xDog Walker wrote:
On Wednesday 2011 June 01 10:34, John Nagle wrote:
I have a program which uses "feedparser". It occasionally hangs when
the network connection has been lost, and remains hung after the network
connection is restored.
My solution is to downloa
that's
what "hoisted" means in this context..
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
hich usually should cause termination or fairly
drastic recovery action) and normal external events (which
have to be routinely handled.)
It's quite possible to get a OSError on "os.kill()" for
a number of legitimate reasons. The target process may have
exited since the PID was obtai
s
not necessary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
efore Google bought it,
was in Python. But it's since been rewritten. All the stuff that
actually handles video is, of course in C/C++. The load of handling
the video dwarfs the user interface load.
Wikipedia is indeed written in PHP.
John Nagle
--
"if" is un-Pythonic.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ernal dependencies, though (different dependencies
for each platform, so it requires a lot to be cross-platform).
It still uses Tcl/Tk stuff, which is un-Pythonic.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
al product) but few people need them.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
his is mostly a curiosity.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
re program bugs, like references to
undefined class members.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
because the nose testing framework does exactly this
kind of thing when loading test modules, causing some very confusing
errors and failures.
Is this behavior expected?
It's undefined behavior. You're dealing with CPython implementation
semantics, not Python language semantics.
27;s also possible
to get UnicodeError from URL operations.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
With the latest flaps about phony cert issuers, it's worth
having issuer info available. It was available in the old M2Crypto
module, but not in the current Python SSL module.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
t's not being used
heavily yet, and users are reporting bugs like "broken pipe"
errors.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
or CR, both of which
are the same in ASCII and UTF-8. Copy the bytes
forward from that point into an array of bytes, then
apply the appropriate codec.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
yway? You can use a tuple as a subscript:
d[1,'abc',40] = 'dummy'
Also, at some point, it's time to use a database.
If you find yourself writing those "dictionaries" to
files, or trying to look up everything with "abc"
in the second subscript,
ng, hoisting
out of loops, compile time arithmetic, unboxing, etc. Ordinarily,
Python compilers have to assume that any variable can be changed
at any time from another thread, requiring worst-case code for
everything.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ither inefficient, with a lookup for every
use (CPython) or really, really complicated, involving just-in-time
compilers, invalidation, recompilation, and a backup interpreter
for when things get ugly (PyPy).
John Nagle
--
http://mail.python.org/mailman/listinfo/p
t;Streaming" out to a network connection while still reading from
the database is undesirable.
If you're doing really big SELECTs, consider using LIMIT and
OFFSET in SQL to break them up into smaller bites. Especially
if the user is paging through the results.
variables. You
need
class Node:
def __init__(self) :
self.distFromSource = infinity
self.previous = invalid_node
self.visited = False
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
CPython barely evaluates anything at compile time.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
e owner of those files. You need to say what
goes into a build of a game, or a revision of a manufactured
product.
You also need really good tools to show the differences
between revisions.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 1270 matches
Mail list logo