Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Luis P. Mendes wrote: When I access the url via the Firefox browser and look into the source code, I also get: ~ ~439 ~ Please do try to understand what you are seeing. This is crucial for understanding what happens. You may have the

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-20 Thread "Martin v. Löwis"
Jarek Zgoda wrote: So why are there non-UNICODE versions of wxPython??? To save memory or something??? Win95, Win98, WinME have problems with unicode. This problem can be solved - on W9x, wxPython would have to pass all Unicode strings to WideCharToMultiByte, using CP_ACP, and then pass the resul

Re: xml parsing escape characters

2005-01-21 Thread "Martin v. LÃwis"
Luis P. Mendes wrote: From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? This is very unlikely. MSXML would never do this incorrectly. Regards, Martin -- http://mail.python.org/mailman/listinfo/py

Re: rotor replacement

2005-01-21 Thread "Martin v. LÃwis"
[EMAIL PROTECTED] wrote: Do you know this for a fact? I'm going by newsgroup messages from around the time that I was proposing to put together a standard block cipher module for Python. Ah, newsgroup messages. Anybody could respond, whether they have insight or not. The PSF does comply with the

Re: rotor replacement

2005-01-23 Thread "Martin v. Löwis"
Paul Rubin wrote: There's tons of such examples, but python-dev apparently reached consensus that the Python maintainers were less willing than the maintainers of those other packages to deal with those issues. As Andrew says, it is not apparent that there was consensus. Martin, do you know more ab

Re: Alternative Ways to install Python 2.4?

2005-01-23 Thread "Martin v. Löwis"
Michael Goettsche wrote: I convinced my CS teacher to use Python in school. We currently have 2.2 installed on a Windows 2000 Terminal server. I asked the system administrator to upgrade to Python 2.4, but he didn't succeed in doing it. He used the microsoft installer package, which according to

Re: What's so funny? WAS Re: rotor replacement

2005-01-23 Thread "Martin v. Löwis"
Paul Rubin wrote: If he understood how Python is actually used, he'd understand that any C module is a lot more useful in the core than out of it. This is non-sense. I have been distributing C modules outside the core for quite some time now, and I found that the modules are quite useful. distuti

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: Maybe we're not thinking about the same problems. Say I'm an app writer and I want to use one of your modules. My development environment is GNU/Linux, and I want to ship a self-contained app that anyone can run without having to download additional components. That incl

Re: What's so funny? WAS Re: rotor replacement

2005-01-25 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: I hadn't thought there was any controversy over the technical side of this. There isn't. The interface might be beautifully designed, and you might claim it is, and I would *still* require that the module gets field testing before being incorporated into Python. If other pe

Re: What's so funny? WAS Re: rotor replacement

2005-01-26 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: That it's not appropriate for the distro maintainers to look at the spec and the reference (pure Python) implementatation and say "yes, we want this, go write the C version and we'll include it after it's had some testing". I know that I'm not going to give a blanket prom

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: I don't see why you can't make up your mind enough to issue simple statements like "the Python lib should have a module that does so-and-so I can say that assuming I know what so-and-so is. For the specific case of AES, I would say "I don't think the Python lib necessarily

Re: MSI Difficulties

2005-01-27 Thread "Martin v. Löwis"
brolewis wrote: However both of these commands fail to update the Windows path to include C:\Python24 and as such creates problems for me when trying to actually use Python. Not surprisingly so. The Python installation makes no attempt to update the PATH, and never did so, in any recent release. Ho

Re: Missing _bssd in Python 2.4

2005-01-27 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: I compiled and installed python 2.4 on Redhat Linux using default options but don't seem to be getting _bsddb. I get an error message that _bssd cannot be imported. Does anybody know why this might happen? Do I need to do any special customization or install any other softw

Re: What's so funny? WAS Re: rotor replacement

2005-01-28 Thread "Martin v. Löwis"
Paul Rubin wrote: I can say that assuming I know what so-and-so is. For the specific case of AES, I would say "I don't think the Python lib necessarily needs to have an AES module, but I would not object if it had one" Well, ok, you're changing your tune a little bit now, and getting more reasonab

Re: What's so funny? WAS Re: rotor replacement

2005-01-28 Thread "Martin v. Löwis"
Paul Rubin wrote: Let's see, the urandom module was recently released in 2.4, I think initially at my urging. There is no urandom module in Python 2.4. If you can't speak for others, how can you say there's no policy in force? I should say I'm not aware of a policy. If Guido says "no crypto", is

Re: What's so funny? WAS Re: rotor replacement

2005-01-29 Thread "Martin v. Löwis"
Paul Rubin wrote: Oops, sorry, it's in the os module: http://docs.python.org/lib/os-miscfunc.html The difference is simply a matter of the packaging. No, it's not. It also is a matter of code size, and impact. Small additions can be reviewed and studied more easily, and need to be tested on less

Re: What's so funny? WAS Re: rotor replacement

2005-01-29 Thread "Martin v. Löwis"
Paul Rubin wrote: An AES or DES addition to an existing module that implements just one call: ECB(key, data, direction) would be a huge improvement over what we have now. Apparently, people disagree on what precisely the API should be. E.g. cryptkit has obj = aes(key) obj.encrypt(data) I think I

Re: What's so funny? WAS Re: rotor replacement

2005-01-29 Thread "Martin v. Löwis"
Paul Rubin wrote: (And actually: mxCrypto is the most capable of these packages and might be the one with the most users, but it's completely unsuitable for the core because of its size). mxCrypto is primarily unsuitable for the core because Marc-Andre Lemburg will never ever contribute it. He is v

Re: What's so funny? WAS Re: rotor replacement

2005-01-30 Thread "Martin v. Löwis"
Paul Rubin wrote: Oh, ok. Earlier you said you wanted user feedback before you could conclude that there was reason to want an AES module at all. I believe I never said that. I said that I wanted user feedback to determine whether *this* AES module (where this is either your from-scratch implement

Re: msvcp71.dll and Python 2.4 C++ extensions

2005-01-31 Thread "Martin v. Löwis"
Matthias Baas wrote: are there any guidelines about what to do if a Windows extension for Python 2.4 requires the C++ runtime (msvcp71.dll)? No; it should "just work fine". The standard guidelines apply, of course: never try to mix different versions of similar DLLs. If I want to distribute a bin

Re: serializing data structures

2005-01-31 Thread "Martin v. Löwis"
Philippe C. Martin wrote: I once wrote something in C to do that, but since python usually has a solution for me If you use arbitrary data structures, you could use pickle or xmlrpclib to marshal the data. If you know the data is restricted to a few well-known data types, you could use XDR (De

Re: PyUnicodeUCS4_AsUnicode error

2005-07-05 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > When I try to import gtk, or even start some programs that use Python I > get the error: > > "ImportError: /usr/lib/python2.4/site-packages/gtk-2.0/gobject.so: > undefined symbol: PyUnicodeUCS4_AsUnicode" > > Can anyone shed some light on this? > > FWIW, I have reinsta

Re: print values from Py_BuildValue

2005-07-07 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > How do i print values returned by Py_BuildValue in Linux? > > PyObject *obj = Py_BuildValue("{s:i}", "Status", status); > > I need to print the Status value here I'm confused. You say you need to print the Status value here, but then you also say you want to print the

Re: Codecs

2005-07-10 Thread Martin v. Löwis
Ivan Van Laningham wrote: > Hi All-- > As far as I can tell, after looking only at the documentation (and not > searching peps etc.), you cannot query the codecs to give you a list of > registered codecs, or a list of possible codecs it could retrieve for > you if you knew enough to ask for them by

Re: Efficiency of using long integers to hold bitmaps

2005-07-10 Thread Martin v. Löwis
Bengt Richter wrote: > Sounds like a possible^H^H^H^H^H^H^H^Hprobable premature optimization worry > ;-) Right. OTOH, I notice a frequent game of Katze und Maus (cat and mouse?) in questions around Python implementation details. The OP doesn't provide details of his application, but instead asks

Re: gettext and "disambiguating comments"

2005-07-11 Thread Martin v. Löwis
Terry Hancock wrote: > /* Comment right before the gettext call, obviously in C */ > printf(_("Apparently ambiguous string to translate")); > > This will get captured into the .po file, according to the > gettext manual and appear as a comment right before > the msgid (i.e. next to the line number

Re: C API : Creating a Py_Method object from a C function.

2005-07-11 Thread Martin v. Löwis
Hugh Macdonald wrote: > The problem in this workflow is taking the C python function that I've > defined (using the standard "static PyObject *someFunction(PyObject > *self, PyObject *args)" method) and converting this into a Py_Object. > Any ideas? You should use PyCFunction_New(Ex), passing a st

Re: Extending and embedding Python

2005-07-11 Thread Martin v. Löwis
Tommy Nordgren wrote: > In order to correctly compile and link my Application, I need a OS > independent way to find compiler options and linker options necessary to > find header files and libraries. What methods should I use from > DistUtils for this purpose. I don't think distutils supports

Re: C API : Creating a Py_Method object from a C function.

2005-07-12 Thread Martin v. Löwis
Hugh Macdonald wrote: > PyMethodDef *callbackFunctionDef = new PyMethodDef; > callbackFunctionDef->ml_name = "doLoadCallback"; > callbackFunctionDef->ml_meth = &myPython_doLoadCallback; > callbackFunctionDef->ml_flags = 1; I think this gives a memory leak. I was rather thinking of

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Martin v. Löwis
Grant Edwards wrote: > I often foget how old Python is. Still, I've been using IEEE > floating point in C programs (and depending on the proper > production and handling of infinities and NaNs) for more than > 20 years now. I had thought that Python might have caught up. As should be clear by no

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Martin v. Löwis
Grant Edwards wrote: > 1/0 is defined by the standard as +Inf and 0/0 is NaN. I wonder why Tim hasn't protested here: I thought this was *not* the case. I thought IEEE 754 defined +Inf and NaN as only a possible outcome of these operations with other possible outcomes being exceptions... In that c

Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread Martin v. Löwis
John Reese wrote: > Morning. I've been running into an error message pertaining to SSL > that I don't understand, and I was hoping someone had some insight. > Gmail provides POP access over SSL on port 587, so I tried to use > poplib.POP_SSL, with the following results: [...] > socket.sslerror: (1

Re: codecs.getencoder encodes entire string ?

2005-07-28 Thread Martin v. Löwis
nicolas_riesch wrote: > I just don't understand why it returns the "length consumed". > > Does it means that in some case, the input string can be only partially > converted ? For an encoder, I believe the answer is "no". For a decoder, it is a definite yes: if the input does not end with a comp

Re: string methods

2005-07-31 Thread Martin v. Löwis
anthonyberet wrote: > For example if I wanted to replace the 4th character in 'foobar' (the > b)with the contents of another string, newchar, what would be the > easiest way? Depends on how your input is specified. If you know it is the b you want to replace, you write >>> text="foobar" >>> t

Re: How override ALL function calls? (Is there a "function call function"?)

2005-07-31 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I'm trying run a homegrown profiler on some Python code. > > Rather than apply profiler wrapper to ALL functions by hand > > Is there a low level Python function I can override to modify > > how ALL functions are called? Yes, please take a look at sys.setprofile()

Re: Enumerate registered codecs

2005-07-31 Thread Martin v. Löwis
Paul Watson wrote: > The primary identifier and a descriptive string (localized) need to be > available at a minimum. Having aliases would be a plus. You will have to implement your own list. Getting the well-known aliases is possible through encodings.aliases, but a localized descriptive string

Re: minidom xml & non ascii / unicode & files

2005-08-05 Thread Martin v. Löwis
webdev wrote: > 1. when fetching a web page from the net, how am i supposed to know how > it's encoded.. And can i decode it to unicode and encode it back to a > byte string so i can use it in my code, with the charsets i want, like > utf-8.. ? It depends on the content type. If the HTTP header de

Re: minidom xml & non ascii / unicode & files

2005-08-06 Thread Martin v. Löwis
> so what i understood of all this, is that once you're using unicode > objects you're safe ! > At least as long as you don't use statements or operators that will > implicitely try to convert the unicode object back to bytestring using > your default encoding (ascii) which will most certainly resu

Re: PEP: Specialization Syntax

2005-08-07 Thread Martin v. Löwis
Nicolas Fleury wrote: > Hi everyone, I would to know what do you think of this PEP. Any comment > welcomed (even about English mistakes). -1. I don't see the point of this PEP. Apparently, you want to define parametrized types - but for what purpose? I.e. what are the specific use cases for the p

Re: visual studio 2005

2005-08-08 Thread Martin v. Löwis
wilf wrote: > Has anyone had success compiling python with this? I personally didn't try yet. Did you? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: Specialization Syntax

2005-08-09 Thread Martin v. Löwis
Nicolas Fleury wrote: > Well, I'm using the alternatives. Perhaps not to the full power. > __arrayTypes = {} > def makeArrayType(arg1, arg2=someDefault): > if (arg1, arg2) in __arrayTypes: > return __arrayTypes[arg1, arg2] > renamed_arg1 = arg1 > renamed_arg2 = arg2 > clas

Re: Build errors for Objects/complexobject.c

2005-08-09 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I'm attempting to build Python 2.4.1 on Solaris 10 using gcc 3.4.3. I > get the following build error: This is a GCC bug, which I think got fixed in gcc 4.0.1. You can work around it by removing the definition of _XOPEN_SOURCE, POSIX_SOURCE, XOPEN_SOURCE_EXTENDED from py

Re: Adding and attribute to an instance

2005-08-10 Thread Martin v. Löwis
Gregory Bond wrote: > Make sure you init this member to 0 (tp_init), and make sure you > PyXDECREF() it when the object is deleted (tp_dealloc). As this may cause your objects to appear in cycles, you may also have to add support for cyclic GC (unless you already did this before, and unless you ca

Re: Module Extension C/CPI Question

2005-08-10 Thread Martin v. Löwis
Jeremy Moles wrote: > typedef struct Foo { > int x; > int y; > int z; > char xyz[100]; > } Foo; > > Is there an "accepted" way of propagating this upstream? I was thinking > one of these two: It really depends on the struct. Would a C programmer automatically be able to li

Re: Python-2.4.1 Build error on AIX

2005-08-10 Thread Martin v. Löwis
Srinivasan TK wrote: > I get the below error when trying to build python on > AIX. > > Is there a way to ignore _tkinter. Yes. Just ignore these error messages. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP Proposal: Codetags

2005-08-10 Thread Martin v. Löwis
Micah Elliott wrote: > I also have this living as a wiki > if people would like to add comments there. I might try to capture there > feedback from this group anyway. First try at a PEP -- thanks for any > feedback! I think you somewhat misunderstood the purpos

Re: Pre-PEP Proposal: Codetags

2005-08-12 Thread Martin v. Löwis
Bengt Richter wrote: >>Both elements seem to be missing your document: it does not propose >>changes to the Python language; instead, it proposes a specific >>way of writing comments (ie. something that is not relevant to the >>Python interpreter or libraries, only to the Python developer). > > >

Re: How to find Python path in Visual C++ install wizard

2005-08-13 Thread Martin v. Löwis
Philippe C. Martin wrote: > I am trying to setup an .msi for my software (Python code (.pyc) + drivers) > to make installation easier for Windows users. > > I am using the installer that comes with V. C++ 7.1. > > I would like to find the way to make sure Python is insta

Re: distutils on Win32 using .NET Framework SDK

2005-08-14 Thread Martin v. Löwis
Jerry He wrote: > Hi, > I was trying to build a C++ extension on Win32 with > distutils. The extension worked on Cygwin but when I > tried it with the Win32-build python, it complained > that I don't have .NET Framework SDK installed. But > after I installed .NET Framework SDK 2.0, it still > co

Re: Windows 32 service problem (ImportError)

2005-08-15 Thread Martin v. Löwis
Laszlo Zsolt Nagy wrote: > exceptions.ImportError: dynamic module does not define init function > (initzlib) > - > > Where is the problem? Please help. My guess is that you have a zlib.dll somewhere, which gets used before zlib.pyd. Regards, Martin -- http://mail.python.org/mailman/

Re: Embedding Python in C, undefined symbol: PyExc_FloatingPointError

2005-08-17 Thread Martin v. Löwis
Simon Newton wrote: > gcc main.c -c -I-I/usr/include -I/usr/include -I/usr/include/python2.4 > -I/usr/include/python2.4 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > gcc main.o -L/usr/lib -lpthread -ldl -lutil > -lm /usr/lib/python2.4/config/libpython2.4.a -o main > > I've tried the above on two

Re: Tix cannot open /usr/share/libtix

2005-08-17 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > is there any way to tell python/tkinter/tix where to look for the > library? Try (un)setting TIX_LIBRARY. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: certificate-based authentication

2005-08-18 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I have been using XML-RPC to get information from one of our remote > servers. To improve security, the server now has a certificate installed, > and when I try to access it, I get an 'Unauthorized' exception. Is there > an xmlrpclib module that supports (client-side) c

Re: certificate-based authentication (Martin v. L?wis)

2005-08-18 Thread Martin v. Löwis
> I'm using Python version 2.2 - the SafeTransport class in it's xmlrpclib > doesn't have a 'get_host_info' method. Which version were you referring > to? I was looking at the HEAD revision in CVS. That feature was apparently released with Python 2.3. Still, httplib supports client certificates

Re: Version of TAR in tarfile module? TAR 1.14 or 1.15 port to Windows?

2005-08-19 Thread Martin v. Löwis
Claudio Grondi wrote: > What TAR version is built into the tarfile module? None: the tarfile module is not built on top of GNU tar. Instead, it is a complete reimplementation. > Is there a TAR 1.14 or 1.15 port to Windows > available in Internet for download (which URL)? http://sources.redhat.co

Re: pythonXX.dll size: please split CJK codecs out

2005-08-21 Thread Martin v. Löwis
Giovanni Bajo wrote: > I don't think I fully understand the reason why additional .pyd modules were > built into the .dll. OTOH, this does not help anyone, since: The reason is simple: a single DLL is easier to maintain. You only need to add the new files to the VC project, edit config.c, and be d

Re: pythonXX.dll size: please split CJK codecs out

2005-08-21 Thread Martin v. Löwis
Giovanni Bajo wrote: > FWIW, this just highlights how ineffecient your build system is. Everything > you > currently do by hand could be automated, including MSI generation. Also, you > describe the Windows procedure, which I suppose it does not take into account > what needs to be done for other

Re: Revamping Python build system (Was: pythonXX.dll size: please split CJK codecs out)

2005-08-21 Thread Martin v. Löwis
Giovanni Bajo wrote: >>I'm sure Martin would be happy to consider a patch to make the build >>system more efficient. :) > > Out of curiosity, was this ever discussed among Python developers? Would > something like scons qualify for this? OTOH, scons opens nasty > self-bootstrapping issues (being w

Re: Revamping Python build system (Was: pythonXX.dll size: please split CJK codecs out)

2005-08-21 Thread Martin v. Löwis
Giovanni Bajo wrote: > You seem to ignore the fact that scons can easily generate VS.NET projects. I'm not ignoring it - I'm not aware of it. And also, I don't quite believe it until I see it. > But there is no technical reason why it has to be so. I work on several > portable projects, and they

Re: pythonXX.dll size: please split CJK codecs out

2005-08-21 Thread Martin v. Löwis
Ron Adam wrote: > I would put the starting minimum boundary as: > >1. "The minimum required to start the python interpreter with no > additional required files." > > Currently python 2.4 (on windows) does not yet meet that guideline, so > it seems some modules still need to be added while oth

Re: pythonXX.dll size: please split CJK codecs out

2005-08-22 Thread Martin v. Löwis
Thomas Heller wrote: > That seems to be true. But it will need zlib.pyd as soon if you try to > import from compressed zips. So, zlib can be thought as part of the > modules required for bootstrap. Right. OTOH, linking zlib to pythonXY means that you cannot build Python at all anymore unless you

Re: setlocale() in a module/extension library

2005-08-23 Thread Martin v. Löwis
Damien Elmes wrote: > My question is this: it would be nice if every user of my library > didn't need to add the above two lines to their code. But on the other > hand, I'm unsure of the implications of modifying the locale from > within a module, and it doesn't seem very clean. Would calling > set

Re: How to start PEP process?

2005-08-25 Thread Martin v. Löwis
Kenneth McDonald wrote: > Should I just put a "Proposed PEP" message here? Or is there a more > formal way? See PEP 1. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Filetypes in email attachments.

2005-08-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I would like to use the magic file to detect the filetype, if this is > possible. I have the attachement stored and (generally) decoded in a > variable. There is a Python binding to the libmagic library, see http://mx.gw.com/pipermail/file/2003/55.html Meanwhile,

Re: pre-PEP: Object-oriented file module

2005-08-25 Thread Martin v. Löwis
Kenneth McDonald wrote: > I'd like to propose a new PEP [no, that isn't a redundant 'process' in > there :-)--pre-PEP is a different process than PEP], for a standard > library module that deals with files and file paths in an object > oriented manner. I believe this module should be included as

Re: pre-PEP: Object-oriented file module

2005-08-25 Thread Martin v. Löwis
Kenneth McDonald wrote: > Why would any of the issues below be any more difficult than they are with > the current file functions? I'm not proposing a C replacement for current > functions, merely a Python module that wraps all of those functions (and > adds some additional ones) in an appropriate

Re: variable hell

2005-08-26 Thread Martin v. Löwis
Adriaan Renting wrote: > Not in my Python. > > for count in range(0, 10): > > ... value = count > ... exec("'a%s=%s' % (count, value)") > ... > dir() > > ['__builtins__', '__doc__', '__name__', 'count', 'value'] You did not copy the suggestion properly: >>> for count in rang

Re: Setting the encoding in pysqlite2

2005-08-26 Thread Martin v. Löwis
Michele Simionato wrote: > Well, the issue is not how to input text in the database from Python > (it is enough to use literal unicode strings); > in my case the database has been generated from a text file containing > accented chars, using .import, > and it seems I cannot read it from Python beca

Re: Command Line arguments

2005-08-26 Thread Martin v. Löwis
Trent Mick wrote: >>I used the python2.4.MSI from python.org site (dated 3-6-05). I think this >>was the first time they went to MSI verses an exe based installer. >> >>it says Python 2.4 (#60 November 30th, 2004) when I start it. > > > I think Martin has been doing MSIs for a little bit longer t

Re: unicode, C++, python 2.2

2005-09-11 Thread Martin v. Löwis
Trond Eivind Glomsrød wrote: > I am currently writing a python interface to a C++ library. Some of the > functions in this library take unicode strings (UTF-8, mostly) as > arguments. > > However, when getting these data I run into problem on python 2.2 > (RHEL3) - while the data is all nice UCS4

Re: python/SSL/Certificate.

2005-09-13 Thread Martin v. Löwis
Vanessa PARISSE wrote: > In my website, the user connect in HTTPS whith a client certificate. > I would like to get the email in the certificate. > I'm trying to get the client certificate presented to the server. What does that have to do with Python? Are you trying to use Python on the client si

Re: regexps with unicode-aware characterclasses?

2005-09-13 Thread Martin v. Löwis
Stefan Rank wrote: > > > re.compile('|'.join([x.encode('utf8') for x in unicode.uppercase])) This would (almost) work, but it would be terribly inefficient (time linear to the number of alternatives). You can realistically do uppers = [u'['] for i in range(sys.maxunicode): c = unichr(i) i

Re: Static freeze

2005-09-13 Thread Martin v. Löwis
Grzegorz Dostatni wrote: > Is there a way to tell freeze to create a statically linked executable? > Freeze commandline does not appear to have that option. I'm sure that in a > day or two I can figure out the Makefile it generates and perhaps > substitute the object files to create what I need, bu

Re: How to make python24.dll smaller ?

2005-09-14 Thread Martin v. Löwis
Stormbringer wrote: > Final result: a 1.1 MB python24.dll which works with my frozen apps and > is not dependent on msvcr71.dll and compressed goes to around 440 KB. > And I'm sure that depending on the project I still could trim some more > modules out. If you are building yourself, anyway, I rec

Re: Unicode-aware file shortcuts in Windows

2005-09-17 Thread Martin v. Löwis
John Bauman wrote: > I see that another way is available here: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/shortcuts/shortcut.asp > I haven't tried, and I don't have the knowledge to convert the C++ to

Re: Simpler transition to PEP 3000 "Unicode only strings"?

2005-09-20 Thread Martin v. Löwis
Petr Prikryl wrote: > Would this break any existing code? Yes, it would break code which currently contains # -*- coding: utf-8 -*- and also contains byte string literals. Notice that there is an alternative form of the UTF-8 declaration: if the Python file starts with an UTF-8 signature (BOM),

Re: Monitoring a directory for changes

2005-09-20 Thread Martin v. Löwis
Florian Lindner wrote: > is there a python lib (preferably in the std lib) to monitor a directory for > changes (adding / deleting files) for Linux 2.6? I recommend to use the python-fam library: sf.net/projects/python-fam. On Debian, just install the python-fam package. Regards, Martin -- http:

Re: msvcp71.dll and Python 2.4 C++ extensions

2005-02-08 Thread "Martin v. Löwis"
Matthias Baas wrote: I'm creating the installer via the distutils by calling "setup.py bdist_wininst". How can I configure distutils to have it create an installer that does the above things? Ah, I see. Unfortunately, bdist_wininst is not capable of doing a Windows logo compliant installation (with

Re: Printing Filenames with non-Ascii-Characters

2005-02-08 Thread "Martin v. Löwis"
Marian Aldenhövel wrote: dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain non-ascii characters. 'ascii' codec can't encode characters in position 33-34: I cannot reproduce this. On my system, all such file names print just fine,

Re: Printing Filenames with non-Ascii-Characters

2005-02-08 Thread "Martin v. Löwis"
Marian Aldenhövel wrote: > If you're printing to the console, modern Pythons will try to guess the > console's encoding (e.g. cp850). But it seems to have quessed wrong. I don't blame it, I would not know of any way to reliably figure out this setting. It's actually very easy. Python invokes GetC

Re: python-2.4.msi installation issue

2005-02-08 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: My question is this: how do I determine what the error was that caused the installation process to end prematurely? Please run msiexec /i python-2.4.msi /l*v python.log and post the resulting python.log as a bug report on sf.net/projects/python. In most such cases

Re: Is this a bug? BOM decoded with UTF8

2005-02-10 Thread "Martin v. Löwis"
pekka niiranen wrote: I have two files "my.utf8" and "my.utf16" which both contain BOM and two "a" characters. Contents of "my.utf8" in HEX: EFBBBF6161 Contents of "my.utf16" in HEX: FEFF6161 This is not true: this byte string does not denote two "a" characters. Instead, it is a single char

Re: Is this a bug? BOM decoded with UTF8

2005-02-12 Thread "Martin v. Löwis"
What are you talking about? The BOM and UTF-16 go hand-and-hand. Without a Byte Order Mark, you can't unambiguosly determine whether big or little endian UTF-16 was used. In the old days, UCS-2 was *implicitly* big-endian. It was only when Microsoft got that wrong that little-endian version of UC

Re: sre is broken in SuSE 9.2

2005-02-12 Thread "Martin v. Löwis"
Serge Orlov wrote: > To summarize the discussion: either it's a bug in glibc or there is an option to specify modern POSIX locale. POSIX locale consist of characters from the portable character set, unicode is certainly portable. Yes, but U+00E4 is not in the portable character set. The portable

Re: sre is broken in SuSE 9.2

2005-02-13 Thread "Martin v. Löwis"
Serge Orlov wrote: Emphasis is mine. So how many libc implementations with non-unicode wide-character codes do we have in 2005? Solaris has supported 2-byte wchar_t implementations for many years, and so I believe did HP-UX and AIX. ISO C99 defines a constant __STDC_ISO_10646__ which an implementat

Re: For American numbers

2005-02-13 Thread "Martin v. Löwis"
Peter Hansen wrote: For the rest of the computer world, unless I've missed a changing of the guard or something, "kilo" is 1024 and "mega" is 1024*1024 and so forth... In case this isn't clear yet: you have missed a changing of the guard or something. "kibi" is 1024, "mebi" is 1024*1024 and so fort

Re: sre is broken in SuSE 9.2

2005-02-13 Thread "Martin v. Löwis"
Denis S. Otkidach wrote: You are right. But isalpha behavior looks strange for me anyway: why cyrillic character '\u0430' is recognized as alpha one for de_DE locale, but is not for C? In glibc, all "real" locales are based on /usr/share/locale/i18n/locales/i18n, e.g. for de_DE through LC_CTYPE co

Re: win32 extension install hiccup

2005-02-13 Thread "Martin v. Löwis"
MM wrote: I downloaded the latest win32all build 202 and tried to install under win2000 with Py2.4. Install complains about 'couldn't open py2.4 to run script pywin32-preinstall.py'. I checked the directories and there was no sign of this file (preinstall.py) so I presume this is why it bombed.

Re: supress creation of .pyc files

2005-02-16 Thread "Martin v. Löwis"
Thomas Guettler wrote: Is there a way to import a file without creating a .pyc file? That is part of PEP 304, which is not implemented yet, and apparently currently stalled due to lack of interest. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with C extensions under VC6 / WinXP and Python 2.4

2005-02-17 Thread "Martin v. Löwis"
Scott wrote: I'm specifically trying to perform step 6. Creating a brand new project using VC6. The instructions are outdated. Don't use VC6 to build extension modules for Python 2.4. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-18 Thread "Martin v. Löwis"
aurora wrote: The Java has a much more usable model with unicode used internally and encoding/decoding decision only need twice when dealing with input and output. In addition to Fredrik's comment (that you should use the same model in Python) and Walter's comment (that you can enforce it by s

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread "Martin v. Löwis"
Ilias Lazaridis wrote: My questions: It appears that nobody has answered the questions, yet. a) Why does the Python Foundation not provide additionally a binary version, compiled with MinGW or another open-source compiler? We don't have the resources to do that. b) Why does the Python Foundation n

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread "Martin v. Löwis"
Ilias Lazaridis wrote: Should a professional developer take python serious? Yes. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-20 Thread "Martin v. Löwis"
Thomas Heller wrote: Is it possible to specify a byte string literal when running with the -U option? Not literally. However, you can specify things like bytes = [0x47, 0x49, 0x4f, 0x50, 0x01, 0x00] bytes = ''.join((chr(x) for x in bytes)) Alternatively, you could rely on the 1:1 feature of Latin-1

Re: unicode encoding usablilty problem

2005-02-20 Thread "Martin v. Löwis"
aurora wrote: Lots of errors. Amount them are gzip (binary?!) and strftime?? For gzip, this is not surprising. It contains things like self.fileobj.write('\037\213') which is not intended to denote characters. How about b'' - 8bit string; '' unicode string and no automatic conversion. This has

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread "Martin v. Löwis"
Ilias Lazaridis wrote: Should I take answers serious? If not, why are you asking questions in the first place? Answer from people which do not respect coherence of writings? Coherence of writings? Should a professional developer take python serious? Yes. I mean, if the team does not manage at least

Re: unicode encoding usablilty problem

2005-02-20 Thread "Martin v. Löwis"
Nick Coghlan wrote: Having "", u"", and r"" be immutable, while b"" was mutable would seem rather inconsistent. Yes. However, this inconsistency might be desirable. It would, of course, mean that the literal cannot be a singleton. Instead, it has to be a display (?), similar to list or dict displ

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread "Martin v. Löwis"
Ilias Lazaridis wrote: Should I take answers serious? . . . . Answer from people which do not respect coherence of writings? - - - I still detect the coherence. As most people in this group will detect the coherence. I don't. The second fragment is not even correct English (it does not have a verb

Re: unicode encoding usablilty problem

2005-02-21 Thread "Martin v. Löwis"
aurora wrote: What is the processing of getting a PEP work out? Does the work and discussion carry out in the python-dev mailing list? I would be glad to help out especially on this particular issue. See PEP 1 for the PEP process. The main point is that discussion is *not* carried out on any sp

Re: IDLE Problem: win98\Python2.4

2005-02-21 Thread "Martin v. Löwis"
kim kubik wrote: A little knowledge is indeed a dangerous thing; forgive my stupidity - it will happen again, so I'm apologizing in advance! No need to apologize! This is a frequent mistake, and it might be sensible to change Python to be more resistent against it. For example, it might be possible

<    1   2   3   4   5   6   7   8   9   10   >