Python 3.2.2rc1

2011-08-14 Thread Martin v. Löwis
nges in 3.2, see http://docs.python.org/3.2/whatsnew/3.2.html To download Python 3.2 visit: http://www.python.org/download/releases/3.2/ Please consider trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! -- Martin v. Löwis (

Re: 2to3 and maketrans

2011-03-03 Thread Martin v. Löwis
Am 04.03.2011 03:21, schrieb Dan Stromberg: > > On Thu, Mar 3, 2011 at 3:46 PM, Martin v. Loewis > wrote: > > That depends on how you chose to represent text in 2.7. > The recommended way for that (also with 3.x in mind) > is that you should use Unicode str

[ANN] Python 2.5.6 Release Candidate 1

2011-04-17 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release candidate 1 of Python 2.5.6. This is a source-only release that only includes security fixes. The last full bug-fix release of Python 2.5 was Python 2.5.4. Users are encouraged to upgrade to the la

[ANN] Python 2.5.6 released

2011-05-27 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.6. There were no changes since the release candidate. This is a source-only release that only includes security fixes. The last full bug-fix release of Python 2.5 was Python 2.5.4. Us

Re: Small python24.dll / how to strip off asian codecs to separate package(s) ?

2005-09-23 Thread Martin v. Löwis
Robert wrote: > Or how to build one? Just download the source, and follow the instructions in PCBuild/readme.txt. Then, edit the pythoncore project to remove the files you don't want to include, and edit config.c to remove the dangling references. Regards, Martin -- http://mail.python.org/mailma

Re: Small python24.dll / how to strip off asian codecs to separate package(s) ?

2005-09-24 Thread Martin v. Löwis
Robert wrote: > Wouldn't it be an issue to think about if future win-python distributions > should keep on including the asian codecs in the main-dll? Indeed, it would. As I said before: if somebody defines a clear, fair policy which finds agreement in the community, I'm willing to change the curr

Re: Memory stats

2005-09-26 Thread Martin v. Löwis
Tarek Ziadé wrote: > I am trying to find a general memory profiler that can measure the > memory usage in Python program > and gather some stats about object usages, and things like that. As Diez says, use gc: gc.getobjects() gives you all container objects. If you want a list of all objects (cont

Re: Fixes since 2.4.2c1?

2005-09-29 Thread Martin v. Löwis
Michael Ströder wrote: > Does that differ from 2.4.2c1? On Monday I noticed a crash in the test > suite on a box running Solaris 8. It seems I can build Python 2.4.1 and > run make test there without problems. There is also a chance that you found a compiler bug. So reporting the compiler you used

Re: RELEASED Python 2.4.2 (final)

2005-09-29 Thread Martin v. Löwis
Trent Mick wrote: > It is possible that the python.org installer didn't overwrite the > "python24.dll" in the system directory (C:\WINDOWS\system32). Try doing > this: Even though this is apparently what happened, I'm puzzled as to why it happened: shouldn't the version number of python24.dll in t

Re: RELEASED Python 2.4.2 (final)

2005-09-30 Thread Martin v. Löwis
Trent Mick wrote: > I suppose that is possible. Martin, does python-2.4.2.msi install > python24.dll to the Python install dir for a "per-user" installation? Yes, that is supported. It would be good if Bugs could confirm that he only deleted the wrong python24.dll, with the proper one being insta

Re: What encoding is used when initializing sys.argv?

2005-09-30 Thread Martin v. Löwis
Petr Prikryl wrote: > I know about the rejected attempt to implement > sys.argvu. Still, how the sys.argv is filled? What > encoding is used when parsing the cmd line internally? > To what encoding is it converted when non ASCII > characters appear? Python does not perform any conversion whatsoeve

Re: RELEASED Python 2.4.2 (final)

2005-10-02 Thread Martin v. Löwis
Bugs wrote: > - I had an old ActiveState python24.dll in \windows\system32 which I > deleted. That must've been left over from a 2.4.1 ActiveState > installation which I had installed then uninstalled sometime ago. > > - I then uninstalled Python 2.4.2 and re-installed it for "all" users. > After

Re: Unicode charmap decoders slow

2005-10-03 Thread Martin v. Löwis
Tony Nelson wrote: > Is there a faster way to decode from charmaps to utf-8 than unicode()? You could try the iconv codec, if your system supports iconv: http://cvs.sourceforge.net/viewcvs.py/python-codecs/practicecodecs/iconv/ Regards, Martin -- http://mail.python.org/mailman/listinfo/python-l

Re: Unicode charmap decoders slow

2005-10-03 Thread Martin v. Löwis
Tony Nelson wrote: > I had seen iconv. Even if my system supports it and it is faster than > Python's charmap decoder, it might not be available on other systems. > Requiring something unusual in order to do a trivial LUT task isn't an > acceptable solution. If I write a charmap decoder as an

Re: Call C functions from Python

2005-10-04 Thread Martin v. Löwis
Java and Swing wrote: > Is there some other way, besides SWIG, which will allow me to call > functions inside an Ansi C DLL? You could write an extension module. See Modules/xxmodule.c in the Python source tree, as well as http://docs.python.org/ext/ext.html In the specific case, if it weren't f

Re: Replacing utf-8 characters

2005-10-05 Thread Martin v. Löwis
Mike wrote: > So it seems link.replace() function reads whether the first option is > utf-8 and converts the second option automatically to utf-8? How do I > prevent that? Not sure what an option is... if you are talking about parameters, rest assured that .replace does not know or care whether

Re: Compile as static

2005-10-06 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > However the executable size is always the same :/ Please assist. At a minimum, you should edit Modules/Setup to compile all extension modules in. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: PyObject_New

2005-10-07 Thread Martin v. Löwis
Jeremy Moles wrote: > PyObject* obj = _PyObject_New(&PyType_MyType); > obj = PyObject_Init(obj, &PyType_MyType); > > ... > > return obj; The call to PyObject_Init is redundant: _PyObject_New is malloc+init. However, this shouldn't cause any crashes (except in the de

Re: [regex] case-splitting strings in unicode

2005-10-09 Thread Martin v. Löwis
John Perks and Sarah Mount wrote: > I have to split some identifiers that are casedLikeThis into their > component words. In this instance I can safely use [A-Z] to represent > uppercase, but what pattern should I use if I wanted it to work more > generally? I can envisage walking the string testin

Re: Looking for info on Python's memory allocation

2005-10-11 Thread Martin v. Löwis
Fredrik Lundh wrote: I = iter(L) I > > > len(I) > > 3 [...] > (it's probably not a good idea to rely on this behaviour...) I believe this has been classified as a bug in Python 2.4, which will be undone in Python 2.5. Regards, Martin -- http://mail.python.org/mailman/listinfo/pyt

Re: Python name lookups / Interning strings

2005-10-11 Thread Martin v. Löwis
Dave wrote: > What exactly does it mean to "intern" a string? "exactly" it means to place lookup the string in the global interning dictionary. If an entry is found, then interning yields the string in the interning dictionary. If the string is not found, it is added to the interning dictionary, a

Re: Why asci-only symbols?

2005-10-12 Thread Martin v. Löwis
Mike Meyer wrote: > Out of random curiosity, is there a PEP/thread/? that explains why > Python symbols are restricted to 7-bit ascii? No PEP yet; I meant to write one for several years now. The principles would be - sources must use encoding declarations - valid identifiers would follow the Unic

Re: C Extension - return an array of longs or pointer?

2005-10-12 Thread Martin v. Löwis
Brandon K wrote: > PyTuple_SET_ITEM(py, i, Py_BuildValue("l",*result[i]); Using Py_BuildValue is overkill here. PyInt_FromLong will do just as well. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: installer for amd64 build of python?

2005-10-13 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Does anyone know of an available downloader for an amd64 bit > build of (a modern) python? There is no official build. The only official Win64 build is for Itanium, see www.python.org/2.4.2 > I've done my due diligence search of python docs and > mailing archives, and I

Re: Why asci-only symbols?

2005-10-16 Thread Martin v. Löwis
Bengt Richter wrote: > Perhaps string equivalence in keys will be treated like numeric equivalence? > I.e., a key/name representation is established by the initial key/name > binding, but > values can be retrieved by "equivalent" key/names with different > representations > like unicode vs ascii

Re: Why asci-only symbols?

2005-10-17 Thread Martin v. Löwis
Bengt Richter wrote: > Well, what will be assumed about name after the lines > > #-*- coding: latin1 -*- > name = 'Martin Löwis' > > ? Are you asking what is assumed about the identifier 'name', or the value bound to that identifier? Currently, the identifier must be encoded in latin1 in this

Re: Why asci-only symbols?

2005-10-18 Thread Martin v. Löwis
Bengt Richter wrote: >>Others reject it because of semantic difficulties: how would such >>strings behave under concatenation, if the encodings are different? > > I mentioned that in parts you snipped (2nd half here): > > This could also support s1+s2 to mean generate a concatenated string > that

Re: Extention Module/ list of chars-> string

2005-10-19 Thread Martin v. Löwis
Tuvas wrote: > A. Change a list of chars to a single string or > B. Read a list of chars in an extention module Either is possible, but I recommend to do A: data = ''.join(data) Then pass the modified data to the extension module. Regards, Martin -- http://mail.python.org/mailman/listinfo/pyth

Re: How to statically link Python with ncurses and readline?

2005-10-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > That is, there are no longer any readline.so or _curses.so in lib-dynload, > but instead they are added to Python's shared library dependencies. What is "they" in that sentence? readline.so and _curses.so? I very much doubt that - more likely, libreadline.so and libncu

Re: How to statically link Python with ncurses and readline?

2005-10-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Well, I implied that _curses.so and readline.so disappeared as one > would expect, dependencies on libncurses.so and libreadline.so instead > showing up in Python itself. It's very strange that this happens with > ncurses and readline, when both db and Tcl/Tk got linked i

Re: How to statically link Python with ncurses and readline?

2005-10-26 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > What do you mean? A static-only build does somehow exclude that I had > static libraries before? No, it doesn't. I misunderstood. It is quite unclear still what you had been doing: e.g. did you have shared versions of db and Tcl or not? Did you have linker scripts in pla

Re: Building 2.4.2 on OpenBSD 3.8

2005-10-29 Thread Martin v. Löwis
Dan M wrote: > /usr/include/sys/event.h:53: error: syntax error before "u_int" > /usr/include/sys/event.h:55: error: syntax error before "u_short" > *** Error code 1 > > Stop in /usr/local/src/Python-2.4.2. > > immediately upon running "make". I took at look at event.h to see if I > could find an

Re: urlencode with high characters

2005-11-02 Thread Martin v. Löwis
Jim wrote: > My understanding is that I am supposed to be able to urlencode anything > up to the top half of latin-1 -- decimal 128-255. I believe your understanding is incorrect. Without being able to quote RFCs precisely, I think your understanding should be this: - the URL literal syntax only

Re: /usr/lib/python2.4/posixfile.py error

2005-11-03 Thread Martin v. Löwis
Chris wrote: > Wonder if anyone can help me? I very much doubt that, with as little information you gave us. > I am trying to run a perl script but I keep getting this error: > > /usr/lib/python2.4/posixfile.py:59: DeprecationWarning: The posixfile > module is obsolete and will disappear in the

Re: PYTHON LOOSING FOR JAVA???????

2005-11-07 Thread Martin v. Löwis
Fcamattti wrote: > Hello for everybody > > So I have a doubt. I'd like to know what do you think about the joint > of efforts of Sun Microsystems and the Google to create a office web > based. I sincerely enjoy the idea althoug I'd like to know what will be > the future of this wonderful lang

Re: weird problem with os.chmod

2005-11-11 Thread Martin v. Löwis
James Colannino wrote: > I discovered the solution and thought I'd share it with everyone. I > discovered as I googled that Python used to have a function called > atoi() that took the parameter base=X. I decided to see if that worked > with the newer function int() and it did :) I recommend

Re: weird problem with os.chmod

2005-11-11 Thread Martin v. Löwis
James Colannino wrote: > Ok, so further research revealed that 0600 is actually the octal > representation for 384 (which makes sense.) So then, I guess my > question would have to be, is there a way for me to make Python aware > that the 0600 I'm passing to int() is octal and not decimal so th

Re: Want to perform unattended installation of SW using python

2005-11-13 Thread Martin v. Löwis
28tommy wrote: > I'm trying to automate an installation of some SW that is installed on > Windows (you know - 'Start' ==> 'Next' ==> 'Next' ==> 'Finish' kind of > installation). Is ther any way to perform that using python? While that is possible in Python, it is very tedious to do: you essential

Re: Tix BUG? Where to submit?

2005-11-14 Thread Martin v. Löwis
Ron wrote: > Surprising to myself, this was all that it took to make this work. So I'm > not sure why this method was left out. Could it have been an oversight? It could be an oversight. More likely, it was not originally there when the underlying tix library was developed, and only added to t

Re: compiling Python under Windows

2005-11-21 Thread Martin v. Löwis
Philippe C. Martin wrote: >>My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2 >> > > PS: since bzip.org does not have 1.0.2 source anymore, can I just rename > 1.0.3 ? That should work; alternatively, you can change the project file. Regards, Martin -- http://mail.python

Re: How to install python2.4.2 on IRIX6.5 ?

2005-11-21 Thread Martin v. Löwis
Xiao Jianfeng wrote: > self.assertEquals(result, expected) > AssertionError: '-0' != '0' > > Can somebody tell me what's the problem ? It looks like there is some minor bug in the floating point libraries of your operating system: Python expects that the strings for both numbers are the same in t

Re: bsddb185 question

2005-11-21 Thread Martin v. Löwis
thakadu wrote: > So it seems I am forced to use the bsddb185 module > which does not have convenient record level methods. > Am I missing something here or have others eperienced > tha same? I think you are missing that bsddb185 implements the dictionary interface. So you can use [key] to access t

Re: IPv6 RFC 3542 with socket module?

2005-11-21 Thread Martin v. Löwis
Roy Smith wrote: > Is there any way to access the RFC 3542 defined macros such as > ICMP6_FILTER_SETPASSALL() from within the socket module? No. Not sure it would belong into the socket module, though: an icmp module could be developed independently from the socket module if needed. Regards, Ma

Re: linking one extension module to another (Mac OSX)

2005-11-21 Thread Martin v. Löwis
Simon Burton wrote: > I'm having some trouble linking one extension module to another because > the linker expects a "lib" prefix and my python modules cannot have > this prefix. This is a Good Thing (tm) :-) Don't link extension modules to each other; this is really asking for trouble. Instead, c

Re: keys in dictionary

2005-11-21 Thread Martin v. Löwis
Shi Mu wrote: > I run the following code and got wrong message, but I still want to > make [1,2],[4,3] and [6,9] to be keys of the dictionary or change the > style a little bit. How to do that? Make them tuples: >>> p=[[1,2],[4,3],[6,9]] >>> n=dict([(tuple(x),[]) for x in p]) >>> n {(6, 9): [

Re: bsddb185 question

2005-11-22 Thread Martin v. Löwis
thakadu wrote: > It seems it doesnt implement ALL of the dictionary interface though. > dir({}) yields many more methods than dir(bsddb185.open(f)). > So bsddb185 is missing many of the methods that I am used > to in bsddb. I mentioned some above that are missing, pop() > in particular would be use

Re: linking one extension module to another (Mac OSX)

2005-11-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I have C Extension classes distributed across several modules with > non-trivial interdependancies. I guess you are saying I should have > these in backend libraries and then put the module specific functions > in the module itself. It's going to be tricky because I am us

Re: Built windows installers and Cygwin

2005-11-22 Thread Martin v. Löwis
SPE - Stani's Python Editor wrote: > Is there any way for these kind of installers to be used with cygwin. No. The bdist_wininst packages link against Microsoft's C library; the cygwin Python against Cygwin's. If there is no native code in the package, it would be possible to *use* them - install

Re: Using gettext to provide different language-version of a script

2005-11-22 Thread Martin v. Löwis
Thomas W wrote: > Hmmm ... any hints? I think gettext needs environment variables (e.g. LANG) to be set. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: bsddb185 question

2005-11-23 Thread Martin v. Löwis
thakadu wrote: > However the line: > del db[key] > results in an error: (1, 'Operation not permitted') > (only tested on Python 2.3.5) Did you open the dbm file for read-write? This should work, and is implemented. > Could this be because the .del() method of the dictionary > has not been impleme

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-23 Thread Martin v. Löwis
Paul Watson wrote: > Any ideas why ./Modules/cjkcodecs/_codecs_cn.c fails to compile? It > appears that the CODEC_STATELESS macro is concatenating 'hz' with a > number and text. More likely, hz is already defined to be 100, then forming 100_encode. It would be best if you could find out what A

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-23 Thread Martin v. Löwis
Paul Watson wrote: > This is on AIX 4.3.3 > > $ grep -i _hz $(find . -name m_param.h) > #define _HZ 100/* ticks per second of the clock*/ > #define __hzHZ /* Berkeley uses lower case hz */ > #define HZ _HZ > #define hz __hz I expected to see something li

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-23 Thread Martin v. Löwis
Paul Watson wrote: > Can we #undef _ALL_SOURCE for _codecs_cn.c compilation? Where does _ALL_SOURCE come from? Why is it defined? What is its effect on hz? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a CPython Script engine in a .NET application.

2005-11-23 Thread Martin v. Löwis
Carl Waldbieser wrote: > Has anyone had any experience embedding a CPython engine in a .NET > application? In the COM/ActiveX world, it was pretty easy to use Mark > Hammond's win32 modules to create a script engine component that you could > expose other COM objects to, but I was not sure how I w

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread Martin v. Löwis
Christoph Zwerschke wrote: > Anyway, I was thinking about whether it would be possible and desirable > to change the old behavior in future Python versions and let dict.keys() > and dict.values() both return sets instead of lists. You answer the question whether it would be possible (no, because

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-24 Thread Martin v. Löwis
Paul Watson wrote: > It appears that _ALL_SOURCE gets defined in the /usr/include/standards.h > file. If we could #define _ANSI_C_SOURCE or _POSIX_SOURCE, it appears > that it would eleminate _ALL_SOURCE. Ah, ok - this should be easy enough. Python would normally define _POSIX_SOURCE (through _

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-24 Thread Martin v. Löwis
Paul Watson wrote: > I also note that compiles occurring after the complaint about not > finding Tcl/Tk do not appear to get the OPT= setting I specified on the > 'make' command line. It starts with compilation of structmodule.c and > includes the _codecs_??.c files. Does this have any signifi

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Martin v. Löwis
Christoph Zwerschke wrote: > I know. But this does not answer the question: If the keys *are* already > a set according to their semantics, why aren't they returned as a set > from the beginning? Notice that this was not the question you originally asked. This one has a clear answer: because tha

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Martin v. Löwis
Christoph Zwerschke wrote: > Sorry. Your answer was good; I missed the point and thought you wrote > set(d.keys()). Is it documented anywhere that set(d) = set(d.keys())? I > think this should go into the Python Doco where keys() are explained. It follows from what is documented. set() creates a

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Martin v. Löwis
Mike Meyer wrote: >>I trusted the doco which defines a set as "an unordered collection of >>immutable values" (http://docs.python.org/lib/types-set.html). > > > If the hash changes, you've screwed up the set. What it really should > say is "collection of objects with fixed hashes", or words to th

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread Martin v. Löwis
Christoph Zwerschke wrote: > You need to know a third thing, namely that as an iterable object, a > dictionary returns the keys only, not the key/value tuples which would > also make some sense. If it had been designed that way, you could write Right. I forgot to say that, but that is also expla

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread Martin v. Löwis
Mike Meyer wrote: > I would have phrased it as "identical" instead of equal. Sets should > hold unique elements, where "unique" depends on the use at hand. For > some uses, "==" might be appropriate. For others, "is" might be > appropriate. Sets, as currently defined, require hashable objects, i.e

Re: Which License Should I Use?

2005-11-25 Thread Martin v. Löwis
mojosam wrote: > How do I decide on a license? If you want to look at this from a legal point of view, I highly recommend reading Larry Rosen's book, Open Source Licensing. It covers issue you would never have thought of without studying law, and gives good advice (IMHO). Regards, Martin -- htt

Re: Move xml.sax.saxutils.*?

2005-11-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > It seems like functions such as xml.sax.saxutils.escape and unescape > are generally useful, and not at all tied to the xml.sax module. Would > it make sense to move them somewhere else, like to xml? Moving it would be a bad idea. Exposing it elsewhere would be useful.

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: >>class mylist1(list): >> def __hash__(self): return 0815 >> >>class mylist2(list): >> def __hash__(self): return id(self) >> >>In the case of mylist1, everything is ok including semantics, but >>performance suffers dramatically. In mylist2, performance is great, >>but sem

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Christoph Zwerschke wrote: >> This is not true. The second definition of __hash__ does not meet >> the specifications: >> "The only required property is that objects which compare equal have the >> same hash value" > > > As Mike has written in his last posting, you could easily "fix" that by > t

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: >>This is not true. The second definition of __hash__ does not meet >>the specifications: > > > The specification isn't on the __hash__ method, but on objects. What does it mean for a specification to be "on" something? The specification I quoted is listed "under" the __hash__

Re: New docs for set elements/dictionary keys (Was: Why is dictionary.keys() a list and not a set?)

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: > Personally, I think we'd be better off to come up with a term for this > property that doesn't have a commonly understood meaning that has such > broad areas of disagreement with the property. I've been using > "hashable", which I would currently define as "has a __hash__ method

Re: Why is dictionary.keys() a list and not a set?

2005-11-27 Thread Martin v. Löwis
Christoph Zwerschke wrote: > Anyway, the original question was: Are mylist1 and mylist2 (as above) to > be considered "hashable" types or not? I long forgot was the original question was (I thought it was "Why is dictionary.keys() a list and not a set?" :-); anyway, the answer to this question is

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Martin v. Löwis
Mike Meyer wrote: >>>Personally, I think we'd be better off to come up with a term for this >>>property that doesn't have a commonly understood meaning that has such >>>broad areas of disagreement with the property. I've been using >>>"hashable", which I would currently define as "has a __hash__ me

Re: New Ordered Dictionery to Criticise

2005-11-28 Thread Martin v. Löwis
Fuzzyman wrote: > Criticism solicited (honestly) :-) A couple of minor points: - I would drop 2.2 compatibility - self=self isn't needed in the functions, because of nested scopes - popitem(self) can be rewritten as def popitem(self): try: key = self._sequence.pop()

Re: cheese shop registration error

2005-11-28 Thread Martin v. Löwis
Todd Greenwood-Geer wrote: > Q: Do I have to be a member of some sort of secret society in order to > be listed in the 'local recipient table'? Ah, you don't know about the PSU :-? Seriously, please report a bug at sf.net/projects/pypi. Unfortunately, the (single) cheeseshop maintainer is overwor

Re: New Ordered Dictionery to Criticise

2005-11-29 Thread Martin v. Löwis
Fuzzyman wrote: >>- One problem with the FancyDict is that it allows >> d.keys.append(100) > > > Are you sure ? Not at all. This was from inspection only; I propably misinterpreted the code. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & Unicode decimal interpretation

2005-12-03 Thread Martin v. Löwis
Scott David Daniels wrote: > In reading over the source for CPython's PyUnicode_EncodeDecimal, > I see a dance to handle characters which are neither dec-equiv nor > in Latin-1. Does anyone know about the intent of such a conversion? To support this: >>> int(u"\N{DEVANAGARI DIGIT SEVEN}") 7 >

Re: os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Martin v. Löwis
Tony Meyer wrote: > Is this the intended behaviour? Sort-of. os.rename invokes the C library's rename, and does whatever this does. It is expected that most platform's C libraries do what the documentation says rename does, but platforms may vary in their implementation of the C library, and from

Re: os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Martin v. Löwis
Tony Meyer wrote: > Thanks for that. In your opinion, would a documentation patch that > explained that this would occur on Windows (after the existing note > about the Windows rename not being atomic) be acceptable? In principle, yes. We cannot do that for every platform, of course, but it p

Re: Python & Unicode decimal interpretation

2005-12-03 Thread Martin v. Löwis
Scott David Daniels wrote: >> >>> int(u"\N{DEVANAGARI DIGIT SEVEN}") >> 7 > > OK, That much I have handled. I am fiddling with direct-to-number > conversions and wondering about cases like >>>> int(u"\N{DEVANAGARI DIGIT SEVEN}" + XXX >+ u"\N{DEVANAGARI DIGIT SEVEN}") int() passe

Re: Building Python 2.4 on machines that do not support dynamic loading

2005-12-04 Thread Martin v. Löwis
Robert McLay wrote: > I have been trying to build python on Cray X1. As far as I can > tell it does not support dynamic loading. So the question is: > >How to build 2.4 without dynamic loading? Make sure HAVE_DYNAMIC_LOADING isn't defined; configure should detect this automatically. > That

Re: Detect character encoding

2005-12-04 Thread Martin v. Löwis
Martin P. Hellwig wrote: > From what I can remember is that they used an algorithm to create some > statistics of the specific page and compared that with statistic about > all kinds of languages and encodings and just mapped the most likely. More hearsay: I believe language-based heuristics ar

Re: Detect character encoding

2005-12-04 Thread Martin v. Löwis
Diez B. Roggisch wrote: > So cp1250 doesn't have all codepoints defined - but the others have. > Sure, this helps you to eliminate 1 of the three choices the OP wanted > to choose between - but how many texts you have that have a 129 in them? For the iso8859 ones, you should assume that the char

Re: Python 2.4.2 make failure in posixmodule on OSX 10.4.3

2005-12-05 Thread Martin v. Löwis
smurphus wrote: > Any suggestions on how I can remedy this? It would be good if you could try to understand and to analyse these error messages; your message does not indicate whether you have knowledge of the C language and could analyse them or not. For example, it is very puzzling that there i

Re: Python 2.4.2 make failure in posixmodule on OSX 10.4.3

2005-12-06 Thread Martin v. Löwis
smurphus wrote: > I hope that information is of some use. Not sure where to go from > here. Please try gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixm

Re: python24.dll and encodings ?

2005-12-08 Thread Martin v. Löwis
Bugs wrote: > I believe I read in a relatively recent thread that the reason > python24.dll is so large compared to previous releases is that all the > language encodings are linked into the library? Not only that (but also). In addition, it also contains modules that were previously implemented

Re: Encoding of file names

2005-12-08 Thread Martin v. Löwis
utabintarbo wrote: > Fredrik, you are a God! Thank You^3. I am unworthy > > I believe that may do the trick. Here is the results of running your > code: For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 5

Re: Encoding of file names

2005-12-09 Thread Martin v. Löwis
Tom Anderson wrote: > Isn't the key thing that Windows is applying a non-roundtrippable > character encoding? This is a fact, but it is not a key thing. Of course Windows is applying a non-roundtrippable character encoding. What else could it do? > Windows, however, maps that name to the > 8-bi

Re: Encoding of file names

2005-12-10 Thread Martin v. Löwis
Tom Anderson wrote: >> This is a fact, but it is not a key thing. Of course Windows is >> applying a non-roundtrippable character encoding. What else could it do? > > > Well, i'm no great thinker, but i'd say that errors should never pass > silently, and that in the face of ambiguity, one shoul

Re: Using ICL to compile C extensions

2005-01-04 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: Does anyone know how I can use "icl" (Intel C++) to compile C extensions? I'm on Windows, and my Python is compiled using VS7.1 (binary distribution). Right now, when I run setup.py install, it uses cl.exe (MSVC++ Toolkit 2003), and I would like to use icl because MSVC++ 20

Re: Wide Unicode build for Windows available somewhere?

2005-01-12 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: I am trying to locate a windows binary of a recent python (2.4 preferred, but not essential) with support for Unicode characters with values greater than 0x1. I have tested the python.org binaries and those from Activestate, both give me a traceback on unichr(0x1) a

Re: Static executable with shared modules

2005-01-14 Thread "Martin v. Löwis"
Rickard Lind wrote: Is there any way to build the python executable statically and still be able to load modules built as shared libraries? I'm not what "build statically" means; if you talking about building a statically linked interpreter binary - then no, this is not possible. At a minimum, you

Re: deleting from tarfile

2005-01-16 Thread "Martin v. Löwis"
Mark McEahern wrote: It doesn't appear so. A workaround, of course, is to create a new file with the subset of files from the old file: That is actually the *only* way to do that. tarfiles cannot be "sparse", in the sense that parts of the file can be marked as deleted. So in order to delete a fi

Re: mutable string?

2005-01-16 Thread "Martin v. Löwis"
Torsten Mohr wrote: is there some string class that i can change in place, like perls strings? array.array is mutable. You can use the 'c' code if you want an array of characters. Is it possible to do some regex replacement functions that would even change its length? You can't use re.sub array, bu

Re: why are some types immutable?

2005-01-16 Thread "Martin v. Löwis"
Torsten Mohr wrote: reading the documentation (and also from a hint from this NG) i know now that there are some types that are not mutable. But why is it this way? There are various reasons, some apply for some types, and some for others: - immutable objects are hashable - their hash value will no

Re: Static executable with shared modules

2005-01-17 Thread "Martin v. Löwis"
Rickard Lind wrote: I'll be more specific: when I build python 2.3.4 on FreeBSD 4.9, the interpreter binary is linked against three shared libraries: libutil.so.3, libm.so.2 and libc_r.so.4. Now, these libraries are not present on the TARGET system (which is distinct from the build system, but bas

Re: xml parsing escape characters

2005-01-19 Thread "Martin v. Löwis"
Luis P. Mendes wrote: I get the following result: http://www..";> ~ Most likely, this result is correct, and your document really does contain I don't get any elements. But, if I access the same url via a browser, the result in the browser window is something like

Re: rotor replacement

2005-01-20 Thread "Martin v. Löwis"
Paul Rubin wrote: Some countries have laws about cryptography software (against some combination of export, import, or use). The Python maintainers didn't want to deal with imagined legal hassles that might develop from including good crypto functions in the distribution. Then it became obvious t

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Luis P. Mendes wrote: with:DataSetNode = stringNode.childNodes[0] print DataSetNode.toxml() I get: ~ ~439 ~ ___- so far so good, but when I issue the command: print D

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Irmen de Jong wrote: The unescaping is usually done for you by the xml parser that you use. Usually, but not in this case. If you have a text that looks like XML, and you want to put it into an XML element, the XML file uses < and >. The XML parser unescapes that as < and >. However, it does not th

Re: xml parsing escape characters

2005-01-20 Thread &quot;Martin v. Löwis"
Irmen de Jong wrote: Usually, but not in this case. If you have a text that looks like XML, and you want to put it into an XML element, the XML file uses < and >. The XML parser unescapes that as < and >. However, it does not then consider the < and > as markup, and it shouldn't. That's also what

Re: xml parsing escape characters

2005-01-20 Thread &quot;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 &quot;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

  1   2   3   4   5   6   7   8   9   10   >