Re: Python on imac

2007-10-14 Thread Tommy Nordgren
On 14 okt 2007, at 01.21, John Velman wrote: I'm considering moving from Linux to imac. I've recently returned to Python (was never very expert) to develop a small gui application. At present I plan to use PyGTK with Pango and Cairo. What surprises may I be in for :-) (Currently using

Entering username password automatically using urllib.urlopen

2007-10-14 Thread rodrigo
I am trying to retrieve a password protected page using: get = urllib.urlopen('http://password.protected.url;').read() While doing this interactively, I'm asked for the username, then the password at the terminal. Is there any way to do this non-interactively? To hardcode the user/ pass into

Safely dealing with arbitrary file objects

2007-10-14 Thread Steven D'Aprano
I have found myself writing functions rather like these: def openfile(filename): if filename == '-': # convention for shell scripts in Unix-land is to use # '-' for stdin/stdout for reading/writing. outfile = sys.stdout if filename == '2-': outfile =

Re: Memory Problems in Windows 2003 Server

2007-10-14 Thread Tim Roberts
AMD [EMAIL PROTECTED] wrote: I do the reading one line at a time, the problem seems to be with the dictionary I am creating. I don't know whether Python dictionaries must live in a contiguous piece of memory, but if so, that could be the issue. The system DLLs in Server 2003 have been rebased

Re: Error on base64.b64decode() ?!

2007-10-14 Thread Tim Roberts
Christoph Krammer [EMAIL PROTECTED] wrote: On 12 Okt., 17:09, Jean-Paul Calderone [EMAIL PROTECTED] wrote: If you get an incorrect padding error, try appending a = and decoding again. If you get the error again, try appending one more =. If it still doesn't work, then you might be out of

Re: Safely dealing with arbitrary file objects

2007-10-14 Thread Scott David Daniels
Steven D'Aprano wrote: I have found myself writing functions rather like these: def openfile(filename): if filename == '-': # convention for shell scripts in Unix-land is to use # '-' for stdin/stdout for reading/writing. outfile = sys.stdout if filename ==

Re: Python on imac

2007-10-14 Thread James Stroud
John Velman wrote: I'm considering moving from Linux to imac. I've recently returned to Python (was never very expert) to develop a small gui application. At present I plan to use PyGTK with Pango and Cairo. What surprises may I be in for :-) (Currently using slackware 11.0 on an old

First class lexical closures

2007-10-14 Thread Jon Harrop
Just debating somewhere else whether or not Python might be considered a functional programming language. Lua, Ruby and Perl all seem to provide first class lexical closures. What is the current state of affairs in Python? Last time I looked they were just removing (?!) closures... -- Dr Jon D

Re: First class lexical closures

2007-10-14 Thread Kay Schluehr
On Oct 14, 7:54 am, Jon Harrop [EMAIL PROTECTED] wrote: Just debating somewhere else whether or not Python might be considered a functional programming language. Lua, Ruby and Perl all seem to provide first class lexical closures. What is the current state of affairs in Python? Last time I

Re: Last iteration?

2007-10-14 Thread Paul McGuire
On Oct 12, 5:58 am, Florian Lindner [EMAIL PROTECTED] wrote: Hello, can I determine somehow if the iteration on a list of values is the last iteration? Example: for i in [1, 2, 3]: if last_iteration: print i*i else: print i that would print 1 2 9 Can this be

Pymedia audio analyzer

2007-10-14 Thread Carlos Leite
Is there any other option to analyze audio frequencies? Or Any here try to use pymedia to a simple audio FingerPrint. A cant understand what the information the asBands() really giveme. The Docs, say that asBands() return a List of tupples grouped by frquenciy, and the first two values are

Re: Foreign Character Problems In Python 2.5 and Tkinter

2007-10-14 Thread Juha S.
[EMAIL PROTECTED] wrote: As a noob I've struggled a bit, but basically what I've come up with is = if the information is strings and especially strings stored in any style of list/dict, it takes a loop to write the lines to file myfile[ i ] + '\n' to keep each line for Python I/O purposes. If

Re: unicodedata implementation - categories

2007-10-14 Thread Martin v. Löwis
1) Why doesn't the category method raise an Exception, like the name method does? As Chris explains, the result category means Other, Not Assigned. Python returns this category because it's the truth: for those characters, the value of the category property really *is* Cn; it means that they

Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Michele Simionato
On Oct 14, 2:52 am, Ian Bicking [EMAIL PROTECTED] wrote: That said, going without a framework (which at least in his article is what Michele seems to be comparing Pylons against) isn't always so bad. I started writing an Atompub server in Pylons, but felt like I was spending too much time

Re: Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Graham Dumpleton
On Oct 14, 6:46 pm, Michele Simionato [EMAIL PROTECTED] wrote: Now, since you are here, there is an unrelated question that I want to ask you, concerning the future of Paste with respect to WSGI 2.0. I do realize that at this stage WSGI 2.0, is only a draft Hmmm, not sure where people keep

Re: Entering username password automatically using urllib.urlopen

2007-10-14 Thread Diez B. Roggisch
rodrigo schrieb: I am trying to retrieve a password protected page using: get = urllib.urlopen('http://password.protected.url;').read() While doing this interactively, I'm asked for the username, then the password at the terminal. Is there any way to do this non-interactively? To

Re: Last iteration?

2007-10-14 Thread Paul Hankin
On Oct 14, 8:00 am, Paul McGuire [EMAIL PROTECTED] wrote: On Oct 12, 5:58 am, Florian Lindner [EMAIL PROTECTED] wrote: Hello, can I determine somehow if the iteration on a list of values is the last iteration? Example: for i in [1, 2, 3]: if last_iteration: print i*i

Re: Last iteration?

2007-10-14 Thread Diez B. Roggisch
Peter Otten schrieb: Diez B. Roggisch wrote: Florian Lindner wrote: can I determine somehow if the iteration on a list of values is the last iteration? def last_iter(iterable): it = iter(iterable) buffer = [it.next()] for i in it: buffer.append(i) old,

Re: Safely dealing with arbitrary file objects

2007-10-14 Thread Paul Hankin
On Oct 14, 5:01 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: I have found myself writing functions rather like these: def openfile(filename): if filename == '-': # convention for shell scripts in Unix-land is to use # '-' for stdin/stdout for

Simple Text Processing Help

2007-10-14 Thread patrick . waldo
Hi all, I started Python just a little while ago and I am stuck on something that is really simple, but I just can't figure out. Essentially I need to take a text document with some chemical information in Czech and organize it into another text file. The information is always EINECS number,

Re: Simple Text Processing Help

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 13:48:51 +, patrick.waldo wrote: Essentially I need to take a text document with some chemical information in Czech and organize it into another text file. The information is always EINECS number, CAS, chemical name, and formula in tables. I need to organize them

[no subject]

2007-10-14 Thread 353851029352
01smil;Name=01smil Description: application/smil -- http://mail.python.org/mailman/listinfo/python-list

a good website for softwares,sports,movies and music ,sex etc.

2007-10-14 Thread panguohua
www.space666.com good! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Text Processing Help

2007-10-14 Thread Paul Hankin
On Oct 14, 2:48 pm, [EMAIL PROTECTED] wrote: Hi all, I started Python just a little while ago and I am stuck on something that is really simple, but I just can't figure out. Essentially I need to take a text document with some chemical information in Czech and organize it into another text

Order of tuples in dict.items()

2007-10-14 Thread Will McGugan
Hi, If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? I tried an experiment with CPython and it does appear to be the case. a=dict(a=1, b=1, c=2) b=dict(c=2, a=1, b=1) a {'a': 1, 'c': 2, 'b': 1} b {'a':

Re: Order of tuples in dict.items()

2007-10-14 Thread Paul Hankin
On Oct 14, 3:28 pm, Will McGugan [EMAIL PROTECTED] wrote: If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? ... Can I rely on this behavior? No. To quote the python documentation: Keys and values are listed in

Re: Entering username password automatically using urllib.urlopen

2007-10-14 Thread byte8bits
On Oct 13, 11:41 pm, rodrigo [EMAIL PROTECTED] wrote: I am trying to retrieve a password protected page using: get = urllib.urlopen('http://password.protected.url;').read() While doing this interactively, I'm asked for the username, then the password at the terminal. Is there any way to do

Re: Python on imac

2007-10-14 Thread byte8bits
On Oct 14, 1:27 am, James Stroud [EMAIL PROTECTED] wrote: For OS X 10.4, wx has come as part of the stock python install. You may want to consider going that route if you develop exclusively for OS X--it will keep the size of your distribution down. James wx works well on Macs... Linux and

GLE-like python package

2007-10-14 Thread Wildemar Wildenburger
Hello there, I'm exploring possibilities of using python as an alternative to Matlab. The obvious way to go seems to be matplotlib for plotting, but I do like GLE URL:http://glx.sourceforge.net/ a lot. One reason is that with GLE you can also do diagrams, that is, descriptive pictures (like

Re: Python on imac

2007-10-14 Thread Alex Martelli
James Stroud [EMAIL PROTECTED] wrote: ... For OS X 10.4, wx has come as part of the stock python install. You may I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any wx as part of the stock Python (2.3.5). Maybe you mean something else? Alex --

Re: GLE-like python package

2007-10-14 Thread Cesar G. Miguel
On Oct 14, 12:54 pm, Wildemar Wildenburger [EMAIL PROTECTED] wrote: Hello there, I'm exploring possibilities of using python as an alternative to Matlab. The obvious way to go seems to be matplotlib for plotting, but I do like GLE URL:http://glx.sourceforge.net/ a lot. One reason is that with

Re: Python on imac

2007-10-14 Thread Kevin Walzer
Alex Martelli wrote: James Stroud [EMAIL PROTECTED] wrote: ... For OS X 10.4, wx has come as part of the stock python install. You may I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any wx as part of the stock Python (2.3.5). Maybe you mean something else?

Re: GLE-like python package

2007-10-14 Thread Wildemar Wildenburger
Cesar G. Miguel wrote: I think this is what you're looking for: http://pyx.sourceforge.net/ It damn sure is (a straight ripoff of GLE ;))! The syntax seems a bit messier than GLE (naturally) but since it is python I'm willing to bite that bullet. Thanks :) /W --

Re: Simple Text Processing Help

2007-10-14 Thread patrick . waldo
Thank you both for helping me out. I am still rather new to Python and so I'm probably trying to reinvent the wheel here. When I try to do Paul's response, I get tokens = line.strip().split() [] So I am not quite sure how to read line by line. tokens = input.read().split() gets me all the

Re: Python on imac

2007-10-14 Thread Raffaele Salmaso
Alex Martelli wrote: I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any wx as part of the stock Python (2.3.5). Maybe you mean something else? Very old version, see /System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python/wx-2.5.3-mac-unicode --

Re: Last iteration?

2007-10-14 Thread Paul McGuire
On Oct 14, 5:58 am, Paul Hankin [EMAIL PROTECTED] wrote: On Oct 14, 8:00 am, Paul McGuire [EMAIL PROTECTED] wrote: def signal_last(lst): last2 = None it = iter(lst) try: last = it.next() except StopIteration: last = None for last2 in it:

Re: Simple Text Processing Help

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 16:57:06 +, patrick.waldo wrote: Thank you both for helping me out. I am still rather new to Python and so I'm probably trying to reinvent the wheel here. When I try to do Paul's response, I get tokens = line.strip().split() [] What is in `line`? Paul wrote this

int to str in list elements..

2007-10-14 Thread Abandoned
Hi.. I have a list as a=[1, 2, 3 ] (4 million elements) and b=,.join(a) than TypeError: sequence item 0: expected string, int found I want to change list to a=['1','2','3'] but i don't want to use FOR because my list very very big. I'm sorry my bad english. King regards --

Re: Python on imac

2007-10-14 Thread Alex Martelli
Raffaele Salmaso [EMAIL PROTECTED] wrote: Alex Martelli wrote: I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any wx as part of the stock Python (2.3.5). Maybe you mean something else? Very old version, see

Re: Python on imac

2007-10-14 Thread John Velman
Thanks to all. I'll look into wx before I get too much further. John V. -- http://mail.python.org/mailman/listinfo/python-list

Re: int to str in list elements..

2007-10-14 Thread Tobias K.
1. Use a generator expression: b = ,.join(str(i) for i in a) or 2. Use imap from itertools import imap b = ,.join(imap(str, a)) -- http://mail.python.org/mailman/listinfo/python-list

pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
Hi, I need help with pydev code completion... Let's assume that we have something like this: class One: def fun(self): return 1 class Two: li = [] li.append(One()) one = li[0] print one.fun() one2 = li.pop() print one2.fun()

Re: Order of tuples in dict.items()

2007-10-14 Thread Erik Max Francis
Will McGugan wrote: If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? I tried an experiment with CPython and it does appear to be the case. a=dict(a=1, b=1, c=2) b=dict(c=2, a=1, b=1) a {'a': 1,

Re: Cross-platform GUI development

2007-10-14 Thread David Tremouilles
crappy, waaay better I will not feed the troll... Pygtk on mac just do the work for me on a more than satisfying way. David 2007/10/13, Diez B. Roggisch [EMAIL PROTECTED]: David Tremouilles schrieb: No issue with pygtk on mac! Actually I develop on this platform everyday. Macport take care

Re: pydev code completion problem

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 19:45:07 +, Lukasz Mierzejewski wrote: Let's assume that we have something like this: class One: def fun(self): return 1 class Two: li = [] li.append(One()) one = li[0] print one.fun() one2 = li.pop() print

Re: Python on imac

2007-10-14 Thread Erik Jones
On Oct 13, 2007, at 8:23 PM, Adam Atlas wrote: On Oct 13, 7:21 pm, John Velman [EMAIL PROTECTED] wrote: I'm considering moving from Linux to imac. I've recently returned to Python (was never very expert) to develop a small gui application. At present I plan to use PyGTK with Pango

Re: pydev code completion problem

2007-10-14 Thread cyberco
Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 2B -- http://mail.python.org/mailman/listinfo/python-list

Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Dmitri O.Kondratiev
The function I wrote (below) reverses lists all right: def reverse(xs): if xs == []: return [] else: return (reverse (xs[1:])) + [xs[0]] reverse ([1,2,3]) [3, 2, 1] Yet when I try to reverse a string I get: reverse (abc) ... ... ... File

Re: Simple Text Processing Help

2007-10-14 Thread John Machin
On Oct 14, 11:48 pm, [EMAIL PROTECTED] wrote: Hi all, I started Python just a little while ago and I am stuck on something that is really simple, but I just can't figure out. Essentially I need to take a text document with some chemical information in Czech and organize it into another text

Re: int to str in list elements..

2007-10-14 Thread John Machin
On Oct 15, 4:02 am, Abandoned [EMAIL PROTECTED] wrote: Hi.. I have a list as a=[1, 2, 3 ] (4 million elements) and b=,.join(a) than TypeError: sequence item 0: expected string, int found I want to change list to a=['1','2','3'] but i don't want to use FOR because my list very very

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
I can confirm and it's something I would expect. It is obvious to *you* that there is a `One` object in that list, but it would get very Thank you for confirmation and your time! quickly very complicated for an IDE to keep track of objects if not even impossible. I guess that you are

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 Thank you for replay, but I'm still not sure what to think about it... Marc

Re: pydev code completion problem

2007-10-14 Thread Diez B. Roggisch
Lukasz Mierzejewski schrieb: On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 Thank you for replay, but I'm still not sure what

hi hi hi

2007-10-14 Thread Tagrislam
Hi Hi Hi my name is tagreed , I am from Syria I've seen many places of the world on TV screen and few that I've visited either for fun or/ and business as you know when we travel we meet a lot different cultures and people. I found in many places I've been to ; that people stereotyped Islam

Re: compile for ARM

2007-10-14 Thread mickeyl
Rafael Marin Perez [EMAIL PROTECTED] wrote: Hello I'm Rafael Marin, and work as reseacher in University of Murcia (Spain). I want to install and compile modules of python2.4 in a ARMv5b architecture. Any idea? Use OpenEmbedded [http://openembedded.org], I've already done everything

Re: pydev code completion problem

2007-10-14 Thread Steven D'Aprano
On Sun, 14 Oct 2007 21:57:12 +, Lukasz Mierzejewski wrote: On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 Thank you for

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
But maybe someone use Komodo IDE or Wing IDE and can tell how they handle situations like this? How works code completion in those IDE's? I've downloaded and checked both of them (both have Linux version which is nice thing). Both did worse job with code completion then PyDev with my simple

Re: Order of tuples in dict.items()

2007-10-14 Thread Steven D'Aprano
On Sun, 14 Oct 2007 13:26:27 -0700, Erik Max Francis wrote: Will McGugan wrote: If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? [...] Can I rely on this behavior? Probably not. Definitely not. See Paul

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
He is right. What would you expect from this piece of code: foo = random.choose([A(), B(), C(), ..., Z()]) Thank you all for dispelling my stupid doubts! What PyDev does is to implement some heuristics that can guess easy cases - as you saw for yourself. But there is a limit to what can

Re: The fundamental concept of continuations

2007-10-14 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Barb Knox wrote: Instead of function A returning to its caller, the caller provides an additional argument (the continuation) which is a function B to be called by A with A's result(s). That's just a callback. I've been doing that in C code (and other

Re: Order of tuples in dict.items()

2007-10-14 Thread John Machin
On Oct 15, 8:27 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: I've never seen the point of a sorted dictionary, it's easy to just say: for key, value in sorted(D.items()) There are several applications that involve finding i such that key[i] = query key[i+1] where the keys

Re: Order of tuples in dict.items()

2007-10-14 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: I've never seen the point of a sorted dictionary, it's easy to just say: for key, value in sorted(D.items()) You might want just a subrange of the dictionary (say the 100th through 150th items in sorted order) without having to sort the entire

Re: Python on imac

2007-10-14 Thread w . greg . phillips
On Oct 13, 7:21 pm, John Velman [EMAIL PROTECTED] wrote: I'm considering moving from Linux to imac. I've recently returned to Python (was never very expert) to develop a small gui application. At present I plan to use PyGTK with Pango and Cairo. You should be aware that unless something has

[issue1268] array unittest problems with UCS4 build

2007-10-14 Thread Travis Oliphant
Travis Oliphant added the comment: This issue may be closed. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1268 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1268] array unittest problems with UCS4 build

2007-10-14 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1268 __ ___ Python-bugs-list mailing list

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Christian wrote: Alexandre's mangle loop doesn't do the same job as mine. Chars like _ and - aren't removed from the encoding name and the if clauses don't catch for example UTF-8 or ISO-8859-1 only UTF8 or ISO8859-1. That isn't true. My mangler does

[issue1631171] implement warnings module in C

2007-10-14 Thread Brett Cannon
Brett Cannon added the comment: So the descriptor idea didn't work. Another idea is to have the C code that relies on attributes on warnings that are allowed to change have an initial check for warnings, and if that fails to fall back on C code. That way the module can still be completely

[issue1276] LookupError: unknown encoding: X-MAC-JAPANESE

2007-10-14 Thread Georg Brandl
Changes by Georg Brandl: -- versions: +Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1276 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1114345] Add SSL certificate validation

2007-10-14 Thread vila
vila added the comment: I'm planning to do a package for 2.3... Any progress on that package ? I'd like to do the same for python 2.4 and 2.5 as I have a need for it for both versions. I don't know what you call a package though, but I'm willing to learn :) -- nosy: +vila

[issue961805] Text.edit_modified() fails

2007-10-14 Thread Matthias Kievernagel
Matthias Kievernagel added the comment: Moved my patch from Issue1643641 to this Issue. (duplication was created when moving from SF bugs/patches) Patch to be applied with 'patch -p0' I have also attached a demo where you can test all Text.edit_* functions. Regards, Matthias Kievernagel

[issue961805] Text.edit_modified() fails

2007-10-14 Thread Matthias Kievernagel
Changes by Matthias Kievernagel: Tracker [EMAIL PROTECTED] http://bugs.python.org/issue961805 ___ Python-bugs-list mailing list Unsubscribe:

[issue1643641] Fix Bug 1362475 Text.edit_modified() doesn't work

2007-10-14 Thread Matthias Kievernagel
Matthias Kievernagel added the comment: Moved my patch to Issue961805. (duplication was created when moving from SF bugs/patches) This issue should be closed down. Regards, Matthias Kievernagel _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1643641

[issue1135] xview/yview of Tix.Grid is broken

2007-10-14 Thread Matthias Kievernagel
Matthias Kievernagel added the comment: Hint: There is also Issue1522587, which contains a large patch (by klappnase) for Tix.Grid addressing xview/yview and several other issues. I do not know if it fixes this issue exactly. Can you take a look at it, ocean-city? Regards, Matthias Kievernagel

[issue1522587] Tix.Grid patch

2007-10-14 Thread Matthias Kievernagel
Changes by Matthias Kievernagel: -- nosy: +mkiever _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1522587 _ ___ Python-bugs-list mailing list Unsubscribe:

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: Alexandre Vassalotti wrote: That isn't true. My mangler does exactly the same thing as your original one. However, I forgot to add Py_CHARMASK to the calls of tolower() and isalnum() which would cause problems on platforms with signed char. I wasn't

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Guido van Rossum
Guido van Rossum added the comment: Only a few modules are involved in the bootstrap. The filename is mostly used to display in the traceback. There is already a fallback in the traceback-printing code that tries to look through sys.path for a file matching the module if it can't open the

[issue1268] array unittest problems with UCS4 build

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: Can this be closed now that Travis reverted his patch? Yes, it can be closed. By the way svn.python.org and the anon svn server are down the third time this week. Something is wrong with the server. Christian __ Tracker

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I have a question for Alexandre related to frozen.c -- why is there a mode line with an encoding involved in freezing hello.py? For some reason which I don't know about, freeze.py tries to read all the modules accessible from sys.path: # collect

[issue1277] mailbox.Maildir: factory not used

2007-10-14 Thread Bernd Wurst
New submission from Bernd Wurst: The factory-argument to the constructorof mailbox.Maildir is not used as it should be. First, it's default is set to rfc822.Message instead of MaildirMessage and then, inside the module's code, MaildirMessage is hard-coded as a message constructor. If I need

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I thought of another way to implement PyUnicode_DecodeFSDefault. If Py_FileSystemDefaultEncoding is set, decode with the codecs module, otherwise use UTF-8 + replace. This works because when Py_FileSystemDefaultEncoding is initialized at the end of

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: Alexandre Vassalotti wrote: Alexandre Vassalotti added the comment: I thought of another way to implement PyUnicode_DecodeFSDefault. If Py_FileSystemDefaultEncoding is set, decode with the codecs module, otherwise use UTF-8 + replace. This works because

[issue1268] array unittest problems with UCS4 build

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: Oh stop, the array module doesn't build for me (Ubuntu Linux, i386, UCS-4 build, rev58458): Modules/arraymodule.c: In function 'array_buffer_getbuf': Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats' Please replace formats with

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: Changes since updated_file_fsenc-5.patch: * Fix for hard coded FS default encoding on Apple and Windows * Added two notes to unicode_default_encoding and Py_FileSystemDefaultEncoding __ Tracker [EMAIL PROTECTED]

[issue1114345] Add SSL certificate validation

2007-10-14 Thread Bill Janssen
Bill Janssen added the comment: See the SSL package on PyPI. Should work on 2.3, 2.4, and 2.5. Bill On 10/14/07, vila [EMAIL PROTECTED] wrote: vila added the comment: I'm planning to do a package for 2.3... Any progress on that package ? I'd like to do the same for python 2.4 and 2.5

[issue1268] array unittest problems with UCS4 build

2007-10-14 Thread Guido van Rossum
Guido van Rossum added the comment: Oh stop, the array module doesn't build for me (Ubuntu Linux, i386, UCS-4 build, rev58458): Modules/arraymodule.c: In function 'array_buffer_getbuf': Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats' Please replace formats

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Guido van Rossum
Guido van Rossum added the comment: This looks promising. I'm working on the freeze issue. Once I get that working I'll check this in. Thanks Alexandre and Christian for all your hard work!!! __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1272

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Guido van Rossum
Guido van Rossum added the comment: The problem is the imp module, which modulefinder uses, does not detect the encoding of the files from the mode-line. This causes TextIOWrapper to crash when it tries to read modules using an encoding other than ASCII or UTF-8. Here an example: import

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1428-1430: invalid data I can't reproduce this. Can you open a separate issue? It breaks for me with the same error message on Ubuntu Linux, i386, UCS-4 build and locale de_DE.UTF-8.

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: This looks promising. I'm working on the freeze issue. Once I get that working I'll check this in. Thanks Alexandre and Christian for all your hard work!!! You're welcome. Does the patch qualify me for Misc/ACKS? :) I'm going to work on the basestring

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Christian Heimes
Christian Heimes added the comment: I found two minor bugs in the fix. In Modules/posixmodule.c the tmpnam() and tempnam() methods return a PyString instance. Please change line 5373 and 5431 to use PyUnicode_DecodeFSDefault(). Index: Modules/posixmodule.c

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-14 Thread Guido van Rossum
Guido van Rossum added the comment: This looks promising. I'm working on the freeze issue. Once I get that working I'll check this in. Thanks Alexandre and Christian for all your hard work!!! You're welcome. Does the patch qualify me for Misc/ACKS? :) Yes, and also Alexandre. :-) I'm

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-14 Thread Christian Heimes
New submission from Christian Heimes: imp.find_module() returns an io.TextIOWrapper instance first value. The encoding of the TextIOWrapper isn't set from a -*- coding: Latin-1 -*- line. import imp imp.find_module(heapq) (io.TextIOWrapper object at 0xb7c8f50c,