Strange Python internal error

2011-09-16 Thread JKPeck
We have a user on Windows with Python 2.6 who gets this error message when executing an import statement. from extension import Template, Syntax, processcmd SystemError: ..\Objects\listobject.c:169: bad argument to internal function The module can be imported directly via import extension wi

Installing Python Apps on Mac Lion

2011-06-24 Thread JKPeck
The Lion version of the OS on the Mac comes with Python 2.7 installed, but it is in /System/Library/Frameworks/..., and this area is not writable by third party apps. So is there a consensus on what apps that typically install under the Python site-packages directory should do in this situation

Re: Use company name for module

2010-11-29 Thread JKPeck
On Nov 29, 1:41 pm, Chris Withers wrote: > On 12/11/2010 15:50, Robert Kern wrote: > > > > > On 11/12/10 8:12 AM, Micah Carrick wrote: > >> My company is working on releasing some of our code as open-source python > >> modules. I don't want my "foo" module conflicting with other modules > >> calle

Re: How to Suppress Interactive Assignment to "_"

2010-01-01 Thread JKPeck
On Jan 1, 10:06 am, Peter Otten <__pete...@web.de> wrote: > JKPeck wrote: > > The gettext module uses the convention of defining a function named > > "_" that maps text into its translation. > > This conflicts with the automatic interactive interpreter assign

How to Suppress Interactive Assignment to "_"

2010-01-01 Thread JKPeck
The gettext module uses the convention of defining a function named "_" that maps text into its translation. This conflicts with the automatic interactive interpreter assignment of expressions to a variable with that same name. While if you are careful, you can avoid that assignment while debuggin

Re: Problems with gettext and msgfmt

2009-12-16 Thread JKPeck
On Dec 15, 9:12 pm, JKPeck wrote: > I'm using Python 2.6 on Windows and having trouble with the charset in > gettext.  It seems to be so broken that I must be missing something. > > When I run msgfmt.py, as far as I can see it writes no charset > information into the mo file.

Problems with gettext and msgfmt

2009-12-15 Thread JKPeck
I'm using Python 2.6 on Windows and having trouble with the charset in gettext. It seems to be so broken that I must be missing something. When I run msgfmt.py, as far as I can see it writes no charset information into the mo file. The actual po files are in utf-8 in this case and have a charset

Re: csv module and None values

2009-08-29 Thread JKPeck
On Aug 25, 8:49 am, Peter Otten <__pete...@web.de> wrote: > JKPeck wrote: > > On Aug 24, 10:43 pm, John Yeung wrote: > >> On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > > >> > If I understand you correctly the csv.writer already does >

Re: csv module and None values

2009-08-25 Thread JKPeck
On Aug 24, 10:43 pm, John Yeung wrote: > On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > > > If I understand you correctly the csv.writer already does > > what you want: > > > >>> w.writerow([1,None,2]) > > 1,,2 > > > just sequential commas, but that is the special treatment. > > Witho

Re: csv module and None values

2009-08-24 Thread JKPeck
On Aug 24, 11:30 am, JKPeck wrote: > I'm trying to get the csv module (Python 2.6) to write data records > like Excel.  The excel dialect isn't doing it.  The problem is in > writing None values.  I want them to result in just sequential commas > - ,, but csv treats None

csv module and None values

2009-08-24 Thread JKPeck
I'm trying to get the csv module (Python 2.6) to write data records like Excel. The excel dialect isn't doing it. The problem is in writing None values. I want them to result in just sequential commas - ,, but csv treats None specially, as the doc says, "To make it as easy as possible to interf

Re: how to get rid of pyc files ?

2009-05-24 Thread JKPeck
On May 24, 4:08 pm, Dave Angel wrote: > pythoncuri...@gmail.com wrote: > > On May 24, 3:58 pm, John Machin wrote: > > >> What problems? Like avoiding having to recompile your .py files makes > >> your app run too fast? > > > There are real problems with this. I'm having similar problems when > >

Using the backing store with mmap

2008-06-25 Thread JKPeck
According to the mmap.mmap 2.5 documentation, "Changed in version 2.5: To map anonymous memory, -1 should be passed as the fileno along with the length." I would like to use shared memory to communicate between two processes that otherwise have no way to communicate, but I couldn't find a way to s

Re: Looking for library to estimate likeness of two strings

2008-02-07 Thread JKPeck
On Feb 7, 6:11 am, Lee Capps <[EMAIL PROTECTED]> wrote: > At 14:01 Wed 06 Feb 2008, [EMAIL PROTECTED] wrote: > > >Are there any Python libraries implementing measurement of similarity > >of two strings of Latin characters? > > >I'm writing a script to guess-merge two tables based on people's > >nam

Re: Mysterious xml.sax Encoding Exception

2008-02-05 Thread JKPeck
On Feb 4, 4:09 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Feb 5, 9:02 am, JKPeck <[EMAIL PROTECTED]> wrote: > > > > > On Feb 2, 12:56 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] > > > nomine.org> wrote: > > > -On [20080201 19:06],

Re: Mysterious xml.sax Encoding Exception

2008-02-04 Thread JKPeck
On Feb 2, 12:56 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080201 19:06], JKPeck ([EMAIL PROTECTED]) wrote: > > >In both of these cases, there are only plain, 7-bit ascii characters > >in the xml, and it really is valid utf-16 as far as

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:51 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > They sent me the actual file, which was created on Windows, as an > > email attachment. They had also sent the actual dataset from which > > the XML was generated so that I could generate it myself using the > > same version of o

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > In both of these cases, there are only plain, 7-bit ascii characters > > in the xml, and it really is valid utf-16 as far as I can tell. > > What do you mean by "7-bit ascii characters"? If it means what I think > it means (namely,

Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
I have a module that uses xml.sax and feeds it a string of xml as in xml.sax.parseString(dictfile,handler) The xml is always encoded in utf-16, and the XML string always starts with This almost always works fine, but two users of this module get an exception whatever input they use it on. (The

Re: Cost of "unicode(s)" where s is Unicode

2008-01-06 Thread JKPeck
On Jan 6, 9:06 am, John Nagle <[EMAIL PROTECTED]> wrote: >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 >>> u = u"abc" >>> uu = unicode(u) >>>

Re: Wrapping stdout in a codec

2007-10-24 Thread JKPeck
On Oct 22, 12:20 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 22 Oct 2007 02:41:17 +, JKPeck wrote: > > We want to wrap the stdout device in a codec in order to decode output > > transparently according to a particular code page (which might

Wrapping stdout in a codec

2007-10-21 Thread JKPeck
We want to wrap the stdout device in a codec in order to decode output transparently according to a particular code page (which might not be the system code page). However, codec.open requires a filename, and stdout may be a tty or otherwise anonymous. How can we accomplish this wrapping? Our ap

Re: Module Indexing

2006-12-07 Thread JKPeck
Thanks. I've gotten good results with epydoc pretty quickly. It hangs on one module just burning cpu time, but I've left that one out for now. Diez B. Roggisch wrote: > JKPeck schrieb: > > We are interested in building a module index for our libraries similar > > to t

Module Indexing

2006-12-06 Thread JKPeck
We are interested in building a module index for our libraries similar to the global module index on the Python site. Is there a tool/script available that builds something similar to that automatically? We would probably want the result to be an html document. TIA, Jon Peck -- http://mail.pyt

Re: Character Encodings and display of strings

2006-11-13 Thread JKPeck
. Nothing to do with Unicode. If a source file could have a declared encoding of, say, cp932 via the # coding comment, I thought there was a chance that eval would respond to that, too. Diez B. Roggisch wrote: > JKPeck wrote: > > > Thanks for the quick answer. I thought repr was involv

Re: Character Encodings and display of strings

2006-11-13 Thread JKPeck
obviously it doesn't. Fredrik Lundh wrote: > "JKPeck" wrote: > > >I am trying to understand why, with nonwestern strings, I sometimes get > > a hex display and sometimes get the string printed as characters. > > > > With my Python locale set to Japanese and

Character Encodings and display of strings

2006-11-13 Thread JKPeck
I am trying to understand why, with nonwestern strings, I sometimes get a hex display and sometimes get the string printed as characters. With my Python locale set to Japanese and with or without a # coding of cp932 (this is Windows) at the top of the file, I read a list of Japanese strings into a

Re: Sets and Membership Tests

2006-07-12 Thread JKPeck
mmediatly obvious. So you > could for example return hash( (attribute1, attribute2, attribute3) ), > where attribute1, attribute2, attribute3 are all hashable. > Of course, you provided no code and no error messages (the > 'SoFarNoLuck' exception is not descriptive enough ; ) >

Sets and Membership Tests

2006-07-11 Thread JKPeck
I would like to be able use sets where the set members are objects of a class I wrote. I want the members to be distinguished by some of the object content, but I have not figured out how a set determines whether two (potential) elements are identical. I tried implementing __eq__ and __ne__ and __

Re: Python and Java

2006-03-07 Thread JKPeck
Thanks for these suggestions. To be clear, we already have a Python 2.4 minimum requirement for other reasons, and we are looking for a long-term solution so that as Python advances, the scripting solution can keep up in a timely way. Since the Java code is for a very large, complex application,

Python and Java

2006-03-06 Thread JKPeck
Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the application. On Windows you could do this with COM and various addons such as J-Integra and Mark Hamm