Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote: On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: On 08/17/2017 05:14 PM, John Nagle wrote: I'm cleaning up some data which has text description fields from multiple sources. A few more cases: bytearray(b'\xe5\x81ukasz zmywaczy

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
8 which had been run through an ASCII-type lower casing algorithm, that's a reasonable assumption. Thanks for looking at this, everyone. If a string won't parse as either UTF-8 or Windows-1252, I'm just going to convert the bogus stuff to the Unicode replacement character. I

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote:> On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: >> On 08/17/2017 05:14 PM, John Nagle wrote: >>> I'm cleaning up some data which has text description fields from >>> multiple sources. >> A few more

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:14 PM, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. A few more cases: bytearray(b'miguel \xe3\x81ngel santos') bytearray(b'lidija kmeti\xe4\x8d') bytearray(b'\xe5\x81ukasz zmywac

What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
g1.decode("latin-1") '\\"Perfect Gift Idea\\"\x9d Each time' That just converts 0x9d in the input to 0x9d in Unicode. That's "Operating System Command" (the "Windows" key?) That's clearly wrong; some kind of quote was intended. Any ideas? John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Unicode support in Python 2.7.8 - 16 bit

2017-03-07 Thread John Nagle
3, it's 3.2.3, which rejects "u" Unicode string constants and has other problems in the MySQL area.) John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Who still supports recent Python on shared hosting

2017-03-05 Thread John Nagle
something I have to sysadmin, just a small shared hosting account. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

input vs. readline

2016-07-08 Thread John Nagle
ross-version (Python 2.7, 3.x), and doesn't do "readline" processing? (No, I don't want to use signals, a GUI, etc. This is simulating a serial input device while logging messages appear. It's a debug facility to be able to type input in the console window.) John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: py2exe crashes on simple program

2016-07-05 Thread John Nagle
flow.com/questions/32963057/is-there-a-py2exe-version-thats-compatible-with-python-3-5 cx_freeze has been suggested as an alternative, but its own documents indicate it's only been tested through Python 3.4. Someone reported success with a development version. I guess people don't create Python executables much. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

py2exe crashes on simple program

2016-07-04 Thread John Nagle
ime.py", line 426, in build_archive assert mod.__file__.endswith(EXTENSION_SUFFIXES[0]) AssertionError Python 3.5.2 / Win7 / AMD64. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread John Nagle
On 3/29/2015 7:11 PM, John Nagle wrote: > Meanwhile, I've found two more variants on "flup" > > https://pypi.python.org/pypi/flipflop > https://pypi.python.org/pypi/flup6 > > All of these are descended from the original "flup" code base

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-29 Thread John Nagle
of which don't work. Incidentally, in my last report, I reported problems with BS4, PyMySQL, and Pickle. I now have workarounds for all of those, but not fixes. The bug reports I listed last time contain the workaround code. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-29 Thread John Nagle
On 3/29/2015 1:19 PM, John Nagle wrote: > On 3/29/2015 12:11 PM, Ben Finney wrote: >> John Nagle writes: >> >>> The Python 3 documentation at >>> https://docs.python.org/3/howto/webservers.html >>> >>> recommends "flup" >> >>

Python 3 lack of support for fcgi/wsgi.

2015-03-29 Thread John Nagle
but pip3 doesn't know that. There's "wsgiref", which looks more promising, but has a different interface. That's not what the Python documentation recommends as the first choice, but it's a standard module. I keep thinking I'm almost done with Python 3 hell, but

Workaround for BeautifulSoup/HTML5parser bug

2015-03-21 Thread John Nagle
ix the bug. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread John Nagle
t reproduces the bug on a tiny snippet of HTML, and that's been uploaded to the BS4 issues tracker. I don't have a workaround for that. All this has cost me about two weeks of work so far. The "everything is just fine" comments are not helpful. Denial is not a river in Egypt. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread John Nagle
On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: > John Nagle : >> I'm approaching the end of converting a large system from Python 2 >> to Python 3. Here's why you don't want to do this. > > A nice report, thanks. Shows that the slowness of Python 3 adoption i

Re: Python 2 to 3 conversion - embrace the pain

2015-03-13 Thread John Nagle
on 3 comes from having to switch packages because the Python 2 package didn't make it to Python 3. All the bugs I'm discussing reflect forced package changes or upgrades. None were voluntary on my part. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Python 2 to 3 conversion - embrace the pain

2015-03-13 Thread John Nagle
sing four library bugs and filing bug reports on all of them. Workarounds are known for two of the problems. I can't deploy the Python 3 version on the servers yet. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
On 3/12/2015 5:18 PM, John Nagle wrote: > On 3/12/2015 2:56 PM, Cameron Simpson wrote: >> On 12Mar2015 12:55, John Nagle wrote: >>> I have working code from Python 2 which uses "pickle" to talk to a >>> subprocess via stdin/stdio. I'm trying to make that

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
On 3/12/2015 2:56 PM, Cameron Simpson wrote: > On 12Mar2015 12:55, John Nagle wrote: >> I have working code from Python 2 which uses "pickle" to talk to a >> subprocess via stdin/stdio. I'm trying to make that work in Python >> 3. First, the subprocess Python

Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
e stdin and stdout come from "sys", "sys.stdin.buffer" is valid. That fixes the ""str" does not support the buffer interface error." But now I get the pickle error "Ran out of input" on the process child side. Probably because there's a

Re: Python 2.7.9, 3.4.2 won't verify SSL cert for "verisign.com"

2015-02-17 Thread John Nagle
am: http://www.animats.com/private/sslbug Please try that and let me know what happens on other platforms. Works with Python 2.7.9 or 3.x. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.9, 3.4.2 won't verify SSL cert for "verisign.com"

2015-02-17 Thread John Nagle
#x27;t pass detailed OpenSSL error codes through in exceptions. The Python exception text is "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581).", which is a generic message for most OpenSSL errors. John Nagle On 2/17/2015 12:00 AM,

Python 2.7.9, 3.4.2 won't verify SSL cert for "verisign.com"

2015-02-16 Thread John Nagle
st Network'),), (('organizationalUnitName', u'(c) 2006 VeriSign, Inc. - For authorized use only'),), (('commonName', u'VeriSign Class 3 Public Primary Certification Authority - G5'),))} Firefox is happy with that cert. The serial number of the root cert

SSLsocket.getpeercert - request to return ALL the fields of the certificate.

2014-11-12 Thread John Nagle
me', 'Illinois'),), (('localityName', 'Chicago'),), (('streetAddress', '135 S La Salle St'),), (('organizationName', 'Bank of America Corporation'),), (('organizationalUnitName', 'Network Infrastructure'),), (('commonName', 'www.bankofamerica.com'),)), 'subjectAltName': (('DNS', 'mobile.bankofamerica.com'), ('DNS', 'www.bankofamerica.com')), 'version': 3} How about just returning ALL the remaining fields and finishing the job? Thanks. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Show off your Python chops and compete with others

2013-11-06 Thread John Nagle
le are at >> different skills. And recruiters use MetaBright to find outrageously skilled >> job candidates. With tracking cookies blocked, you get 0 points. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-26 Thread John Nagle
usually done in debug mode only, and is sometimes causes programs with bugs to behave differently when built in debug vs. release mode. Sigh. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Global Variable In Multiprocessing

2013-10-23 Thread John Nagle
tent of all messages sent to or from this > e-mail > address. Messages sent to or from this e-mail address may be stored on the > Infosys e-mail system. > ***INFOSYS End of Disclaimer INFOSYS*** Because of the above restriction, we are unable to repl

Re: Python Front-end to GCC

2013-10-23 Thread John Nagle
On 10/23/2013 12:25 AM, Philip Herron wrote: > On Wednesday, 23 October 2013 07:48:41 UTC+1, John Nagle wrote: >> On 10/20/2013 3:10 PM, victorgarcia...@gmail.com wrote: >> >>> On Sunday, October 20, 2013 3:56:46 PM UTC-2, Philip Herron >>> wrote: > Nagle re

Re: Python Front-end to GCC

2013-10-22 Thread John Nagle
calls of "strcmp (x->identifier, "Int")". A performance win over CPython is unlikely. Compare Shed Skin, which tries to infer the type of Python objects so it can generate efficient type-specific C++ code. That's much harder to do, and has trouble with very dynamic code, but what comes out is fast. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Complex literals (was Re: I am never going to complain about Python again)

2013-10-15 Thread John Nagle
r velocity to get angular position, quaternions are the way to go. If you want to understand all this, there's a good writeup in one of the Graphics Gems books. Unlike complex numbers, these quaternions are always unit vectors. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: PID tuning.

2013-10-15 Thread John Nagle
; > Is this related to Python? What is “PID tuning”, and what have you > tried already? See "http://sts.bwk.tue.nl/7y500/readers/.%5CInstellingenRegelaars_ExtraStof.pdf"; You might also try the OpenHRP3 forums. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-14 Thread John Nagle
reter like CPython. These make many compile time optimizations hard. At any time, any thread can monkey-patch any code, object, or variable in any other thread. The ability for anything to use "setattr()" on anything carries a high performance price. That's part of why Unladen Swall

Re: web scraping

2013-10-13 Thread John Nagle
, President or General Manager >> 4. Email address of number 3 above >> 5. Phone number of dealership If you really want that data, and aren't just hacking, buy it. There are data brokers that will sell it to you. D&B, FindTheCompany, Infot, etc. Sounds like you want

Re: What version of glibc is Python using?

2013-10-13 Thread John Nagle
e that this function has intimate knowledge of how different libc versions add symbols to the executable is probably only usable for executables compiled using gcc" isn't even a sentence. The documentation needs to be updated. Please submit a patch. John

Re: What version of glibc is Python using?

2013-10-13 Thread John Nagle
s.python.org/issue928297 The result under GenToo is bogus: http://archives.gentoo.org/gentoo-user/msg_b676eccb5fc00cb051b7423db1b5a9f7.xml There are several programs which fetch this info and display it, or send it in with crash reports, but I haven't found any that actually use the result for anything. I'd suggest deprecating it and documenting that. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: What version of glibc is Python using?

2013-10-12 Thread John Nagle
On 10/11/2013 11:50 PM, Christian Gollwitzer wrote: > Am 12.10.13 08:34, schrieb John Nagle: >> I'm trying to find out which version of glibc Python is using. >> I need a fix that went into glibc 2.10 back in 2009. >> (http://udrepper.livejournal.com/20948.html) >>

What version of glibc is Python using?

2013-10-11 Thread John Nagle
2 ('glibc', '2.7') That version of glibc is from October 2007. Where are these ancient versions coming from? They're way out of sync with the GCC version. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: Applying 4x4 transformation to 3-element vector with numpy

2013-10-08 Thread John Nagle
On 10/8/2013 10:36 PM, Christian Gollwitzer wrote: > Dear John, > > Am 09.10.13 07:28, schrieb John Nagle: >> This is the basic transformation of 3D graphics. Take >> a 3D point, make it 4D by adding a 1 on the end, multiply >> by a transformation matrix to

Applying 4x4 transformation to 3-element vector with numpy

2013-10-08 Thread John Nagle
? John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Python FTP timeout value not effective

2013-09-02 Thread John Nagle
ed to be 20 seconds, and I increased it to 60. It didn't help. This isn't an OS problem. The above traceback was on a Linux system. On Windows 7, it fails with "URLError: " But in both cases, the command line FTP client will work, after a consistent 20 second delay before the login prompt. So the Python timeout parameter isn't working. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 2.7.5

2013-06-03 Thread John Nagle
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

Re: Getting USB volume serial number from inserted device on OSX

2013-04-04 Thread John Nagle
ng". That would be useful to have as a portable function for all USB devices. Serial port devices are particularly annoying, because their port number is somewhat random when there's more than one, and changes on hot-plugging. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Distributing a Python program hell

2013-04-03 Thread John Nagle
.gz file. Then "setup.py install") Download "BaudotRSS" from SourceForge. (ZIP file, put in your chosen directory for this program.) Run: python baudotrss.py --help I'm thinking of switching to Go. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Unhelpful traceback

2013-03-07 Thread John Nagle
On 3/7/2013 10:42 AM, John Nagle wrote: > On 3/7/2013 5:10 AM, Dave Angel wrote: >> On 03/07/2013 01:33 AM, John Nagle wrote: >>> Here's a traceback that's not helping: >>> >> >> A bit more context would be helpful. Starting with Python version. &g

Re: Unhelpful traceback

2013-03-07 Thread John Nagle
On 3/7/2013 5:10 AM, Dave Angel wrote: > On 03/07/2013 01:33 AM, John Nagle wrote: >> >> "infdraw" is a stream from the zip module, create like this: >> >> with inzip.open(zipelt.filename,"r") as infd : > > You probably nee

Re: Unhelpful traceback

2013-03-07 Thread John Nagle
On 3/7/2013 5:10 AM, Dave Angel wrote: > On 03/07/2013 01:33 AM, John Nagle wrote: >> Here's a traceback that's not helping: >> > > A bit more context would be helpful. Starting with Python version. Sorry, Python 2.7. > > If that isn't enough, t

Unhelpful traceback

2013-03-06 Thread John Nagle
(zipelt.filename,"r") as infd : self.dofilecsv(infile, infd) This works for data records that are pure ASCII, but as soon as some non-ASCII character comes through, it fails. Where is the error being generated? I'm not seeing any place where there's a conversion to ASCII. Not even a print. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-08 Thread John Nagle
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

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread John Nagle
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

Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread John Nagle
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

Re: python 6 compilation failure on RHEL

2012-08-20 Thread John Nagle
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

Re: On-topic: alternate Python implementations

2012-08-06 Thread John Nagle
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

Re: Implicit conversion to boolean in if and while statements

2012-07-17 Thread John Nagle
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

Re: How to safely maintain a status file

2012-07-09 Thread John Nagle
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

Re: Socket code not executing properly in a thread (Windows)

2012-07-07 Thread John Nagle
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

Re: simpler increment of time values?

2012-07-05 Thread John Nagle
. 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

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-02 Thread John Nagle
ct only at well-defined points. That's un-Pythonic. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-26 Thread John Nagle
e four serial ports. Is some device emulating a serial port? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-26 Thread John Nagle
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

Re: Internationalized domain names not working with URLopen

2012-06-13 Thread John Nagle
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

Internationalized domain names not working with URLopen

2012-06-12 Thread John Nagle
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

Re: sqlite INSERT performance

2012-05-30 Thread John Nagle
able, you may be approaching the problem incorrectly. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Id Verification

2012-05-24 Thread John Nagle
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.

Re: escaping/encoding/formatting in python

2012-05-23 Thread John Nagle
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.

Re: serial module

2012-05-22 Thread John Nagle
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

Re: serial module

2012-05-22 Thread John Nagle
9,200 baud is enough for you, don't worry about it. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a directory structure and modifying files automatically in Python

2012-05-07 Thread John Nagle
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

Re: Creating a directory structure and modifying files automatically in Python

2012-05-07 Thread John Nagle
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

Re: key/value store optimized for disk storage

2012-05-06 Thread John Nagle
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

"

2012-05-03 Thread John Nagle
An HTML page for a major site (http://www.chase.com) has some incorrect HTML. It contains

Re: Python SOAP library

2012-05-02 Thread John Nagle
edorahosted.org/suds/ John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a directory structure and modifying files automatically in Python

2012-04-30 Thread John Nagle
data storage. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

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

2012-04-29 Thread John Nagle
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

Re: CPython thread starvation

2012-04-29 Thread John Nagle
ot;Know who you're dealing with" system, SiteTruth.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython thread starvation

2012-04-27 Thread John Nagle
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

Re: CPython thread starvation

2012-04-27 Thread John Nagle
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

Re: CPython thread starvation

2012-04-27 Thread John Nagle
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

CPython thread starvation

2012-04-27 Thread John Nagle
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.

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

2012-04-26 Thread John Nagle
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: why () is () and [] is [] work in other way?

2012-04-25 Thread John Nagle
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

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

2012-04-23 Thread John Nagle
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

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

2012-04-22 Thread John Nagle
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

Re: global vars across modules

2012-04-22 Thread John Nagle
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

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

2012-04-22 Thread John Nagle
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

Re: Deep merge two dicts?

2012-04-12 Thread John Nagle
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:

Re: python module development workflow

2012-04-12 Thread John Nagle
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

Re: Donald E. Knuth in Python, cont'd

2012-04-11 Thread John Nagle
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

Re: Python Gotcha's?

2012-04-08 Thread John Nagle
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

Re: Python Gotcha's?

2012-04-07 Thread John Nagle
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

Re: getaddrinfo NXDOMAIN exploit - please test on CentOS 6 64-bit

2012-04-04 Thread John Nagle
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

Re: Best way to structure data for efficient searching

2012-04-03 Thread John Nagle
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

Re: getaddrinfo NXDOMAIN exploit - please test on CentOS 6 64-bit

2012-04-02 Thread John Nagle
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:

Re: Will MySQL ever be supported for Python 3.x?

2012-04-01 Thread John Nagle
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

Re: [OT] getaddrinfo NXDOMAIN exploit - please test on CentOS 6 64-bit

2012-04-01 Thread John Nagle
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

Re: getaddrinfo NXDOMAIN exploit - please test on CentOS 6 64-bit

2012-03-31 Thread John Nagle
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"

getaddrinfo NXDOMAIN exploit - please test on CentOS 6 64-bit

2012-03-31 Thread John Nagle
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

Re: Will MySQL ever be supported for Python 3.x?

2012-03-30 Thread John Nagle
, with the parameters expressed differently. It's a good approach, but very incompatible. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Will MySQL ever be supported for Python 3.x?

2012-03-30 Thread John Nagle
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

  1   2   3   4   5   6   7   8   9   10   >