From noreply@sourceforge.net Sat Sep 1 01:46:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 17:46:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-457399 ] bisect module broken in 2.1.1 ? Message-ID: Bugs item #457399, was opened at 2001-08-31 13:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457399&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Daniel Mahler (dmahler) Assigned to: Tim Peters (tim_one) Summary: bisect module broken in 2.1.1 ? Initial Comment: given the function:  def findClause(C, SS): for j in range(1,len(SS)): assert SS[j-1] <= SS[j], (j, SS[j-1], SS[j]) C2 = map(abs, C) i = bisect.bisect_left(C2, SS) assert C2 >= SS[i], (i, C, C2, [C3 for C3 in SS if C3 <= C2], SS[0:4]) return i I get: i = findClause(C, SS) File "/home/mahler/code/scripts/oshl.py", line 248, in findClause assert C2 >= SS[i], (i, C, C2, [C3 for C3 in SS if C3 <= C2], SS[0:4]) AssertionError: (3, [5, -2, 1], [5, 2, 1], [], [[5, 3, 1], [5, 3, 2], [6, 4, 2], [7, 3, 2]]) As far as I can tell this must be a bug: the first loop ensures that the list is sorted. It is the bottom asertion that is throwing the exception The values returned with the exception show that we were looking for an element smaller than any in the list. I would therefore expect 0 to be returned, but I get 3. Daniel Mahler mahler@cyc.com ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-08-31 17:46 Message: Logged In: YES user_id=31435 BTW, if bisect were a method rather than a function, it would clearly be a method of list objects. Therefore it makes most sense that bisect takes the list argument first. You could argue about how logical that "therefore" is , but nevertheless it's a principle that can be used to help remember the argument order for many library functions. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-31 14:05 Message: Logged In: YES user_id=31435 It looks like you passed arguments to bisect in the wrong order. Try i = bisect.bisect_left(SS, C2) instead. As is, you're looking for the position within list [5, 2, 1] to insert element SS (the opposite of what I expect you intended), and since any list *happens to* compare greater than any integer in 2.1, the list SS belongs at position C2[3]. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457399&group_id=5470 From noreply@sourceforge.net Sat Sep 1 03:36:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 19:36:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-457100 ] httplib GET example should use host head Message-ID: Bugs item #457100, was opened at 2001-08-30 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457100&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: httplib GET example should use host head Initial Comment: the POST example in httplib docs does use a host: header, but the GET one does not. people should probably always use a host header these days as name-based virtual hosts are very common, copying the example in the documentation as is is likely to give surprises. -- erno@iki.fi ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-31 19:36 Message: Logged In: YES user_id=3066 Agreed; fixed in Doc/lib/libhttplib.tex revision 1.24. In fact, I wouldn't mind httplib adding it automatically if it hasn't already been set when endheaders() is called if the HTTP instance was created with a non-IP value for the hostname. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457100&group_id=5470 From noreply@sourceforge.net Sat Sep 1 05:51:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 21:51:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-457486 ] downloaded Lib. Ref. shows 'in' for Dict Message-ID: Bugs item #457486, was opened at 2001-08-31 21:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457486&group_id=5470 Category: Documentation Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: downloaded Lib. Ref. shows 'in' for Dict Initial Comment: The Library Reference document that is part of the Windows download for version 2.1.1 indicates that the 'in' and 'not in' relational operators exist for the dictionary type. The online version of this document does not show 'in' or 'not in' for dictionaries. The version 2.1.1 interpreter (for Windows) does not actually support 'in' or 'not in' for dictionaries, so the downloaded Library Reference must be in error. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457486&group_id=5470 From noreply@sourceforge.net Sat Sep 1 06:10:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 22:10:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-457487 ] Itemconfigure for Listbox Message-ID: Bugs item #457487, was opened at 2001-08-31 22:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 Category: Tkinter Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Itemconfigure for Listbox Initial Comment: The Tkinter included with version 2.1.1 does not include support for the Tk function itemconfigure for Listbox's. This functionality is very useful for changing the appearance of individual entries in a Listbox (e.g. their colors). This functionality is easily implemented by adding the following method to the Listbox class definition in Tkinter def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item . The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. """ if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, 'itemconfigure', index) + self._options(cnf, kw)) itemconfig = itemconfigure ----------- The code works, and I use it routinely in an augmented version of Tkinter. It would be nice to eventually have it in the standard version. thanks for everything. Mike. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 From noreply@sourceforge.net Sat Sep 1 06:12:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 22:12:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-457487 ] Itemconfigure for Listbox Message-ID: Bugs item #457487, was opened at 2001-08-31 22:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 Category: Tkinter Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Itemconfigure for Listbox Initial Comment: The Tkinter included with version 2.1.1 does not include support for the Tk function itemconfigure for Listbox's. This functionality is very useful for changing the appearance of individual entries in a Listbox (e.g. their colors). This functionality is easily implemented by adding the following method to the Listbox class definition in Tkinter def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item . The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. """ if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, 'itemconfigure', index) + self._options(cnf, kw)) itemconfig = itemconfigure ----------- The code works, and I use it routinely in an augmented version of Tkinter. It would be nice to eventually have it in the standard version. thanks for everything. Mike. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 22:12 Message: Logged In: NO all the indenting was lost! sorry. If you want me to email the properly indented version, let me know. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 From noreply@sourceforge.net Sat Sep 1 07:07:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 23:07:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-457493 ] include SQL interface module Message-ID: Bugs item #457493, was opened at 2001-08-31 23:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: include SQL interface module Initial Comment: The standard Python library IMO should include an SQL interface module like Perl DBI. With all the use of Python in web sites I'm surprised this isn't there already. There are a few modules like that on Parnassus--I haven't tried them so won't suggest any specific one. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 From noreply@sourceforge.net Sat Sep 1 07:34:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 23:34:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Closed Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 07:38:19 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 31 Aug 2001 23:38:19 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Closed Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 14:53:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 06:53:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-457541 ] zlib homepage has changed Message-ID: Bugs item #457541, was opened at 2001-09-01 06:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457541&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: zlib homepage has changed Initial Comment: The "canonical" URL for zlib is: http://www.gzip.org/zlib/ ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457541&group_id=5470 From noreply@sourceforge.net Sat Sep 1 16:36:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 08:36:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-457541 ] zlib homepage has changed Message-ID: Bugs item #457541, was opened at 2001-09-01 06:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457541&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: zlib homepage has changed Initial Comment: The "canonical" URL for zlib is: http://www.gzip.org/zlib/ ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-01 08:36 Message: Logged In: YES user_id=3066 This has already been fixed in the documentation for the "zlib" module. If you found another reference to an older zlib site, please explain the bug report where you found the reference. This report is closed as "already fixed". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457541&group_id=5470 From noreply@sourceforge.net Sat Sep 1 19:03:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 11:03:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-457100 ] httplib GET example should use host head Message-ID: Bugs item #457100, was opened at 2001-08-30 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457100&group_id=5470 Category: Documentation Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: httplib GET example should use host head Initial Comment: the POST example in httplib docs does use a host: header, but the GET one does not. people should probably always use a host header these days as name-based virtual hosts are very common, copying the example in the documentation as is is likely to give surprises. -- erno@iki.fi ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:03 Message: Logged In: YES user_id=6380 The HTTPConnection class already does this, but only for HTTP/1.1. I think that's good enough. Read the comments in putrequest(). ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-31 19:36 Message: Logged In: YES user_id=3066 Agreed; fixed in Doc/lib/libhttplib.tex revision 1.24. In fact, I wouldn't mind httplib adding it automatically if it hasn't already been set when endheaders() is called if the HTTP instance was created with a non-IP value for the hostname. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457100&group_id=5470 From noreply@sourceforge.net Sat Sep 1 19:15:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 11:15:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-457493 ] include SQL interface module Message-ID: Bugs item #457493, was opened at 2001-08-31 23:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Barry Warsaw (bwarsaw) Summary: include SQL interface module Initial Comment: The standard Python library IMO should include an SQL interface module like Perl DBI. With all the use of Python in web sites I'm surprised this isn't there already. There are a few modules like that on Parnassus--I haven't tried them so won't suggest any specific one. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:15 Message: Logged In: YES user_id=6380 Assigning to Barry, who should be working on getting something like this into the core. Barry, how's it coming? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 From noreply@sourceforge.net Sat Sep 1 19:19:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 11:19:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request >Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 19:31:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 11:31:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-457487 ] Itemconfigure for Listbox Message-ID: Bugs item #457487, was opened at 2001-08-31 22:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 Category: Tkinter Group: Feature Request >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: Itemconfigure for Listbox Initial Comment: The Tkinter included with version 2.1.1 does not include support for the Tk function itemconfigure for Listbox's. This functionality is very useful for changing the appearance of individual entries in a Listbox (e.g. their colors). This functionality is easily implemented by adding the following method to the Listbox class definition in Tkinter def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item . The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. """ if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, 'itemconfigure', index) + self._options(cnf, kw)) itemconfig = itemconfigure ----------- The code works, and I use it routinely in an augmented version of Tkinter. It would be nice to eventually have it in the standard version. thanks for everything. Mike. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:31 Message: Logged In: YES user_id=6380 Thanks! I recovered the indented version from the email announcement that SF sends. I've applied this (with some minor change), Tkinter version 1.156. What's your name? For the Misc/ACKS file. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 22:12 Message: Logged In: NO all the indenting was lost! sorry. If you want me to email the properly indented version, let me know. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 From noreply@sourceforge.net Sat Sep 1 21:04:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 13:04:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 21:12:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 13:12:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 22:05:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 14:05:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 22:20:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 14:20:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 22:27:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 14:27:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 14:27 Message: Logged In: YES user_id=6380 OK. Sounds like a good plan: break 3-arg pow() for all float args in 2.2a3, and see in anybody screams. I predict dead silence. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sat Sep 1 22:35:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 14:35:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:35 Message: Logged In: YES user_id=72053 Sounds good to me re breaking float pow. It's doing something really weird in 2.2.1 anyway. pow(3.,500.,7.) returns 2, pow(3,5000,7) returns 2, pow(3.,5000.,7.) returns 4.0, but 3.**5000. returns inf. pow(3.,50000.,7.) returns NaN. The roundoff errors though don't bother me especially more than any other float roundoff errors, e.g. 3.**99+1-3.**99 = 0. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 14:27 Message: Logged In: YES user_id=6380 OK. Sounds like a good plan: break 3-arg pow() for all float args in 2.2a3, and see in anybody screams. I predict dead silence. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Sun Sep 2 00:12:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 16:12:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Sun Sep 2 02:33:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 18:33:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-457654 ] bkgd() does not set attribute Message-ID: Bugs item #457654, was opened at 2001-09-01 18:33 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: bkgd() does not set attribute Initial Comment: In _cursesmodule.c PyCursesWindow_Bkgd calls wbkgd() with a hard-coded attribute (A_NORMAL) rather than the attr retrieved from the arguments. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 From noreply@sourceforge.net Sun Sep 2 03:15:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 19:15:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Sun Sep 2 03:18:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 19:18:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-457654 ] bkgd() does not set attribute Message-ID: Bugs item #457654, was opened at 2001-09-01 18:33 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: A.M. Kuchling (akuchling) Summary: bkgd() does not set attribute Initial Comment: In _cursesmodule.c PyCursesWindow_Bkgd calls wbkgd() with a hard-coded attribute (A_NORMAL) rather than the attr retrieved from the arguments. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 From noreply@sourceforge.net Sun Sep 2 05:59:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 01 Sep 2001 21:59:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-457487 ] Itemconfigure for Listbox Message-ID: Bugs item #457487, was opened at 2001-08-31 22:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 Category: Tkinter Group: Feature Request Status: Closed Resolution: Accepted Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: Itemconfigure for Listbox Initial Comment: The Tkinter included with version 2.1.1 does not include support for the Tk function itemconfigure for Listbox's. This functionality is very useful for changing the appearance of individual entries in a Listbox (e.g. their colors). This functionality is easily implemented by adding the following method to the Listbox class definition in Tkinter def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item . The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. """ if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', index)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, 'itemconfigure', index) + self._options(cnf, kw)) itemconfig = itemconfigure ----------- The code works, and I use it routinely in an augmented version of Tkinter. It would be nice to eventually have it in the standard version. thanks for everything. Mike. ---------------------------------------------------------------------- Comment By: Michael Zarnstorff (mzarnstorff) Date: 2001-09-01 21:59 Message: Logged In: YES user_id=313296 Mike Zarnstorff. I eventually got registered... thanks again. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:31 Message: Logged In: YES user_id=6380 Thanks! I recovered the indented version from the email announcement that SF sends. I've applied this (with some minor change), Tkinter version 1.156. What's your name? For the Misc/ACKS file. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 22:12 Message: Logged In: NO all the indenting was lost! sorry. If you want me to email the properly indented version, let me know. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457487&group_id=5470 From noreply@sourceforge.net Sun Sep 2 14:28:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 02 Sep 2001 06:28:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-457493 ] include SQL interface module Message-ID: Bugs item #457493, was opened at 2001-08-31 23:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Barry Warsaw (bwarsaw) Summary: include SQL interface module Initial Comment: The standard Python library IMO should include an SQL interface module like Perl DBI. With all the use of Python in web sites I'm surprised this isn't there already. There are a few modules like that on Parnassus--I haven't tried them so won't suggest any specific one. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-02 06:28 Message: Logged In: YES user_id=44345 While this is a noble goal, I think we're not going to be there for a little while. The various SQL-related modules, while most (all?) adhere to the DB 2.0 API, have never been integrated. I would suggest you first see if you can get those several people to put their collective heads together to see what they come up with. Skip ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:15 Message: Logged In: YES user_id=6380 Assigning to Barry, who should be working on getting something like this into the core. Barry, how's it coming? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457493&group_id=5470 From noreply@sourceforge.net Mon Sep 3 10:23:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 02:23:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Nobody/Anonymous (nobody) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Mon Sep 3 16:12:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 08:12:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-451607 ] SSL support in socket module needs tests Message-ID: Bugs item #451607, was opened at 2001-08-16 09:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451607&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Martin v. Löwis (loewis) Summary: SSL support in socket module needs tests Initial Comment: SSL support in the socket module should have a regression test, either in test_socket.py or in a separate test_ssl.py file. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 08:12 Message: Logged In: YES user_id=21627 I'd suggest an approach similar to the one in test_socket, i.e. test only if can_fork. As for the certificates: I think they should be generated in advance and included into the test suite. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-08-28 06:53 Message: Logged In: YES user_id=12800 There is currently an extremely minimal test in test_socket_ssl.py, but it is fairly bogus because it requires an outside network connection. The only test there just tries to hit https://sf.net. Ideally, there would be a set of regression tests that only required local resources. I.e. it would set up a local SSL server, then do connects to it to test the various SSL features in socket module. Take a look at test_socket_ssl.py in the 2.2 cvs and see if you can improve matters. From what I understand, the tricky part is generating all the necessary certificates, etc. Also, if you intend to work on this, please log in to SF to continue this dialog so we know who we're talking to! :) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-27 22:58 Message: Logged In: NO I may be able to help with this. I'm fairly familiar with SSL in general, though not about the socket module. What's needed? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451607&group_id=5470 From noreply@sourceforge.net Mon Sep 3 22:36:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 14:36:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-456738 ] Support for smoother debugging of C exts Message-ID: Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 From noreply@sourceforge.net Mon Sep 3 22:40:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 14:40:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-456393 ] missing test_locale output Message-ID: Bugs item #456393, was opened at 2001-08-28 21:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456393&group_id=5470 Category: None Group: Python 2.2 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Nobody/Anonymous (nobody) Summary: missing test_locale output Initial Comment: When running the regression tests for the CVS version of Python (under IRIX 6.4 - an old SGI machine) I get: test_locale The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_locale ******************************************************* *************** Then ... We expected (repr): '' But instead we got: "'%f' % 1024 == '1024.000000' ! = '1,024.000000'" test test_locale failed -- Writing: "'%f' % 1024 == '1024.000000' != '1,024.000000 '", expected: '' This appears to be because there is no file named Lib/test/output/test_locale origin> ./python Lib/test/test_locale.py '%f' % 1024 =? '1,024.000000' ... no '%f' % 1024 == '1024.000000' != '1,024.000000' '%f' % 102 =? '102.000000' ... yes '%f' % -42 =? '-42.000000' ... yes '%+f' % -42 =? '-42.000000' ... yes '%20.f' % -42 =? ' -42' ... yes '%+10.f' % -4200 =? ' -4,200' ... no '%+10.f' % -4200 == ' -4200' != ' -4,200' '%-10.f' % 4200 =? '4,200 ' ... no '%-10.f' % 4200 == '4200 ' != '4,200 ' origin> ls Lib/test/output/*loc* ls: No match. origin> ls Lib/test/output/*lo* Lib/test/output/test_global Lib/test/output/test_longexp origin> Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:40 Message: Logged In: YES user_id=21627 Absence of output/test_locale is not the problem here; test_locale.py is not supposed to give any output. It only does if one of the test fails. In your case, the test fails because there is a bug in the en_US locale on Irix (which does not properly report the group separators for the en_US locale). So the Python test suite actually finds a bug in the OS C library, since it uses the OS C library for the function being tested. I close this as "won't fix"; please complain to SGI. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456393&group_id=5470 From noreply@sourceforge.net Tue Sep 4 02:22:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 18:22:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-458223 ] shutil doesn't copy special files Message-ID: Bugs item #458223, was opened at 2001-09-03 18:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458223&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Matthew Cowles (mdcowles) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: shutil doesn't copy special files Initial Comment: It may be worth adding to the caveat at the beginning of the documentation for shutil that under Unix it will copy only regular files, not special files or sockets. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458223&group_id=5470 From noreply@sourceforge.net Tue Sep 4 03:57:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 03 Sep 2001 19:57:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-449989 ] Make dir() more b/w compatible Message-ID: Bugs item #449989, was opened at 2001-08-10 20:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449989&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Tim Peters (tim_one) Summary: Make dir() more b/w compatible Initial Comment: The new dir() semantics are incompatible with Python 2.1 and before, because e.g. dir([]) returns [] instead of ['append', ...]. One possibility would be to change dir() to use the new introspection rules to give all instance variables and all methods that are discoverable using the new introspection API. Though for classes I would not want to show the metaclass attributes, and maybe I'd make an exception for modules -- it may be confusing to see dir(sys) return __class__, __getattr__ and so on. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-03 19:57 Message: Logged In: YES user_id=31435 I'm closing this because I checked in a new dir() that acts as suggested. We need more feedback on it, though. In particular, distutils's dist.py, and test_pyclbr.py, both fell over because they were expecting dir(C) to be a shorthand for C.__dict__.keys() when C was a classic-class instance (distutils) or class (test_pyclbr). All of the *complaints* about dir() in 2.2a2 stemmed from new- class/type cases; if classic classes will go away, maybe it's a bearable tradeoff to make dir() act differently for old-style classes and new-style ones (oh, yuck ...). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-16 08:13 Message: Logged In: YES user_id=6380 Tim, would you mind implementing this? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-10 20:52 Message: Logged In: YES user_id=6380 (The idea here is that giving *more* information than before is less likely to break old code or cause misgivings than giving *less* information.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449989&group_id=5470 From noreply@sourceforge.net Tue Sep 4 10:07:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 02:07:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:07 Message: Logged In: YES user_id=45365 It turns out that the curses on MacOSX is a really old (1994?) Berkeley curses, not good enough for _cursesmodule.c. I've "manually" disabled it in setup.py (are there no other platforms that have this problem?). I have no idea why the problem only showed up recently, there appear to have been no changes around this area in setup.py... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Tue Sep 4 10:44:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 02:44:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-456738 ] Support for smoother debugging of C exts Message-ID: Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:44 Message: Logged In: YES user_id=45365 I think I would like this feature. Actually, I think it would even be nice to export it to Python (through sys?). There's something similar in MacPython (the MacOS DebugStr() routine) and I use it a lot. The advantage of a separate routine (as opposed to setting a breakpoint) is that you can put complex conditions in your code for when you want to call the routine. This could conceivably be done with conditional breakpoints too, but it tends to be much more of a hassle. Especially going from Python code to the C debugger at a specific point is pretty difficult. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 From noreply@sourceforge.net Tue Sep 4 12:26:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 04:26:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-458343 ] distutils should zap .o as well as .so Message-ID: Bugs item #458343, was opened at 2001-09-04 04:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: A.M. Kuchling (akuchling) Summary: distutils should zap .o as well as .so Initial Comment: Just rebuilt from CVS and got this toward the end: skipping 'pyexpat' extension (up-to-date) WARNING: removing "pyexpat" since importing it failed It would have been nice to know why the import failed. Also, instead of just deleting the .so file it should delete the .o file as well. In this case, deleting the .o file to force recompilation instead of just relinking solved the problem. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 From noreply@sourceforge.net Tue Sep 4 12:37:27 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 04:37:27 -0700 Subject: [Python-bugs-list] [ python-Bugs-458350 ] module sys - variables missing Message-ID: Bugs item #458350, was opened at 2001-09-04 04:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Hernan Martinez Foffani (hfoffani) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: module sys - variables missing Initial Comment: Documetation entries for the following variables of module sys are missing: - maxunicode - warnoptions file: Doc/lib/module-sys.html -Hernan ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 From noreply@sourceforge.net Tue Sep 4 13:01:35 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 05:01:35 -0700 Subject: [Python-bugs-list] [ python-Bugs-454493 ] building _socket failed Message-ID: Bugs item #454493, was opened at 2001-08-23 00:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Roeland Rengelink (rengelink) Assigned to: Martin v. Löwis (loewis) Summary: building _socket failed Initial Comment: I experienced a build failure of Python2.2a2 on Suse 6.4 Linux 2.2.14 The following error was reported: gcc -DINET6 -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I~/Python-2.2a2/./Include -I/usr/local/include -IInclude/ -c ~/Python-2.2a2/Modules/socketmodule.c -o build/temp.linux-i686-2.2/socketmodule.o ~/Python-2.2a2/Modules/socketmodule.c: In function `makesockaddr': ~/Python-2.2a2/Modules/socketmodule.c:715: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `getsockaddrarg': ~/Python-2.2a2/Modules/socketmodule.c:828: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `PySocket_getnameinfo': ~/Python-2.2a2/Modules/socketmodule.c:2469: structure has no member named `sin6_scope_id' WARNING: building of extension "_socket" failed: command 'gcc' failed with exit status 1 I didn't see this in 2.2a1. Presumably, there is a problem with IPv6 support on my machine. Shouldn't configure have cought this? Probably also a bug is that test_socket ran succesfully. Since _socket wasn't build, the old version in $PREFIX/lib/Python2.2/, which I got from 2.2a1, was used in the test. Let me know if you need additional info. Roeland ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-04 05:01 Message: Logged In: YES user_id=21627 Please try the attached config.patch (contributed by itojun). It is against 2.2a2; if you want to apply it to any other Python snapshot, you need to rerun autoconf. It should detect that your C library does not support the RFC2553 API (despite being glibc), and thus disable IPv6 support. Please report whether it works, and if not, report how you've invoked configure, and what version of the C library you have. If you then need a work-around, try configuring with --disable-ipv6 (this should not be necessary with the patch). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 07:39 Message: Logged In: YES user_id=6380 Oh well. Maybe you built 2.2a2 in the same directory as 2.2a1? ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-08-23 07:33 Message: Logged In: YES user_id=302601 Re test_socket failing to fail. You can mark that as irreproducable. I completely deleted my old Python installs and then did an Install of 2.2a1 followed by a build of 2.2a2. make test now failed on test__all__ with test test___all__ skipped -- No module named _socket and on test_socket with test test_socket crashed -- exceptions.AttributeError: 'module' object has no attribute 'error' I am of course convinced that this didn't happen last time ;) Sorry for bothering you with that one. (the build failure stands, I'm not going crazy yet) Roeland ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 06:21 Message: Logged In: YES user_id=6380 Thanks for the report. I've assigned this to the IPv6 author. He's on vacation, but will look at this when he's back in a week or so. Re test_socket succeeding: did you run it from the build directory, or did you install the broken installation? If the latter, you have yourself to blame. If the former, I'd like to see the value of sys.path and all env variables starting with PYTHON (try "set | grep PYTHON" in your shell) to help you debug this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 From noreply@sourceforge.net Tue Sep 4 14:26:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 06:26:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-458350 ] module sys - variables missing Message-ID: Bugs item #458350, was opened at 2001-09-04 04:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Hernan Martinez Foffani (hfoffani) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: module sys - variables missing Initial Comment: Documetation entries for the following variables of module sys are missing: - maxunicode - warnoptions file: Doc/lib/module-sys.html -Hernan ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 06:26 Message: Logged In: YES user_id=6380 Note: sys.warnoptions is an implementation detail of the warnings module and should not be documented beyond that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 From noreply@sourceforge.net Tue Sep 4 16:03:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 08:03:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None >Status: Open >Resolution: Remind >Priority: 4 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 08:03 Message: Logged In: YES user_id=6380 Reopening, hoping for a better way to fix this. This should really check for a magic string that occurs in all recent curses.h files, or one that only occurs in ancient (unusable) cursees.h files, to distinguish between a good and a bad curses. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:07 Message: Logged In: YES user_id=45365 It turns out that the curses on MacOSX is a really old (1994?) Berkeley curses, not good enough for _cursesmodule.c. I've "manually" disabled it in setup.py (are there no other platforms that have this problem?). I have no idea why the problem only showed up recently, there appear to have been no changes around this area in setup.py... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Tue Sep 4 16:49:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 08:49:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-457360 ] Nested scopes crash when tracing (v2.1) Message-ID: Bugs item #457360, was opened at 2001-08-31 12:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None >Priority: 7 Submitted By: Stephan R.A. Deibel (sdeibel) >Assigned to: Jeremy Hylton (jhylton) Summary: Nested scopes crash when tracing (v2.1) Initial Comment: Python will crash on post-trace processing if the tracer is installed during a class def nested inside of a nest function def, under certain conditions at least. I tried to make a small test case but that didn't bring out the bug. As a result, this is best illustrated by installing Zope 2.4.0 (I did this on Linux) and altering z2.py by inserting the following near the top of the file: def tracer(*args): print "trace" return tracer import sys sys.settrace(tracer) Then run with the './start' command. Python will segfault during the following around line 570 of z2.py: exec "import "+MODULE in {} The real problem is the LocalsToFast() call after the tracer has been called while the interpreter is doing the 'line' tracing for line 118 of libs/python/RestrictedPython/Gaurds.py in Zope, where "class Wrapper" is defined nested inside of a nested function. The innermost part of the C backtrace is: #0 PyCell_Set (op=0x0, obj=0x8322e04) at Objects/cellobject.c:32 (gdb) up #1 0x808068a in dict_to_map (map=0x81d5cc4, nmap=1, dict=0x81d269c, values=0x8195db0, deref=1, clear=1) at Objects/frameobject.c:287 (gdb) up #2 0x8080903 in PyFrame_LocalsToFast (f=0x8195c68, clear=1) at Objects/frameobject.c:371 (gdb) up #3 0x80587e3 in call_trace (p_trace=0x8195c88, p_newtrace=0x8195c88, f=0x8195c68, msg=0x809c3a2 "line", arg=0x80b5c0c) at Python/ceval.c:2595 I tested this under RedHat 6.1 with Python 2.1 (both the copy that comes with Zope and one I built from source with debug symbols). For more info, contact via email: info at wingide.com. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 From noreply@sourceforge.net Tue Sep 4 16:51:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 08:51:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-456738 ] Support for smoother debugging of C exts Message-ID: Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Barry Warsaw (bwarsaw) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:44 Message: Logged In: YES user_id=45365 I think I would like this feature. Actually, I think it would even be nice to export it to Python (through sys?). There's something similar in MacPython (the MacOS DebugStr() routine) and I use it a lot. The advantage of a separate routine (as opposed to setting a breakpoint) is that you can put complex conditions in your code for when you want to call the routine. This could conceivably be done with conditional breakpoints too, but it tends to be much more of a hassle. Especially going from Python code to the C debugger at a specific point is pretty difficult. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 From noreply@sourceforge.net Tue Sep 4 17:00:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 09:00:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-456175 ] add dictionary "tokens" to token.py Message-ID: Bugs item #456175, was opened at 2001-08-28 08:48 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456175&group_id=5470 Category: Python Library Group: Feature Request >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Grant Griffin (dspguru) Assigned to: Nobody/Anonymous (nobody) >Summary: add dictionary "tokens" to token.py Initial Comment: I would like for token.py to provide a dictionary, called "tokens" that maps the name of each token to its value, e.g.: token.tokens[token.INDENT] is 'INDENT' This would be useful for debugging programs that use tokenize. A user currently could create a dictionary like this using introspection on token.py (assuming tokens are in all caps) but that's a lot of trouble. Instead, I believe it would be better to solve the problem once- and-for-all by building the extra logic required to create the dictionary into token.main. thanks much, =g2 ---------------------------------------------------------------------- >Comment By: Jeremy Hylton (jhylton) Date: 2001-09-04 09:00 Message: Logged In: YES user_id=31392 Have you looked at token.py? It's always had tok_name. ---------------------------------------------------------------------- Comment By: Grant Griffin (dspguru) Date: 2001-08-28 10:56 Message: Logged In: YES user_id=70844 Thanks much, Skip. That's not a bad idea, but here's what I ended up doing: def token_names(): import tokenize res = {} names = dir(tokenize) for name in names: attr = getattr(tokenize, name) if type(attr) is type(1): res[attr] = name return res Instead of modifying token.py as I had suggested previously, perhaps something like the above could be added to tokenize. - There isn't much code here, but it took me awhile to figure out how to include my own batteries . - I learned the hard way that it's better to get these symbols from tokenize than token because tokenize adds the "COMMENT" token.) thanks, =g2 ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-08-28 09:42 Message: Logged In: YES user_id=44345 I encountered the same problem when programming with Gtk. Gtk defines an enormous number of enumeration types. While I could define one or more dictionaries to map enumerations back to names as you suggested, I chose a somewhat different approach. I defined a ConstantMap class whose instances create a new dictionary containing all non-instance/non- class objects created since the last ConstantMap class was instantiated. class ConstantMap: markdict = {} def __init__(self): """add new global symbols to instance's name map""" self.names = {} import types for key,val in globals().items(): if (not self.markdict.has_key(key) and key[:2] != "__" and type(val) not in [types.InstanceType, types.ClassType]): self.names[val] = key self.markdict.update(globals()) def __call__(self, key): """return a name mapping""" return self.names[key] def mark(self): """checkpoint current globals""" I then instantiate ConstantMap after each block of enumeration constants are defined like so: # GdkPropertyState's PROPERTY_NEW_VALUE = 0 PROPERTY_DELETE = 1 GdkPropertyState = ConstantMap() # GdkWindowState's WINDOW_STATE_WITHDRAWN = 1 << 0 WINDOW_STATE_ICONIFIED = 1 << 1 WINDOW_STATE_MAXIMIZED = 1 << 2 WINDOW_STATE_STICKY = 1 << 3 GdkWindowState = ConstantMap() # GdkSettingAction's SETTING_ACTION_NEW = 0 SETTING_ACTION_CHANGED = 1 SETTING_ACTION_DELETED = 2 GdkSettingAction = ConstantMap() # GdkScrollDirection's SCROLL_UP = 0 SCROLL_DOWN = 1 SCROLL_LEFT = 2 SCROLL_RIGHT = 3 GdkScrollDirection = ConstantMap() This is more than you're asking for in this case, but may be a somewhat more general foundation for a problem that bugs many people debugging code that uses imported constants. Skip ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456175&group_id=5470 From noreply@sourceforge.net Tue Sep 4 17:14:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 09:14:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-456391 ] unexpected test_largefile output Message-ID: Bugs item #456391, was opened at 2001-08-28 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456391&group_id=5470 Category: None Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Barry Warsaw (bwarsaw) Summary: unexpected test_largefile output Initial Comment: Running test_largefile produces this output: test_largefile @test exists: 0 The second line is unexpected. It occurs because at the end of test_largefile.py is print >>sys.stderr, name, "exists:", os.path.exists (name) This makes it harder to understand the regression test output and should likely be removed. Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456391&group_id=5470 From noreply@sourceforge.net Tue Sep 4 17:16:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 09:16:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-458430 ] convert library to use inplace ops Message-ID: Bugs item #458430, was opened at 2001-09-04 09:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Grant Griffin (dspguru) Assigned to: Nobody/Anonymous (nobody) Summary: convert library to use inplace ops Initial Comment: The Python library contains a large number of lines which could be converted to use inplace operators ("+=" and friends). That would make the library modules marginally smaller and faster. The attached program identifies these cases and prints out a list. It has found 647 instances in 91 files of the 2.2a2 library. There are so many of these that I recommend that a tool be made to automatically convert these things. Failing that, perhaps at least the most frequently- used modules could be manually converted. (For example, sre and fnmatch [used by glob] contain a few of these.) If there's any interest in a conversion tool, I could take a shot at doing it. (It could be done fairly easily by adapting the attached program.) thanks, =g2 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 From noreply@sourceforge.net Tue Sep 4 17:27:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 09:27:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-458430 ] convert library to use inplace ops Message-ID: Bugs item #458430, was opened at 2001-09-04 09:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Grant Griffin (dspguru) Assigned to: Nobody/Anonymous (nobody) Summary: convert library to use inplace ops Initial Comment: The Python library contains a large number of lines which could be converted to use inplace operators ("+=" and friends). That would make the library modules marginally smaller and faster. The attached program identifies these cases and prints out a list. It has found 647 instances in 91 files of the 2.2a2 library. There are so many of these that I recommend that a tool be made to automatically convert these things. Failing that, perhaps at least the most frequently- used modules could be manually converted. (For example, sre and fnmatch [used by glob] contain a few of these.) If there's any interest in a conversion tool, I could take a shot at doing it. (It could be done fairly easily by adapting the attached program.) thanks, =g2 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 09:27 Message: Logged In: YES user_id=6380 Nice tool, but I am against doing a large-scale massive conversion on the library. We did something like this once before (for string methods) and we still found conversion bugs months later. The performance benefits will be unmeasurable, so I don't see much benefit from doing this at all. The risk is clear: a botched conversion introduced a new bug. I think it's up to the "owners" of individual modules to decide whether they want to manuallly convert their code to using the new paradigm. And why would we do this? It's not like the old way is going to be outlawed in the future! Also note that the SRE codebase in particular still has to run on Python 1.5.2, which doesn't have augmented assignments. For all these reasons, I'm rejecting this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 From noreply@sourceforge.net Tue Sep 4 17:27:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 09:27:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-458430 ] convert library to use inplace ops Message-ID: Bugs item #458430, was opened at 2001-09-04 09:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 >Category: Python Library >Group: Not a Bug >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Grant Griffin (dspguru) >Assigned to: Guido van Rossum (gvanrossum) Summary: convert library to use inplace ops Initial Comment: The Python library contains a large number of lines which could be converted to use inplace operators ("+=" and friends). That would make the library modules marginally smaller and faster. The attached program identifies these cases and prints out a list. It has found 647 instances in 91 files of the 2.2a2 library. There are so many of these that I recommend that a tool be made to automatically convert these things. Failing that, perhaps at least the most frequently- used modules could be manually converted. (For example, sre and fnmatch [used by glob] contain a few of these.) If there's any interest in a conversion tool, I could take a shot at doing it. (It could be done fairly easily by adapting the attached program.) thanks, =g2 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 09:27 Message: Logged In: YES user_id=6380 Nice tool, but I am against doing a large-scale massive conversion on the library. We did something like this once before (for string methods) and we still found conversion bugs months later. The performance benefits will be unmeasurable, so I don't see much benefit from doing this at all. The risk is clear: a botched conversion introduced a new bug. I think it's up to the "owners" of individual modules to decide whether they want to manuallly convert their code to using the new paradigm. And why would we do this? It's not like the old way is going to be outlawed in the future! Also note that the SRE codebase in particular still has to run on Python 1.5.2, which doesn't have augmented assignments. For all these reasons, I'm rejecting this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458430&group_id=5470 From noreply@sourceforge.net Tue Sep 4 18:01:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 10:01:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Nobody/Anonymous (nobody) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Tue Sep 4 18:27:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 10:27:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-458463 ] HTTPSConnect.__init__ too tricky Message-ID: Bugs item #458463, was opened at 2001-09-04 10:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458463&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Nobody/Anonymous (nobody) Summary: HTTPSConnect.__init__ too tricky Initial Comment: The code in HTTPSConnect's ctor is way too tricky. How about this: for k in x509.keys(): if k not in ['key_file', 'cert_file']: raise InvalidKeywordArgument() if you NEED to be clever then use a list comprehensive if [ k for k in x509.keys() if k not in ['key_file','cert_file']]: raise InvalidKeywordArgument() (It's also inefficient copying the keys only to delete them, in case you need a real justification. ;) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458463&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:18:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:18:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-458350 ] module sys - variables missing Message-ID: Bugs item #458350, was opened at 2001-09-04 04:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Hernan Martinez Foffani (hfoffani) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: module sys - variables missing Initial Comment: Documetation entries for the following variables of module sys are missing: - maxunicode - warnoptions file: Doc/lib/module-sys.html -Hernan ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 11:18 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libsys.tex revision 1.52. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 06:26 Message: Logged In: YES user_id=6380 Note: sys.warnoptions is an implementation detail of the warnings module and should not be documented beyond that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458350&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:19:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:19:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Tim Peters (tim_one) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:20:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:20:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Nobody/Anonymous (nobody) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:26:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:26:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-429570 ] GC objects are tracked prematurely Message-ID: Bugs item #429570, was opened at 2001-06-02 04:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=429570&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Ernst Jan Plugge (rmc) Assigned to: Neil Schemenauer (nascheme) Summary: GC objects are tracked prematurely Initial Comment: Under certain circumstances, the Python Garbage Collector tracks objects that haven't yet been added to the GC chain. This causes hard to debug segfaults when GC occurs. I've reduced the problem to this simple case: a simple extension module with one extension type that holds a reference to another object. The single module method creates two objects, lets them point to eachother, and returns one of them. This creates a cycle to be broken by the GC. In the attached source, the second PyObject_GC_Init() call is done after the references have been set up. If called in a 'while 1: a = trouble.createT( "foo" )' loop, it segfaults as soon as a GC cycle is performed while the method is still setting up the objects. If the PyObject_GC_Init() call is moved up to immediately after the obj field is set to Py_None, no segfault occurs. I believe this should not happen because one should be free to mess with tracked objects as long as they haven't been added to the GC chain. If it is in fact working as designed, this should be documented. I'm using Python 2.1 on Linux/Intel. 2.0 has the same problem, but it shows in slightly different places. 2.1 made it easier to create this simple minimal case. It took a few long, frustrating days to track this one down, because it didn't show up until the module was up to about 20000 twisty lines of code, all interconnected... :-( ---------------------------------------------------------------------- >Comment By: Neil Schemenauer (nascheme) Date: 2001-09-04 11:26 Message: Logged In: YES user_id=35752 This problem has been fixed by recent changes to the GC. It's now acceptable to have container objects that are reachable by the collector but are not tracked. Also, collection is now triggered by PyObject_GC_New or PyObject_GC_NewVar, not by PyObject_GC_Track. ---------------------------------------------------------------------- Comment By: Ernst Jan Plugge (rmc) Date: 2001-08-21 04:52 Message: Logged In: YES user_id=151380 The cause of the segfault in my original report is the collision of two issues: first the fact that, at GC time, all reachable containers must be tracked, and second the fact that merely adding an object to the GC chain may trigger a GC sweep. The latter is counter-intuitive to me at least; I expected GC to occur only at object allocation time because the GC module doc mentions that GC is triggered by the number of allocations exceeding a threshold. The combination of these two issues is what caused the problem in the first place, and although I had read the docs reasonably carefully, I missed the connection. Therefore, I still think this should be mentioned in the docs. For example by listing the conditions that may trigger a GC sweep and referring to that list from the text that documents the restriction that containers reachable from tracked objects must also be tracked. Of course if the restriction has been lifted, the issue has become academic anyway. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-08-20 13:41 Message: Logged In: YES user_id=35752 The API document says: Any container which may be referenced from another object reachable by the collector must itself be tracked by the collector [...] Can I close this bug or should the documentation be yet more explict? Note that this restriction is lifted by my "GC API cleanup" patch (i.e. it's okay to have an object with the GC flag set that is reachable from a tracked object but is not itself tracked). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-06-02 23:06 Message: Logged In: YES user_id=31435 Assigned to Neil. The docs should at least be more explicit about that when a container C is added to the GC list via PyObject_GC_Init(), all objects reachable from C then and until PyObject_GC_Fini() is called must either (a) not participate in GC at all, or (b) themselves have been PyObject_GC_Init()'ed before becoming reachable from C. It looks like this particular case would not have blown up if, in _PyGC_Insert, op were added to generation0 *before* checking to see whether collection should run. Think that's more robust? Well, maybe in a case where A references B references A, but if the cycle being created were longer than that this style of programming would still lead to problems. Ernst, independent of all that, when doing x = y; get into the rigid habit of incref'ing y before decref'ing x. Sooner or later they're going to point to the same object without you realizing it, and then decref'ing x first can leave y pointing at trash. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=429570&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:27:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:27:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-458223 ] shutil doesn't copy special files Message-ID: Bugs item #458223, was opened at 2001-09-03 18:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458223&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Matthew Cowles (mdcowles) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: shutil doesn't copy special files Initial Comment: It may be worth adding to the caveat at the beginning of the documentation for shutil that under Unix it will copy only regular files, not special files or sockets. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 11:27 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libshutil.tex revision 1.8. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458223&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:29:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:29:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-457486 ] downloaded Lib. Ref. shows 'in' for Dict Message-ID: Bugs item #457486, was opened at 2001-08-31 21:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457486&group_id=5470 Category: Documentation Group: Python 2.1.1 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: downloaded Lib. Ref. shows 'in' for Dict Initial Comment: The Library Reference document that is part of the Windows download for version 2.1.1 indicates that the 'in' and 'not in' relational operators exist for the dictionary type. The online version of this document does not show 'in' or 'not in' for dictionaries. The version 2.1.1 interpreter (for Windows) does not actually support 'in' or 'not in' for dictionaries, so the downloaded Library Reference must be in error. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 11:29 Message: Logged In: YES user_id=3066 It is a documentation error; that feature will be part of Python 2.2. The documentation for the 2.1.x series of releases has been corrected in the revision-control repository and in the online version. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457486&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:36:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:36:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-458463 ] HTTPSConnect.__init__ too tricky Message-ID: Bugs item #458463, was opened at 2001-09-04 10:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458463&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None >Priority: 3 Submitted By: Rich Salz (rsalz) >Assigned to: Greg Stein (gstein) Summary: HTTPSConnect.__init__ too tricky Initial Comment: The code in HTTPSConnect's ctor is way too tricky. How about this: for k in x509.keys(): if k not in ['key_file', 'cert_file']: raise InvalidKeywordArgument() if you NEED to be clever then use a list comprehensive if [ k for k in x509.keys() if k not in ['key_file','cert_file']]: raise InvalidKeywordArgument() (It's also inefficient copying the keys only to delete them, in case you need a real justification. ;) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:36 Message: Logged In: YES user_id=6380 Looks like your alternative still makes a copy. What I personally don't get about that piece of code is why the function doesn't just declare arguments with default values of None and be done with it. Assigned to Greg Stein for judgement. Personally, I'd say there are bigger fish to fry. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458463&group_id=5470 From noreply@sourceforge.net Tue Sep 4 19:43:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 11:43:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-453523 ] list.sort crasher Message-ID: Bugs item #453523, was opened at 2001-08-20 15:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453523&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None >Priority: 4 Submitted By: Gregory H. Ball (greg_ball) >Assigned to: Nobody/Anonymous (nobody) Summary: list.sort crasher Initial Comment: The marshal module is on the default list of ok builtin modules, but it can be used to crash the interpreter. The new module, on the other hand, is not allowed. To me the only obvious reason for this is that it provides a way to make new code objects, which can then crash the interpreter. But marshal also gives this ability. Example is attached as a file. Having imported marshal, I use marshal.loads() on a carefully constructed string to get a corrupt code object. To work out this string: (in unrestricted mode) def f(): pass import marshal badstring=marshal.dumps(f.func_code).replace('(\x01\x00\x00\x00N', '(\x00\x00\x00\x00') which when loaded gives a code object with co_consts = (). Possible fixes: Easy: remove marshal from the list of approved modules for restricted execution. Hard: Fix marshal (and perhaps new) by adding checks on code objects before returning them. Probably no way to do this exhaustively. Lateral thinking: prohibit exec in restricted mode? (Currently eval() also allows execution of code objects, so that would have to be changed too.) I think this is a nice complement to the existing features of restricted execution mode, which prevent the attachment of a new code object to a function. On the other hand, there's not much point fixing this unless other methods of crashing the interpreter are also hunted down... >>> class C: ... def __cmp__(self, other): ... pop(0) ... return 1 ... >>> gl = [C() for i in '1'*20] >>> pop=gl.pop >>> gl.sort() Segmentation fault (core dumped) (should I submit this as a separate bug report?) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:43 Message: Logged In: YES user_id=6380 I'm not so interested in the list.sort crasher, so I'm lowering the priority and unassigning it. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2001-08-30 07:51 Message: Logged In: YES user_id=6656 OK, done, in: marshal.c version 1.67 Changed summary. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 05:48 Message: Logged In: YES user_id=6380 Michael's patch is fine -- the code-loading is not done in restricted mode (but the execution is, because the restricted globals are passed). Michael, can you check it in? The list issue could be fixed by adding a PyList_Check() call to each list method implementation (or at least to the mutating ones). But is it sufficient? I believe there are plenty of other ways to cause a crash -- stack overflow is one, and I think marshal itself can also crash on corrupt input. Greg's bug report points out that rexec is far from sufficient to deter a real hacker. Imagine that this was used in a popular email program... :-( If we can't deprecate rexec, perhaps we should add very big warnings to the documentation that it can't be trusted against truly hostile users. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-29 23:45 Message: Logged In: YES user_id=31435 Reassigning to Guido. The patch stops marshal from loading a code object when in restricted mode, but I have no feel for whether that's going to be a serious limitation for restricted mode (which I've never used for real). For example, wouldn't this also stop regular old imports from .pyc files? I'd hate for restricted users to be barred from importing tabnanny . The list-crasher is a different issue, but I went over *my* limit for caring about trying to foil hostile users when we added the immutable list type. That trick doesn't help here (the mutating mutable-list method is captured in a bound method object before the sort is invoked). I suppose we could instead check that the list base address and length haven't changed after every compare -- but with N*log(N) compares, that's a significant expense the immutable list trick was trying to get away from. Not worth it to me, but my native interest in competing with hostile users is admittedly undetectable. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2001-08-25 00:25 Message: Logged In: YES user_id=6656 I think a reasonable approach to the first problem is to not let marshal load code objects when in restricted execution mode. The second crasher you mention is much more worrying, to me. I think it blows the "immutable list trick" out of the water. I'll attach a patch to marshal (from another machine) and assign to Tim to think about the list nagery. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453523&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:16:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:16:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Python Library Group: None >Status: Deleted Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Nobody/Anonymous (nobody) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:20:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:20:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 >Category: Documentation Group: None >Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 12:20 Message: Logged In: YES user_id=6380 Please don't Delete requests. Please don't Close them unless you are a project manager (I consider it a SF bug that the submitter can decide to close a bug report if they happen to have admin perms on another project). I've reopened this and recategorized as Doc and assigned to Fred so he can see if the httplib docs need to be updated. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:34:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:34:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-457654 ] bkgd() does not set attribute Message-ID: Bugs item #457654, was opened at 2001-09-01 18:33 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 Category: Extension Modules Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: A.M. Kuchling (akuchling) Summary: bkgd() does not set attribute Initial Comment: In _cursesmodule.c PyCursesWindow_Bkgd calls wbkgd() with a hard-coded attribute (A_NORMAL) rather than the attr retrieved from the arguments. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:34 Message: Logged In: YES user_id=11375 Fixed in revision 2.55 of _cursesmodule.c; thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457654&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:36:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:36:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-404274 ] Linking error on AIX (Python 1.5.2) Message-ID: Bugs item #404274, was opened at 2001-02-26 04:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rene Liebscher (rliebscher) Assigned to: A.M. Kuchling (akuchling) Summary: Linking error on AIX (Python 1.5.2) Initial Comment: The patch from 1.32 to 1.33 of file sysconfig.py removes some special actions for AIX and BeOS concerning the paths to the linker scripts. On Python 1.5.2 these parts are still needed, because it doesn't have this new style of Makefile ( LDSHARED and BLDSHARED ) The old version (1.5.2) has no BLDSHARED so if is not found you could execute the old code to stay compatible. Or you declare that Distutils is not suited for versions <2.X. Error message (PyOpenGL build): ../././Modules/ld_so_aix cc build/temp.aix-3-000769244C00-1.5/_openglmodule.o -L/usr/local/lib -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/lib -lGL -lX11 -lXext -o build/lib.aix-3-000769244C00-1.5/OpenGL/dynload/aix4/_opengl.so unable to execute ../././Modules/ld_so_aix: No such file or directory error: command '../././Modules/ld_so_aix' failed with exit status 1 ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:36 Message: Logged In: YES user_id=11375 Rene, can you please try this patch, and confirm whether or not it works for you? If so, I'll check it in. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-08-16 13:54 Message: Logged In: YES user_id=11375 It's too early to drop 1.5.2 support. (When that's done, the Distutils version will probably be bumped to 1.1.) I've attached a patch that brings back the old code. With this patch, does it work with 1.5.2 again ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-02-28 20:55 Message: Logged In: YES user_id=3066 Greg, you're the distutils guru... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:38:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:38:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: Remind Priority: 4 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:38 Message: Logged In: YES user_id=11375 >(are there no other platforms that have this problem?) Probably not, as most systems are SYSV-based these days. It wouldn't work on, say, SunOS 4.1, but who uses such an old version? I'm surprised MacOS X has such an old version of curses, since current *BSDs don't have a problem. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 08:03 Message: Logged In: YES user_id=6380 Reopening, hoping for a better way to fix this. This should really check for a magic string that occurs in all recent curses.h files, or one that only occurs in ancient (unusable) cursees.h files, to distinguish between a good and a bad curses. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:07 Message: Logged In: YES user_id=45365 It turns out that the curses on MacOSX is a really old (1994?) Berkeley curses, not good enough for _cursesmodule.c. I've "manually" disabled it in setup.py (are there no other platforms that have this problem?). I have no idea why the problem only showed up recently, there appear to have been no changes around this area in setup.py... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:39:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:39:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: Remind >Priority: 5 Submitted By: Jack Jansen (jackjansen) >Assigned to: A.M. Kuchling (akuchling) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:38 Message: Logged In: YES user_id=11375 >(are there no other platforms that have this problem?) Probably not, as most systems are SYSV-based these days. It wouldn't work on, say, SunOS 4.1, but who uses such an old version? I'm surprised MacOS X has such an old version of curses, since current *BSDs don't have a problem. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 08:03 Message: Logged In: YES user_id=6380 Reopening, hoping for a better way to fix this. This should really check for a magic string that occurs in all recent curses.h files, or one that only occurs in ancient (unusable) cursees.h files, to distinguish between a good and a bad curses. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:07 Message: Logged In: YES user_id=45365 It turns out that the curses on MacOSX is a really old (1994?) Berkeley curses, not good enough for _cursesmodule.c. I've "manually" disabled it in setup.py (are there no other platforms that have this problem?). I have no idea why the problem only showed up recently, there appear to have been no changes around this area in setup.py... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:41:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:41:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-454030 ] distutils cannot link C++ code with GCC Message-ID: Bugs item #454030, was opened at 2001-08-21 16:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454030&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Alan Scott (barry-scott) >Assigned to: A.M. Kuchling (akuchling) Summary: distutils cannot link C++ code with GCC Initial Comment: It is mandatory to link C++ code against -lstdc++ -lm when creating an extension. distutils does not do this in 2.1.1 Here is a setup.py for Python CXX that works around the problem, but it would be better for distutils to understand enough about C++ to do the right thing. THen the code for other compilers could be added. But GCC is important enough to do first. You can get the CXX sources from http://sourceforge.net/projects/cxx/ from distutils.core import setup, Extension if os.name == 'posix': CXX_libraries = ['stdc++','m'] else: CXX_libraries = [] setup(name="pycxx_demo", version="1.0", ext_modules= [Extension( "example", sources = [ "Demo/example.cxx", "Demo/python.cxx", "Demo/range.cxx", "Demo/rangetest.cxx", "Src/cxx_extensions.cxx", "Src/cxxextensions.c", "Src/cxxsupport.cxx", "Src/IndirectPythonInterface.cxx" ], include_dirs = [ ".", "Demo" ], libraries = CXX_libraries ) ] ) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454030&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:46:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:46:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-458343 ] distutils should zap .o as well as .so Message-ID: Bugs item #458343, was opened at 2001-09-04 04:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: A.M. Kuchling (akuchling) Summary: distutils should zap .o as well as .so Initial Comment: Just rebuilt from CVS and got this toward the end: skipping 'pyexpat' extension (up-to-date) WARNING: removing "pyexpat" since importing it failed It would have been nice to know why the import failed. Also, instead of just deleting the .so file it should delete the .o file as well. In this case, deleting the .o file to force recompilation instead of just relinking solved the problem. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:46 Message: Logged In: YES user_id=11375 I'm not clear on the problem here; what did you use to clean up *.so files that didn't clean up *.o files? "make clean" runs rm `find -name *.o`, and "python setup.py clean" blows away an entire directory under build/, so both of those seem to be correct. What were you using? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:51:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:51:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-453208 ] 64-bit zip problems Message-ID: Bugs item #453208, was opened at 2001-08-19 22:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453208&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Nobody/Anonymous (nobody) Summary: 64-bit zip problems Initial Comment: This is from c.l.py. There's not enough info (e.g., which OS, which compiler, which Python), but in case anyone is wondering what to do with their IA64 box ... From: John Wiegley Sent: Thursday, August 16, 2001 6:14 PM To: python-list@python.org Subject: Problem with zipfile between 32-bit and 64-bit Using the test script below, run it once on an Intel 32-bit platform. This produces test.zip, which extracts hello.py. Then take the test script and test.zip to an ia64 platform, and run it again. The file it extracts has 0 bytes. I've run into other problems between ia32 and ia64, such as bad checksums, and was wondering if anyone knew anything about this? Thanks, John Wiegley ----[ file: ziptest.py ]------------------------------- --------------- import os import zipfile import string if not os.path.exists('test.zip'): zip = zipfile.ZipFile('test.zip', 'w') zip.write('ziptest.py', 'hello.py') zip.close() zip = zipfile.ZipFile('test.zip', 'r') if hasattr(zip, 'namelist'): files = zip.namelist() else: files = zip.listdir() for file in files: file = apply(os.path.join, string.split (file, '\')) data = open(file, 'wb') print "unarchiving", file data.write(zip.read(file)) data.close() ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:51 Message: Logged In: YES user_id=11375 The zlib module seems to use struct.pack('l') for packing some values, which should be 64-bits on a 64-bit platform. Maybe that's the bug. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453208&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:56:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:56:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-454086 ] distutils/mingw32 links to dbg libs Message-ID: Bugs item #454086, was opened at 2001-08-21 21:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: A.M. Kuchling (akuchling) Summary: distutils/mingw32 links to dbg libs Initial Comment: When compiling extension modules on Windows with debugging enabled for the native mode of the GNU compilers ("--compiler=mingw32 --debug"), distutils tries to link with the debugging version of the libraries (python21_d.dll, ...). This may be useful for Microsoft Visual C++, but for the GNU compilers, it isn't. GNU tools have a different debugging symbol format than MS tools, so there's no point in doing this. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:56 Message: Logged In: YES user_id=11375 Hmm... I can't see any code in cygwinccompiler.py that adds the _d prefix in the current CVS. Can you please track down the code that adds it, and submit a patch to fix the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:58:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:58:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-445902 ] runtime_library_dirs and gcc don't mix Message-ID: Bugs item #445902, was opened at 2001-07-30 03:15 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=445902&group_id=5470 Category: Distutils Group: Platform-specific Status: Open Resolution: None >Priority: 7 Submitted By: Gary Capell (gcapell) Assigned to: A.M. Kuchling (akuchling) Summary: runtime_library_dirs and gcc don't mix Initial Comment: providing runtime_library_dirs =["/foo"], setup.py build does: gcc -shared -R/foo ... whereas it requires gcc -shared -Wl,-R/foo to get the option through to the linker. My configuration: python2.1.1, gcc 2.9.6, binutils 2.10.91.0.2, redhat 7.1, intel Please let me know if I'm just doing something stupid. Thanks heaps for the distutils stuff, it makes playing with extensions way easier. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-11 00:53 Message: Logged In: YES user_id=21627 It somewhat depends on the platform; on Solaris, gcc will accept -R. On Linux, it doesn't, so this is really distutils fault, not yours. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=445902&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:59:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:59:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-454030 ] distutils cannot link C++ code with GCC Message-ID: Bugs item #454030, was opened at 2001-08-21 16:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454030&group_id=5470 Category: None Group: None Status: Open Resolution: None >Priority: 7 Submitted By: Barry Alan Scott (barry-scott) Assigned to: A.M. Kuchling (akuchling) Summary: distutils cannot link C++ code with GCC Initial Comment: It is mandatory to link C++ code against -lstdc++ -lm when creating an extension. distutils does not do this in 2.1.1 Here is a setup.py for Python CXX that works around the problem, but it would be better for distutils to understand enough about C++ to do the right thing. THen the code for other compilers could be added. But GCC is important enough to do first. You can get the CXX sources from http://sourceforge.net/projects/cxx/ from distutils.core import setup, Extension if os.name == 'posix': CXX_libraries = ['stdc++','m'] else: CXX_libraries = [] setup(name="pycxx_demo", version="1.0", ext_modules= [Extension( "example", sources = [ "Demo/example.cxx", "Demo/python.cxx", "Demo/range.cxx", "Demo/rangetest.cxx", "Src/cxx_extensions.cxx", "Src/cxxextensions.c", "Src/cxxsupport.cxx", "Src/IndirectPythonInterface.cxx" ], include_dirs = [ ".", "Demo" ], libraries = CXX_libraries ) ] ) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454030&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:59:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:59:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-454086 ] distutils/mingw32 links to dbg libs Message-ID: Bugs item #454086, was opened at 2001-08-21 21:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None >Priority: 7 Submitted By: Gerhard Häring (ghaering) Assigned to: A.M. Kuchling (akuchling) Summary: distutils/mingw32 links to dbg libs Initial Comment: When compiling extension modules on Windows with debugging enabled for the native mode of the GNU compilers ("--compiler=mingw32 --debug"), distutils tries to link with the debugging version of the libraries (python21_d.dll, ...). This may be useful for Microsoft Visual C++, but for the GNU compilers, it isn't. GNU tools have a different debugging symbol format than MS tools, so there's no point in doing this. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:56 Message: Logged In: YES user_id=11375 Hmm... I can't see any code in cygwinccompiler.py that adds the _d prefix in the current CVS. Can you please track down the code that adds it, and submit a patch to fix the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 From noreply@sourceforge.net Tue Sep 4 20:59:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 12:59:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-457633 ] _cursesmodules.c does not build on MacOSX Message-ID: Bugs item #457633, was opened at 2001-09-01 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: Remind >Priority: 7 Submitted By: Jack Jansen (jackjansen) Assigned to: A.M. Kuchling (akuchling) Summary: _cursesmodules.c does not build on MacOSX Initial Comment: _cursesmodule.c suddenly stopped build on MacOSX. (this is from the CVS repository). The first error is on "chtype" on line 187, and you don't want the know the amount of errors it causes after that. I guess that some optional feature of curses was added without an appropriate ifdef or something. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:38 Message: Logged In: YES user_id=11375 >(are there no other platforms that have this problem?) Probably not, as most systems are SYSV-based these days. It wouldn't work on, say, SunOS 4.1, but who uses such an old version? I'm surprised MacOS X has such an old version of curses, since current *BSDs don't have a problem. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 08:03 Message: Logged In: YES user_id=6380 Reopening, hoping for a better way to fix this. This should really check for a magic string that occurs in all recent curses.h files, or one that only occurs in ancient (unusable) cursees.h files, to distinguish between a good and a bad curses. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:07 Message: Logged In: YES user_id=45365 It turns out that the curses on MacOSX is a really old (1994?) Berkeley curses, not good enough for _cursesmodule.c. I've "manually" disabled it in setup.py (are there no other platforms that have this problem?). I have no idea why the problem only showed up recently, there appear to have been no changes around this area in setup.py... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 19:15 Message: Logged In: YES user_id=6380 When did it last build for you without problems? The last change was from 19 July, and unless MacOS X defines either sgi or __sgi, I don't see how that could cause lots of errors. The 'chtype' typedef isn't affected by the last two checkins. Maybe something changed in some header included y Python.h or pyport.h? Maybe something you changed yourself? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457633&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:07:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:07:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-436732 ] install.py does not record path file Message-ID: Bugs item #436732, was opened at 2001-06-27 07:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install.py does not record path file Initial Comment: install.py does not record in INSTALLED_FILES when it creates the .pth file which is created when extra_path is used. Included is a patch: --- install.py.orig Wed Jun 27 08:55:39 2001 +++ install.py Wed Jun 27 08:56:30 2001 @@ -489,6 +489,9 @@ # write list of installed files, if requested. if self.record: outputs = self.get_outputs() + if self.path_file and self.install_path_file: + outputs.append(os.path.join(self.install_libbase, + self.path_file + ".pth")) if self.root: # strip any package prefix root_len = len(self.root) for counter in xrange(len(outputs)): ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:07 Message: Logged In: YES user_id=11375 I've modified your patch to change get_outputs() instead, and checked it in as revision 1.59 of commands/install.py. Can you please check that it still works, and that it fixes the problem? ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-07-25 13:35 Message: Logged In: YES user_id=8446 Is anything going to be done about this? It's really quite necessary. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:20:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:20:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-458343 ] distutils should zap .o as well as .so Message-ID: Bugs item #458343, was opened at 2001-09-04 04:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: A.M. Kuchling (akuchling) Summary: distutils should zap .o as well as .so Initial Comment: Just rebuilt from CVS and got this toward the end: skipping 'pyexpat' extension (up-to-date) WARNING: removing "pyexpat" since importing it failed It would have been nice to know why the import failed. Also, instead of just deleting the .so file it should delete the .o file as well. In this case, deleting the .o file to force recompilation instead of just relinking solved the problem. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 13:20 Message: Logged In: YES user_id=44345 > what did you use to clean up *.so files that didn't clean > up *.o files? The usual: cvs up . cd build ../configure make Maybe this won't be a problem for people who routinely download tarballs and build afresh, but when working from CVS it doesn't seem to me like I should always need to "make clean", presuming the make dependencies are done right. The only thing I'm suggesting is that if distutils performs an import to see if the newly built .so file is okay and finds that it isn't, it should delete both the .so file and the .o file from which it was built. The message it emits indicates that it is already zapping the .so file. Skip ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:46 Message: Logged In: YES user_id=11375 I'm not clear on the problem here; what did you use to clean up *.so files that didn't clean up *.o files? "make clean" runs rm `find -name *.o`, and "python setup.py clean" blows away an entire directory under build/, so both of those seem to be correct. What were you using? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:21:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:21:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-436732 ] install.py does not record path file Message-ID: Bugs item #436732, was opened at 2001-06-27 07:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install.py does not record path file Initial Comment: install.py does not record in INSTALLED_FILES when it creates the .pth file which is created when extra_path is used. Included is a patch: --- install.py.orig Wed Jun 27 08:55:39 2001 +++ install.py Wed Jun 27 08:56:30 2001 @@ -489,6 +489,9 @@ # write list of installed files, if requested. if self.record: outputs = self.get_outputs() + if self.path_file and self.install_path_file: + outputs.append(os.path.join(self.install_libbase, + self.path_file + ".pth")) if self.root: # strip any package prefix root_len = len(self.root) for counter in xrange(len(outputs)): ---------------------------------------------------------------------- >Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:21 Message: Logged In: YES user_id=8446 Yes! This appears to work, and is, in fact, cleaner! Whoohoo! Now please fix 444589 (also with patch). Yes! ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:07 Message: Logged In: YES user_id=11375 I've modified your patch to change get_outputs() instead, and checked it in as revision 1.59 of commands/install.py. Can you please check that it still works, and that it fixes the problem? ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-07-25 13:35 Message: Logged In: YES user_id=8446 Is anything going to be done about this? It's really quite necessary. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:39:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:39:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-453208 ] 64-bit zip problems Message-ID: Bugs item #453208, was opened at 2001-08-19 22:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453208&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Nobody/Anonymous (nobody) Summary: 64-bit zip problems Initial Comment: This is from c.l.py. There's not enough info (e.g., which OS, which compiler, which Python), but in case anyone is wondering what to do with their IA64 box ... From: John Wiegley Sent: Thursday, August 16, 2001 6:14 PM To: python-list@python.org Subject: Problem with zipfile between 32-bit and 64-bit Using the test script below, run it once on an Intel 32-bit platform. This produces test.zip, which extracts hello.py. Then take the test script and test.zip to an ia64 platform, and run it again. The file it extracts has 0 bytes. I've run into other problems between ia32 and ia64, such as bad checksums, and was wondering if anyone knew anything about this? Thanks, John Wiegley ----[ file: ziptest.py ]------------------------------- --------------- import os import zipfile import string if not os.path.exists('test.zip'): zip = zipfile.ZipFile('test.zip', 'w') zip.write('ziptest.py', 'hello.py') zip.close() zip = zipfile.ZipFile('test.zip', 'r') if hasattr(zip, 'namelist'): files = zip.namelist() else: files = zip.listdir() for file in files: file = apply(os.path.join, string.split (file, '\')) data = open(file, 'wb') print "unarchiving", file data.write(zip.read(file)) data.close() ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-04 13:39 Message: Logged In: YES user_id=31435 Should they really be 64 bits on a 64-bit box? Looks like zipfile.py is using a standard (as opposed to native) pack format, in order to ensure platform-independent layout. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:51 Message: Logged In: YES user_id=11375 The zlib module seems to use struct.pack('l') for packing some values, which should be 64-bits on a 64-bit platform. Maybe that's the bug. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453208&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:42:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:42:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-444589 ] install_data.py does not record dirs Message-ID: Bugs item #444589, was opened at 2001-07-25 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 Category: Distutils Group: Feature Request >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install_data.py does not record dirs Initial Comment: Let's say I want to create a directory but not put anything in it. Logically, I would add: data_files = [ ('directory', [] ) ], to my setup.py file. However, it doesn't work. The following small patch allows special behavior for empty file lists. It is quite useful for normal installs, as well as for bdist and friends. --- install_data.py.orig Wed Jul 25 15:27:19 2001 +++ install_data.py Wed Jul 25 15:26:54 2001 @@ -63,6 +63,8 @@ elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) + if f[1] == []: + self.outfiles.append(dir) for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:42 Message: Logged In: YES user_id=11375 Applied to revision 1.19 of distutils/commands/install_data.py. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:51:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:51:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-444589 ] install_data.py does not record dirs Message-ID: Bugs item #444589, was opened at 2001-07-25 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 Category: Distutils Group: Feature Request Status: Closed Resolution: Fixed Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install_data.py does not record dirs Initial Comment: Let's say I want to create a directory but not put anything in it. Logically, I would add: data_files = [ ('directory', [] ) ], to my setup.py file. However, it doesn't work. The following small patch allows special behavior for empty file lists. It is quite useful for normal installs, as well as for bdist and friends. --- install_data.py.orig Wed Jul 25 15:27:19 2001 +++ install_data.py Wed Jul 25 15:26:54 2001 @@ -63,6 +63,8 @@ elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) + if f[1] == []: + self.outfiles.append(dir) for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) ---------------------------------------------------------------------- >Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:51 Message: Logged In: YES user_id=8446 Thanks! This rocks. Now, if I can only get an answer to 452144. Of course, that's not a bug! ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:42 Message: Logged In: YES user_id=11375 Applied to revision 1.19 of distutils/commands/install_data.py. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:52:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:52:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-444589 ] install_data.py does not record dirs Message-ID: Bugs item #444589, was opened at 2001-07-25 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 Category: Distutils Group: Feature Request Status: Closed Resolution: Fixed Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install_data.py does not record dirs Initial Comment: Let's say I want to create a directory but not put anything in it. Logically, I would add: data_files = [ ('directory', [] ) ], to my setup.py file. However, it doesn't work. The following small patch allows special behavior for empty file lists. It is quite useful for normal installs, as well as for bdist and friends. --- install_data.py.orig Wed Jul 25 15:27:19 2001 +++ install_data.py Wed Jul 25 15:26:54 2001 @@ -63,6 +63,8 @@ elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) + if f[1] == []: + self.outfiles.append(dir) for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) ---------------------------------------------------------------------- >Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:52 Message: Logged In: YES user_id=8446 Uh oh. Looks like a date problem somewhere. Look at the 'close_date' field below: 1969-12-31 18:00 ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:51 Message: Logged In: YES user_id=8446 Thanks! This rocks. Now, if I can only get an answer to 452144. Of course, that's not a bug! ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:42 Message: Logged In: YES user_id=11375 Applied to revision 1.19 of distutils/commands/install_data.py. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:52:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:52:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-444589 ] install_data.py does not record dirs Message-ID: Bugs item #444589, was opened at 2001-07-25 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 Category: Distutils Group: Feature Request Status: Closed Resolution: Fixed Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install_data.py does not record dirs Initial Comment: Let's say I want to create a directory but not put anything in it. Logically, I would add: data_files = [ ('directory', [] ) ], to my setup.py file. However, it doesn't work. The following small patch allows special behavior for empty file lists. It is quite useful for normal installs, as well as for bdist and friends. --- install_data.py.orig Wed Jul 25 15:27:19 2001 +++ install_data.py Wed Jul 25 15:26:54 2001 @@ -63,6 +63,8 @@ elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) + if f[1] == []: + self.outfiles.append(dir) for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) ---------------------------------------------------------------------- >Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:52 Message: Logged In: YES user_id=8446 nevermind, it clearly means 'the dawn of time'. ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:52 Message: Logged In: YES user_id=8446 Uh oh. Looks like a date problem somewhere. Look at the 'close_date' field below: 1969-12-31 18:00 ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:51 Message: Logged In: YES user_id=8446 Thanks! This rocks. Now, if I can only get an answer to 452144. Of course, that's not a bug! ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:42 Message: Logged In: YES user_id=11375 Applied to revision 1.19 of distutils/commands/install_data.py. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=444589&group_id=5470 From noreply@sourceforge.net Tue Sep 4 21:57:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 13:57:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-458343 ] distutils should zap .o as well as .so Message-ID: Bugs item #458343, was opened at 2001-09-04 04:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: A.M. Kuchling (akuchling) Summary: distutils should zap .o as well as .so Initial Comment: Just rebuilt from CVS and got this toward the end: skipping 'pyexpat' extension (up-to-date) WARNING: removing "pyexpat" since importing it failed It would have been nice to know why the import failed. Also, instead of just deleting the .so file it should delete the .o file as well. In this case, deleting the .o file to force recompilation instead of just relinking solved the problem. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 13:57 Message: Logged In: YES user_id=6380 > when working from > CVS it doesn't seem to me like I should always need > to "make clean", > presuming the make dependencies are done right. Unfortunately, setup doen't honor dependencies, and when a header file has changed that affects the extensions, you have to manually remove the build subdirectory (I do "rm -rf build" :-) to get this to work. I wish that this could be fixed too. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 13:20 Message: Logged In: YES user_id=44345 > what did you use to clean up *.so files that didn't clean > up *.o files? The usual: cvs up . cd build ../configure make Maybe this won't be a problem for people who routinely download tarballs and build afresh, but when working from CVS it doesn't seem to me like I should always need to "make clean", presuming the make dependencies are done right. The only thing I'm suggesting is that if distutils performs an import to see if the newly built .so file is okay and finds that it isn't, it should delete both the .so file and the .o file from which it was built. The message it emits indicates that it is already zapping the .so file. Skip ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:46 Message: Logged In: YES user_id=11375 I'm not clear on the problem here; what did you use to clean up *.so files that didn't clean up *.o files? "make clean" runs rm `find -name *.o`, and "python setup.py clean" blows away an entire directory under build/, so both of those seem to be correct. What were you using? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 From noreply@sourceforge.net Tue Sep 4 22:03:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 14:03:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) >Assigned to: Guido van Rossum (gvanrossum) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 14:03 Message: Logged In: YES user_id=3066 It's not at all clear what sort of documentation update is needed. What did you have in mind? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 12:20 Message: Logged In: YES user_id=6380 Please don't Delete requests. Please don't Close them unless you are a project manager (I consider it a SF bug that the submitter can decide to close a bug report if they happen to have admin perms on another project). I've reopened this and recategorized as Doc and assigned to Fred so he can see if the httplib docs need to be updated. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Tue Sep 4 22:10:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 14:10:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-451556 ] bad tags in HTML documentation Message-ID: Bugs item #451556, was opened at 2001-08-16 06:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451556&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Fredrik Lundh (effbot) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: bad tags in HTML documentation Initial Comment: just grabbed the HTML versions of the 2.1.1 documentation, and found a couple of rather interesting HTML tags in there: can/should this be fixed? (to find the culprits, run tidy on the files, and look for Error lines. or use grep...) ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 14:10 Message: Logged In: YES user_id=3066 OK, I think the cross_ref_mark problem is a LaTeX2HTML issue; I won't spend any more time looking into it. Marking this "Fixed" since most of this actually got fixed. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-17 10:22 Message: Logged In: YES user_id=3066 Fixed the (and protected against the same problem for ) in Doc/perl/SynopsisTable.pm revision 1.8. The cross_ref_mark will be harder. ;-( ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-16 14:59 Message: Logged In: YES user_id=3066 Fixed the first three (, , and ) by adding them to the table they were missing from in Doc/perl/python.perl revision 1.108. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451556&group_id=5470 From noreply@sourceforge.net Wed Sep 5 01:47:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 17:47:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Tim Peters (tim_one) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Wed Sep 5 02:32:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 18:32:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Tim Peters (tim_one) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Wed Sep 5 03:02:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 19:02:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Guido van Rossum (gvanrossum) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Rich Salz (rsalz) Date: 2001-09-04 19:02 Message: Logged In: YES user_id=36737 I created this bug because urllib didn't let you set the content-type header. Guido pointed out that I should be using httplib. I didn't use httplib because I didn't know until I read the source, that httplib had an https object that used SSL. So I guess "document the https object" is what this has mutated into. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 14:03 Message: Logged In: YES user_id=3066 It's not at all clear what sort of documentation update is needed. What did you have in mind? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 12:20 Message: Logged In: YES user_id=6380 Please don't Delete requests. Please don't Close them unless you are a project manager (I consider it a SF bug that the submitter can decide to close a bug report if they happen to have admin perms on another project). I've reopened this and recategorized as Doc and assigned to Fred so he can see if the httplib docs need to be updated. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Wed Sep 5 03:16:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 19:16:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Tim Peters (tim_one) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Wed Sep 5 04:41:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 20:41:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-458343 ] distutils should zap .o as well as .so Message-ID: Bugs item #458343, was opened at 2001-09-04 04:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: A.M. Kuchling (akuchling) Summary: distutils should zap .o as well as .so Initial Comment: Just rebuilt from CVS and got this toward the end: skipping 'pyexpat' extension (up-to-date) WARNING: removing "pyexpat" since importing it failed It would have been nice to know why the import failed. Also, instead of just deleting the .so file it should delete the .o file as well. In this case, deleting the .o file to force recompilation instead of just relinking solved the problem. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 20:41 Message: Logged In: YES user_id=44345 > Unfortunately, setup doen't honor dependencies, ... While Distutils is a very clever piece of software, I have always had this sneaking suspicion that it was trying to do too much, subsuming some or all of the roles of make, autoconf, libtool, etc. In this particular case, the more I think about it, the more I think it has to delete the .o file. When import of the .so fails, setup.py has no idea why it failed, just that something's amiss. It might have been overly aggressive compiler switches, missing shared libraries, or other things, so to be on the safe side it should delete the .so file and any .o files that were compiled to create the module that failed to load. The GNU build tools have progressed quite a way in the past couple years, including improvements in portability (I believe some or all of them will run on Windows now, at least in certain configurations, like cygwin). While their output can be hell to debug, they do a much more complete job of dependency analysis than setup.py. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 13:57 Message: Logged In: YES user_id=6380 > when working from > CVS it doesn't seem to me like I should always need > to "make clean", > presuming the make dependencies are done right. Unfortunately, setup doen't honor dependencies, and when a header file has changed that affects the extensions, you have to manually remove the build subdirectory (I do "rm -rf build" :-) to get this to work. I wish that this could be fixed too. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 13:20 Message: Logged In: YES user_id=44345 > what did you use to clean up *.so files that didn't clean > up *.o files? The usual: cvs up . cd build ../configure make Maybe this won't be a problem for people who routinely download tarballs and build afresh, but when working from CVS it doesn't seem to me like I should always need to "make clean", presuming the make dependencies are done right. The only thing I'm suggesting is that if distutils performs an import to see if the newly built .so file is okay and finds that it isn't, it should delete both the .so file and the .o file from which it was built. The message it emits indicates that it is already zapping the .so file. Skip ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:46 Message: Logged In: YES user_id=11375 I'm not clear on the problem here; what did you use to clean up *.so files that didn't clean up *.o files? "make clean" runs rm `find -name *.o`, and "python setup.py clean" blows away an entire directory under build/, so both of those seem to be correct. What were you using? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458343&group_id=5470 From noreply@sourceforge.net Wed Sep 5 04:45:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 20:45:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] overriding content-type in urllib Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Guido van Rossum (gvanrossum) Summary: overriding content-type in urllib Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 20:45 Message: Logged In: YES user_id=44345 I'm not sure why you'd want to program SOAP (or XMLRPC, for that matter) directly. You would (normally) only use those protocols through special-purpose modules like SOAP.py or xmlrpclib.py, both of which talk to httplib I believe. I don't see that allowing the Content-Type: header to be overridden at the urllib level is all that necessary. If you're going to want to mess with Content-Type: you're probably going to want to mess with other headers as well. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 19:02 Message: Logged In: YES user_id=36737 I created this bug because urllib didn't let you set the content-type header. Guido pointed out that I should be using httplib. I didn't use httplib because I didn't know until I read the source, that httplib had an https object that used SSL. So I guess "document the https object" is what this has mutated into. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 14:03 Message: Logged In: YES user_id=3066 It's not at all clear what sort of documentation update is needed. What did you have in mind? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 12:20 Message: Logged In: YES user_id=6380 Please don't Delete requests. Please don't Close them unless you are a project manager (I consider it a SF bug that the submitter can decide to close a bug report if they happen to have admin perms on another project). I've reopened this and recategorized as Doc and assigned to Fred so he can see if the httplib docs need to be updated. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Wed Sep 5 05:10:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 21:10:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-458608 ] python functions called from c Message-ID: Bugs item #458608, was opened at 2001-09-04 21:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458608&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: John Asmuth (jtasmuth) Assigned to: Nobody/Anonymous (nobody) Summary: python functions called from c Initial Comment: I'm having trouble referencing objects in any scope outside the called function. Its python going to native code which invokes a function that references a variable in the global scope, and then the core dumps. Any tips? John ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458608&group_id=5470 From noreply@sourceforge.net Wed Sep 5 05:14:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 21:14:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-458608 ] python functions called from c Message-ID: Bugs item #458608, was opened at 2001-09-04 21:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458608&group_id=5470 Category: None >Group: Not a Bug >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: John Asmuth (jtasmuth) >Assigned to: Guido van Rossum (gvanrossum) Summary: python functions called from c Initial Comment: I'm having trouble referencing objects in any scope outside the called function. Its python going to native code which invokes a function that references a variable in the global scope, and then the core dumps. Any tips? John ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 21:14 Message: Logged In: YES user_id=6380 Read the docs, or post the source code of what you're trying to do to comp.lang.python if you need help getting started. Alas, the bug manager is not the right place to get programming help. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458608&group_id=5470 From noreply@sourceforge.net Wed Sep 5 05:16:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 21:16:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-454887 ] static/classmethods and tp_slots Message-ID: Bugs item #454887, was opened at 2001-08-24 01:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454887&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed Resolution: None Priority: 4 Submitted By: Roeland Rengelink (rengelink) Assigned to: Guido van Rossum (gvanrossum) Summary: static/classmethods and tp_slots Initial Comment: Consider: >>> class D(object): ... def __iter__():return iter([1,2,3]) ... __iter__ = staticmethod(__iter__) ... >>> D.__iter__() >>> iter(D) Traceback (most recent call last): File "", line 1, in ? TypeError: iter() of non-sequence I can't say this is a bug, because i don't think the behaviour of assignment of staticmethod and classmethod objects to tp_* slots is defined. However, the behaviour was unexpected to me. Also, if the assignment is illegal it should probably raise an error at class definition time. PS I have one or two similar examples of surprising errors that would probably just need additional docs to explain them. Should I report these as bugs, or should I await further releases/doc updates first? Cheers, Roeland ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 21:16 Message: Logged In: YES user_id=6380 No further response, assume no further action needed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-24 02:42 Message: Logged In: YES user_id=6380 This is indeed as intended. To get the behavior you want (iterate over a class object) you would have to define a metaclass (derived from type) that defines __iter__. I'll try to ensure this is documented. I disagree that the assignment is illegal: in general if you put something invalid in a special method name it's very hard to detect that until the time you actually try to call it. Why don't you email me the other examples? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454887&group_id=5470 From noreply@sourceforge.net Wed Sep 5 06:15:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 22:15:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-454493 ] building _socket failed Message-ID: Bugs item #454493, was opened at 2001-08-23 00:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Roeland Rengelink (rengelink) Assigned to: Martin v. Löwis (loewis) Summary: building _socket failed Initial Comment: I experienced a build failure of Python2.2a2 on Suse 6.4 Linux 2.2.14 The following error was reported: gcc -DINET6 -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I~/Python-2.2a2/./Include -I/usr/local/include -IInclude/ -c ~/Python-2.2a2/Modules/socketmodule.c -o build/temp.linux-i686-2.2/socketmodule.o ~/Python-2.2a2/Modules/socketmodule.c: In function `makesockaddr': ~/Python-2.2a2/Modules/socketmodule.c:715: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `getsockaddrarg': ~/Python-2.2a2/Modules/socketmodule.c:828: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `PySocket_getnameinfo': ~/Python-2.2a2/Modules/socketmodule.c:2469: structure has no member named `sin6_scope_id' WARNING: building of extension "_socket" failed: command 'gcc' failed with exit status 1 I didn't see this in 2.2a1. Presumably, there is a problem with IPv6 support on my machine. Shouldn't configure have cought this? Probably also a bug is that test_socket ran succesfully. Since _socket wasn't build, the old version in $PREFIX/lib/Python2.2/, which I got from 2.2a1, was used in the test. Let me know if you need additional info. Roeland ---------------------------------------------------------------------- >Comment By: Roeland Rengelink (rengelink) Date: 2001-09-04 22:15 Message: Logged In: YES user_id=302601 The patch solved the problem. Thanks ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-04 05:01 Message: Logged In: YES user_id=21627 Please try the attached config.patch (contributed by itojun). It is against 2.2a2; if you want to apply it to any other Python snapshot, you need to rerun autoconf. It should detect that your C library does not support the RFC2553 API (despite being glibc), and thus disable IPv6 support. Please report whether it works, and if not, report how you've invoked configure, and what version of the C library you have. If you then need a work-around, try configuring with --disable-ipv6 (this should not be necessary with the patch). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 07:39 Message: Logged In: YES user_id=6380 Oh well. Maybe you built 2.2a2 in the same directory as 2.2a1? ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-08-23 07:33 Message: Logged In: YES user_id=302601 Re test_socket failing to fail. You can mark that as irreproducable. I completely deleted my old Python installs and then did an Install of 2.2a1 followed by a build of 2.2a2. make test now failed on test__all__ with test test___all__ skipped -- No module named _socket and on test_socket with test test_socket crashed -- exceptions.AttributeError: 'module' object has no attribute 'error' I am of course convinced that this didn't happen last time ;) Sorry for bothering you with that one. (the build failure stands, I'm not going crazy yet) Roeland ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 06:21 Message: Logged In: YES user_id=6380 Thanks for the report. I've assigned this to the IPv6 author. He's on vacation, but will look at this when he's back in a week or so. Re test_socket succeeding: did you run it from the build directory, or did you install the broken installation? If the latter, you have yourself to blame. If the former, I'd like to see the value of sys.path and all env variables starting with PYTHON (try "set | grep PYTHON" in your shell) to help you debug this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 From noreply@sourceforge.net Wed Sep 5 07:27:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 04 Sep 2001 23:27:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-404274 ] Linking error on AIX (Python 1.5.2) Message-ID: Bugs item #404274, was opened at 2001-02-26 04:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rene Liebscher (rliebscher) Assigned to: A.M. Kuchling (akuchling) Summary: Linking error on AIX (Python 1.5.2) Initial Comment: The patch from 1.32 to 1.33 of file sysconfig.py removes some special actions for AIX and BeOS concerning the paths to the linker scripts. On Python 1.5.2 these parts are still needed, because it doesn't have this new style of Makefile ( LDSHARED and BLDSHARED ) The old version (1.5.2) has no BLDSHARED so if is not found you could execute the old code to stay compatible. Or you declare that Distutils is not suited for versions <2.X. Error message (PyOpenGL build): ../././Modules/ld_so_aix cc build/temp.aix-3-000769244C00-1.5/_openglmodule.o -L/usr/local/lib -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/lib -lGL -lX11 -lXext -o build/lib.aix-3-000769244C00-1.5/OpenGL/dynload/aix4/_opengl.so unable to execute ../././Modules/ld_so_aix: No such file or directory error: command '../././Modules/ld_so_aix' failed with exit status 1 ---------------------------------------------------------------------- >Comment By: Rene Liebscher (rliebscher) Date: 2001-09-04 23:27 Message: Logged In: YES user_id=28463 It works for me. No problems building the lastest versions of Numerical Python or PyOpenGL with this patch. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:36 Message: Logged In: YES user_id=11375 Rene, can you please try this patch, and confirm whether or not it works for you? If so, I'll check it in. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-08-16 13:54 Message: Logged In: YES user_id=11375 It's too early to drop 1.5.2 support. (When that's done, the Distutils version will probably be bumped to 1.1.) I've attached a patch that brings back the old code. With this patch, does it work with 1.5.2 again ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-02-28 20:55 Message: Logged In: YES user_id=3066 Greg, you're the distutils guru... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 From noreply@sourceforge.net Wed Sep 5 09:23:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 01:23:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-454493 ] building _socket failed Message-ID: Bugs item #454493, was opened at 2001-08-23 00:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Roeland Rengelink (rengelink) Assigned to: Martin v. Löwis (loewis) Summary: building _socket failed Initial Comment: I experienced a build failure of Python2.2a2 on Suse 6.4 Linux 2.2.14 The following error was reported: gcc -DINET6 -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I~/Python-2.2a2/./Include -I/usr/local/include -IInclude/ -c ~/Python-2.2a2/Modules/socketmodule.c -o build/temp.linux-i686-2.2/socketmodule.o ~/Python-2.2a2/Modules/socketmodule.c: In function `makesockaddr': ~/Python-2.2a2/Modules/socketmodule.c:715: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `getsockaddrarg': ~/Python-2.2a2/Modules/socketmodule.c:828: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `PySocket_getnameinfo': ~/Python-2.2a2/Modules/socketmodule.c:2469: structure has no member named `sin6_scope_id' WARNING: building of extension "_socket" failed: command 'gcc' failed with exit status 1 I didn't see this in 2.2a1. Presumably, there is a problem with IPv6 support on my machine. Shouldn't configure have cought this? Probably also a bug is that test_socket ran succesfully. Since _socket wasn't build, the old version in $PREFIX/lib/Python2.2/, which I got from 2.2a1, was used in the test. Let me know if you need additional info. Roeland ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 01:23 Message: Logged In: YES user_id=21627 Fixed in configure.in 1.250, configure 1.242. ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-09-04 22:15 Message: Logged In: YES user_id=302601 The patch solved the problem. Thanks ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-04 05:01 Message: Logged In: YES user_id=21627 Please try the attached config.patch (contributed by itojun). It is against 2.2a2; if you want to apply it to any other Python snapshot, you need to rerun autoconf. It should detect that your C library does not support the RFC2553 API (despite being glibc), and thus disable IPv6 support. Please report whether it works, and if not, report how you've invoked configure, and what version of the C library you have. If you then need a work-around, try configuring with --disable-ipv6 (this should not be necessary with the patch). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 07:39 Message: Logged In: YES user_id=6380 Oh well. Maybe you built 2.2a2 in the same directory as 2.2a1? ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-08-23 07:33 Message: Logged In: YES user_id=302601 Re test_socket failing to fail. You can mark that as irreproducable. I completely deleted my old Python installs and then did an Install of 2.2a1 followed by a build of 2.2a2. make test now failed on test__all__ with test test___all__ skipped -- No module named _socket and on test_socket with test test_socket crashed -- exceptions.AttributeError: 'module' object has no attribute 'error' I am of course convinced that this didn't happen last time ;) Sorry for bothering you with that one. (the build failure stands, I'm not going crazy yet) Roeland ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 06:21 Message: Logged In: YES user_id=6380 Thanks for the report. I've assigned this to the IPv6 author. He's on vacation, but will look at this when he's back in a week or so. Re test_socket succeeding: did you run it from the build directory, or did you install the broken installation? If the latter, you have yourself to blame. If the former, I'd like to see the value of sys.path and all env variables starting with PYTHON (try "set | grep PYTHON" in your shell) to help you debug this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 From noreply@sourceforge.net Wed Sep 5 09:23:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 01:23:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-454493 ] building _socket failed Message-ID: Bugs item #454493, was opened at 2001-08-23 00:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 Category: Extension Modules Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Roeland Rengelink (rengelink) Assigned to: Martin v. Löwis (loewis) Summary: building _socket failed Initial Comment: I experienced a build failure of Python2.2a2 on Suse 6.4 Linux 2.2.14 The following error was reported: gcc -DINET6 -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I~/Python-2.2a2/./Include -I/usr/local/include -IInclude/ -c ~/Python-2.2a2/Modules/socketmodule.c -o build/temp.linux-i686-2.2/socketmodule.o ~/Python-2.2a2/Modules/socketmodule.c: In function `makesockaddr': ~/Python-2.2a2/Modules/socketmodule.c:715: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `getsockaddrarg': ~/Python-2.2a2/Modules/socketmodule.c:828: structure has no member named `sin6_scope_id' ~/Python-2.2a2/Modules/socketmodule.c: In function `PySocket_getnameinfo': ~/Python-2.2a2/Modules/socketmodule.c:2469: structure has no member named `sin6_scope_id' WARNING: building of extension "_socket" failed: command 'gcc' failed with exit status 1 I didn't see this in 2.2a1. Presumably, there is a problem with IPv6 support on my machine. Shouldn't configure have cought this? Probably also a bug is that test_socket ran succesfully. Since _socket wasn't build, the old version in $PREFIX/lib/Python2.2/, which I got from 2.2a1, was used in the test. Let me know if you need additional info. Roeland ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 01:23 Message: Logged In: YES user_id=21627 Fixed in configure.in 1.250, configure 1.242. ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-09-04 22:15 Message: Logged In: YES user_id=302601 The patch solved the problem. Thanks ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-04 05:01 Message: Logged In: YES user_id=21627 Please try the attached config.patch (contributed by itojun). It is against 2.2a2; if you want to apply it to any other Python snapshot, you need to rerun autoconf. It should detect that your C library does not support the RFC2553 API (despite being glibc), and thus disable IPv6 support. Please report whether it works, and if not, report how you've invoked configure, and what version of the C library you have. If you then need a work-around, try configuring with --disable-ipv6 (this should not be necessary with the patch). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 07:39 Message: Logged In: YES user_id=6380 Oh well. Maybe you built 2.2a2 in the same directory as 2.2a1? ---------------------------------------------------------------------- Comment By: Roeland Rengelink (rengelink) Date: 2001-08-23 07:33 Message: Logged In: YES user_id=302601 Re test_socket failing to fail. You can mark that as irreproducable. I completely deleted my old Python installs and then did an Install of 2.2a1 followed by a build of 2.2a2. make test now failed on test__all__ with test test___all__ skipped -- No module named _socket and on test_socket with test test_socket crashed -- exceptions.AttributeError: 'module' object has no attribute 'error' I am of course convinced that this didn't happen last time ;) Sorry for bothering you with that one. (the build failure stands, I'm not going crazy yet) Roeland ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-23 06:21 Message: Logged In: YES user_id=6380 Thanks for the report. I've assigned this to the IPv6 author. He's on vacation, but will look at this when he's back in a week or so. Re test_socket succeeding: did you run it from the build directory, or did you install the broken installation? If the latter, you have yourself to blame. If the former, I'd like to see the value of sys.path and all env variables starting with PYTHON (try "set | grep PYTHON" in your shell) to help you debug this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454493&group_id=5470 From noreply@sourceforge.net Wed Sep 5 09:25:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 01:25:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-449991 ] xml.dom.pulldom exception for integers Message-ID: Bugs item #449991, was opened at 2001-08-10 21:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449991&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: xml.dom.pulldom exception for integers Initial Comment: >>> xml.dom.minidom.parseString(str) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.0/xml/dom/minidom.py", line 475, in parseString return _doparse(pulldom.parseString, args, kwargs) File "/usr/lib/python2.0/xml/dom/minidom.py", line 465, in _doparse toktype, rootNode = events.getEvent() File "/usr/lib/python2.0/xml/dom/pulldom.py", line 187, in getEvent self.parser.feed(buf) File "/usr/lib/python2.0/xml/sax/expatreader.py", line 81, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.0/xml/sax/expatreader.py", line 160, in start_element_ns AttributesNSImpl(newattrs, {})) File "/usr/lib/python2.0/xml/dom/pulldom.py", line 36, in startElementNS tagName = self._current_context[uri] + ":" + localname TypeError: bad operand type(s) for + This happened for Python 2.0. For Python the line may be different Suggested fix: On the offending line, use "str()" to force conversion (inquisition ;-)) ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 01:25 Message: Logged In: YES user_id=21627 Closing it, since there was no feedback from the submitter. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-11 00:48 Message: Logged In: YES user_id=21627 Can you give the exact document that caused this problem? I'm tempted to close this as "Works for me", since I've never seen that problem before, and can't imagine what may have caused it. In case you are reading your report once more: It would help enormously if you'd leave some contact address for questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449991&group_id=5470 From noreply@sourceforge.net Wed Sep 5 09:45:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 01:45:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-433234 ] Problems building under HP-UX 11.0 Message-ID: Bugs item #433234, was opened at 2001-06-14 13:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433234&group_id=5470 Category: Build Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Ivan Munoz (imbunche) Assigned to: Martin v. Löwis (loewis) Summary: Problems building under HP-UX 11.0 Initial Comment: My system: HP-UX dev1 B.11.00 A 9000/782 2015744842 two-user license I'm using gcc, gcc version 2.95.2 19991024 (release) Trying to compile Python 2.1 I ran into a number of problems. After the customary configure; make I get the following error while making the modules ld: DP relative code in file build/temp.hp-ux-B.11.00-9000/782-2.1/_weakref.o - shared library must be position independent. Use +z or +Z to recompile. WARNING: building of extension "_weakref" failed: command 'ld' failed with exit status 1 The error message is the same for all extensions. I fixed it by defining in the Makefile CFLAGSFORSHARED=-fpic tried again ... better but: gcc -Wl,-E -Wl,+s -Wl,+b/home/imunoz/local/hp/lib/python2.1/lib-dynload -o python \ Modules/python.o \ libpython2.1.a -lnsl -ldld -lpthread -lm /usr/bin/ld: Data Linkage Table (+z) overflow in file libpython2.1.a(exceptions.o) - use +Z option to recompile collect2: ld returned 1 exit status make: *** [python] Error 1 Then I changed -fpic by -fPIC and voila! (tip found thanx to a google search). still problems when generating the module's shared libraries. Fixed by: Makefile:301 # Build the shared modules sharedmods: $(PYTHON) PY_CFLAGS= $(CFLAGS) $(CFLAGSFORSHARED) -fPIC PYTHONPATH= ./$(PYTHON) $(srcdir)/setup.py build This last step I don't understand but Python won't make the modules without it. Finally got Python 2.1 in HP-UX 11. Does anyone knows a better way? ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 01:45 Message: Logged In: YES user_id=21627 In configure.in 1.251, configure 1.243, I have replaced the -fpic with -fPIC for HP/UX and gcc. Unfortunately, I have no HP/UX box to test this on, so please try the next 2.2 alpha release (2.2a3), and submit a new bug report if any problems remain. It appears that gcc 3 does not distinguish anymore between -fpic and -fPIC on HP/UX (i.e. it always uses the "big" model), so it seems using -fPIC is the right approach. I have not done anything about setting PYTHONPATH to an empty string; that should not be necessary. Did you PYTHONPATH in your environment before invoking configure? If you are still getting problems, please also report gcc invocation lines for the object files (by example), not just the linker lines. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-08-20 13:11 Message: Logged In: YES user_id=35752 Assigned to Martin as I think he knowns more about shared libraries than I do. I think for gcc that -fPIC should be supplied if shared libraries are being built. So, CFLAGSFORSHARED should include -fPIC. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433234&group_id=5470 From noreply@sourceforge.net Wed Sep 5 10:00:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 02:00:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-411374 ] [Irix] SIGINT causes crash Message-ID: Bugs item #411374, was opened at 2001-03-26 06:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=411374&group_id=5470 Category: Python Interpreter Core Group: Platform-specific >Status: Closed Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Sjoerd Mullender (sjoerd) Summary: [Irix] SIGINT causes crash Initial Comment: python version 2.1b2 on Irix 6.5.8f: dumps core on a segfault when SIGINT is sent to the process, either by keystroke or using the kill command. ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-05 02:00 Message: Logged In: YES user_id=43607 Closed this bug since it doesn't happen for me, and there was never a response from the original submitter. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-06-08 12:37 Message: Logged In: YES user_id=43607 Always first try recompiling without -O option. I have never seen a problem like this, and I use python quite a lot on an SGI (currently IRIX 6.5.12m), but I never compile with -O. If this doesn't help, please supply a stack trace. (If it does help, complain to SGI :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=411374&group_id=5470 From noreply@sourceforge.net Wed Sep 5 10:10:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 02:10:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-417587 ] compiler warnings compiling 2.1 Message-ID: Bugs item #417587, was opened at 2001-04-20 02:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417587&group_id=5470 Category: Build Group: None >Status: Closed >Resolution: Wont Fix Priority: 3 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Sjoerd Mullender (sjoerd) Summary: compiler warnings compiling 2.1 Initial Comment: I get a whole bunch of compiler warnings when compiling the stock Python-2.1 on SGI IRIX 6.5.11m. These warnings are innocuous, but I feel that many of them should be fixed anyway. I particularly dislike code where a goto or return is immediately followed by break. There is just *no way* the flow of control can get to that break and I feel that it betrays uncertainty in the programmer. ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-05 02:10 Message: Logged In: YES user_id=43607 Most of the code causing warnings has been fixed. Remaining are warnings like "cast between pointer-to-object and pointer-to-function" for which I don't know a fix (except turning of this particular warning) and a bunch of warnings in glmodule which is generated and for which it's too much work to fix the generator script. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-05-11 09:41 Message: Logged In: YES user_id=3066 Sjoerd, are you planning to follow up on this? See Tim's remarks. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-20 19:47 Message: Logged In: YES user_id=31435 Sjoerd, it would be much more helpful if you submitted a patch. We don't have an SGI IRIX 6.5.11m box to compile on, so can't tell whether we've fixed anything. We have a "no compiler warnings!" policy that I enforce under the Windows build, and so I don't see *any* warnings in the 2.1 build. I fixed the most egregious ones where fixes were obviously harmless, checked in as mmapmodule.c new revision: 2.28 unicodeobject.c new revision: 2.86 tokenizer.c new revision: 2.50 ceval.c new revision: 2.240 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417587&group_id=5470 From noreply@sourceforge.net Wed Sep 5 10:38:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 02:38:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-458654 ] Code Bug Message-ID: Bugs item #458654, was opened at 2001-09-05 02:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458654&group_id=5470 Category: Documentation Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Code Bug Initial Comment: 4.7.1 Default Argument Values def f(a, l = []): l.append(a) return l print f(1) print f(2) print f(3) Needs a after return l ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458654&group_id=5470 From noreply@sourceforge.net Wed Sep 5 13:05:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 05:05:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-404274 ] Linking error on AIX (Python 1.5.2) Message-ID: Bugs item #404274, was opened at 2001-02-26 04:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 Category: Distutils Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Rene Liebscher (rliebscher) Assigned to: A.M. Kuchling (akuchling) Summary: Linking error on AIX (Python 1.5.2) Initial Comment: The patch from 1.32 to 1.33 of file sysconfig.py removes some special actions for AIX and BeOS concerning the paths to the linker scripts. On Python 1.5.2 these parts are still needed, because it doesn't have this new style of Makefile ( LDSHARED and BLDSHARED ) The old version (1.5.2) has no BLDSHARED so if is not found you could execute the old code to stay compatible. Or you declare that Distutils is not suited for versions <2.X. Error message (PyOpenGL build): ../././Modules/ld_so_aix cc build/temp.aix-3-000769244C00-1.5/_openglmodule.o -L/usr/local/lib -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/lib -lGL -lX11 -lXext -o build/lib.aix-3-000769244C00-1.5/OpenGL/dynload/aix4/_opengl.so unable to execute ../././Modules/ld_so_aix: No such file or directory error: command '../././Modules/ld_so_aix' failed with exit status 1 ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-05 05:05 Message: Logged In: YES user_id=11375 Checked into revision 1.43 of sysconfig.py. ---------------------------------------------------------------------- Comment By: Rene Liebscher (rliebscher) Date: 2001-09-04 23:27 Message: Logged In: YES user_id=28463 It works for me. No problems building the lastest versions of Numerical Python or PyOpenGL with this patch. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:36 Message: Logged In: YES user_id=11375 Rene, can you please try this patch, and confirm whether or not it works for you? If so, I'll check it in. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-08-16 13:54 Message: Logged In: YES user_id=11375 It's too early to drop 1.5.2 support. (When that's done, the Distutils version will probably be bumped to 1.1.) I've attached a patch that brings back the old code. With this patch, does it work with 1.5.2 again ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-02-28 20:55 Message: Logged In: YES user_id=3066 Greg, you're the distutils guru... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404274&group_id=5470 From noreply@sourceforge.net Wed Sep 5 14:52:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 06:52:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-455537 ] module search in import.c Message-ID: Bugs item #455537, was opened at 2001-08-26 10:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455537&group_id=5470 Category: Build Group: Python 2.1.1 Status: Open >Resolution: Fixed Priority: 5 Submitted By: Armin Steinhoff (arminsteinhoff) Assigned to: Nobody/Anonymous (nobody) Summary: module search in import.c Initial Comment: I'm porting 2.1.1 to QNX6 and got the situation that the module 'os' could not be be found with 'import os' After some hacking with DDD .. I found out that the pathes used by the search algorithm of import.c has nothing to do with the directory structure of the UNIX distribution of Python 2.1.1 =:-/ I have installed Python in the root directory and set PYTHONHOME/PYTHONPATH to /Python-2.1.1 -> the path to he library modules is then -> /Python-2.1.1/Lib OK ... that's not a clean place for UNIX freaks :) The search algorithm of import.c is using the following search path sequence: "os.so" -> I don't know why it should make sense to open a shared object with fopen ?? "osmodule.so" "os.py" "os.pyc" "/Python-2.1.1/os.so" ... os.pyc "/Python-2.1.1/lib/python2.1/os.so" ... os.pyc ^^^^^^^^^^^^^^^ who got the idea that this is part of the UNIX tar.gz distribution ?? Also ... there are similar problems with the binaries installed by 'make install' ... Armin a-steinhoff@web.de ---------------------------------------------------------------------- >Comment By: Armin Steinhoff (arminsteinhoff) Date: 2001-09-05 06:52 Message: Logged In: YES user_id=64602 OK ... the directories "lib/python2.1" are not part of the UNIX sources, but they are used in the search sequence. Yes ... your last statement is correct :-) However ... I will look into the 'getpath' module in order to modify the default search path for QNX6 Armin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-31 05:37 Message: Logged In: YES user_id=6380 Ignoring your original message (which I didn't understand) but clued in by your latest followup (which makes sense to me): The Unix and Windows getpath code accommodates this case (running from the build directory) by noticing this and choosing a different default path in that case. Maybe you should do the same in your QNX port. The relevant code for Unix is in Modules/getpath.c (not in import.c, which is one of the reasons why your initial message threw me off). Regarding the search algorithm: it uses fopen() to detect existence of the file. Read the source and it will be clear to you: it has a table of suffixes to try. I don't understand your remark "who got the idea that this is part of the UNIX tar.gz distribution ??" My feeling is that you're jumping to conclusions based on insufficient knowledge, which makes it hard to argue. :-) ---------------------------------------------------------------------- Comment By: Armin Steinhoff (arminsteinhoff) Date: 2001-08-31 01:47 Message: Logged In: YES user_id=64602 Hello Jeremy, The location of the standard Phython libraries are valid for a binary installation ... but not for the structure of the source distribution, that means for the build process (setup.py). For instance os.py is located in $(PYTHONHOME)/Lib and not in ${prefix}/lib/python ! This creates an import error when setup.py will be executed. .... and this is exactly the problem! Armin ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-27 15:20 Message: Logged In: YES user_id=31392 I'm not sure what the complaint is. The man page for Python is quite clear about what PYTHONHOME means: Change the location of the standard Python libraries. By default, the libraries are searched in ${prefix}/lib/python and ${exec_prefix}/lib/python, where ${prefix} and ${exec_prefix} are installation-dependent directories, both defaulting to \fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value replaces both ${prefix} and ${exec_prefix}. To specify different values for these, set $PYTHONHOME to ${prefix}:${exec_prefix}. It sounds like Python is doing exactly what it is documented to do. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455537&group_id=5470 From noreply@sourceforge.net Wed Sep 5 15:38:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 07:38:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-458745 ] PyInt_Check doc amiss in API manual Message-ID: Bugs item #458745, was opened at 2001-09-05 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458745&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: PyInt_Check doc amiss in API manual Initial Comment: In the API manual, PyInt_Check is listed as returning a borrowed reference. This is almost certainly incorrect. ;-) http://www.python.org/doc/api/intObjects.html I checked Doc/api/refcounts.dat and it looks okay. There is nothing in the api.tex file to suggest it would put anything there, so there must be some postprocessing step where this erroneous bit is added. Skip ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458745&group_id=5470 From noreply@sourceforge.net Wed Sep 5 16:37:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 08:37:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-458447 ] New httplib lacks documentation Message-ID: Bugs item #458447, was opened at 2001-09-04 10:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) >Assigned to: Fred L. Drake, Jr. (fdrake) >Summary: New httplib lacks documentation Initial Comment: urllib should allow the user to set the content-type. This would allow applications to do more than just "forms posting" -- e.g., use it to make SOAP requests. The attached patch allows that. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 08:37 Message: Logged In: YES user_id=6380 Fred: it turns out the httplib docs still document the old version of the module. The new version is considerably more powerful, and is essentially undocumented. Maybe you can shame Greg Stein into providing some docs, or maybe you can convert the copious docstrings to LaTeX. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-04 20:45 Message: Logged In: YES user_id=44345 I'm not sure why you'd want to program SOAP (or XMLRPC, for that matter) directly. You would (normally) only use those protocols through special-purpose modules like SOAP.py or xmlrpclib.py, both of which talk to httplib I believe. I don't see that allowing the Content-Type: header to be overridden at the urllib level is all that necessary. If you're going to want to mess with Content-Type: you're probably going to want to mess with other headers as well. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 19:02 Message: Logged In: YES user_id=36737 I created this bug because urllib didn't let you set the content-type header. Guido pointed out that I should be using httplib. I didn't use httplib because I didn't know until I read the source, that httplib had an https object that used SSL. So I guess "document the https object" is what this has mutated into. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-04 14:03 Message: Logged In: YES user_id=3066 It's not at all clear what sort of documentation update is needed. What did you have in mind? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 12:20 Message: Logged In: YES user_id=6380 Please don't Delete requests. Please don't Close them unless you are a project manager (I consider it a SF bug that the submitter can decide to close a bug report if they happen to have admin perms on another project). I've reopened this and recategorized as Doc and assigned to Fred so he can see if the httplib docs need to be updated. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-04 12:16 Message: Logged In: YES user_id=36737 Okay, I'll accept that. Had HTTP documented that it included HTTPS I wouldn't have made the initial mistake. :) Let me know if you want the diff. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:20 Message: Logged In: YES user_id=6380 Isn't SOAP an HTTP application? Then you shouldn't be using urllib, but httplib. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458447&group_id=5470 From noreply@sourceforge.net Wed Sep 5 16:38:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 08:38:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-443762 ] dictionary type ignores argument list Message-ID: Bugs item #443762, was opened at 2001-07-23 04:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443762&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Duncan Booth (duncanb) >Assigned to: Tim Peters (tim_one) Summary: dictionary type ignores argument list Initial Comment: In 2.2a1 the dictionary type object completely ignores its argument list when constructing a new dictionary. It always returns an empty dictionary no matter what arguments are specified. Either: it should check that it has been called with no arguments. Or: it should take some arguments and do something useful with them. I would suggest that the following arguments would be useful: dictionary() should return a new empty dictionary. dictionary(d) where d is a dictionary should return a copy of the original dictionary. dictionary(k1=v1, k2=v2, k3=v3, ...) should return a dictionary with keys k1, k2, k3, ... and corresponding values. dictionary(kvlist) where kvlist is a list of key, value tuples should build a dictionary from the key value pairs (effectively this is the inverse of d.items ()). dictionary(kseq, vseq) should do the same as dictionary (zip(kseq, vseq)) i.e. create a dictionary initialised with corresponding elements from each list as key and value. Any other arguments to dictionary should be rejected. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 08:38 Message: Logged In: YES user_id=6380 Closed, as fixed -- Tim implemented a simple dictionary() constructor (taking only a mapping-like argument). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-07 10:37 Message: Logged In: YES user_id=6380 Well, that would be a very generous API -- probably too generous. I'm tempted to allow only a single argument with a mapping interface -- that would be more in line with how tuple() and list() work. Let this also be a reminder for me to fix the docstring when I fix the constructor. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443762&group_id=5470 From noreply@sourceforge.net Wed Sep 5 16:40:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 08:40:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-427345 ] CGIHTTPServer fix for Windows Message-ID: Bugs item #427345, was opened at 2001-05-25 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=427345&group_id=5470 Category: Python Library Group: Platform-specific Status: Open Resolution: None Priority: 3 Submitted By: Kevin Altis (kasplat) >Assigned to: Nobody/Anonymous (nobody) Summary: CGIHTTPServer fix for Windows Initial Comment: CGIHTTPServer.py in the Python 2.1 library needs two changes to the popen2 section in order to support binary data and to avoid buffering problems under Windows. The complete code block is shown at the end of this message. The two changed lines are: cmdline = "%s -u %s" % (interp, cmdline) fi, fo = os.popen2(cmdline, 'b') I've tested this under Windows 2000 Pro and binary file uploads now work, however more extensive tests should probably be done. It appears there is another socket-related problem and/or end-of-line conversion error that occurs when using Internet Explorer 5.x and BASEHTTPServer with CGIHTTPServer on the same machine. I'm still investigating that issue. Finally, I have done a small rewrite of CGIHTTPServer.py to simplify subclassing it to support running CGIs in any or all directories and using other file extensions such as .cgi. The maintainer for the current file should email me about the changes to see whether they want to update the official library file. I didn't post it here since it needs more tweaking ka --- CGIHTTPServer.p fixes... elif self.have_popen2: # Windows -- use popen2 to create a subprocess import shutil os.environ.update(env) cmdline = scriptfile if self.is_python(scriptfile): interp = sys.executable if interp.lower().endswith("w.exe"): # On Windows, use python.exe, not python.exe interp = interp[:-5] = interp[-4:] cmdline = "%s -u %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) self.log_error("command: %s", cmdline) try: nbytes = int(length) except: nbytes = 0 fi, fo = os.popen2(cmdline, 'b') if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) fi.write(data) fi.close() shutil.copyfileobj(fo, self.wfile) sts = fo.close() if sts: self.log_error("CGI script exit status %#x", sts) else: self.log_error("CGI script exited OK") ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 08:40 Message: Logged In: YES user_id=6380 Load shedding. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-09 06:14 Message: Logged In: YES user_id=6380 Reopening -- not that I have time for this. :-( Note that that patch is in socket.py. If this really is a work-around, I'd like to understand why. ---------------------------------------------------------------------- Comment By: Steve Pike (oztourer) Date: 2001-08-09 05:27 Message: Logged In: YES user_id=120658 To further elaborate on the problems with POST on Windows 95: without having reached any real understanding of the problem I have found a tolerable workaround. By modifying the default _rbufsize for class _fileobject in socket.py I can get any POSTs with text length less than _rbufsize to work. Here is the mod:
class _fileobject:
    def __init__(self, sock, mode, bufsize):
        self._sock = sock
        self._mode = mode
        if bufsize < 0:
            bufsize = 512
        # SP 9 Aug 2001: default _rbufsize is too small, 
crashing CGIHTTPServer on POST's
        # This fix still only allows pages of less than 
given buffer size to be updated,
        # so the real fix has still to be discovered.
        #self._rbufsize = max(1, bufsize)
        self._rbufsize = max(16*1024, bufsize)
        self._wbufsize = bufsize
        self._wbuf = self._rbuf = ""
-- StevePike ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-07 12:59 Message: Logged In: YES user_id=6380 I agree that this is a laudable goal, but I don't have the time to spend to work on this. Please upload a patch to the SF patch manager and assign it to me and I'll look at it. In the mean time, I've applied the two small suggestions and will close this bug report. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-05-29 09:29 Message: Logged In: NO I want to elaborate on the second-to-last paragraph in this report. CGIHTTPServer in 2.1 and 2.0 is apparently broken for POST requests (only) to CGI scripts, when running locally on Windows with an IE client. The details: there is a problem with the combination of a CGIHTTPServer and Intenernet Explorer both running locally on Windows (with server name "localhost"). In this setup, POST requests to CGI scripts fail, but GET requests to the exact same script work fine. That is, a form with method=GET, or a URL with an appended query string, both work ok. In POST mode, the CGI script gets proper data in the input stream, and generates a correct reply stream (which is in fact identical to the output generated for quivalent GET requests). So, somewhere between CGIHTTPServer and IE, the data seems to be dropped or munged. The same thing happens of you force CGIHTTPServer to use execfile() to launch the script, instead of os.popen2. I've also observed that endline conventions seem to be irrelevant to the problem; using \n or \r\n makes no difference in both the input and reply streams. I've also been told that the problem may not exist in Netscape clients. Since CGIHTTPServer is a very nice way to test CGI scripts (all you need is a standard Python install), this seems important. It would also be nice if the directory assumptions in that module were more customizable, but that's just a wish. --Mark Lutz ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=427345&group_id=5470 From noreply@sourceforge.net Wed Sep 5 16:42:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 08:42:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-458768 ] Python.h conventions. Message-ID: Bugs item #458768, was opened at 2001-09-05 08:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458768&group_id=5470 Category: Documentation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Python.h conventions. Initial Comment: Most system headers are included by Python.h, which includes pyconfig.h before any system headers. We can make a new rule: "Python.h must be included first, instead of most system headers, and before any other system headers are included." ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458768&group_id=5470 From noreply@sourceforge.net Wed Sep 5 16:49:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 08:49:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-458771 ] unittest things to be doc'd Message-ID: Bugs item #458771, was opened at 2001-09-05 08:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: unittest things to be doc'd Initial Comment: We're starting to use the unittest module, and am noticing some things that need documentation or doc fixes. TestSuite class: the run() method requires the result object; unlike TestCase, it's not optional. TestSuite objects "prefer" to be invoked by a test runner (according to comments in the source); the run() method of the TextTestRunner should be documented. If not, then TestSuite.__call__ needs to be changed to make the result object optional. I don't think the docs explain using the first line of the docstring as the "short description" for tests. TestLoader.loadTestFromName needs to define what a "string specifier" is, as dis ltnNames. :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 From noreply@sourceforge.net Wed Sep 5 17:21:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 09:21:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-458785 ] Link in module-sha docs Message-ID: Bugs item #458785, was opened at 2001-09-05 09:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458785&group_id=5470 Category: Documentation Group: Not a Bug Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Link in module-sha docs Initial Comment: http://www.python.org/doc/current/lib/module-sha.html At the bottom of the page, the link seems to be outdated. The new one is http://www.itl.nist.gov/fipspubs/fip180-1.htm PDF version in http://csrc.nist.gov/publications/fips/fips180-1/fips180-1.pdf However, this seems to be a more general link to secure hashing (includes both the above): http://csrc.nist.gov/encryption/tkhash.html ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458785&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:39:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:39:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-452747 ] New-style class instances can't be pickled Message-ID: Bugs item #452747, was opened at 2001-08-18 17:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Allan Crooks (amc1) Assigned to: Guido van Rossum (gvanrossum) >Summary: New-style class instances can't be pickled Initial Comment: Any class which extends either the dictionary or list types in Python 2.2a1 is both unpickable by both the pickle module and cPickle, and is uncopyable by the copy module. Oh, and I'll use this opportunity to thank Guido and everyone who's ever worked on Python for making a programming language which is absolutely wonderful to program in. :) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-18 23:35 Message: Logged In: YES user_id=6380 Thanks :-) Regarding your bug, it's more general than what you describe even: any class derived from object except certain built-in classes are unpicklable. I have to think about this -- part of my brain says that this is how it should be, and that you can register your constructor with copy_reg to make your type picklable, and another part of my brain says that it should be supported one way or another. Changed the subject to reflect the problem better. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:43:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:43:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-216289 ] Programs using Tkinter sometimes can't shut down (Windows) Message-ID: Bugs item #216289, was opened at 2000-10-06 19:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=216289&group_id=5470 Category: Windows Group: 3rd Party Status: Closed Resolution: Wont Fix Priority: 3 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: Programs using Tkinter sometimes can't shut down (Windows) Initial Comment: The following msg from the Tutor list is about 1.6, but I noticed the same thing several times today using 2.0b2+CVS. In my case, I was running IDLE via python ../tool/idle/idle.pyw from a DOS box in my PCbuild directory. Win98SE. *Most* of the time, shutting down IDLE via Ctrl+Q left the DOS box hanging. As with the poster, the only way to regain control was to use the Task Manager to kill off Winoldap. -----Original Message----- From: Joseph Stubenrauch Sent: Friday, October 06, 2000 9:23 PM To: tutor@python.org Subject: Re: [Tutor] Python 1.6 BUG Strange, I have been experiencing the same bug myself. Here's the low down for me: Python 1.6 with win95 I am running a little Tkinter program The command line I use is simply: "python foo.py" About 25-35% of the time, when I close the Tkinter window, DOS seems to "freeze" and never returns to the c:\ command prompt. I have to ctrl-alt-delete repeatedly and shut down "winoldapp" to get rid of the window and then shell back into DOS and keep working. It's a bit of a pain, since I have the habit of testing EVERYTHING in tiny little stages, so I change one little thing, test it ... freeze ... ARGH! Change one more tiny thing, test it ... freeze ... ARGH! However, sometimes it seems to behave and doesn't bother me for an entire several hour session of python work. That's my report on the problem. Cheers, Joe ---------------------------------------------------------------------- Comment By: Howard Lightstone (hlightstone) Date: 2001-09-05 10:43 Message: Logged In: YES user_id=66570 I sometimes get bunches of these.... A tool I use (Taskinfo2000) reports that (after killing winoldap): python.exe is blocked on a mutex named OLESCELOCKMUTEX. The reported state is "Console Terminating". There appears to be only one (os) thread running. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-02 13:06 Message: Logged In: YES user_id=31435 No sign of progress on this presumed Tk/Tcl Windows bug in over 3 months, so closing it for lack of hope. ---------------------------------------------------------------------- Comment By: Doug Henderson (djhender) Date: 2001-02-05 21:13 Message: This was a symptom I saw while tracking down the essence of the problem reported in #131207. Using Win98SE, I would get an error dialog (GPF?) in the Kernel, and sometimes the dos prompt would not come back. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-12-12 18:00 Message: Just reproduced w/ current CVS, but didn't hang until the 8th try. http://dev.scriptics.com/software/tcltk/ says 8.3 is still the latest released version; don't know whether that URL still makes sense, though. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-12-12 12:58 Message: Tim, can you still reproduce this with the current CVS version? There's been one critical patch to _tkinter since the 2.0 release. An alternative would be to try with a newer version of Tcl (isn't 8.4 out already?). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2000-10-15 09:47 Message: Same as I've reported earlier; it hangs in the call to Tcl_Finalize (which is called by the DLL finalization code). It's less likely to hang if I call Tcl_Finalize from the _tkinter DLL (from user code). Note that the problem isn't really Python-related -- I have stand-alone samples (based on wish) that hangs in the same way. More later. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-10-13 07:40 Message: Back to Tim since I have no clue what to do here. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-10-12 10:25 Message: The recent fix to _tkinter (Tcl_GetStringResult(interp) instead of interp->result) didn't fix this either. As Tim has remarked in private but not yet recorded here, a workaround is to use pythonw instead of python, so I'm lowering thepriority again. Also note that the hanging process that Tim writes about apparently prevents Win98 from shutting down properly. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-10-07 00:37 Message: More info (none good, but some worse so boosted priority): + Happens under release and debug builds. + Have not been able to provoke when starting in the debugger. + Ctrl+Alt+Del and killing Winoldap is not enough to clean everything up. There's still a Python (or Python_d) process hanging around that Ctrl+Alt+Del doesn't show. + This process makes it impossible to delete the associated Python .dll, and in particular makes it impossible to rebuild Python successfully without a reboot. + These processes cannot be killed! Wintop and Process Viewer both fail to get the job done. PrcView (a freeware process viewer) itself locks up if I try to kill them using it. Process Viewer freezes for several seconds before giving up. + Attempting to attach to the process with the MSVC debugger (in order to find out what the heck it's doing) finds the process OK, but then yields the cryptic and undocumented error msg "Cannot execute program". + The processes are not accumulating cycles. + Smells like deadlock. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=216289&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:51:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:51:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-456504 ] Memory leak in PyString_FromString Message-ID: Bugs item #456504, was opened at 2001-08-29 06:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456504&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None >Priority: 4 Submitted By: Nobody/Anonymous (nobody) Assigned to: Barry Warsaw (bwarsaw) Summary: Memory leak in PyString_FromString Initial Comment: Purify (on WinNT) reports a memory leak: Memory leak of 567 bytes from 14 blocks allocated in PyString_FromString Distribution of leaked blocks Allocation location malloc [msvcrt.dll] PyString_FromString [python21.dll] ??? [python.exe ip=0x00405059] This fragments the heap and my long-running program eventually runs out of memory. I was running my sample program with wxPython and so could not run debug version for more explicit info without compiling wx myself. If this is not enough info we can probably get a more detailed output. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:51 Message: Logged In: YES user_id=6380 With 99.9% probability, this is not a bug in PyString_FromString(), but a missing Py_DECREF() somewhere else. Because of the way reference counting works, missing DECREFs show up as memory leaks originating in one of the "new-object-creation" routines, but these routines are usually without blame. The trick is to find the missing DECREF! If you want to help us fund it, the best thing to do is boil your example program down to something as small as possible that still exhibits the leak -- then show us the code. With the Python code in hand we can look at what C code is being invoked that might have a missing DECREF. I've done this many times so I know it can be very effective -- and Purify or Insure are very little help, alas. HOWEVER, you mention wxPython. That's a HUGE body of 3rd party code. If you can only reproduce this when wxPython is involved, it's probably a bug in wxPython (3rd party code is always the most likely cause for refcount bugs, in my experience). I propose to lower the priority and close this bug a month from now if no new evidence is found that it's a core Python bug. (BTW the Python version would also be handy to know.) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-29 12:40 Message: Logged In: YES user_id=31435 I'm afraid we need better evidence of a "real leak" than this. PyString_FromString is called from 100s of locations, and some of the targets are file-static vrbls that indeed are never *expected* to get cleared (for example, abstract.c constructs the string "__bases__" once and then reuses it forever after). BTW, it's extremely unlikely that a "loss" of 567 bytes is causing you to run out of memory, yes? I'd look elsewhere. Assigning to Barry, since he runs Insure++ regularly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456504&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:54:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:54:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martijn Pieters (mjpieters) >Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:53:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:53:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-456391 ] unexpected test_largefile output Message-ID: Bugs item #456391, was opened at 2001-08-28 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456391&group_id=5470 Category: None Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Guido van Rossum (gvanrossum) Summary: unexpected test_largefile output Initial Comment: Running test_largefile produces this output: test_largefile @test exists: 0 The second line is unexpected. It occurs because at the end of test_largefile.py is print >>sys.stderr, name, "exists:", os.path.exists (name) This makes it harder to understand the regression test output and should likely be removed. Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:53 Message: Logged In: YES user_id=6380 Jeremy, you've got to stop assigning bugs to random folks. :-) This was clearly a debug printf left in by accident by Fred. I've removed it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456391&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:55:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:55:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-456738 ] Support for smoother debugging of C exts Message-ID: Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Nobody/Anonymous (nobody) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:55 Message: Logged In: YES user_id=6380 I don't see why Barry should do this (he doesn't seem interested), so unassigning, on the theory that Jeremy randomly assigned it. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:44 Message: Logged In: YES user_id=45365 I think I would like this feature. Actually, I think it would even be nice to export it to Python (through sys?). There's something similar in MacPython (the MacOS DebugStr() routine) and I use it a lot. The advantage of a separate routine (as opposed to setting a breakpoint) is that you can put complex conditions in your code for when you want to call the routine. This could conceivably be done with conditional breakpoints too, but it tends to be much more of a hassle. Especially going from Python code to the C debugger at a specific point is pretty difficult. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:58:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:58:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-449000 ] re.sub(r'\n', ...) broke Message-ID: Bugs item #449000, was opened at 2001-08-07 21:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449000&group_id=5470 Category: Regular Expressions Group: Python 2.2 Status: Open Resolution: None Priority: 6 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Fredrik Lundh (effbot) Summary: re.sub(r'\n', ...) broke Initial Comment: Fredrik, I believe the latest changes to re.sub() broke an endcase in re.sub(). I used to be able to write r'\n' as a pattern and it would do the same thing as '\n'. Now this doesn't work any more; '\n' works but r'\n' doesn't seem to do anything. I'm guessing this is an endcase handled wrong in the most recent checkin ("map re.sub() to string.replace(), when possible" sounds suspicious to me). I haven't verified this hypothesis, but it still works in 2.1.1 and is broken in current CVS. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:58 Message: Logged In: YES user_id=6380 Fredrik, when will you have time to fix this? There is currently a large amount of code checked in that is disabled because it's buggy... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 20:47 Message: Logged In: YES user_id=6380 Lowered priority -- this won't need to hold up the 2.2a2 release. (But /F, if you fix it before Wednesday, it may still make it into 2.2a2.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449000&group_id=5470 From noreply@sourceforge.net Wed Sep 5 18:56:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 10:56:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-410993 ] linuxaudiodev fails during "make test". Message-ID: Bugs item #410993, was opened at 2001-03-24 02:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410993&group_id=5470 Category: Python Library Group: Platform-specific Status: Open Resolution: Accepted Priority: 4 Submitted By: Sean Reifschneider (jafo) Assigned to: Charles G Waldman (cgw) >Summary: linuxaudiodev fails during "make test". Initial Comment: Picked up 2.1b2 and did "./configure" and "make test" on a RedHat 7.0-based system: test test_linuxaudiodev crashed -- linuxaudiodev.error: (11, 'Resource temporarily unavailable') Was running build as root, and "mpg123" runs successfully before and after. This is on a ThinkPad 240 with esssolo1 driver with 2.2.18 kernel. Sean ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:56 Message: Logged In: YES user_id=6380 Charles, are you still interested in tackling this bug? If not, let us know! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-10 21:27 Message: Logged In: YES user_id=6380 We've gone back and forth over this one. It seems to happen for certain drivers for certain audio cards -- the problem has disappeared for most folks, but still works for some hardware (e.g. some Dell laptops running Mandrake). I've assigned this to Charles Waldman since he seems to know this area; he commented in python-dev that the initialization order is invalid. Charles if you still feel you won't touch this module (because you'd rather give us a new module that does the right thing), please close it as Won't Fix -- that's what I almost did until I remembered your interest. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-11 09:36 Message: Logged In: YES user_id=6380 I think you misread his comment. He wasn't mpg123 *during* the test, he ran it before and after the test to verify that in fact his audio was in good working order. But, I do suggest to him to try the CVS version, which is one (relevant) fix ahead of 2.1b2. That version passes the test for me, but I don't hear a thing, so I'm not sure what's going on... ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-11 07:19 Message: Logged In: YES user_id=31392 I think we should report this failure as "test skipped." I think it would be essentially correct: The test was skipped because the device was in use. It's not a crash. Not sure how this test is affected by the recent changes to the module to handle EAGAIN. Sean or Guido-- can you try it with the updated module? My Linux audio config is screwed up. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410993&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:02:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:02:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-438164 ] Format operator % fails with unicode Message-ID: Bugs item #438164, was opened at 2001-07-03 00:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438164&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Chema Cortés (chemacortes) Assigned to: M.-A. Lemburg (lemburg) Summary: Format operator % fails with unicode Initial Comment: A dictionary with unicode keys raise an error when it is applied to a string throught the format operator %. Here is the ofending code: >>> "%(año)d" % { u"año":2001 } # KeyError: año This fails because u"año" and "año" cannot be compared: byte strings and Unicode strings are comparable only if the byte string is ASCII. > >>> u"%(año)4d" % { u"año":2001 } # KeyError: año This fails because the key is converted to UTF-8 before lookup. Must be add the unicode case into the format operator % ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:02 Message: Logged In: YES user_id=6380 Wow, that's some vacation! :-) ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2001-08-16 03:47 Message: Logged In: YES user_id=38388 I'll look into this after I'm back from vacation on the 10.09. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438164&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:03:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:03:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-448403 ] libpython2.2.a missing -- Make Failure Message-ID: Bugs item #448403, was opened at 2001-08-06 06:08 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448403&group_id=5470 Category: Installation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: libpython2.2.a missing -- Make Failure Initial Comment: Hi, In trying to install Python for the first time on a Sun Ultrasparc 10, I followed recommended procedure and obtained the following error (whilst runing "make"): gcc -o python \ Modules/python.o \ libpython2.2.a -lpthread -lsocket -lnsl -ldl -lthread -lm gcc: libpython2.2.a: No such file or directory make: *** [python] Error 1 Any assistance would be greatly appreciated. All the best, Lars ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:03 Message: Logged In: YES user_id=6380 Martin, are you capable of dealing with this? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448403&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:05:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:05:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-458814 ] MHammond non-responsive Message-ID: Bugs item #458814, was opened at 2001-09-05 11:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 Category: None Group: 3rd Party Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Mark Hammond (mhammond) Summary: MHammond non-responsive Initial Comment: Bugs assigned to Mark Hammond don't seem to be dealt with. Mark, have you fallen out of our community? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:06:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:06:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-415950 ] Problem with SSL and socketmodule Message-ID: Bugs item #415950, was opened at 2001-04-13 10:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=415950&group_id=5470 Category: Extension Modules Group: Platform-specific >Status: Closed Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Moshe Zadka (moshez) Summary: Problem with SSL and socketmodule Initial Comment: Subject: [Python-Dev] Problem with SSL and socketmodule on Debian Potato? From: Neil Schemenauer To: python-dev@python.org Cc: Moshe Zadka Date: Thu, 12 Apr 2001 14:39:37 -0700 Fresh CVS tree: Python 2.1c1 (#2, Apr 12 2001, 17:23:20) [GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import socket Traceback (most recent call last): File "", line 1, in ? File "/scratch/nascheme/py_cvs/dist/src/Lib/socket.py", line 41, in ? from _socket import * ImportError: /scratch/nascheme/py_cvs/dist/src/linux/build/lib.linux-i686-2.1/_socket.so: undefined symbol: RAND_status socketmodule is linked thusly: gcc -shared build/temp.linux-i686-2.1/socketmodule.o -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-i686-2.1/_socket.so The SSL package is: libssl09-dev 0.9.4-5 I've no time to dig into the details right now but I should have time tonight. I will be gone on holiday tomorrow. Neil _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:06 Message: Logged In: YES user_id=6380 Closing this. In the end we reversed the checkin because it broke on some platforms and there was no clear way to fix it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-13 13:56 Message: Logged In: YES user_id=6380 I've checked in a tentative fix, provided by Martin von Loewis. I'm keeping this bug report open because Moshe thought that Martin's fix was broken, but failed to give a better fix that Martin could agree to. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=415950&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:07:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:07:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-407783 ] urllib2: AbstractHTTPHandler limits flexible client implemen Message-ID: Bugs item #407783, was opened at 2001-03-11 16:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Postponed Priority: 4 Submitted By: Bill Bumgarner (bbum) Assigned to: Moshe Zadka (moshez) Summary: urllib2: AbstractHTTPHandler limits flexible client implemen Initial Comment: The implementation of the do_open() method on the AbstractHTTPHandler class contains a couple of "features" that could be considered to be "bugs". In any case, each time I have wanted to use urllib2 for relatively straightforward development of an HTTP client, I have had to effectively replace the HTTPHandler with one that reimplements do_open() (or http_open() in 2.0). Maybe my usage is not the norm-- in any case, the more information, the better... Specifics (all names in context of Python 2.1): - AbstractHTTPHandler does not allow for anything but GET or POST requests. GET is the default and POST happens anytime the request object contains data to be passed to the server. This limitation is the only thing that stands in the way of using the AbstractHTTPHandler *directly* to implement, say, a WebDAV client or to do something like a site sucker that uses the HEAD method to determine if content has changed. - [this is likely a bug] the method will throw an exception if *any* response is received from the server other than 200. However, HTTP defines that all 2XX responses should be treated as successful. In any case, there are *a lot* of contexts within which a non-200 response may be treated as a 'success' of some sort or another. Regardless, it is really outside of the scope of the AbstractHTTPHandler's implementation to make the success/failure decision-- it should simply return the same thing regardless of the response status. - [a bug?] Whenever an exception is raised (a non-200 code is received), the status code and reason (as provided by the server) are both lost. I see that moshez has been primarily responsible for recent changes surrounding this code. I would be happy to contribute to the evolution of the code; please feel free to contact me directly. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:07 Message: Logged In: YES user_id=6380 Unassigning from Moshe -- he doesn't seem to have time (Moshe, if you're still interested, just change the owner field back to you). ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-04-09 07:02 Message: Logged In: YES user_id=11645 I'm formally postponing it until the 2.1 release comes out -- clearly none of this can be considered a bug fix. ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-19 16:37 Message: Logged In: YES user_id=103811 OK-- I can understand that logic (close to beta, etc). Given the prominence of Python in the WebDav community combined with the increasing use of 2xx (and 1xx) codes, it would be extremely useful to include-- at the least-- examples of handling such via the urllib2 modules. Beyond that, it would be quite helpful to the developers to expend some amount of engineering effort such that handling 2xx response codes doesn't require __getattr__ trickery! Similarly, breaking out the HTTP raw connection setup from the method that actually composes and sends the HTTP request would be helpful in that it would greatly reduce the amount of code that has to be duplicated when subclassing the handler to customize handling of 2xx or when specifying methods other than GET/POST. I.e. most developers will be confused to the point of being overwhelmed if "how do I customize responses such that they don't raise" or "how do I send an OPTIONS or HEAD request" requires figuring out how to deal with setting up and sending a request via the much-lower-level-than-urllib2 HTTP API. ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-03-18 01:22 Message: Logged In: YES user_id=11645 None of these can really be classified as "bugs" rather then functionality enhancement requests, and this is something I'm not sure I want to do this close to the second beta. BTW, one thing I'm sure I *don't* want to change -- handling of 20x codes. If you want to handle 201/206/whatever, then just handle them. With some __getattr__ trickery, you can have a class that handles all http_error_20x errors, so this is *easy* for 3rd party urllib2 extensions to add. Regarding explicitly determining the command: just put the command inside the request object, and use it in your own HTTPHandler/HTTPSHandler. This may be done in the next version of urllib2 (for 2.2). At that time I might also add the feature that other encodings (not just application/x-www-form-urlencoded, but also multipart/form-data) will be supported. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-03-16 10:43 Message: Logged In: YES user_id=31392 I haven't had any spare cycles to devote to urllib2 this year. Perhaps Moshe can be of more help in the near term. Following the 2.1 release, I may have more time. I never used urllib2 it a situation that produced anything other than vanilla responses -- 200, 401, etc. I'm not to surprised to hear that there are problems with 2XX cases. Can you post some examples of the sorts of things you want to do? It sounds reasonable in the abstract, but some code would help. If not in this patch archive, perhaps on comp.lang.python? ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-11 19:59 Message: Logged In: YES user_id=103811 I realized that the exception throw behaviour is more fundamental to the underlying implementation than may have been indicated in the above description. In particular, throwing an HTTP exception when handling a 401 is key to making the various Authentication Handlers work. I still feel that the behaviour should be normalized across all requests such that the callee is responsible for determining error conditions or, at the lest, has access to the same data in a relatively similar format upon success or failure. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:07:19 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:07:19 -0700 Subject: [Python-bugs-list] [ python-Bugs-407783 ] urllib2: AbstractHTTPHandler limits flexible client implemen Message-ID: Bugs item #407783, was opened at 2001-03-11 16:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Postponed Priority: 4 Submitted By: Bill Bumgarner (bbum) >Assigned to: Nobody/Anonymous (nobody) Summary: urllib2: AbstractHTTPHandler limits flexible client implemen Initial Comment: The implementation of the do_open() method on the AbstractHTTPHandler class contains a couple of "features" that could be considered to be "bugs". In any case, each time I have wanted to use urllib2 for relatively straightforward development of an HTTP client, I have had to effectively replace the HTTPHandler with one that reimplements do_open() (or http_open() in 2.0). Maybe my usage is not the norm-- in any case, the more information, the better... Specifics (all names in context of Python 2.1): - AbstractHTTPHandler does not allow for anything but GET or POST requests. GET is the default and POST happens anytime the request object contains data to be passed to the server. This limitation is the only thing that stands in the way of using the AbstractHTTPHandler *directly* to implement, say, a WebDAV client or to do something like a site sucker that uses the HEAD method to determine if content has changed. - [this is likely a bug] the method will throw an exception if *any* response is received from the server other than 200. However, HTTP defines that all 2XX responses should be treated as successful. In any case, there are *a lot* of contexts within which a non-200 response may be treated as a 'success' of some sort or another. Regardless, it is really outside of the scope of the AbstractHTTPHandler's implementation to make the success/failure decision-- it should simply return the same thing regardless of the response status. - [a bug?] Whenever an exception is raised (a non-200 code is received), the status code and reason (as provided by the server) are both lost. I see that moshez has been primarily responsible for recent changes surrounding this code. I would be happy to contribute to the evolution of the code; please feel free to contact me directly. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:07 Message: Logged In: YES user_id=6380 Unassigning from Moshe -- he doesn't seem to have time (Moshe, if you're still interested, just change the owner field back to you). ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-04-09 07:02 Message: Logged In: YES user_id=11645 I'm formally postponing it until the 2.1 release comes out -- clearly none of this can be considered a bug fix. ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-19 16:37 Message: Logged In: YES user_id=103811 OK-- I can understand that logic (close to beta, etc). Given the prominence of Python in the WebDav community combined with the increasing use of 2xx (and 1xx) codes, it would be extremely useful to include-- at the least-- examples of handling such via the urllib2 modules. Beyond that, it would be quite helpful to the developers to expend some amount of engineering effort such that handling 2xx response codes doesn't require __getattr__ trickery! Similarly, breaking out the HTTP raw connection setup from the method that actually composes and sends the HTTP request would be helpful in that it would greatly reduce the amount of code that has to be duplicated when subclassing the handler to customize handling of 2xx or when specifying methods other than GET/POST. I.e. most developers will be confused to the point of being overwhelmed if "how do I customize responses such that they don't raise" or "how do I send an OPTIONS or HEAD request" requires figuring out how to deal with setting up and sending a request via the much-lower-level-than-urllib2 HTTP API. ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-03-18 01:22 Message: Logged In: YES user_id=11645 None of these can really be classified as "bugs" rather then functionality enhancement requests, and this is something I'm not sure I want to do this close to the second beta. BTW, one thing I'm sure I *don't* want to change -- handling of 20x codes. If you want to handle 201/206/whatever, then just handle them. With some __getattr__ trickery, you can have a class that handles all http_error_20x errors, so this is *easy* for 3rd party urllib2 extensions to add. Regarding explicitly determining the command: just put the command inside the request object, and use it in your own HTTPHandler/HTTPSHandler. This may be done in the next version of urllib2 (for 2.2). At that time I might also add the feature that other encodings (not just application/x-www-form-urlencoded, but also multipart/form-data) will be supported. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-03-16 10:43 Message: Logged In: YES user_id=31392 I haven't had any spare cycles to devote to urllib2 this year. Perhaps Moshe can be of more help in the near term. Following the 2.1 release, I may have more time. I never used urllib2 it a situation that produced anything other than vanilla responses -- 200, 401, etc. I'm not to surprised to hear that there are problems with 2XX cases. Can you post some examples of the sorts of things you want to do? It sounds reasonable in the abstract, but some code would help. If not in this patch archive, perhaps on comp.lang.python? ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-11 19:59 Message: Logged In: YES user_id=103811 I realized that the exception throw behaviour is more fundamental to the underlying implementation than may have been indicated in the above description. In particular, throwing an HTTP exception when handling a 401 is key to making the various Authentication Handlers work. I still feel that the behaviour should be normalized across all requests such that the callee is responsible for determining error conditions or, at the lest, has access to the same data in a relatively similar format upon success or failure. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:08:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:08:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-232637 ] can't compile modules on AIX 4.2.1 (for real this time) Message-ID: Bugs item #232637, was opened at 2001-02-15 15:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232637&group_id=5470 Category: Build Group: None Status: Open Resolution: None Priority: 5 Submitted By: Benjamin Collar (bcollar) Assigned to: Neil Schemenauer (nascheme) Summary: can't compile modules on AIX 4.2.1 (for real this time) Initial Comment: Hi, CC=cc_r CFLAGS="-O2 -qmaxmem=6000" ./configure --prefix=/development/utils --without-gcc make CC=cc_r OPT="-O2 -qmaxmem=6000". I'm building 2.1a2 with patch 103679 applied (necessary for makexp_aix and ld_so_aix to be found earlier in the process). Here's some output (it's the same for all modules): building '_tkinter' extension /development/utils/lib/python2.1/config/ld_so_aix cc -bI:/development/utils/lib/python2.1/config/python.exp build/temp.aix-2-000310094C00-2.1/_tkinter.o build/temp.aix-2-000310094C00-2.1/tkappinit.o -L/usr/X11/lib -L/usr/local/lib -ltk8.0 -ltcl8.0 -lld -lX11 -o build/lib.aix-2-000310094C00-2.1/_tkinter.so unable to execute /development/utils/lib/python2.1/config/ld_so_aix: No such file or directory WARNING: building of extension "_tkinter" failed: command '/development/utils/lib/python2.1/config/ld_so_aix' failed with exit status 1 There are TWO things I notice here: 1) ld_so_aix is in Modules, not in /development/utils/lib/python2.1/config. In fact, there is no directory called /development/utils/lib/python2.1. 2) (copied from above) "/development/utils/lib/python2.1/config/ld_so_aix cc" Note it says cc, not cc_r, which is how I configured and ran make. cc_r is darn important, since python will blow up if it's configured with threads but you don't run cc_r. Previously this problem was mentioned in bug #129991, which was closed when I submitted some patches I thought solved the problem...well they were incomplete. I don't know exactly what to patch for the above problems... ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:08 Message: Logged In: YES user_id=6380 Neil, it may make sense to just close this one -- there's little chance we'll ever make progress given the last message from bcollar. ---------------------------------------------------------------------- Comment By: Benjamin Collar (bcollar) Date: 2001-04-04 12:53 Message: Logged In: YES user_id=7170 Hi, I have a little bad news...I'm at another job now, so I don't currently have access to the machines I was building on. I am trying to get permission to use the machine in order to follow up on this bug; I won't find out if I can until next week. Sorry Ben ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-03-21 15:58 Message: Logged In: YES user_id=35752 What are the values of CC and LINKCC in Makefile? ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-03-17 09:17 Message: Logged In: YES user_id=11375 Reassigning to Neil; I don't know why the value of CC changes depending on the version of make. setup.py looks at the CC environment variable; perhaps AIX make doesn't pass its variables to subprocesses correctly? ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-02-28 20:52 Message: Logged In: YES user_id=3066 This relates to the move to distutils, but may have already been fixed. Andrew? ---------------------------------------------------------------------- Comment By: Benjamin Collar (bcollar) Date: 2001-02-22 11:47 Message: I got today's snapshot and ran the same configure and make I've been doing. Lo and behold everything worked GREAT. No problems building modules at all. NOTE: this is using GNU make. Good job Neil! However, when I used AIX's make, there were a few errors while building Modules: ./Modules/ld_so_aix cc -bI:Modules/python.exp build/temp.aix-2-000310094C00-2.1/dlmodule.o -L/usr/local/lib -o build/lib.aix-2-000310094C00-2.1/dl.so ld: 0711-317 ERROR: Undefined symbol: .dlopen ld: 0711-317 ERROR: Undefined symbol: .dlerror ld: 0711-317 ERROR: Undefined symbol: .dlsym ld: 0711-317 ERROR: Undefined symbol: .dlclose ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. ./Modules/ld_so_aix cc -bI:Modules/python.exp build/temp.aix-2-000310094C00-2.1/_cursesmodule.o -L/usr/local/lib -lcurses -ltermcap -o build/lib.aix-2-000310094C00-2.1/_curses.so ld: 0706-006 Cannot find or open library file: -l termcap ld:open(): A file or directory in the path name does not exist. While GNU make during the Module builds used "ld_so_aix cc_r" ... you'll note that AIX's make used cc. Shall we continue with this? Or is it sufficient to say "Please use GNU make if you're on AIX"? ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2001-02-16 01:51 Message: Just reading through the checkins today I fonud that Neil has been fiddling with that code. Perhaps you ought to grab the latest CVS snapshot and rerun the install ?! ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2001-02-16 01:45 Message: Ok, here we go again :-) 1) distutils assumes Python to be already installed on the machine and thus it looks for the AIX tools in the config dir -- unfortunately, setup.py is run before these files are installed, so it cannot find them. Perhaps we ought to add a special case to distutils which allows finding them anyway ?! 2) It seems as if your make doesn't copy the command line variables into the OS environment. The setup.py file contains explicit code which uses the OS environment variables to choose a compiler and linker: # When you run "make CC=altcc" or something similar, you really want # those environment variables passed into the setup.py phase. Here's # a small set of useful ones. compiler = os.environ.get('CC') linker_so = os.environ.get('LDSHARED') Not sure what to do about this. It hints at another problem though: distutils uses the settings from the Makefile per default. It seems that in your case it is having trouble parsing that file. BTW, why does sys.platform return for you ? (There is a switch in distutils.sysconfig which switches on 'aix4' -- could be that this causes the problem) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232637&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:10:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:10:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-415492 ] Compiler generates relative filenames Message-ID: Bugs item #415492, was opened at 2001-04-11 11:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=415492&group_id=5470 Category: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Paul Prescod (prescod) >Assigned to: Nobody/Anonymous (nobody) Summary: Compiler generates relative filenames Initial Comment: Make a file called "test.py" ---- import pack print pack.func.func_code.co_filename ----- Make a directory called "pack". Put a file in it called "__init__.py" with the contents: def func(): pass Now run test.py. It will compile a relative path into these modules. Now you can change to any directory on the system and run test.py and it will return the original relative path. The problem is that the relative path is compiled into the .pyc. It should be an absolute path. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:10 Message: Logged In: YES user_id=6380 Why on earth was this assigned to Paul? He's not going to make progress. Assigning back to nobody. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-13 14:15 Message: Logged In: YES user_id=31392 Just to clarify. The compiler in question is the builtin compiler. It generates absolute path names unless the .py file is in the current working directory. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-13 07:12 Message: Logged In: YES user_id=31392 I'm not clear on what the rules for co_filename are, but it looks like the absolute path is only used for package imports. If you cd into the package directory, run python -c "import __init__", and then later import the package the path name is relative. The compiler package isn't connected to the import mechanism, so there's no way for it to know whether it is compiling a module or a package. I don't think there's a way to do anything better. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=415492&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:12:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:12:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-453515 ] filecmp.dircmp case sensitivity bug Message-ID: Bugs item #453515, was opened at 2001-08-20 14:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Rik Kabel (ving) >Assigned to: Nobody/Anonymous (nobody) Summary: filecmp.dircmp case sensitivity bug Initial Comment: (warning: python newbie submission) Platforms: W2K w/Activestate 2.1.1 (same library source found in 2.0 and 2.11 on NetBSD). filecmp.dircmp performs incorrect filename comparisons when building lists of common and directory-unique files. In particular, it sets a dictionary key to the filename (and value to 1) for each file in the right-hand tree, and looks for matching names (has_key). This fails on case-insensitive platforms when the names are equivalent except for case. A simple workaround would be to use os.path.normcase() around the filenames before storing and comparing, but this is not case-preserving. Case preservation is to be preferred. A case-preserving workaround might use os.path.normcase() for the dictionary entry keys, but store the unchanged filename as the value, and use that value when constructing the list from the dictionary. -- Rik creating tomorrow's legacy systems, today ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:12 Message: Logged In: YES user_id=6380 While this was reported as an ActivePython bug, the problem is the same with filecmp.py in CVS, so I'm unassigning this from Paul (it's not like Paul's track record of responding to bug reports is so great :-). ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 08:34 Message: Logged In: YES user_id=31392 Can you look at this, Paul? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:12:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:12:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-451309 ] don't store traceback objects Message-ID: Bugs item #451309, was opened at 2001-08-15 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 6 Submitted By: Jeremy Hylton (jhylton) >Assigned to: Jeremy Hylton (jhylton) Summary: don't store traceback objects Initial Comment: A TestResult object stores the exceptions raised when tests fail. The only use of these stored tracebacks, it seems, is to print a stack trace when the test run's report is generated. The traceback objects, however, keep pointers to a bunch of objects that might otherwise be garbage collected. I ran into this on Windows, where the traceback was keeping a file object alive. Because the file object was not collected, my tearDown() method could not remove the file. This patch changes unittest to generate the formatted traceback immediately, so that it does not keep tracebacks around any longer than needed. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:12 Message: Logged In: YES user_id=6380 Jeremy, can you propose a patch for this? Steve isn't going to fix it without some help. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 08:27 Message: Logged In: YES user_id=31392 We had a water-cooler conversation about this issue. It was observed that keeping tracebacks alive until the end of a test suite isn't very useful, because any number of objects on the stack may be mutated during the subsequent run of the program. In general, a traceback object should be handed to the debugger right away or processed in some other way. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-16 08:38 Message: Logged In: YES user_id=31392 I think this feature is more trouble than it's worth. If a testrunner wants to capture the actual exception, it could easily override the addError or addFailure method to get the traceback then. The cost of the feature is high, particularly since it is not used by anyone. The effects of preserving tracebacks can be hard to discern, and I expect when it happens it will cause a lot of confusion. In my case, two experienced Python programmers, who are novices with unittest, spent several hours trying to figure out what went wrong. I don't think updating the docs will be particularly helpful, because this situation is somewhat unusual and the current behavior so surprising. ---------------------------------------------------------------------- Comment By: Steve Purcell (purcell) Date: 2001-08-15 14:46 Message: Logged In: YES user_id=21477 Hi Jeremy, This behaviour is actually known and intentional; the dangers are documented as a caveat in the PyUnit docs. The intention was that a test runner (GUI or otherwise) could potentially make the traceback available for inspection when a test fails, to aid in debugging. In your particular case, relying on GC to close the file might have caused problems with following code even if PyUnit didn't store the traceback. Overall I'd prefer to keep storing the tracebacks, especially since they only get stored when tests fail. It would be worth me adding a note about GC interaction to the docs, though. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:14:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:14:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-417796 ] illegal version 1.0.2pre Message-ID: Bugs item #417796, was opened at 2001-04-20 21:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 Category: Distutils Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Garth T Kidd (gtk) Assigned to: Thomas Heller (theller) Summary: illegal version 1.0.2pre Initial Comment: Description: The version in distutils/__init__ doesn't conform to the strict versioning guidelines in distutils/version, resulting in failure when trying to use distutils to install 4Suite (and perhaps other modules). Workaround: Hand-edit distutils/__init__.py to remove "pre". Pointers to vital stuff in code: Lib/distutils/__init__.py: __version__ = "1.0.2pre" Lib/distutils/version.py: A version number consists of two or three dot- separated numeric components, with an optional "pre- release" tag on the end. The pre-release tag consists of the letter 'a' or 'b' followed by a number. Demonstration of problem: Python 2.1 (#1, Apr 18 2001, 10:49:25) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. >>> import distutils >>> import distutils.version >>> v = distutils.version.StrictVersion (distutils.__version__) Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.1/distutils/version.py", line 42, in __init__ self.parse(vstring) File "/usr/local/lib/python2.1/distutils/version.py", line 109, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '1.0.2pre' >>> ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Why is this not closed? ---------------------------------------------------------------------- Comment By: Garth T Kidd (gtk) Date: 2001-07-29 23:15 Message: Logged In: YES user_id=59803 Fixed in distutils 1.20 tagged for release with Python 2.2, meaning 4Suite et al won't install cleanly with any out-of- the-box Python 2.1. :/ If there's ever a 2.1.2, anyone want to tag this for it? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:14:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:14:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Can we close this now that it's been rejected and we've made pow(a,b,c) illegal for float args? ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:35 Message: Logged In: YES user_id=72053 Sounds good to me re breaking float pow. It's doing something really weird in 2.2.1 anyway. pow(3.,500.,7.) returns 2, pow(3,5000,7) returns 2, pow(3.,5000.,7.) returns 4.0, but 3.**5000. returns inf. pow(3.,50000.,7.) returns NaN. The roundoff errors though don't bother me especially more than any other float roundoff errors, e.g. 3.**99+1-3.**99 = 0. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 14:27 Message: Logged In: YES user_id=6380 OK. Sounds like a good plan: break 3-arg pow() for all float args in 2.2a3, and see in anybody screams. I predict dead silence. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:15:27 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:15:27 -0700 Subject: [Python-bugs-list] [ python-Bugs-456420 ] no __methods__ for lists, strings etc. Message-ID: Bugs item #456420, was opened at 2001-08-29 00:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456420&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Detlef Lannert (lannert) Assigned to: Tim Peters (tim_one) Summary: no __methods__ for lists, strings etc. Initial Comment: With Python 2.2a2+ from cvs, [].__methods__ fails with AttributeError: 'list' object has no attribute '__methods__' Same for a string or a dictionary. The Library Reference section on "Special Attributes" (2.1.9 here) still recommends [].__methods__ for finding out about an object's methods. dir([]) returns [] and doesn't list the attributes either. OK, I can use [].__class__.__dict__.keys() -- but it's not very intuitive ... Detlef ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:15 Message: Logged In: YES user_id=6380 Maybe this should be reclassified as a doc bug and assigned to Fred? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-29 15:10 Message: Logged In: YES user_id=31435 Reassigned to me. __members__ and __methods__ were always ugly hacks, and we'd like to get rid of them. I'm making dir() "smarter" again, so that dir([]) will be more informative (see bug 449989). Until then, try using dir(type([])) (more generally, dir (type(object)) instead of the atrocious [].__class__.__dict__.keys(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456420&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:19:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:19:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) >Assigned to: Guido van Rossum (gvanrossum) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:19 Message: Logged In: YES user_id=6380 Reassigning this to me, I don't think Tim can help. Frederic, your explanations are inscrutable. "Py_Main() isn't called, but it is called." "python -i and python -i" does *what*? Who are "the guys"? Sorry, I just don't see the bug report in there. Can you provide a small test program that exhibits the problem? ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:20:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:20:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-221791 ] Error for bad \x escape doesn't mention filename Message-ID: Bugs item #221791, was opened at 2000-11-06 08:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 Category: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Error for bad \x escape doesn't mention filename Initial Comment: Using: GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 I get the following 'error' message: from interscript.languages.interscript_languages import add_translation File "interscript/languages/interscript_languages.py", line 2, in ? from interscript.encoding.utf8 import utf8 ValueError: invalid \x escape in known correct code (i.e. it works on Python 1.5.2). I have examined the function 'parsestr' in 'compile.c', and added debugging prints to find out what is going on. The function _correctly_ processes the string 'utf8' (quotes included), and returns, then the error is generated _without_ entering the routine! This almost certainly must be a bug in egcs-2.91.66. The code in 'parsestr' looks correct to me. It is possible the error can be replicated by downloading and running 'interscript' (without any arguments). Interscript is available at http://interscript.sourceforge.net [Reply to skaller@maxtal.com.au, sorry, I couldn't figure out how to 'log on'] ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:20 Message: Logged In: YES user_id=6380 This one can use a kick in the butt -- it's still unsolved! ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-12-13 08:56 Message: I lost my changes when moving to my new machine. Wasn't happy with them anyway -- changing the exception from ValueError to SyntaxError was purely a hack, to worm its way thru the maze of hacks already there. As long as it's got to be a hack, better a pleasant hack . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-12-13 08:02 Message: Tim, I remember you were looking into this. Any luck? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-11-13 14:51 Message: Just noting that this is a bit of a mess to repair: no "2nd phase" compile-time errors report file names or line numbers unless they're SyntaxErrors. The bad \x escape here is one path thru that code; bad \x escapes in Unicode strings are another; likewise for OverflowError due to "too large" integer literal. A fix is in progress. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-11-06 09:04 Message: The error message is legitimate: in Python 2.0, \x escapes must have exactly two hex characters following, and he uses \x0\x0 in his __init__.py module, which generates the error message. But his bug report is also legitimate: the ValueError doesn't mention the file where this is occurring! I'm changing the bug subject to reflect this -- it has nothing to do with egcs 2.91.66. I'm randomly assigning this to Tim. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:21:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:21:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-445484 ] pickle lacks float('inf') Message-ID: Bugs item #445484, was opened at 2001-07-28 08:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=445484&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 4 Submitted By: Anthony Doggett (anthonydoggett) Assigned to: Tim Peters (tim_one) Summary: pickle lacks float('inf') Initial Comment: Support for float('inf') still appears to be missing in Python 2.1.1 (#1, Jul 28 2001, 14:15:01) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 >>> cPickle.dumps(float('inf'), 1) Traceback (most recent call last): File "", line 1, in ? SystemError: frexp() result out of range >>> pickle.dumps(float('inf'), 1) Traceback (most recent call last): File "", line 1, in ? File "/var/ajd111/python/lib/python2.1/pickle.py", line 943, in dumps Pickler(file, bin).dump(object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 109, in dump self.save(object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 211, in save f(self, object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 273, in save_float self.write(BINFLOAT + pack('>d', object)) SystemError: frexp() result out of range Both structmodule.c and cPickle.c require changes. Surely something like if (x == HUGE_VAL) { /* Inf */ e = 1024; f = 0.0; } else { f = frexp(x, &e); ... and if (e == 1024) x = HUGE_VAL; /* Inf */ else { is all that is required for all IEEE754 machines? (structmodule.c requires similar changes for Float also) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:21 Message: Logged In: YES user_id=6380 Is there a point in keeping this bug report open indefinitely? A "won't fix" would make just as much sense. Maybe add Inf support to PEP 42. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-01 15:41 Message: Logged In: YES user_id=31435 Note that Python has no intentional support for Infs and NaNs anywhere; even that float('inf') doesn't blow up when you do it is a platform accident (it blows up ("invalid literal") on my box). Given that, in the absence of a comprehensive plan for supporting this stuff across the board, and worker bees to implement it, I downgraded the priority. A good plan would refactor the code so that dealing with the platform double and float formats occurs in only one place. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=445484&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:22:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:22:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-443042 ] 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Message-ID: Bugs item #443042, was opened at 2001-07-20 04:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: Thomas Wouters (twouters) Summary: 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Initial Comment: gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 160.490u 10.370s 3:09.17 90.3% 0+0k 0+0io 70442pf+0w yetix@/usr/home/ajung/new/Python-2.2a1(318)% make gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 Env: gcc 2.95.3, Linux 2.4.5 i386 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:22 Message: Logged In: YES user_id=6380 Andreas, is this still a problem in 2.2a2? ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 16:38 Message: Logged In: YES user_id=11084 Compilation works fine after removing HAVE_BROKEN_NICE from config.h - seems to be broken :-) Andreas ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 10:08 Message: Logged In: YES user_id=11084 My system uses glibc 2.1.2. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-07-20 07:33 Message: Logged In: YES user_id=11375 The version of glibc is probably also relevant. Reassigning to Thomas Wouters, as this looks related to the recent nice/getpriority changes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:23:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:23:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-437152 ] compiling source code fails on aix 4.3.1 Message-ID: Bugs item #437152, was opened at 2001-06-28 11:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437152&group_id=5470 Category: Installation Group: Platform-specific Status: Open Resolution: None >Priority: 4 Submitted By: birgit kellner (birgitk) Assigned to: Thomas Wouters (twouters) Summary: compiling source code fails on aix 4.3.1 Initial Comment: python version 2.1, to be installed on an ibm rs/6000 r40, running aix 4.31 (apache 1.3.12). configure runs fine, but make stops with the following error: "fatal error in /usr/lpp/xlC/exe/xlCcode: signal 24 received the error code from the last command is 251" ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:23 Message: Logged In: YES user_id=6380 No new info since 8 weeks. I propose to close this one. ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-07-09 06:57 Message: Logged In: YES user_id=34209 Sorry, but we need *way* more information than this. It looks like an internal bug in the xlC AIX compiler, since it complains about a signal being raised. Does the compiler give any clue what the 'last command' is, the one that returned 'error code 251' ? Any clue what errorcode 251 is supposed to be ? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437152&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:25:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:25:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-435455 ] Python 2.0.1c1 fails to build on RH7.1 Message-ID: Bugs item #435455, was opened at 2001-06-22 06:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435455&group_id=5470 Category: Distutils Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Ole H. Nielsen (ohnielse) Assigned to: Thomas Wouters (twouters) Summary: Python 2.0.1c1 fails to build on RH7.1 Initial Comment: Building Python 2.0.1c1 on a RedHat 7.1 (2.4.2-2 on i586) fails at this point: cd Modules; make OPT="-g -O2 -Wall -Wstrict-prototypes -fPIC" VERSION="2.0" \ prefix="/usr/local" exec_prefix="/usr/local" \ sharedmods make[1]: Entering directory `/scratch/ohnielse/Python-2.0.1/Modules' gcc -fpic -g -O2 -Wall -Wstrict-prototypes -fPIC -I./../Include -I.. -DHAVE_CONFIG_H -c ./bsddbmodule.c ./bsddbmodule.c: In function `newdbhashobject': ./bsddbmodule.c:55: `HASHINFO' undeclared (first use in this function) ./bsddbmodule.c:55: (Each undeclared identifier is reported only once ./bsddbmodule.c:55: for each function it appears in.) ./bsddbmodule.c:55: parse error before `info' ./bsddbmodule.c:60: `info' undeclared (first use in this function) ./bsddbmodule.c:71: warning: implicit declaration of function `dbopen' ./bsddbmodule.c:71: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `newdbbtobject': ./bsddbmodule.c:100: `BTREEINFO' undeclared (first use in this function) ./bsddbmodule.c:100: parse error before `info' ./bsddbmodule.c:105: `info' undeclared (first use in this function) ./bsddbmodule.c:118: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `newdbrnobject': ./bsddbmodule.c:147: `RECNOINFO' undeclared (first use in this function) ./bsddbmodule.c:147: parse error before `info' ./bsddbmodule.c:152: `info' undeclared (first use in this function) ./bsddbmodule.c:164: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `bsddb_dealloc': ./bsddbmodule.c:202: too few arguments to function ./bsddbmodule.c: In function `bsddb_length': ./bsddbmodule.c:232: structure has no member named `seq' ./bsddbmodule.c:233: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c:235: structure has no member named `seq' ./bsddbmodule.c:236: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c:229: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_subscript': ./bsddbmodule.c:265: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:265: too few arguments to function ./bsddbmodule.c: In function `bsddb_ass_sub': ./bsddbmodule.c:307: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:307: too few arguments to function ./bsddbmodule.c:330: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:330: too few arguments to function ./bsddbmodule.c: In function `bsddb_close': ./bsddbmodule.c:357: too few arguments to function ./bsddbmodule.c: In function `bsddb_keys': ./bsddbmodule.c:386: structure has no member named `seq' ./bsddbmodule.c:386: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c:407: structure has no member named `seq' ./bsddbmodule.c:407: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c:376: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_has_key': ./bsddbmodule.c:440: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:440: too few arguments to function ./bsddbmodule.c: In function `bsddb_set_location': ./bsddbmodule.c:466: structure has no member named `seq' ./bsddbmodule.c:466: `R_CURSOR' undeclared (first use in this function) ./bsddbmodule.c:453: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_seq': ./bsddbmodule.c:503: structure has no member named `seq' ./bsddbmodule.c:489: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_next': ./bsddbmodule.c:531: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_previous': ./bsddbmodule.c:536: `R_PREV' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_first': ./bsddbmodule.c:541: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_last': ./bsddbmodule.c:546: `R_LAST' undeclared (first use in this function) make[1]: *** [bsddbmodule.o] Error 1 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:25 Message: Logged In: YES user_id=6380 Can someone see if this is still a problem with current CVS (or even with 2.2a2)? I believe we've added another layer of patchwork around the bsddb compilation in setup.py. Why does Thomas own this item? Thomas, if you don't want it, feel free to unassign it. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-07-10 01:30 Message: Logged In: YES user_id=43607 I have no trouble building the current CVS version on RedHat 7.1. However, when I try the gcc command given in the error message, I get much the same errors. The deciding difference was: setup.py (part of the standard current build process) adds -DHAVE_DB_185_H=1 to the compiler command line. ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-07-09 07:51 Message: Logged In: YES user_id=27232 twouters wrote: > I suspect the problem here is that you don't have the > appropriate -devel RPM installed. I think you need > 'db3-devel', but 'db2-devel', 'db1-devel' or 'db-devel' > might work too. Sorry, no. These RPMs seem to be installed by default on RedHat 7.1: # rpm -qa | grep devel | grep db db1-devel-1.85-5 db2-devel-2.4.14-5 gdbm-devel-1.8.0-5 db3-devel-3.1.17-7 It would be nice if a Python developer could gain access to a RedHat 7.1 machine to sort this problem out :-) ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-07-09 07:06 Message: Logged In: YES user_id=34209 I suspect the problem here is that you don't have the appropriate -devel RPM installed. I think you need 'db3-devel', but 'db2-devel', 'db1-devel' or 'db-devel' might work too. Can you confirm that you have none of those installed ? I think what happens is that distutils can't find an include header to include, so it assumes the DB implementation is included in libc, instead. (Changing catagory to distutils on that assumption.) ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-06-26 14:52 Message: Logged In: YES user_id=27232 loewis wrote: > I have asked you to report things, not to change things. > It is not easy to repeat for me, as I don't have Redhat 7.1. Sorry about the confusion. My report is for RedHat 7.1: 1. Untar the distribution 2.0.1c1 2. ./configure 3. make The errors reported occur. I have changed nothing. I don't know what bsddb is, nor why it's getting compiled. Hopefully, someone knowing Python 2.0.1 and having access to a RedHat 7.1 box could look into the problem. At this point Python building seems broken on RH7.1 :-( ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-06-26 00:02 Message: Logged In: YES user_id=21627 I have asked you to report things, not to change things. It is not easy to repeat for me, as I don't have Redhat 7.1. ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-06-25 15:20 Message: Logged In: YES user_id=27232 loewis wrote: > Please report the following things: > - the line in Setup that you activated to enable > compilation of bsddb > - the exact version of the bsddb RPM package that provides > db.h > - whether or not this packages includes a file db_185.h Sorry, I didn't change ANYTHING ! I was trying a vanilla build on RedHat 7.1 ! Should be easy to repeat... Maybe the build scripts make some incorrect choices on RedHat 7.1 ? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-06-23 13:58 Message: Logged In: YES user_id=21627 Please report the following things: - the line in Setup that you activated to enable compilation of bsddb - the exact version of the bsddb RPM package that provides db.h - whether or not this packages includes a file db_185.h ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435455&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:26:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:26:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-456398 ] strange IRIX test_re/test_sre failure Message-ID: Bugs item #456398, was opened at 2001-08-28 21:56 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456398&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None >Priority: 4 Submitted By: Andrew Dalke (dalke) >Assigned to: Fredrik Lundh (effbot) Summary: strange IRIX test_re/test_sre failure Initial Comment: The test_re and test_sre regression tests cause a core dump with the CVS version of Python. If I run the file directly I don't get the core dump. test_pyclbr test_pyexpat test test_pyexpat skipped -- No module named pyexpat test_quopri test_re make: *** [test] Segmentation fault (core dumped) ./python -E -tt ./Lib/test/regrtest.py -l ^C % % ./python -E -tt ./Lib/test/test_re.py Running tests on re.search and re.match Running tests on re.sub Running tests on symbolic references Running tests on re.subn Running tests on re.split Running tests on re.findall Running tests on re.match Running tests on re.escape Pickling a RegexObject instance Test engine limitations maximum recursion limit exceeded Running re_tests test suite % This is under an IRIX 6.4 machine, which is several years old. Python is compiled with gcc 2.95.2 but using the vendor's assembler. The assembler is also out of date. There were known problems with in 1.5.2 where the optimizer broke the pcre module. So I recompiled _sre.c with "-g". That did not fix the problem. Here's the stack trace from the core file. > 0 mark_save(state = , lo = , hi = ) ["/usr2/people/dalke/cvses/python/dist/src/./Modules/_s re.c":280, 0x100a1e 2c] 1 sre_match(state = 0x7fff1200, pattern = 0x104ec55a, level = 1357) ["/usr2/peo ple/dalke/cvses/python/dist/src/Modules/_sre.c":1053, 0x100a44b4] 2 sre_match(state = 0x7fff1200, pattern = 0x104ec55a, level = 1356) ["/usr2/peo ple/dalke/cvses/python/dist/src/Modules/_sre.c":1057, 0x100a4504] Guessing it's in the "recursion limit" test. I don't know if the problem is in _sre.c or in the IRIX libraries. I don't have access to a newer version of IRIX. I tried to force the core dump to occur without having to go through the whole regression suite. That doesn't work, which is itself suspecious. % ./python -E -tt ./Lib/test/regrtest.py -l test_re test_re 1 test OK. % ./python -E -tt ./Lib/test/regrtest.py -l test_array test_re test_array test_re All 2 tests OK. % ./python -E -tt ./Lib/test/regrtest.py -l test_array test_re test_re test_array test_re test_re All 3 tests OK. % I get the same failures with test_sre. Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456398&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:26:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:26:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-457114 ] Incorporate timeoutsocket.py into core Message-ID: Bugs item #457114, was opened at 2001-08-30 22:48 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457114&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) >Assigned to: Skip Montanaro (montanaro) Summary: Incorporate timeoutsocket.py into core Initial Comment: I was responding to a question on c.l.py earlier about urllib hanging and was reminded of Tim O'Malley's timeoutsocket.py. It's a shim above socket that allows you to set timeouts on any TCP connections. Back in January, Jeff Bauer suggested in c.l.py that it be included in the core. I agree that it provides useful extra functionality beyond the current socket implementation and would like it to be considered for addition to the standard distribution. Here's a pointer: http://www.timo-tasi.org/python/timeoutsocket.py Here's how you use it: import timeoutsocket import httplib timeoutsocket.setDefaultSocketTimeout(20) # at this point any sockets created # will have a 20-second timeout h = httplib.HTTP("www.python.org") Pretty simple, huh? Skip ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:26 Message: Logged In: YES user_id=6380 Skip, want to work on this? If not, please unassign it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-31 06:10 Message: Logged In: YES user_id=6380 I like this idea, but don't think this exact implementation belongs in the standard library. The hacks deployed to "install" the special effect are a bit fragile, e.g. consider "import socket as foo"; and they shouldn't be necessary. When integrated into the standard library, it should probably become a standard feature of the socket object. Note that on Windows, socket.socket is already a shim on top of _socket.socket, so that would be a convenient starting point. Patch anyone? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457114&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:27:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:27:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-456024 ] event synchronization Message-ID: Bugs item #456024, was opened at 2001-08-27 22:56 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456024&group_id=5470 Category: Threads Group: Feature Request >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: event synchronization Initial Comment: It would be nice if the set and clear operations on Event objects atomically returned the old state of the internal flag: old_state = event.set() if old_state: nevermind() else: do_stuff () sets the flag to true and returns true if the flag was already set, otherwise returns false. This avoids the obvious race condition in if event.isSet(): nevermind() else: event.set() do_stuff() Maybe there's a way to accomplish this with Semaphore objects (I haven't figured this thread stuff out yet) but the event interface is more natural for some purposes (i.e. the event represents a lock on a resource). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:27 Message: Logged In: YES user_id=6380 Rejected, for lack of opposition. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-28 19:56 Message: Logged In: YES user_id=31435 I'm opposed to this. Events are very feeble mechanisms, best reserved for dead-simple cases where an event is set once, is never cleared, and it doesn't matter if it's set multiple times (if you find yourself clearing an event, your code is likely wrong). If you want a lock, threading.py already supplies two flavors: if lock.acquire(0): . # we own the lock now . do_stuff() . lock.release() else: . # the lock wasn't available . nevermind() A non-blocking acquire can also be done with a Sempahore, but that's overkill unless the semaphore is counting a pool (more than one) of resources. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456024&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:28:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:28:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-455183 ] Cygwin build fails for 2.2a2 Message-ID: Bugs item #455183, was opened at 2001-08-24 19:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Martin v. Löwis (loewis) Summary: Cygwin build fails for 2.2a2 Initial Comment: The Cygwin build fails at the compile stage with the error message that a working getaddrinfo function is needed, unless the option "--disable-ipv6" is selected. I tried that option (as well as --with-threads=no), and both configure and make ran successfully. I started the interpreter from the Python-2.2a2 directory and successfully imported division and generators from __future__. I ran the interpreter test following the instructions for Cygwin and got this message: 1 test failed: test_strftime 31 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_dbm test_dl test_fork1 test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pty test_pyexpat test_sax test_socket_ssl test_socketserver test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_unicode_file test_winreg test_winsound ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:28:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:28:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-455537 ] module search in import.c Message-ID: Bugs item #455537, was opened at 2001-08-26 10:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455537&group_id=5470 Category: Build Group: Python 2.1.1 >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Armin Steinhoff (arminsteinhoff) >Assigned to: Guido van Rossum (gvanrossum) Summary: module search in import.c Initial Comment: I'm porting 2.1.1 to QNX6 and got the situation that the module 'os' could not be be found with 'import os' After some hacking with DDD .. I found out that the pathes used by the search algorithm of import.c has nothing to do with the directory structure of the UNIX distribution of Python 2.1.1 =:-/ I have installed Python in the root directory and set PYTHONHOME/PYTHONPATH to /Python-2.1.1 -> the path to he library modules is then -> /Python-2.1.1/Lib OK ... that's not a clean place for UNIX freaks :) The search algorithm of import.c is using the following search path sequence: "os.so" -> I don't know why it should make sense to open a shared object with fopen ?? "osmodule.so" "os.py" "os.pyc" "/Python-2.1.1/os.so" ... os.pyc "/Python-2.1.1/lib/python2.1/os.so" ... os.pyc ^^^^^^^^^^^^^^^ who got the idea that this is part of the UNIX tar.gz distribution ?? Also ... there are similar problems with the binaries installed by 'make install' ... Armin a-steinhoff@web.de ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:28 Message: Logged In: YES user_id=6380 Closing this report -- the submitter has what he wants (a clue). ---------------------------------------------------------------------- Comment By: Armin Steinhoff (arminsteinhoff) Date: 2001-09-05 06:52 Message: Logged In: YES user_id=64602 OK ... the directories "lib/python2.1" are not part of the UNIX sources, but they are used in the search sequence. Yes ... your last statement is correct :-) However ... I will look into the 'getpath' module in order to modify the default search path for QNX6 Armin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-31 05:37 Message: Logged In: YES user_id=6380 Ignoring your original message (which I didn't understand) but clued in by your latest followup (which makes sense to me): The Unix and Windows getpath code accommodates this case (running from the build directory) by noticing this and choosing a different default path in that case. Maybe you should do the same in your QNX port. The relevant code for Unix is in Modules/getpath.c (not in import.c, which is one of the reasons why your initial message threw me off). Regarding the search algorithm: it uses fopen() to detect existence of the file. Read the source and it will be clear to you: it has a table of suffixes to try. I don't understand your remark "who got the idea that this is part of the UNIX tar.gz distribution ??" My feeling is that you're jumping to conclusions based on insufficient knowledge, which makes it hard to argue. :-) ---------------------------------------------------------------------- Comment By: Armin Steinhoff (arminsteinhoff) Date: 2001-08-31 01:47 Message: Logged In: YES user_id=64602 Hello Jeremy, The location of the standard Phython libraries are valid for a binary installation ... but not for the structure of the source distribution, that means for the build process (setup.py). For instance os.py is located in $(PYTHONHOME)/Lib and not in ${prefix}/lib/python ! This creates an import error when setup.py will be executed. .... and this is exactly the problem! Armin ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-27 15:20 Message: Logged In: YES user_id=31392 I'm not sure what the complaint is. The man page for Python is quite clear about what PYTHONHOME means: Change the location of the standard Python libraries. By default, the libraries are searched in ${prefix}/lib/python and ${exec_prefix}/lib/python, where ${prefix} and ${exec_prefix} are installation-dependent directories, both defaulting to \fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value replaces both ${prefix} and ${exec_prefix}. To specify different values for these, set $PYTHONHOME to ${prefix}:${exec_prefix}. It sounds like Python is doing exactly what it is documented to do. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455537&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:29:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:29:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-454456 ] int overflow code needs tests Message-ID: Bugs item #454456, was opened at 2001-08-22 21:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454456&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Tim Peters (tim_one) Summary: int overflow code needs tests Initial Comment: The code that implements phase A of PEP 237 is now checked in. It seems to work, but it deserves a test suite. When I had first coded it, there were quite a few surprises when I ran it! I'm looking for a volunteer to create a test that checks the various boundary cases, different optional behaviors, etc. I need to concentrate on type/class unification, so I won't get to this myself. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:29 Message: Logged In: YES user_id=6380 Good enough. Closing this. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-23 15:54 Message: Logged In: YES user_id=31435 I added tests to test_long.py that check for auto-long on overflowing + - * / ** unary_minus divmod and 3-arg pow. That turned up several bugs, but most unrelated to the PEP! I don't intend to do more on this. "various boundary cases" are pretty well covered now, but "different optional behaviors" aren't at all. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454456&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:31:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:31:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-453489 ] Using deiconify() hangs on exit Message-ID: Bugs item #453489, was opened at 2001-08-20 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 Category: Tkinter Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Using deiconify() hangs on exit Initial Comment: If you run the following script, and iconize the window before the after() timer, it'll restore and raise the window as it should, but then you can't exit. You have to kill winoldap with ctrl+alt+del and wait. I ran into this trying to write a portable jabber client using tkinter. This is with 2.1.1 on Windows 98. Does it every time. May be related to bug #216289. from Tkinter import * import sys def foo(): print 'foo' sys.stdout.flush() root.deiconify() print 'bar' sys.stdout.flush() root=Tk() Button(root, text='Quit', command=root.quit).pack() root.after(5000, foo) root.mainloop() ---------------------------------------------------------------------- Comment By: Howard Lightstone (hlightstone) Date: 2001-09-05 11:31 Message: Logged In: YES user_id=66570 Since I was also looking at #216289: Data using pythonw.exe (Taskinfo2000): Handles while running (before quit) 4 : Process 4 PID:FFF6F92D, C:\PYTHON20\PYTHONW.EXE C : Event 1 10 : Event 1 1C : Mutex 17 OLESCMLOCKMUTEX 20 : Event 1 24 : Event 1 -------------------------------------------------------- Handles while running Python.exe (before quit) |Handle||Type| |Refs||Name| 4 : Process 7 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 2 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 ThID:FFF79069, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 38 : Event 1 3C : Event 2 40 : Thread 1 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 44 : Event 1 48 : Event 2 4C : Thread 1 ThID:FFF53539, PID:FFF50719, C:\PYTHON20\PYTHON.EXE ---------------------------------------------------------- Handles AFTER trying to quit |Handle||Type| |Refs||Name| 4 : Process 4 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 1 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 38 : Event 1 3C : Event 1 40 : Thread 2 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE It appears that there is a thread NOT terminating. I just don't know how to go about finding it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 19:39 Message: Logged In: YES user_id=6380 I agree that this is likely the same as #216289. AFAIK it's a Tcl bug and we don't know what to do about it. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-20 15:51 Message: Logged In: NO Interestingly enough, if you add a print statement after the mainloop(), it gets printed, showing the event loop exits properly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:31:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:31:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-454383 ] make test failed in solaris_2.7 with gcc Message-ID: Bugs item #454383, was opened at 2001-08-22 16:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454383&group_id=5470 Category: Build >Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Thiep Duong (duongusa) >Assigned to: A.M. Kuchling (akuchling) Summary: make test failed in solaris_2.7 with gcc Initial Comment: I tried to compile/build configure with no option, make gave no apparent error, but make test failed at the below messages. Any clue what to do next? I am new with Python .... Please help. skipping 'sunaudiodev' extension (up-to-date) running build_scripts not copying /fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Tools/scripts/pydoc (up-to-date) find ./Lib -name '*.py[co]' -print | xargs rm -f PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 39, in ? import random File "/fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Lib/random.py", line 76, in ? from math import log as _log, exp as _exp, pi as _pi, e as _e ImportError: cannot import name log make: [test] Error 1 (ignored) PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 39, in ? import random File "/fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Lib/random.py", line 76, in ? from math import log as _log, exp as _exp, pi as _pi, e as _e ImportError: cannot import name log Bus Error - core dumped make: *** [test] Error 138 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:31 Message: Logged In: YES user_id=6380 It looks like the math module didn't get compiled completely. Possibly the compiler invocation used by setup.py to build shared libraries doesn't work for your platform. Assigning this to Andrew, who knows about such things. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454383&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:32:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:32:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-453489 ] Using deiconify() hangs on exit Message-ID: Bugs item #453489, was opened at 2001-08-20 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 Category: Tkinter >Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Using deiconify() hangs on exit Initial Comment: If you run the following script, and iconize the window before the after() timer, it'll restore and raise the window as it should, but then you can't exit. You have to kill winoldap with ctrl+alt+del and wait. I ran into this trying to write a portable jabber client using tkinter. This is with 2.1.1 on Windows 98. Does it every time. May be related to bug #216289. from Tkinter import * import sys def foo(): print 'foo' sys.stdout.flush() root.deiconify() print 'bar' sys.stdout.flush() root=Tk() Button(root, text='Quit', command=root.quit).pack() root.after(5000, foo) root.mainloop() ---------------------------------------------------------------------- Comment By: Howard Lightstone (hlightstone) Date: 2001-09-05 11:31 Message: Logged In: YES user_id=66570 Since I was also looking at #216289: Data using pythonw.exe (Taskinfo2000): Handles while running (before quit) 4 : Process 4 PID:FFF6F92D, C:\PYTHON20\PYTHONW.EXE C : Event 1 10 : Event 1 1C : Mutex 17 OLESCMLOCKMUTEX 20 : Event 1 24 : Event 1 -------------------------------------------------------- Handles while running Python.exe (before quit) |Handle||Type| |Refs||Name| 4 : Process 7 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 2 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 ThID:FFF79069, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 38 : Event 1 3C : Event 2 40 : Thread 1 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 44 : Event 1 48 : Event 2 4C : Thread 1 ThID:FFF53539, PID:FFF50719, C:\PYTHON20\PYTHON.EXE ---------------------------------------------------------- Handles AFTER trying to quit |Handle||Type| |Refs||Name| 4 : Process 4 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 1 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 38 : Event 1 3C : Event 1 40 : Thread 2 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE It appears that there is a thread NOT terminating. I just don't know how to go about finding it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 19:39 Message: Logged In: YES user_id=6380 I agree that this is likely the same as #216289. AFAIK it's a Tcl bug and we don't know what to do about it. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-20 15:51 Message: Logged In: NO Interestingly enough, if you add a print statement after the mainloop(), it gets printed, showing the event loop exits properly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:32:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:32:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-453489 ] Using deiconify() hangs on exit Message-ID: Bugs item #453489, was opened at 2001-08-20 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 Category: Tkinter Group: Platform-specific Status: Open Resolution: None >Priority: 4 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Using deiconify() hangs on exit Initial Comment: If you run the following script, and iconize the window before the after() timer, it'll restore and raise the window as it should, but then you can't exit. You have to kill winoldap with ctrl+alt+del and wait. I ran into this trying to write a portable jabber client using tkinter. This is with 2.1.1 on Windows 98. Does it every time. May be related to bug #216289. from Tkinter import * import sys def foo(): print 'foo' sys.stdout.flush() root.deiconify() print 'bar' sys.stdout.flush() root=Tk() Button(root, text='Quit', command=root.quit).pack() root.after(5000, foo) root.mainloop() ---------------------------------------------------------------------- Comment By: Howard Lightstone (hlightstone) Date: 2001-09-05 11:31 Message: Logged In: YES user_id=66570 Since I was also looking at #216289: Data using pythonw.exe (Taskinfo2000): Handles while running (before quit) 4 : Process 4 PID:FFF6F92D, C:\PYTHON20\PYTHONW.EXE C : Event 1 10 : Event 1 1C : Mutex 17 OLESCMLOCKMUTEX 20 : Event 1 24 : Event 1 -------------------------------------------------------- Handles while running Python.exe (before quit) |Handle||Type| |Refs||Name| 4 : Process 7 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 2 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 ThID:FFF79069, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 38 : Event 1 3C : Event 2 40 : Thread 1 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE 44 : Event 1 48 : Event 2 4C : Thread 1 ThID:FFF53539, PID:FFF50719, C:\PYTHON20\PYTHON.EXE ---------------------------------------------------------- Handles AFTER trying to quit |Handle||Type| |Refs||Name| 4 : Process 4 PID:FFF50719, C:\PYTHON20\PYTHON.EXE 8 : Console 3 C : Screen Buff 3 10 : Screen Buff 3 18 : Event 1 1C : Event 1 20 : Event 1 24 : Event 1 28 : Mutex 19 OLESCMLOCKMUTEX 2C : Event 1 30 : Event 1 34 : Thread 1 38 : Event 1 3C : Event 1 40 : Thread 2 ThID:FFF52B8D, PID:FFF50719, C:\PYTHON20\PYTHON.EXE It appears that there is a thread NOT terminating. I just don't know how to go about finding it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 19:39 Message: Logged In: YES user_id=6380 I agree that this is likely the same as #216289. AFAIK it's a Tcl bug and we don't know what to do about it. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-20 15:51 Message: Logged In: NO Interestingly enough, if you add a print statement after the mainloop(), it gets printed, showing the event loop exits properly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453489&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:33:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:33:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-451636 ] linuxaudiodev caused machine hangup Message-ID: Bugs item #451636, was opened at 2001-08-16 10:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451636&group_id=5470 Category: Build Group: Python 2.1.1 >Status: Closed >Resolution: Works For Me Priority: 4 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: linuxaudiodev caused machine hangup Initial Comment: OS and Python versions: Linux turb 2.2.17-8enterprise #1 SMP Fri Nov 17 16:02:20 EST 2000 i686 unknown Python 2.1.1 (#1, Aug 15 2001, 16:39:55) [GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2 In following the standard procedure: ./configure make make test our RedHat machine locked up when testing linuxaudiodev. The speaker on the machine was uttering nonsense repeatedly. We had to reboot the machine and run fsck to clear things up. Thanks, Gerry Wiener National Center for Atmospheric Research gerry@ucar.edu ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:33 Message: Logged In: YES user_id=6380 Closing as Irreproducible. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-16 13:16 Message: Logged In: NO I would look into this further, but unfortunately (or fortunately depending on your point of view) the machine in question is being used operationally for turbulence forecasting. We're using Python to glue the system together. If the machine is down for routine maintenance, I'll check into this problem. Strangely enough, there's at least one person one reads README files :-) Gerry Wiener gerry@ucar.edu ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-16 12:52 Message: Logged In: YES user_id=6380 It might be more productive to find out why it didn't work as advertised. I've only heard reports of one kind of failure for the linuxaudiodev module: with some hardware/driver combinations it plays the first second or so of the sound file and then stops with an exception. The failure you are experiencing is different. Until we've figured out what went wrong on your box, I see no reason to do either of the things you propose. (Besides, nobody reads README files. :-) As a workaround, su root followed by chmod 0 /dev/audio does wonders. :-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-16 12:37 Message: Logged In: NO Our version of Red Hat was factory installed at Dell on a Dell PC. Admittedly there may be a problem with how the OS was configured or with the sound card. Still, I would think "make test" would be more user friendly if: 1. Testing linuxaudiodev be optional -- perhaps make test_optional. 2. Warnings be provided with regard to make test in the README file, i.e., some users have experienced system crashes when using make test owing to problems with linuxaudiodev. Note that we typically are not interested in the use of the sound cards on our systems -- our systems are generally used for running scientific algorithms. Gerry Wiener gerry@ucar.edu ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-16 12:35 Message: Logged In: NO Our version of Red Hat was factory installed at Dell on a Dell PC. Admittedly there may be a problem with how the OS was configured or with the sound card. Still, I would think "make test" would be more user friendly if: 1. Testing linuxaudiodev be optional -- perhaps make test_optional. 2. Warnings be provided with regard to make test in the README file, i.e., some users have experienced system crashes when using make test owing to problems with linuxaudiodev. Note that we typically are not interested in the use of the sound cards on our systems -- our systems are generally used for running scientific algorithms. Gerry Wiener gerry@ucar.edu ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-16 11:33 Message: Logged In: YES user_id=21627 Why do you think this is a Python bug? Python was acessing the hardware of your computer through the official interfaces that your operating system offers for that. Unless you can demonstrate that it did wrong doing so, I'll assume that either your machine is misconfigured, or the sound drivers of your system are broken. In that case, you best disable sound support, since it won't work anyways. Since the specific test works without problems on any other Linux system, I propose to close this bug as "Works for me". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451636&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:34:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:34:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-443783 ] Cygwin32 builds threads, but they hang Message-ID: Bugs item #443783, was opened at 2001-07-23 05:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 Category: Windows Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Jeff Epler (jepler) >Assigned to: Tim Peters (tim_one) Summary: Cygwin32 builds threads, but they hang Initial Comment: Recent cygwin32 install. recent descr-branch checkout. Windows 98 system. Python compiles with thread support. However, 'test_asynchat' and 'test_thread*' hang. Workaround: configure --without-threads ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:34 Message: Logged In: YES user_id=6380 Let's either close the bug report as Not A Bug or try to fix threads in Cygwin. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-07-23 14:03 Message: Logged In: YES user_id=31435 The README file already says Cygwin has to be built via configure --with-threads=no This has nothing to do with descr-branch. Unassigned this bug, pending a Cygwin expert to deal with it. Jeff, please read the README file before rediscovering all the other things already known not to work . ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:36:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:36:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) >Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:36:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:36:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-410993 ] linuxaudiodev fails during "make test". Message-ID: Bugs item #410993, was opened at 2001-03-24 02:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410993&group_id=5470 Category: Python Library Group: Platform-specific Status: Open Resolution: Accepted Priority: 4 Submitted By: Sean Reifschneider (jafo) Assigned to: Charles G Waldman (cgw) >Summary: linuxaudiodev fails during "make test". Initial Comment: Picked up 2.1b2 and did "./configure" and "make test" on a RedHat 7.0-based system: test test_linuxaudiodev crashed -- linuxaudiodev.error: (11, 'Resource temporarily unavailable') Was running build as root, and "mpg123" runs successfully before and after. This is on a ThinkPad 240 with esssolo1 driver with 2.2.18 kernel. Sean ---------------------------------------------------------------------- >Comment By: Charles G Waldman (cgw) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=7151 I've been out of town and somewhat out of the loop. But I'm back now. I will look into this over the weekend. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:56 Message: Logged In: YES user_id=6380 Charles, are you still interested in tackling this bug? If not, let us know! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-10 21:27 Message: Logged In: YES user_id=6380 We've gone back and forth over this one. It seems to happen for certain drivers for certain audio cards -- the problem has disappeared for most folks, but still works for some hardware (e.g. some Dell laptops running Mandrake). I've assigned this to Charles Waldman since he seems to know this area; he commented in python-dev that the initialization order is invalid. Charles if you still feel you won't touch this module (because you'd rather give us a new module that does the right thing), please close it as Won't Fix -- that's what I almost did until I remembered your interest. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-11 09:36 Message: Logged In: YES user_id=6380 I think you misread his comment. He wasn't mpg123 *during* the test, he ran it before and after the test to verify that in fact his audio was in good working order. But, I do suggest to him to try the CVS version, which is one (relevant) fix ahead of 2.1b2. That version passes the test for me, but I don't hear a thing, so I'm not sure what's going on... ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-11 07:19 Message: Logged In: YES user_id=31392 I think we should report this failure as "test skipped." I think it would be essentially correct: The test was skipped because the device was in use. It's not a crash. Not sure how this test is affected by the recent changes to the module to handle EAGAIN. Sean or Guido-- can you try it with the updated module? My Linux audio config is screwed up. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410993&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:38:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:38:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-433775 ] module build dir first in test import Message-ID: Bugs item #433775, was opened at 2001-06-16 10:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433775&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) >Assigned to: A.M. Kuchling (akuchling) Summary: module build dir first in test import Initial Comment: This problem was found on a Linux (RedHat 7.1) system, but applies to all Unix systems. In the step "python setup.py build", after a shared module is built, setup checks whether it can import the module. During this test, the build directory should be at the beginning of sys.path to make sure you get the module that was actually built. Currently, the build directory is at the end. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433775&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:37:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:37:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-435446 ] Python.h not found while building extent Message-ID: Bugs item #435446, was opened at 2001-06-22 05:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435446&group_id=5470 Category: Extension Modules Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Gilles Civario (gcivario) Assigned to: Nobody/Anonymous (nobody) Summary: Python.h not found while building extent Initial Comment: I've got an extention module which installation was simple whith python1.5.2 With python2.1, an error occure : $ make -f Makefile.pre.in boot $ make static cc -O -I/luna/civario/prodtmp/include/python2.1 -I/luna/civario/prodtmp/include/python2.1 -DHAVE_CONFIG_H -c config.c cc -O -DSunOS -DHAVE_CONFIG_H -I../../SUNTOOL/sources -L../../SUNTOOL/Solaris/bin -lsuntool -lF77 -lsunmath -lM77 -lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai -lfmaxvai -lfsu -lsunmath -lm -c ././../../SUNTOOL/sources/lcmmodule.c -o ./lcmmodule.o "././../../SUNTOOL/sources/lcmp.h", line 40: cannot find include file: "Python.h" cc: acomp failed for ././../../SUNTOOL/sources/lcmmodule.c *** Error code 2 make: Fatal error: Command failed for target `lcmmodule.o' The Setup file look so : -----8<-------------------------------------------------------------- PLATFORM=Solaris MACH=SunOS F7LIBS= -lF77 -lsunmath -lM77 -lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai -lfmaxvai -lfsu -lsunmath -lm F9LIBS= -lF77 -lsunmath -lM77 -lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai -lfmaxvai -lfsu -lsunmath -lm LCM_IMPORT= LIBAUT = bin/libdragon.a MYLIBS= -L../../SUNTOOL/$(PLATFORM)/bin -lsuntool FLAGS= -O $(LCM_IMPORT) -D$(MACH) -DHAVE_CONFIG_H -I../../SUNTOOL/sources lcm ../../SUNTOOL/sources/lcmmodule.c $(FLAGS) $(MYLIBS) $(F7LIBS) sunset ../sources/sunsetmodule.c $(FLAGS) $(LIBAUT) $(MYLIBS) $(F7LIBS) -----8<-------------------------------------------------------------- Finaly, I found a workarround by changing the PY_CFLAGS in CFLAGS in the Makefile : -----8<-------------------------------------------------------------- # Rules appended by makedepend ./lcmmodule.o: $(srcdir)/./../../SUNTOOL/sources/lcmmodule.c; $(CC) $(PY_CFLAGS) $(FLAGS) $(MYLIBS) $(F7LIBS) -c $(srcdir)/./../../SUNTOOL/sources/lcmmodule.c -o ./lcmmodule.o ./lcmmodule$(SO): ./lcmmodule.o; $(LDSHARED) ./lcmmodule.o $(FLAGS) $(MYLIBS) $(F7LIBS) -o ./lcmmodule$(SO) ./sunsetmodule.o: $(srcdir)/./../sources/sunsetmodule.c; $(CC) $(PY_CFLAGS) $(FLAGS) $(LIBAUT) $(MYLIBS) $(F7LIBS) -c $(srcdir)/./../sources/sunsetmodule.c -o ./sunsetmodule.o ./sunsetmodule$(SO): ./sunsetmodule.o; $(LDSHARED) ./sunsetmodule.o $(FLAGS) $(LIBAUT) $(MYLIBS) $(F7LIBS) -o ./sunsetmodule$(SO) -----8<-------------------------------------------------------------- Should I change my Setup file, or is it a bug ? $ uname -a SunOS saturne 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-60 $ python Python 2.1 (#1, Jun 21 2001, 16:05:32) [C] on sunos5 Type "copyright", "credits" or "license" for more information. Gilles. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:37 Message: Logged In: YES user_id=6380 I recommend to switch to using distutils. Closing as "Won't fix" - we're not supporting Makefile.pre.in any more. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-06-23 13:50 Message: Logged In: YES user_id=21627 That seems to be a bug in Makefile.pre.in. As a work-around, I recommend to put *shared* as the first line of your Setup file; that will give a dynamically-loadable extension module. As for the nature of the bug: It appears that PY_CFLAGS is not set in the generated Makefile. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435446&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:39:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:39:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-407783 ] urllib2: AbstractHTTPHandler limits flexible client implemen Message-ID: Bugs item #407783, was opened at 2001-03-11 16:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Postponed Priority: 4 Submitted By: Bill Bumgarner (bbum) >Assigned to: Jeremy Hylton (jhylton) Summary: urllib2: AbstractHTTPHandler limits flexible client implemen Initial Comment: The implementation of the do_open() method on the AbstractHTTPHandler class contains a couple of "features" that could be considered to be "bugs". In any case, each time I have wanted to use urllib2 for relatively straightforward development of an HTTP client, I have had to effectively replace the HTTPHandler with one that reimplements do_open() (or http_open() in 2.0). Maybe my usage is not the norm-- in any case, the more information, the better... Specifics (all names in context of Python 2.1): - AbstractHTTPHandler does not allow for anything but GET or POST requests. GET is the default and POST happens anytime the request object contains data to be passed to the server. This limitation is the only thing that stands in the way of using the AbstractHTTPHandler *directly* to implement, say, a WebDAV client or to do something like a site sucker that uses the HEAD method to determine if content has changed. - [this is likely a bug] the method will throw an exception if *any* response is received from the server other than 200. However, HTTP defines that all 2XX responses should be treated as successful. In any case, there are *a lot* of contexts within which a non-200 response may be treated as a 'success' of some sort or another. Regardless, it is really outside of the scope of the AbstractHTTPHandler's implementation to make the success/failure decision-- it should simply return the same thing regardless of the response status. - [a bug?] Whenever an exception is raised (a non-200 code is received), the status code and reason (as provided by the server) are both lost. I see that moshez has been primarily responsible for recent changes surrounding this code. I would be happy to contribute to the evolution of the code; please feel free to contact me directly. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:07 Message: Logged In: YES user_id=6380 Unassigning from Moshe -- he doesn't seem to have time (Moshe, if you're still interested, just change the owner field back to you). ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-04-09 07:02 Message: Logged In: YES user_id=11645 I'm formally postponing it until the 2.1 release comes out -- clearly none of this can be considered a bug fix. ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-19 16:37 Message: Logged In: YES user_id=103811 OK-- I can understand that logic (close to beta, etc). Given the prominence of Python in the WebDav community combined with the increasing use of 2xx (and 1xx) codes, it would be extremely useful to include-- at the least-- examples of handling such via the urllib2 modules. Beyond that, it would be quite helpful to the developers to expend some amount of engineering effort such that handling 2xx response codes doesn't require __getattr__ trickery! Similarly, breaking out the HTTP raw connection setup from the method that actually composes and sends the HTTP request would be helpful in that it would greatly reduce the amount of code that has to be duplicated when subclassing the handler to customize handling of 2xx or when specifying methods other than GET/POST. I.e. most developers will be confused to the point of being overwhelmed if "how do I customize responses such that they don't raise" or "how do I send an OPTIONS or HEAD request" requires figuring out how to deal with setting up and sending a request via the much-lower-level-than-urllib2 HTTP API. ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-03-18 01:22 Message: Logged In: YES user_id=11645 None of these can really be classified as "bugs" rather then functionality enhancement requests, and this is something I'm not sure I want to do this close to the second beta. BTW, one thing I'm sure I *don't* want to change -- handling of 20x codes. If you want to handle 201/206/whatever, then just handle them. With some __getattr__ trickery, you can have a class that handles all http_error_20x errors, so this is *easy* for 3rd party urllib2 extensions to add. Regarding explicitly determining the command: just put the command inside the request object, and use it in your own HTTPHandler/HTTPSHandler. This may be done in the next version of urllib2 (for 2.2). At that time I might also add the feature that other encodings (not just application/x-www-form-urlencoded, but also multipart/form-data) will be supported. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-03-16 10:43 Message: Logged In: YES user_id=31392 I haven't had any spare cycles to devote to urllib2 this year. Perhaps Moshe can be of more help in the near term. Following the 2.1 release, I may have more time. I never used urllib2 it a situation that produced anything other than vanilla responses -- 200, 401, etc. I'm not to surprised to hear that there are problems with 2XX cases. Can you post some examples of the sorts of things you want to do? It sounds reasonable in the abstract, but some code would help. If not in this patch archive, perhaps on comp.lang.python? ---------------------------------------------------------------------- Comment By: Bill Bumgarner (bbum) Date: 2001-03-11 19:59 Message: Logged In: YES user_id=103811 I realized that the exception throw behaviour is more fundamental to the underlying implementation than may have been indicated in the above description. In particular, throwing an HTTP exception when handling a 401 is key to making the various Authentication Handlers work. I still feel that the behaviour should be normalized across all requests such that the callee is responsible for determining error conditions or, at the lest, has access to the same data in a relatively similar format upon success or failure. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=407783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:45:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:45:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-443042 ] 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Message-ID: Bugs item #443042, was opened at 2001-07-20 04:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: Thomas Wouters (twouters) Summary: 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Initial Comment: gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 160.490u 10.370s 3:09.17 90.3% 0+0k 0+0io 70442pf+0w yetix@/usr/home/ajung/new/Python-2.2a1(318)% make gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 Env: gcc 2.95.3, Linux 2.4.5 i386 ---------------------------------------------------------------------- >Comment By: Andreas Jung (ajung) Date: 2001-09-05 11:45 Message: Logged In: YES user_id=11084 Works now in 2.2a2. Andreas ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:22 Message: Logged In: YES user_id=6380 Andreas, is this still a problem in 2.2a2? ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 16:38 Message: Logged In: YES user_id=11084 Compilation works fine after removing HAVE_BROKEN_NICE from config.h - seems to be broken :-) Andreas ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 10:08 Message: Logged In: YES user_id=11084 My system uses glibc 2.1.2. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-07-20 07:33 Message: Logged In: YES user_id=11375 The version of glibc is probably also relevant. Reassigning to Thomas Wouters, as this looks related to the recent nice/getpriority changes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:48:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:48:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-458835 ] SSL support in httplib causes exception Message-ID: Bugs item #458835, was opened at 2001-09-05 11:48 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458835&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL support in httplib causes exception Initial Comment: in class 'FakeSocket', method 'makefile' line 593: except socket.sslerror,msg: doesn't work as the socketmodule.c code raises socket.error not socket.sslerror; perhaps: except (socket.error,socket.sslerror), msg: or except socket.error, msg: ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458835&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:55:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:55:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-443783 ] Cygwin32 builds threads, but they hang Message-ID: Bugs item #443783, was opened at 2001-07-23 05:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 Category: Windows Group: Platform-specific Status: Open Resolution: None >Priority: 4 Submitted By: Jeff Epler (jepler) >Assigned to: Nobody/Anonymous (nobody) Summary: Cygwin32 builds threads, but they hang Initial Comment: Recent cygwin32 install. recent descr-branch checkout. Windows 98 system. Python compiles with thread support. However, 'test_asynchat' and 'test_thread*' hang. Workaround: configure --without-threads ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 11:55 Message: Logged In: YES user_id=31435 It is a bug, but assigning it to me was futile. Unassigned again but reduced priority. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:34 Message: Logged In: YES user_id=6380 Let's either close the bug report as Not A Bug or try to fix threads in Cygwin. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-07-23 14:03 Message: Logged In: YES user_id=31435 The README file already says Cygwin has to be built via configure --with-threads=no This has nothing to do with descr-branch. Unassigned this bug, pending a Cygwin expert to deal with it. Jeff, please read the README file before rediscovering all the other things already known not to work . ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:58:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:58:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-414228 ] Wrong PYTHONPATH in Makefile Message-ID: Bugs item #414228, was opened at 2001-04-06 00:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=414228&group_id=5470 Category: Build Group: Irreproducible >Status: Closed Resolution: Works For Me Priority: 2 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Wrong PYTHONPATH in Makefile Initial Comment: The build process stopped with error in target sharemods PYTHONPATH= ./python ./setup.py build 'import site' failed; use -v for traceback Traceback (most recent call last): File "./setup.py", line 9, in ? import sys, os, getopt ImportError: No module named os *** Error code 1 make: Fatal error: Command failed for target `sharedmods' This is cured with changing the Makefile (inserting ./Lib) # Build the shared modules sharedmods: $(PYTHON) PYTHONPATH=./Lib ./$(PYTHON) $(srcdir)/setup.py build Python: Python-2.1b2a System: SunOS 5.7 Generic sun4u sparc SUNW,Ultra-60 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:58 Message: Logged In: YES user_id=6380 This should be fixed in 2.2 by the -E option. Try 2.2a2 or later. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-10 13:05 Message: Logged In: YES user_id=6380 Have you set PYTHONHOME in the environment? That could cause this. Lowering the priority since, as Neil says, this should not be required. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-04-10 09:15 Message: Logged In: YES user_id=35752 Setting PYTHONPATH should not be required. Modules/getpath must be getting confused. I have no idea why. The output from ./python -c "import sys; print sys.path" might be helpful. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=414228&group_id=5470 From noreply@sourceforge.net Wed Sep 5 19:59:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 11:59:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-413980 ] core dump with regrtest.py on SGI Message-ID: Bugs item #413980, was opened at 2001-04-05 05:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=413980&group_id=5470 Category: None >Group: Platform-specific >Status: Closed >Resolution: Wont Fix Priority: 2 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: core dump with regrtest.py on SGI Initial Comment: the 'make test' part of the installation on SGI (IRIX 6.5, 64 bits) ends with the following output: running build_scripts not copying /tmp_mnt/home/ibiology1/laurent/download/Python-2.1b2a/Tools/scripts/pydoc (up-to-date) find ./Lib -name '*.py[co]' -print | xargs rm -f PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l sh[4]: 1754889 Bus error(coredump) PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l sh: 1756018 Bus error(coredump) *** Error code 138 Laurent ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-10 13:08 Message: Logged In: YES user_id=6380 Lowering the priority -- as Tim said, it's likely an optimizer bug anyway, so I see no reason (for us :-) to lose much sleep over it. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-05 09:14 Message: Logged In: YES user_id=31435 The first thing to try on an SGI box is to recompile Python with optimization turned off, and see whether that makes the problem go away (historically, the bulk of "Python problems" on SGI turn out to be compiler optimization bugs). So try that, and see whether the problem goes away. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=413980&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:00:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:00:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-443783 ] Cygwin32 builds threads, but they hang Message-ID: Bugs item #443783, was opened at 2001-07-23 05:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 Category: Windows >Group: 3rd Party >Status: Closed >Resolution: Wont Fix Priority: 4 Submitted By: Jeff Epler (jepler) >Assigned to: Tim Peters (tim_one) Summary: Cygwin32 builds threads, but they hang Initial Comment: Recent cygwin32 install. recent descr-branch checkout. Windows 98 system. Python compiles with thread support. However, 'test_asynchat' and 'test_thread*' hang. Workaround: configure --without-threads ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:00 Message: Logged In: YES user_id=31435 On 2nd thought, closed as 3rd-Party and WontFix. From what I understood of what Jason said, the thread problems were due to Cygwin, not Python. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 11:55 Message: Logged In: YES user_id=31435 It is a bug, but assigning it to me was futile. Unassigned again but reduced priority. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:34 Message: Logged In: YES user_id=6380 Let's either close the bug report as Not A Bug or try to fix threads in Cygwin. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-07-23 14:03 Message: Logged In: YES user_id=31435 The README file already says Cygwin has to be built via configure --with-threads=no This has nothing to do with descr-branch. Unassigned this bug, pending a Cygwin expert to deal with it. Jeff, please read the README file before rediscovering all the other things already known not to work . ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443783&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:00:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:00:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-417796 ] illegal version 1.0.2pre Message-ID: Bugs item #417796, was opened at 2001-04-20 21:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 Category: Distutils Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Garth T Kidd (gtk) Assigned to: Thomas Heller (theller) Summary: illegal version 1.0.2pre Initial Comment: Description: The version in distutils/__init__ doesn't conform to the strict versioning guidelines in distutils/version, resulting in failure when trying to use distutils to install 4Suite (and perhaps other modules). Workaround: Hand-edit distutils/__init__.py to remove "pre". Pointers to vital stuff in code: Lib/distutils/__init__.py: __version__ = "1.0.2pre" Lib/distutils/version.py: A version number consists of two or three dot- separated numeric components, with an optional "pre- release" tag on the end. The pre-release tag consists of the letter 'a' or 'b' followed by a number. Demonstration of problem: Python 2.1 (#1, Apr 18 2001, 10:49:25) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. >>> import distutils >>> import distutils.version >>> v = distutils.version.StrictVersion (distutils.__version__) Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.1/distutils/version.py", line 42, in __init__ self.parse(vstring) File "/usr/local/lib/python2.1/distutils/version.py", line 109, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '1.0.2pre' >>> ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2001-09-05 12:00 Message: Logged In: YES user_id=11105 I didn't close it because it should have been fixed in Python 2.1.1, just in case there will be a 2.1.2 release, where it should be fixed. Shall I close it? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Why is this not closed? ---------------------------------------------------------------------- Comment By: Garth T Kidd (gtk) Date: 2001-07-29 23:15 Message: Logged In: YES user_id=59803 Fixed in distutils 1.20 tagged for release with Python 2.2, meaning 4Suite et al won't install cleanly with any out-of- the-box Python 2.1. :/ If there's ever a 2.1.2, anyone want to tag this for it? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:04:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:04:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:05:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:05:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-451285 ] distutils ignores environment variables Message-ID: Bugs item #451285, was opened at 2001-08-15 12:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451285&group_id=5470 Category: Distutils Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) >Assigned to: A.M. Kuchling (akuchling) Summary: distutils ignores environment variables Initial Comment: Visual C++ 6.0 sets up environment variables for use by command-line users -- MSDEVDIR, INCLUDE, LIB. It also provides VCVARS32.BAT to set these environment variables. They specify where to find cl.exe and its header files and libraries. distutils ignores those in favor of the registry. I think distutils should honor the environment variables if they are set. In my case, the registry was pointing to an old, removed install of VC. I later installed a new version in a new location, but that install did not modify the registry. ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2001-09-05 12:05 Message: Logged In: YES user_id=11105 I'm unsure what to do. On one hand, this request makes sense, on the other hand, environment vars are IMO much more fragile than registry entries. I'll assign this to the current distutils maintainer to decide what to do. Or should it be marked as feature request? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-15 12:49 Message: Logged In: YES user_id=31435 Jeremy, do you know how to run regedit? It's a GUI registry browser. Do Start -> Run and type "regedit" (no quotes) then click OK. I want you to navigate to two places: HKEY_LOCAL_MACHINE\ Software\ Microsoft\ Devstudio\ 6.0\ Build System\ and exactly the same except starting at HKEY_CURRENT_USER instead. My *bet* is that you're going to find that path in both places, but that under HKEY_LOCAL_MACHINE it's pointing to a wrong place. This would be a side-effect of not having properly uninstalled your previous MSVC. If that's all true, select the DevStudio node under HKEY_LOCAL_MACHINE and then do Edit->Delete. This will get rid of the obsolete registry setting. Close regedit then. disutils *should* look under HKEY_CURRENT_USER before looking under HKEY_LOCAL_MACHINE, because per-user settings are suppused to take precedence over per-machine settings, and especially under Win2K. That appears to be a repeated buglet in msvccompiler.py. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451285&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:05:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:05:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-458839 ] SSL errno wrong under Windows Message-ID: Bugs item #458839, was opened at 2001-09-05 12:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458839&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL errno wrong under Windows Initial Comment: in socketmodule.c, routine SSL_SSLread(), lines 2348 and 2355: return PyErr_SetFromErrno(PySocket_Error); does not work under Windows; as elsewhere: return PySocket_Err(); should be used instead. In addition, if SSL_read() returns SSL_ERROR_SYSCALL, errno will not be set correctly if an EOF is the cause of this return code. Add something like: case SSL_ERROR_SYSCALL: if (ERR_get_error() == 0 && count == 0) { v = Py_BuildValue("(is)", -1, "Protocol violation: unexpected EOF"); if (v != NULL) { PyErr_SetObject(PySocket_Error, v); Py_DECREF(v); } return NULL; } else { return PySocket_Err(); } break; ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458839&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:05:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:05:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-417779 ] Fails to build on RH 5.1 Message-ID: Bugs item #417779, was opened at 2001-04-20 18:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417779&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Fails to build on RH 5.1 Initial Comment: Im trying to build and install on RH 5.1 i get the following errors. gcc -c -g -O2 -Wall -Wstrict-prototypes -I. - I./Include -DHAVE_CONFIG_H -o Objects/fileobject.o Objects/fileobject.c Objects/fileobject.c: In function `_portable_fseek': Objects/fileobject.c:229: warning: implicit declaration of function `fseeko' gcc -g -O2 -Wall -Wstrict-prototypes -I. -I./Include - DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c:4032: sys/statvfs.h: No such file or directory ./Modules/posixmodule.c:4081: sys/statvfs.h: No such file or directory Am i missing something? Regards Andrew ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:05 Message: Logged In: YES user_id=6380 Please try again with current CVS, or with the 2.2a3 release that will be out in a few days. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417779&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:06:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:06:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-424002 ] sys.executable not reliable Message-ID: Bugs item #424002, was opened at 2001-05-14 11:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=424002&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Evan Simpson (evansimpson) >Assigned to: Guido van Rossum (gvanrossum) Summary: sys.executable not reliable Initial Comment: I created a file test.py containing: #!/usr/local/bin/python2.1 import sys print sys.executable When I run it using the command line "/usr/local/bin/python2.1 test.py", it prints the full path to the executable. When I run it from "/usr/local", using "bin/python2.1 test.py", then I get "bin/python2.1". When I run it using "./test.py", I get a blank string. Under version 1.5.2, all of these yielded the full path to the executable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:06 Message: Logged In: YES user_id=6380 Curious. I'll look into this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=424002&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:13:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:13:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-427073 ] DLINCLDIR defined incorrectly Message-ID: Bugs item #427073, was opened at 2001-05-24 14:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=427073&group_id=5470 Category: Build Group: None >Status: Closed >Resolution: Fixed Priority: 2 Submitted By: Skip Montanaro (montanaro) >Assigned to: Guido van Rossum (gvanrossum) Summary: DLINCLDIR defined incorrectly Initial Comment: On my Linux system (vanilla Mandrake 8.0), .../Python/Makefile winds up defining DLINCLDIR as DLINCLDIR= / While it should should be fairly innocuous, it can't possibly be correct. If it's going to default to something, I suggest it default to "." instead (see configure.in). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:13 Message: Logged In: YES user_id=6380 OK, I've changed the default to ".", just so I can close the bug. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=427073&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:20:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:20:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:20 Message: Logged In: YES user_id=31435 That's up to you -- I closed it before, and you opened it again. Since I'm not clear on why it was reopened, assigning back to you. Disallowing 3-arg pow for floats didn't preclude the possibility of giving 3-arg integer pow with negative 2nd arg a "modular inverse" meaning (which is the substance of the feature request, not float behavior), and I've got nothing new to say about that. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Can we close this now that it's been rejected and we've made pow(a,b,c) illegal for float args? ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:35 Message: Logged In: YES user_id=72053 Sounds good to me re breaking float pow. It's doing something really weird in 2.2.1 anyway. pow(3.,500.,7.) returns 2, pow(3,5000,7) returns 2, pow(3.,5000.,7.) returns 4.0, but 3.**5000. returns inf. pow(3.,50000.,7.) returns NaN. The roundoff errors though don't bother me especially more than any other float roundoff errors, e.g. 3.**99+1-3.**99 = 0. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 14:27 Message: Logged In: YES user_id=6380 OK. Sounds like a good plan: break 3-arg pow() for all float args in 2.2a3, and see in anybody screams. I predict dead silence. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:26:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:26:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-456420 ] no __methods__ for lists, strings etc. Message-ID: Bugs item #456420, was opened at 2001-08-29 00:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456420&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Detlef Lannert (lannert) Assigned to: Tim Peters (tim_one) Summary: no __methods__ for lists, strings etc. Initial Comment: With Python 2.2a2+ from cvs, [].__methods__ fails with AttributeError: 'list' object has no attribute '__methods__' Same for a string or a dictionary. The Library Reference section on "Special Attributes" (2.1.9 here) still recommends [].__methods__ for finding out about an object's methods. dir([]) returns [] and doesn't list the attributes either. OK, I can use [].__class__.__dict__.keys() -- but it's not very intuitive ... Detlef ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:26 Message: Logged In: YES user_id=31435 I want more feedback from 2.2a3 first. If __methods__ and __members__ are going to stay dead, then the docs need to be changed, but I'm not yet sure enough that they're going to stay dead. This particular report seemed driven to try them because of 2.2a2 dir() behavior, so I *hope* the 2.2a3 dir() changes will be enough that we don't see another of these. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:15 Message: Logged In: YES user_id=6380 Maybe this should be reclassified as a doc bug and assigned to Fred? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-29 15:10 Message: Logged In: YES user_id=31435 Reassigned to me. __members__ and __methods__ were always ugly hacks, and we'd like to get rid of them. I'm making dir() "smarter" again, so that dir([]) will be more informative (see bug 449989). Until then, try using dir(type([])) (more generally, dir (type(object)) instead of the atrocious [].__class__.__dict__.keys(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456420&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:29:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:29:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-221791 ] Error for bad \x escape doesn't mention filename Message-ID: Bugs item #221791, was opened at 2000-11-06 08:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 Category: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Error for bad \x escape doesn't mention filename Initial Comment: Using: GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 I get the following 'error' message: from interscript.languages.interscript_languages import add_translation File "interscript/languages/interscript_languages.py", line 2, in ? from interscript.encoding.utf8 import utf8 ValueError: invalid \x escape in known correct code (i.e. it works on Python 1.5.2). I have examined the function 'parsestr' in 'compile.c', and added debugging prints to find out what is going on. The function _correctly_ processes the string 'utf8' (quotes included), and returns, then the error is generated _without_ entering the routine! This almost certainly must be a bug in egcs-2.91.66. The code in 'parsestr' looks correct to me. It is possible the error can be replicated by downloading and running 'interscript' (without any arguments). Interscript is available at http://interscript.sourceforge.net [Reply to skaller@maxtal.com.au, sorry, I couldn't figure out how to 'log on'] ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:29 Message: Logged In: YES user_id=31435 A kick in the butt won't help. It has a higher effort/payback ratio than anything else on my plate, and so long as that's true it stays at the bottom of my priority list. If someone else wants to tackle it, great. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:20 Message: Logged In: YES user_id=6380 This one can use a kick in the butt -- it's still unsolved! ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-12-13 08:56 Message: I lost my changes when moving to my new machine. Wasn't happy with them anyway -- changing the exception from ValueError to SyntaxError was purely a hack, to worm its way thru the maze of hacks already there. As long as it's got to be a hack, better a pleasant hack . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-12-13 08:02 Message: Tim, I remember you were looking into this. Any luck? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-11-13 14:51 Message: Just noting that this is a bit of a mess to repair: no "2nd phase" compile-time errors report file names or line numbers unless they're SyntaxErrors. The bad \x escape here is one path thru that code; bad \x escapes in Unicode strings are another; likewise for OverflowError due to "too large" integer literal. A fix is in progress. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-11-06 09:04 Message: The error message is legitimate: in Python 2.0, \x escapes must have exactly two hex characters following, and he uses \x0\x0 in his __init__.py module, which generates the error message. But his bug report is also legitimate: the ValueError doesn't mention the file where this is occurring! I'm changing the bug subject to reflect this -- it has nothing to do with egcs 2.91.66. I'm randomly assigning this to Tim. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:35:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:35:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-221791 ] Error for bad \x escape doesn't mention filename Message-ID: Bugs item #221791, was opened at 2000-11-06 08:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 Category: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Nobody/Anonymous (nobody) Summary: Error for bad \x escape doesn't mention filename Initial Comment: Using: GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 I get the following 'error' message: from interscript.languages.interscript_languages import add_translation File "interscript/languages/interscript_languages.py", line 2, in ? from interscript.encoding.utf8 import utf8 ValueError: invalid \x escape in known correct code (i.e. it works on Python 1.5.2). I have examined the function 'parsestr' in 'compile.c', and added debugging prints to find out what is going on. The function _correctly_ processes the string 'utf8' (quotes included), and returns, then the error is generated _without_ entering the routine! This almost certainly must be a bug in egcs-2.91.66. The code in 'parsestr' looks correct to me. It is possible the error can be replicated by downloading and running 'interscript' (without any arguments). Interscript is available at http://interscript.sourceforge.net [Reply to skaller@maxtal.com.au, sorry, I couldn't figure out how to 'log on'] ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:29 Message: Logged In: YES user_id=31435 A kick in the butt won't help. It has a higher effort/payback ratio than anything else on my plate, and so long as that's true it stays at the bottom of my priority list. If someone else wants to tackle it, great. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:20 Message: Logged In: YES user_id=6380 This one can use a kick in the butt -- it's still unsolved! ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-12-13 08:56 Message: I lost my changes when moving to my new machine. Wasn't happy with them anyway -- changing the exception from ValueError to SyntaxError was purely a hack, to worm its way thru the maze of hacks already there. As long as it's got to be a hack, better a pleasant hack . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-12-13 08:02 Message: Tim, I remember you were looking into this. Any luck? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-11-13 14:51 Message: Just noting that this is a bit of a mess to repair: no "2nd phase" compile-time errors report file names or line numbers unless they're SyntaxErrors. The bad \x escape here is one path thru that code; bad \x escapes in Unicode strings are another; likewise for OverflowError due to "too large" integer literal. A fix is in progress. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-11-06 09:04 Message: The error message is legitimate: in Python 2.0, \x escapes must have exactly two hex characters following, and he uses \x0\x0 in his __init__.py module, which generates the error message. But his bug report is also legitimate: the ValueError doesn't mention the file where this is occurring! I'm changing the bug subject to reflect this -- it has nothing to do with egcs 2.91.66. I'm randomly assigning this to Tim. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:37:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:37:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-451285 ] distutils ignores environment variables Message-ID: Bugs item #451285, was opened at 2001-08-15 12:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451285&group_id=5470 Category: Distutils Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: A.M. Kuchling (akuchling) Summary: distutils ignores environment variables Initial Comment: Visual C++ 6.0 sets up environment variables for use by command-line users -- MSDEVDIR, INCLUDE, LIB. It also provides VCVARS32.BAT to set these environment variables. They specify where to find cl.exe and its header files and libraries. distutils ignores those in favor of the registry. I think distutils should honor the environment variables if they are set. In my case, the registry was pointing to an old, removed install of VC. I later installed a new version in a new location, but that install did not modify the registry. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:37 Message: Logged In: YES user_id=31435 It would be a reasonable feature request to honor envars if the registry info wasn't found. This wouldn't have helped Jeremy, but so it goes (the 2nd time he installed MSVC, he didn't install the IDE, and that's why the registry didn't get updated; and he didn't properly uninstall his old MSVC either, which is why the stale registry entries didn't get removed -- and this combination of wrong turns has to be as rare as a Unix guy trying to build something on Windows ). ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2001-09-05 12:05 Message: Logged In: YES user_id=11105 I'm unsure what to do. On one hand, this request makes sense, on the other hand, environment vars are IMO much more fragile than registry entries. I'll assign this to the current distutils maintainer to decide what to do. Or should it be marked as feature request? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-15 12:49 Message: Logged In: YES user_id=31435 Jeremy, do you know how to run regedit? It's a GUI registry browser. Do Start -> Run and type "regedit" (no quotes) then click OK. I want you to navigate to two places: HKEY_LOCAL_MACHINE\ Software\ Microsoft\ Devstudio\ 6.0\ Build System\ and exactly the same except starting at HKEY_CURRENT_USER instead. My *bet* is that you're going to find that path in both places, but that under HKEY_LOCAL_MACHINE it's pointing to a wrong place. This would be a side-effect of not having properly uninstalled your previous MSVC. If that's all true, select the DevStudio node under HKEY_LOCAL_MACHINE and then do Edit->Delete. This will get rid of the obsolete registry setting. Close regedit then. disutils *should* look under HKEY_CURRENT_USER before looking under HKEY_LOCAL_MACHINE, because per-user settings are suppused to take precedence over per-machine settings, and especially under Win2K. That appears to be a repeated buglet in msvccompiler.py. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451285&group_id=5470 From noreply@sourceforge.net Wed Sep 5 20:40:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 12:40:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-457066 ] pow(a,b,c) should accept b<0 Message-ID: Bugs item #457066, was opened at 2001-08-30 18:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 Category: Python Library Group: Feature Request >Status: Closed Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: pow(a,b,c) should accept b<0 Initial Comment: You should be able to raise integers to negative powers mod n. If b<0, pow(a,b,c)==pow(pow(a,-1,c),-b,c) where pow(a,-1,c) is a's multiplicative inverse mod c, computed with the extended Euclid algorithm. This would be in Python's spirit of math completeness and would save people from the trouble of having to figure out the algorithm over and over. I can come up with a patch for this if it's agreed on as desirable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:40 Message: Logged In: YES user_id=6380 I reopened it because there was a different action item then (forbid triple-float-arg pow()). Since that has been taken care of now, I'm closing it again. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 12:20 Message: Logged In: YES user_id=31435 That's up to you -- I closed it before, and you opened it again. Since I'm not clear on why it was reopened, assigning back to you. Disallowing 3-arg pow for floats didn't preclude the possibility of giving 3-arg integer pow with negative 2nd arg a "modular inverse" meaning (which is the substance of the feature request, not float behavior), and I've got nothing new to say about that. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Can we close this now that it's been rejected and we've made pow(a,b,c) illegal for float args? ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:35 Message: Logged In: YES user_id=72053 Sounds good to me re breaking float pow. It's doing something really weird in 2.2.1 anyway. pow(3.,500.,7.) returns 2, pow(3,5000,7) returns 2, pow(3.,5000.,7.) returns 4.0, but 3.**5000. returns inf. pow(3.,50000.,7.) returns NaN. The roundoff errors though don't bother me especially more than any other float roundoff errors, e.g. 3.**99+1-3.**99 = 0. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 14:27 Message: Logged In: YES user_id=6380 OK. Sounds like a good plan: break 3-arg pow() for all float args in 2.2a3, and see in anybody screams. I predict dead silence. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 14:20 Message: Logged In: YES user_id=31435 Well, speaking as an old fp number-cruncher, mod makes little sense for floats on its own, and even less so combining it with pow (math.fmod makes sense for floats, but that's a different operation than the builtin float %). As a practical matter, x%1.0 is sometimes used to get at the fractional bits of a float x >= 0, but I haven't seen that combined with pow (in practice -- "in theory" pow (theta, n, 1.0) has interesting properties for irrational theta, but fp arithmetic isn't precise enough to exploit them). OTOH, I can't doubt that some existing code uses integers that just happen to be in fp format, and then e.g. pow(3., 4., 7.) makes as much sense as pow(3, 4, 7). If you want a model where it's a number's value that matters-- not especially its type --that's worth preserving. But then "something should be done about" stuff like this: >>> pow(3., 500., 7.) 4.0 >>> pow(3, 500, 7) 2 >>> So, as currently implemented, floats in 3-arg pow are surprising even when they denote whole integers. 3-arg pow makes clear sense for ints and longs when the power is non-negative, and compelling sense for "go fast" reasons, so I'd like to see it restricted to that. We already complain about 3-arg pow with a complex argument. I haven't found any actual examples of 3-arg float pow on the web ... but who knows? Let's break it in 2.a3 and see whether anyone screams? I can ask on c.l.py too. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-01 14:05 Message: Logged In: YES user_id=72053 If b<0 uses egcd, then pow(4,-1,6) should definitely throw a value error, like dividing by 0. Pow isn't advertised as computing gcd's. It just happens that egcd is a way of computing inverses mod n. I'm fine with 3-arg pow throwing an error on non-integer args. I like that better than unexpected conversions. How about continuing to throw an error on b<0, but adding an egcd function to the math library? What got me started on this was wanting a modular inverse, not remembering how egcd worked and having to figure it out again, and realizing I've been thru that same exercise many times over the years :-). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 13:12 Message: Logged In: YES user_id=6380 The resolution remains Rejected -- apparently selecting "None" signals a "no change" to SF. :-( I don't like it either -- my suggestion to write a PEP was a passive-aggressive way to reject the proposal. :-) Still, it's unclear whether 3-arg pow() makes any sense at all for floats. Maybe that *should* be rejected. And then we could reject 3-arg() pow with negative second arg as well. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-01 13:04 Message: Logged In: YES user_id=31435 Changed Resolution to None since this was opened again. I still don't like this. It's a wart no matter how you cut it: implement the egcd meaning, and it's still a wart, because the "multiplicative inverse" meaning doesn't always make sense. For example, pow(4, -1, 6) -- 4 has no multiplicative inverse mod 6. The best it can return is 2, i.e. the best pow(i, -1, k) can return is an integer x s.t. i*x is congruent to gcd(i, k) mod k. But Python provides no way to get the gcd, so there's no way (short of computing gcd separately) to know what the result of pow (i, -1, k) really means (and it doesn't mean "inverse" unless the gcd is 1; OTOH, raise an exception if the gcd isn't one, and then you've artificially ruled out legitimate uses of egcd apparently not related to Paul's particular interest today). The natural way to spell egcd as a library routine would return the gcd too; e.g., def egcd(aorig, borig): . """Return (g, i) s.t. g=gcd(aorig, borig) and i*aorig % borig = g.""" . a, b = aorig, borig . a1, a2 = 1, 0 . while b: . q, r = divmod(a, b) . a1, a2 = a2, a1-q*a2 . a, b = b, r . if __debug__: . b1, r = divmod(a - a1*aorig, borig) . assert r == 0 . assert a1*aorig + b1*borig == a . return a, a1 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-01 11:19 Message: Logged In: YES user_id=6380 Hm. There's something to say for making 3-arg pow() only work for ints (and longs), and then the egcd would make sense. But that would mean removing the 3-arg pow() for floats. Why would anyone use 3-arg pow() with floats? I don't know, but that doesn't mean it doesn't happen. *If* there are no community objections against making 3-arg pow() raise a TypeError on float or complex arguments, I'm OK with the egcd interpretation. But this is PEP material -- that's the only way to find out. phr, would you mind writing a PEP? It can be short and sweet. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-08-31 23:38 Message: Logged In: YES user_id=72053 Argh. I meant to say I'm NOT enthused about changing /. This item is jinxed :-). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-31 23:34 Message: Logged In: NO Making a 3-arg integer pow return a tiny floating point number seems weird to me. I don't see any situation where I'd want that. If I call pow with b<0 without expecting it to use the egcd to get the integer answer mod c, I've almost certainly made a mistake. So my first preference is still egcd, but second preference is to stay with the old behavior of throwing an exception rather than have my integer calculation suddenly turn into a floating point calculation without my realizing it. I'm also enthused about changing / to turn 2/3 into a float, but at least I understand the argument that 2/3=0 confuses newbies. But newbies won't be using 3-arg pow(), so we needn't worry about confusing them. IMHO anyone using 3-arg pow on integers will expect an integer result. By the way (off topic), 3-arg pow with ~150 decimal digits is about 5x slower in Python than in carefully optimized asm on an x86, which is pretty good. But on a StrongARM it appears to be about 30x slower :-(. This can't really be fixed without adding a lot more code. Sigh. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-30 22:23 Message: Logged In: YES user_id=31435 The desire is understandable but this isn't the right way to do it, so I'm rejecting this. While 2.2a2 changed the specifics, the general rule remains that pow(a, b, c) == a**b % c except that the LHS may be very much faster for large integer arguments. "The right way" to do modular arithmetic is to define a class for it, and do the full job (+ - * /, not just modular pow). egcd is easy to code in Python, and because it's an obscure speciality need (it gets asked about maybe twice per year on c.l.py) doesn't really belong in the core even if it weren't. I'm not even sure how 3-argument pow got in, but am grateful it did and don't want to press our luck . ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:49 Message: Logged In: YES user_id=6380 Of course I meant (1.0/(a**-b))%c. Sorry! ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-30 18:46 Message: Logged In: YES user_id=6380 Hm. In 2.2a2, currently, pow(a, b, c) for ints a, b, c where b < 0 is defined as pow(float(a), float(b), float(c)), IOW (1.0/(a**b))%c. This doesn't make a lot of sense for the three-argument version though, because the result tends to be between 0.0 and 1.0... But it is consistent with the (future) rule that operations on integers and floats should give results with the same value only a different type. Assigning to Tim, whose mathematical sensibilities are more refined than mine... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457066&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:03:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:03:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-458860 ] delitem not supported by Weak*Dicts Message-ID: Bugs item #458860, was opened at 2001-09-05 13:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tim Hochberg (tim-hochberg) Assigned to: Nobody/Anonymous (nobody) Summary: delitem not supported by Weak*Dicts Initial Comment: Python 2.2a1 Example: >>> w = weakref.WeakKeyDictionary() >>> w[c] = 1 >>> del w[c] Traceback (most recent call last): File "", line 1, in ? File "C:\Python22\lib\UserDict.py", line 16, in __delitem__ def __delitem__(self, key): del self.data[key] KeyError: <__main__.C instance at 0081DB54> >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:15:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:15:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-458860 ] delitem not supported by Weak*Dicts Message-ID: Bugs item #458860, was opened at 2001-09-05 13:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 >Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tim Hochberg (tim-hochberg) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: delitem not supported by Weak*Dicts Initial Comment: Python 2.2a1 Example: >>> w = weakref.WeakKeyDictionary() >>> w[c] = 1 >>> del w[c] Traceback (most recent call last): File "", line 1, in ? File "C:\Python22\lib\UserDict.py", line 16, in __delitem__ def __delitem__(self, key): del self.data[key] KeyError: <__main__.C instance at 0081DB54> >>> ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:15 Message: Logged In: YES user_id=6380 Yup, still the case in CVS. Looks like a straightforward bug. Assigned to weakref's author, Fred Drake. (Fred: you can use any instance as 'c' in the example.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:20:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:20:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-458874 ] Long module names fail on the Mac Message-ID: Bugs item #458874, was opened at 2001-09-05 13:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458874&group_id=5470 Category: Macintosh Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Guido van Rossum (gvanrossum) Summary: Long module names fail on the Mac Initial Comment: Long module names fail on the Mac. Or, more precisely, test_repr fails (if you take out the "if" that disables the testing of long module names on the Mac). It needs to be investigated whether it is the mkdir() calls and such in test_repr which are the cause of the problem (in which case the problem is really with the test: methinks platforms are free to raise EINVAL for "illegal" filenames in I/O calls). The other question is what the Python specs say about the number of significant characters in a module name, and how to handle modules that have names longer than the underlying storage system supports. The language reference simply says that identifiers are unlimited in length, but on Unix "unlimited" for modulenames means "255" (and probably something similar on Windows). This last paragraph is the reason I'm assigning this to Guido, I can't start on a fix until I know what I should aim for. Feel free to assign it back (unless you want to fix it yourself:-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458874&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:26:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:26:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:31:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:31:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and socketmodule.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) Summary: gcc -Wall and socketmodule.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:32:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:32:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-458874 ] Long module names fail on the Mac Message-ID: Bugs item #458874, was opened at 2001-09-05 13:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458874&group_id=5470 Category: Macintosh Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) >Assigned to: Jack Jansen (jackjansen) Summary: Long module names fail on the Mac Initial Comment: Long module names fail on the Mac. Or, more precisely, test_repr fails (if you take out the "if" that disables the testing of long module names on the Mac). It needs to be investigated whether it is the mkdir() calls and such in test_repr which are the cause of the problem (in which case the problem is really with the test: methinks platforms are free to raise EINVAL for "illegal" filenames in I/O calls). The other question is what the Python specs say about the number of significant characters in a module name, and how to handle modules that have names longer than the underlying storage system supports. The language reference simply says that identifiers are unlimited in length, but on Unix "unlimited" for modulenames means "255" (and probably something similar on Windows). This last paragraph is the reason I'm assigning this to Guido, I can't start on a fix until I know what I should aim for. Feel free to assign it back (unless you want to fix it yourself:-). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:32 Message: Logged In: YES user_id=6380 Hm... I think that an import of a really long module name might truncate the name that it looks for on the filesystem; that's what Windows used to do in 8+3 mode AFAIK. But this is really up to the platform; I haven't really thought that much about the mapping of long module names. But I think it's OK for a mkdir() or open() to fail if a component of the name is too long -- filename syntax is up to the OS. For a fix of the test, I would simply change the really long package name to a slightly shorter one (say, 28 chars long to allow for the ".pyc" suffix). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458874&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:33:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:33:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:38:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:38:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-458885 ] mailbox.UnixMailbox loses From_ Message-ID: Bugs item #458885, was opened at 2001-09-05 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: mailbox.UnixMailbox loses From_ Initial Comment: The mailbox.UnixMailbox class makes it easy to walk over a Unix From_-style mailbox. Unfortunately, it loses the From_ line. From_ lines are not part of RFC822 message headers, so they should be kept by the UnixMailbox instance. I tried a couple things in a private subclass of UnixMailbox, but didn't come up with something workable. Ideally, when I have an rfc822.Message object from Unixmailbox I should be able to ask the mailbox object for its from_ line. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:41:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:41:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:44:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:44:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-443762 ] dictionary type ignores argument list Message-ID: Bugs item #443762, was opened at 2001-07-23 04:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443762&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Closed Resolution: Fixed Priority: 5 Submitted By: Duncan Booth (duncanb) Assigned to: Tim Peters (tim_one) Summary: dictionary type ignores argument list Initial Comment: In 2.2a1 the dictionary type object completely ignores its argument list when constructing a new dictionary. It always returns an empty dictionary no matter what arguments are specified. Either: it should check that it has been called with no arguments. Or: it should take some arguments and do something useful with them. I would suggest that the following arguments would be useful: dictionary() should return a new empty dictionary. dictionary(d) where d is a dictionary should return a copy of the original dictionary. dictionary(k1=v1, k2=v2, k3=v3, ...) should return a dictionary with keys k1, k2, k3, ... and corresponding values. dictionary(kvlist) where kvlist is a list of key, value tuples should build a dictionary from the key value pairs (effectively this is the inverse of d.items ()). dictionary(kseq, vseq) should do the same as dictionary (zip(kseq, vseq)) i.e. create a dictionary initialised with corresponding elements from each list as key and value. Any other arguments to dictionary should be rejected. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 13:44 Message: Logged In: YES user_id=31435 BTW, I'm not deadly opposed to other forms of dict constructor, but anything beyond the obvious (which I implemented): dictionary() -> new empty dict dictionary(mapping_object) -> genuine-dict copy needs a PEP. In particular, the suggestions above miss what I think is the most obviously useful: dict([k1, v1, k2, v2, ...]) -> {k1: v1, k2: v2, ...} where [k1, v1, ...] is any iterable object. For example, picture trying to construct a dict out of an re.findall() return list. Perl programs routinely build hashes out of flat lists (where it's spelled "%hash = @array;"), and almost nothing produces sequences of two-tuples except for dict.items() (we surely don't a *fourth* way to spell dict.copy()!). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 08:38 Message: Logged In: YES user_id=6380 Closed, as fixed -- Tim implemented a simple dictionary() constructor (taking only a mapping-like argument). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-07 10:37 Message: Logged In: YES user_id=6380 Well, that would be a very generous API -- probably too generous. I'm tempted to allow only a single argument with a mapping interface -- that would be more in line with how tuple() and list() work. Let this also be a reminder for me to fix the docstring when I fix the constructor. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443762&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:46:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:46:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-457114 ] Incorporate timeoutsocket.py into core Message-ID: Bugs item #457114, was opened at 2001-08-30 22:48 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457114&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) >Assigned to: Nobody/Anonymous (nobody) Summary: Incorporate timeoutsocket.py into core Initial Comment: I was responding to a question on c.l.py earlier about urllib hanging and was reminded of Tim O'Malley's timeoutsocket.py. It's a shim above socket that allows you to set timeouts on any TCP connections. Back in January, Jeff Bauer suggested in c.l.py that it be included in the core. I agree that it provides useful extra functionality beyond the current socket implementation and would like it to be considered for addition to the standard distribution. Here's a pointer: http://www.timo-tasi.org/python/timeoutsocket.py Here's how you use it: import timeoutsocket import httplib timeoutsocket.setDefaultSocketTimeout(20) # at this point any sockets created # will have a 20-second timeout h = httplib.HTTP("www.python.org") Pretty simple, huh? Skip ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 13:46 Message: Logged In: YES user_id=44345 While the offer is tempting, I almost certainly don't understand the various bits associated with sockets and don't have the time to learn them, so I'm unassigning. Hopefully someone else will pick it up for 2.3... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:26 Message: Logged In: YES user_id=6380 Skip, want to work on this? If not, please unassign it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-31 06:10 Message: Logged In: YES user_id=6380 I like this idea, but don't think this exact implementation belongs in the standard library. The hacks deployed to "install" the special effect are a bit fragile, e.g. consider "import socket as foo"; and they shouldn't be necessary. When integrated into the standard library, it should probably become a standard feature of the socket object. Note that on Windows, socket.socket is already a shim on top of _socket.socket, so that would be a convenient starting point. Patch anyone? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457114&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:51:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:51:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-458885 ] mailbox.UnixMailbox loses From_ Message-ID: Bugs item #458885, was opened at 2001-09-05 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 Category: None >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Skip Montanaro (montanaro) >Assigned to: Guido van Rossum (gvanrossum) Summary: mailbox.UnixMailbox loses From_ Initial Comment: The mailbox.UnixMailbox class makes it easy to walk over a Unix From_-style mailbox. Unfortunately, it loses the From_ line. From_ lines are not part of RFC822 message headers, so they should be kept by the UnixMailbox instance. I tried a couple things in a private subclass of UnixMailbox, but didn't come up with something workable. Ideally, when I have an rfc822.Message object from Unixmailbox I should be able to ask the mailbox object for its from_ line. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:51 Message: Logged In: YES user_id=6380 The From_ line is saved as the 'unixfrom' attribute of the message objects -- this is a standard feature of the rfc822.Message class. Example: >>> fn = "/var/spool/mail/guido" >>> box = mailbox.UnixMailbox(open(fn)) >>> m = box.next() >>> m.unixfrom 'From python-bugs-list-admin@python.org Wed Sep 5 16:42:21 2001\n\ ' >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:55:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:55:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Wed Sep 5 21:58:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 13:58:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-449151 ] Multiple interpreters break exceptions Message-ID: Bugs item #449151, was opened at 2001-08-08 08:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449151&group_id=5470 Category: Python Interpreter Core >Group: Irreproducible >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Guido van Rossum (gvanrossum) Summary: Multiple interpreters break exceptions Initial Comment: When creating multiple interpreters, the initialization of exceptions in the second interpreter created overwrites the globals set by the first interpreter, thereby messing up the identities of exceptions. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:58 Message: Logged In: YES user_id=6380 I took a closer look, and I can't reproduce this, with or without the call to _PyImport_FixupExtension(). So I'm closing this as irreproducible. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-08-16 08:27 Message: Logged In: YES user_id=12800 Reassigning back to Guido to remind him to take a closer look, and provide more information. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-08-13 16:02 Message: Logged In: YES user_id=12800 This might be related to SF bug #422004, but then again it may not. So far I found a reproducible problem. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449151&group_id=5470 From noreply@sourceforge.net Wed Sep 5 23:03:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 15:03:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-458885 ] rfc822.Message.unixfrom is not documented Message-ID: Bugs item #458885, was opened at 2001-09-05 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 >Category: Documentation >Group: None >Status: Open Resolution: Invalid Priority: 5 Submitted By: Skip Montanaro (montanaro) >Assigned to: Fred L. Drake, Jr. (fdrake) >Summary: rfc822.Message.unixfrom is not documented Initial Comment: The mailbox.UnixMailbox class makes it easy to walk over a Unix From_-style mailbox. Unfortunately, it loses the From_ line. From_ lines are not part of RFC822 message headers, so they should be kept by the UnixMailbox instance. I tried a couple things in a private subclass of UnixMailbox, but didn't come up with something workable. Ideally, when I have an rfc822.Message object from Unixmailbox I should be able to ask the mailbox object for its from_ line. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 15:03 Message: Logged In: YES user_id=44345 Ah! Thanks! Reopening as a doc bug and reassigning to Fred, which explains why I didn't find it. ;-) Patch attached... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:51 Message: Logged In: YES user_id=6380 The From_ line is saved as the 'unixfrom' attribute of the message objects -- this is a standard feature of the rfc822.Message class. Example: >>> fn = "/var/spool/mail/guido" >>> box = mailbox.UnixMailbox(open(fn)) >>> m = box.next() >>> m.unixfrom 'From python-bugs-list-admin@python.org Wed Sep 5 16:42:21 2001\n\ ' >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 From noreply@sourceforge.net Thu Sep 6 00:22:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 16:22:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-458814 ] MHammond non-responsive Message-ID: Bugs item #458814, was opened at 2001-09-05 11:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 Category: None Group: 3rd Party >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Mark Hammond (mhammond) Summary: MHammond non-responsive Initial Comment: Bugs assigned to Mark Hammond don't seem to be dealt with. Mark, have you fallen out of our community? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-05 16:22 Message: Logged In: YES user_id=14198 OK, I can take a hint :) Will start going through these bugs today :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 From noreply@sourceforge.net Thu Sep 6 00:29:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 16:29:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-458941 ] Looks like a unary minus bug Message-ID: Bugs item #458941, was opened at 2001-09-05 16:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 Category: Parser/Compiler Group: Python 2.2 Status: Open Resolution: None Priority: 6 Submitted By: Tim Peters (tim_one) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Looks like a unary minus bug Initial Comment: The attached program should print the same stuff in both calls to drive(). It actually prints Using literals: 0.0 0.0 0.0 0.0 Using computation: 0.0 3.14159265359 0.0 -3.14159265359 on Windows. The disassembly of driver() suggests the compiler is optimizing -0.0 into 0.0, but the sign of a *floating* zero is significant. This works as expected in 2.1.1; the behavior changed after that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 From noreply@sourceforge.net Thu Sep 6 00:31:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 16:31:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-458814 ] MHammond non-responsive Message-ID: Bugs item #458814, was opened at 2001-09-05 11:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 Category: None Group: 3rd Party Status: Closed Resolution: Rejected Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Mark Hammond (mhammond) Summary: MHammond non-responsive Initial Comment: Bugs assigned to Mark Hammond don't seem to be dealt with. Mark, have you fallen out of our community? ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 16:31 Message: Logged In: YES user_id=31435 That's a relief! I was afraid that after we arranged to thank you at the end of every 2.2a2 Windows install, you figured it was time to retire . ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-05 16:22 Message: Logged In: YES user_id=14198 OK, I can take a hint :) Will start going through these bugs today :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458814&group_id=5470 From noreply@sourceforge.net Thu Sep 6 00:45:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 16:45:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-442374 ] Modulefinder registry support broken Message-ID: Bugs item #442374, was opened at 2001-07-18 04:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442374&group_id=5470 Category: Windows Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Thomas Heller (theller) Assigned to: Mark Hammond (mhammond) Summary: Modulefinder registry support broken Initial Comment: The Modulefinder registry support is broken. It uses _winreg.QueryValueEx() instead of winreg.QueryValue(). The attached diff fixes this, and also adds support to query the registry via win32api if _winreg could not be imported. This way modulefinder is compatible with Python 1.5.2 up to 2.1. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-05 16:45 Message: Logged In: YES user_id=14198 Checked in: /cvsroot/python/python/dist/src/Tools/freeze/modulefinder.py ,v <-- modulefinder.py new revision: 1.17; previous revision: 1.16 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442374&group_id=5470 From noreply@sourceforge.net Thu Sep 6 00:52:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 16:52:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-419213 ] win32all: combrowse.py causes crash/`95 Message-ID: Bugs item #419213, was opened at 2001-04-26 11:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419213&group_id=5470 Category: Extension Modules Group: Platform-specific >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Douglas Shawhan (lysdexia) Assigned to: Mark Hammond (mhammond) Summary: win32all: combrowse.py causes crash/`95 Initial Comment: Attempting to run C:\python20\win32com\client\combrowse.py causes a stack fault: -----begin pain------- PYTHON caused a stack fault in module MSVCRT.DLL at 016f:78001169. Registers: EAX=5f401151 CS=016f EIP=78001169 EFLGS=00010246 EBX=00542048 SS=0177 ESP=00542000 EBP=0054200c ECX=00542048 DS=0177 ESI=005420f2 FS=470f EDX=005420c2 ES=0177 EDI=00540000 GS=0000 Bytes at CS:EIP: 50 c3 8b 44 24 04 66 8b 08 66 85 c9 74 0b 66 3b Stack dump: 0054202c 5f492d87 ffffffff 005420a0 5f4012da 00000000 1e44a1f1 00000cac 005420f2 00000000 00542048 00542090 1e45ac48 ffffffff 1e436ff7 00542048 -------end pain------- Any attempt to run combrowse.py again required hard reboot. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-05 16:52 Message: Logged In: YES user_id=14198 Being tracked in http://bugs.activestate.com/ActivePython/show_bug.cgi? id=10183, so marked as "duplicate". FWIW, this has been fixed in the win32 source tree, so the next ActivePython/win32all should work. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-26 14:52 Message: Logged In: YES user_id=31435 Assigned to MarkH. Douglas, the Win32 extensions aren't part of the core Python project (i.e., it's not our code) -- you'd probably have better luck reporting this to ActiveState. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419213&group_id=5470 From noreply@sourceforge.net Thu Sep 6 03:05:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 19:05:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-459007 ] Document sys.path on Windows Message-ID: Bugs item #459007, was opened at 2001-09-05 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459007&group_id=5470 Category: Documentation Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: Document sys.path on Windows Initial Comment: I keep promising to document how Python builds the sys.path. Please-holder so Tim has a consistent place to hassle me :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459007&group_id=5470 From noreply@sourceforge.net Thu Sep 6 03:50:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 19:50:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-458941 ] Looks like a unary minus bug Message-ID: Bugs item #458941, was opened at 2001-09-05 16:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 Category: Parser/Compiler Group: Python 2.2 Status: Open Resolution: None Priority: 6 Submitted By: Tim Peters (tim_one) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Looks like a unary minus bug Initial Comment: The attached program should print the same stuff in both calls to drive(). It actually prints Using literals: 0.0 0.0 0.0 0.0 Using computation: 0.0 3.14159265359 0.0 -3.14159265359 on Windows. The disassembly of driver() suggests the compiler is optimizing -0.0 into 0.0, but the sign of a *floating* zero is significant. This works as expected in 2.1.1; the behavior changed after that. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 19:50 Message: Logged In: YES user_id=44345 >From the checkin comments, it looks like v 2.216 of Python/compile.c is the culprit. Getting rid of com_invert_constant and reverting com_factor to the version from 2.215 fixes the problem. Looks like it was strictly an optimization, so it can probably be safely removed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 From noreply@sourceforge.net Thu Sep 6 05:24:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 21:24:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-454383 ] make test failed in solaris_2.7 with gcc Message-ID: Bugs item #454383, was opened at 2001-08-22 16:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454383&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Thiep Duong (duongusa) Assigned to: A.M. Kuchling (akuchling) Summary: make test failed in solaris_2.7 with gcc Initial Comment: I tried to compile/build configure with no option, make gave no apparent error, but make test failed at the below messages. Any clue what to do next? I am new with Python .... Please help. skipping 'sunaudiodev' extension (up-to-date) running build_scripts not copying /fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Tools/scripts/pydoc (up-to-date) find ./Lib -name '*.py[co]' -print | xargs rm -f PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 39, in ? import random File "/fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Lib/random.py", line 76, in ? from math import log as _log, exp as _exp, pi as _pi, e as _e ImportError: cannot import name log make: [test] Error 1 (ignored) PYTHONPATH= ./python -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 39, in ? import random File "/fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Lib/random.py", line 76, in ? from math import log as _log, exp as _exp, pi as _pi, e as _e ImportError: cannot import name log Bus Error - core dumped make: *** [test] Error 138 ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-05 21:24 Message: Logged In: NO > Thanks for helping out. I got it fixed now, here what I did I updated > the readline-4.2 library and the coredump went away, but I got ton of > messages like: > > gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/./Include - > I/usr/local/include -IInclude/ -c /fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Modules/readline.c -o buil > d/temp.solaris-2.7-sun4u-2.1/readline.o > /fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Modules/readline.c: In function `set_completer_delims': > /fas2/eda2/duong/dev/source/UNIX/Python-2.1.1/Modules/readline.c:212: warning: passing arg 1 of `free' dis > cards qualifiers from pointer target type > gcc -shared build/temp.solaris-2.7-sun4u-2.1/readline.o -L/usr/lib/termcap -L/usr/local/lib -lreadline -lt > ermcap -o build/lib.solaris-2.7-sun4u-2.1/readline.so > Text relocation remains referenced > against symbol offset in file > sigdelset 0x64 /usr/local/lib/libreadline.a(signals.o) > rl_on_new_line_with_prompt 0x1e0 /usr/local/lib/libreadline.a(readline.o) > kill 0x74 /usr/local/lib/libreadline.a(signals.o) > rl_beginning_of_history 0x238 /usr/local/lib/libreadline.a(vi_mode.o) > rl_beginning_of_history 0x250 /usr/local/lib/libreadline.a(vi_mode.o) > > ...... many other modules too. > I also have a SUN C/C++ compiler (V5.0),and use this instead of > gcc, and the python seems to be much happier. > > Thanks for looking into this. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:31 Message: Logged In: YES user_id=6380 It looks like the math module didn't get compiled completely. Possibly the compiler invocation used by setup.py to build shared libraries doesn't work for your platform. Assigning this to Andrew, who knows about such things. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454383&group_id=5470 From noreply@sourceforge.net Thu Sep 6 05:45:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 21:45:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-458941 ] Looks like a unary minus bug Message-ID: Bugs item #458941, was opened at 2001-09-05 16:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 Category: Parser/Compiler Group: Python 2.2 Status: Open Resolution: None Priority: 6 Submitted By: Tim Peters (tim_one) >Assigned to: Guido van Rossum (gvanrossum) Summary: Looks like a unary minus bug Initial Comment: The attached program should print the same stuff in both calls to drive(). It actually prints Using literals: 0.0 0.0 0.0 0.0 Using computation: 0.0 3.14159265359 0.0 -3.14159265359 on Windows. The disassembly of driver() suggests the compiler is optimizing -0.0 into 0.0, but the sign of a *floating* zero is significant. This works as expected in 2.1.1; the behavior changed after that. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-05 21:45 Message: Logged In: YES user_id=31435 Reassigned to Guido for pondering. The unary minus optimization doesn't appear to be the true cause here, but rather unmasked a different problem: com_addconst uses a dict to map (value, type) pairs to consts, and +0.0 compares equal to -0.0. Thus in the test case, compilation of the tuple (+0.0, -0.0) finds +0.0 first, and despite that "-0.0" is correctly converted to a negative 0 on my box, add_const thinks it's the same thing: *all* literal float zeroes are treated like +0.0 just because +0.0 was the first one added to the consts. If I change the tuple to (-0.0, +0.0) instead, then all literal 0.0 thingies get treated like minus 0 instead, and the test case prints 4 instances of - pi (instead of 4 instances of 0). A sufficient hack to hide this again may be to disable the unary minus optimization when the NUMBER is a float or imaginary zero. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 19:50 Message: Logged In: YES user_id=44345 >From the checkin comments, it looks like v 2.216 of Python/compile.c is the culprit. Getting rid of com_invert_constant and reverting com_factor to the version from 2.215 fixes the problem. Looks like it was strictly an optimization, so it can probably be safely removed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 From noreply@sourceforge.net Thu Sep 6 06:37:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 05 Sep 2001 22:37:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-221671 ] bad link David Ascher's compile.py script Message-ID: Bugs item #221671, was opened at 2000-11-05 08:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221671&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mark Phillips (mphillips) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: bad link David Ascher's compile.py script Initial Comment: The document "Extending and Embedding the Python Interpreter, October 16, 2000, Release 2.0", at http://www.python.org/doc/current/ext/win-cookbook.html contains a bad link to bad link David Ascher's compile.py script; the link is to http://starship.python.net/crew/da/compile/ but this URL doesn't work (it redirects to one that refuses connections). It'd be great if someone could put compile.py someplace accessible and fix this link! --Mark ---------------------------------------------------------------------- >Comment By: David Ascher (david_ascher) Date: 2001-09-05 22:37 Message: Logged In: YES user_id=6114 I'll gladly provide the script, but I've lost any energy keeping a permanent website up. I haven't touched the script in ages. I agree that distutils is probably the way to go at this point. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2000-11-08 22:38 Message: This is a known problem. I have a copy of the script, but I need someone to test it to make sure it works with Python 2.0. Another possibility is to push the Distutils tools; that may be a better option at this point. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221671&group_id=5470 From noreply@sourceforge.net Thu Sep 6 08:00:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 00:00:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-456738 ] Support for smoother debugging of C exts Message-ID: Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 23:59 Message: Logged In: YES user_id=21627 In a private conversation, Michael volunteered to contribute a patch for that, including documentation, wrapper macros, and whatever else he considers necessary. So I propose not to act on that report for a few weeks, to see whether we get a contribution of a fix. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:55 Message: Logged In: YES user_id=6380 I don't see why Barry should do this (he doesn't seem interested), so unassigning, on the theory that Jeremy randomly assigned it. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:44 Message: Logged In: YES user_id=45365 I think I would like this feature. Actually, I think it would even be nice to export it to Python (through sys?). There's something similar in MacPython (the MacOS DebugStr() routine) and I use it a lot. The advantage of a separate routine (as opposed to setting a breakpoint) is that you can put complex conditions in your code for when you want to call the routine. This could conceivably be done with conditional breakpoints too, but it tends to be much more of a hassle. Especially going from Python code to the C debugger at a specific point is pretty difficult. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 From noreply@sourceforge.net Thu Sep 6 08:25:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 00:25:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-448403 ] libpython2.2.a missing -- Make Failure Message-ID: Bugs item #448403, was opened at 2001-08-06 06:08 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448403&group_id=5470 Category: Installation Group: Python 2.2 >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: libpython2.2.a missing -- Make Failure Initial Comment: Hi, In trying to install Python for the first time on a Sun Ultrasparc 10, I followed recommended procedure and obtained the following error (whilst runing "make"): gcc -o python \ Modules/python.o \ libpython2.2.a -lpthread -lsocket -lnsl -ldl -lthread -lm gcc: libpython2.2.a: No such file or directory make: *** [python] Error 1 Any assistance would be greatly appreciated. All the best, Lars ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:25 Message: Logged In: YES user_id=21627 In a private conversation with the submitter (Lars Jermiin, ), we found that this problem is caused by /usr/local/bin/ar being a symlink to /usr/bin/true, which means that all ar invocations failed to do anything. Since this conversation started by me placing a comment into the bug report, and since this report does not show such a comment, this may be a duplicate report - but I can't find the original one. The only other explanation seems to be that SF lost a comment, but that is unlikely. So closing this, not sure whether as "Duplicate" or "Works for me". ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:03 Message: Logged In: YES user_id=6380 Martin, are you capable of dealing with this? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448403&group_id=5470 From noreply@sourceforge.net Thu Sep 6 08:32:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 00:32:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-455183 ] Cygwin build fails for 2.2a2 Message-ID: Bugs item #455183, was opened at 2001-08-24 19:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: Cygwin build fails for 2.2a2 Initial Comment: The Cygwin build fails at the compile stage with the error message that a working getaddrinfo function is needed, unless the option "--disable-ipv6" is selected. I tried that option (as well as --with-threads=no), and both configure and make ran successfully. I started the interpreter from the Python-2.2a2 directory and successfully imported division and generators from __future__. I ran the interpreter test following the instructions for Cygwin and got this message: 1 test failed: test_strftime 31 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_dbm test_dl test_fork1 test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pty test_pyexpat test_sax test_socket_ssl test_socketserver test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_unicode_file test_winreg test_winsound ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:32 Message: Logged In: YES user_id=21627 Can you give an exact copy of the error message you got without disable-ipv6? I cannot reproduce the problem, as I don't have a cygwin installation. Also, could you please identify yourself? Furthermore, can you please run test_strftime in isolation, and report the output? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 From noreply@sourceforge.net Thu Sep 6 08:47:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 00:47:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and socketmodule.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) Summary: gcc -Wall and socketmodule.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:47 Message: Logged In: YES user_id=21627 Can you please report what the compiler says? On all of my systems, getaddrinfo.c isn't used, since the C library offers its own getaddrinfo/getnameinfo (which actually works, compared to the one on OS X :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Thu Sep 6 09:27:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 01:27:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-451309 ] don't store traceback objects Message-ID: Bugs item #451309, was opened at 2001-08-15 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 Category: Python Library Group: None Status: Open >Resolution: Fixed Priority: 6 Submitted By: Jeremy Hylton (jhylton) Assigned to: Jeremy Hylton (jhylton) Summary: don't store traceback objects Initial Comment: A TestResult object stores the exceptions raised when tests fail. The only use of these stored tracebacks, it seems, is to print a stack trace when the test run's report is generated. The traceback objects, however, keep pointers to a bunch of objects that might otherwise be garbage collected. I ran into this on Windows, where the traceback was keeping a file object alive. Because the file object was not collected, my tearDown() method could not remove the file. This patch changes unittest to generate the formatted traceback immediately, so that it does not keep tracebacks around any longer than needed. ---------------------------------------------------------------------- >Comment By: Steve Purcell (purcell) Date: 2001-09-06 01:27 Message: Logged In: YES user_id=21477 I've made a fix now. From the CVS checkin message: Changed TestResult to store only the text representation of an error. This patch is similar to that proposed by Jeremy. The proposed patch altered the interface of TestResult such that it would be passed the error information as a string rather than an exc_info() tuple. The implemented change leaves the interface untouched so that TestResults are still passed the tracebacks, but stor them in stringified form for later reporting. Notes: - Custom subclasses of TestResult written by users should be unaffected. - The existing 'unittestgui.py' will still work with this module after the change. - Support can later be added to pop into the debugger when an error occurs; this support should be added to a TestRunner rather than to TestCase itself, which this change will enable. (Jeremy, Fred, Guido: Thanks for all the feedback) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:12 Message: Logged In: YES user_id=6380 Jeremy, can you propose a patch for this? Steve isn't going to fix it without some help. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 08:27 Message: Logged In: YES user_id=31392 We had a water-cooler conversation about this issue. It was observed that keeping tracebacks alive until the end of a test suite isn't very useful, because any number of objects on the stack may be mutated during the subsequent run of the program. In general, a traceback object should be handed to the debugger right away or processed in some other way. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-16 08:38 Message: Logged In: YES user_id=31392 I think this feature is more trouble than it's worth. If a testrunner wants to capture the actual exception, it could easily override the addError or addFailure method to get the traceback then. The cost of the feature is high, particularly since it is not used by anyone. The effects of preserving tracebacks can be hard to discern, and I expect when it happens it will cause a lot of confusion. In my case, two experienced Python programmers, who are novices with unittest, spent several hours trying to figure out what went wrong. I don't think updating the docs will be particularly helpful, because this situation is somewhat unusual and the current behavior so surprising. ---------------------------------------------------------------------- Comment By: Steve Purcell (purcell) Date: 2001-08-15 14:46 Message: Logged In: YES user_id=21477 Hi Jeremy, This behaviour is actually known and intentional; the dangers are documented as a caveat in the PyUnit docs. The intention was that a test runner (GUI or otherwise) could potentially make the traceback available for inspection when a test fails, to aid in debugging. In your particular case, relying on GC to close the file might have caused problems with following code even if PyUnit didn't store the traceback. Overall I'd prefer to keep storing the tracebacks, especially since they only get stored when tests fail. It would be worth me adding a note about GC interaction to the docs, though. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 From noreply@sourceforge.net Thu Sep 6 10:24:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 02:24:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-458941 ] Looks like a unary minus bug Message-ID: Bugs item #458941, was opened at 2001-09-05 16:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 Category: Parser/Compiler Group: Python 2.2 Status: Open Resolution: None Priority: 6 Submitted By: Tim Peters (tim_one) >Assigned to: Tim Peters (tim_one) Summary: Looks like a unary minus bug Initial Comment: The attached program should print the same stuff in both calls to drive(). It actually prints Using literals: 0.0 0.0 0.0 0.0 Using computation: 0.0 3.14159265359 0.0 -3.14159265359 on Windows. The disassembly of driver() suggests the compiler is optimizing -0.0 into 0.0, but the sign of a *floating* zero is significant. This works as expected in 2.1.1; the behavior changed after that. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 02:24 Message: Logged In: YES user_id=6380 The com_addconst code was never intended to deal with anything except positive literals. I wonder if we are doing ourselves a favor with the unary-minus optimization? This is the second time we have a problem in it. If we want to keep it, making the exception for 0.0 and 0j makes sense. Back to Tim (or to Fred?) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 21:45 Message: Logged In: YES user_id=31435 Reassigned to Guido for pondering. The unary minus optimization doesn't appear to be the true cause here, but rather unmasked a different problem: com_addconst uses a dict to map (value, type) pairs to consts, and +0.0 compares equal to -0.0. Thus in the test case, compilation of the tuple (+0.0, -0.0) finds +0.0 first, and despite that "-0.0" is correctly converted to a negative 0 on my box, add_const thinks it's the same thing: *all* literal float zeroes are treated like +0.0 just because +0.0 was the first one added to the consts. If I change the tuple to (-0.0, +0.0) instead, then all literal 0.0 thingies get treated like minus 0 instead, and the test case prints 4 instances of - pi (instead of 4 instances of 0). A sufficient hack to hide this again may be to disable the unary minus optimization when the NUMBER is a float or imaginary zero. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 19:50 Message: Logged In: YES user_id=44345 >From the checkin comments, it looks like v 2.216 of Python/compile.c is the culprit. Getting rid of com_invert_constant and reverting com_factor to the version from 2.215 fixes the problem. Looks like it was strictly an optimization, so it can probably be safely removed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 From noreply@sourceforge.net Thu Sep 6 13:20:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 05:20:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-437152 ] compiling source code fails on aix 4.3.1 Message-ID: Bugs item #437152, was opened at 2001-06-28 11:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437152&group_id=5470 Category: Installation Group: Platform-specific >Status: Closed >Resolution: Out of Date Priority: 4 Submitted By: birgit kellner (birgitk) Assigned to: Thomas Wouters (twouters) Summary: compiling source code fails on aix 4.3.1 Initial Comment: python version 2.1, to be installed on an ibm rs/6000 r40, running aix 4.31 (apache 1.3.12). configure runs fine, but make stops with the following error: "fatal error in /usr/lpp/xlC/exe/xlCcode: signal 24 received the error code from the last command is 251" ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:20 Message: Logged In: YES user_id=34209 Agreed. Marked out of date and closing. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:23 Message: Logged In: YES user_id=6380 No new info since 8 weeks. I propose to close this one. ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-07-09 06:57 Message: Logged In: YES user_id=34209 Sorry, but we need *way* more information than this. It looks like an internal bug in the xlC AIX compiler, since it complains about a signal being raised. Does the compiler give any clue what the 'last command' is, the one that returned 'error code 251' ? Any clue what errorcode 251 is supposed to be ? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437152&group_id=5470 From noreply@sourceforge.net Thu Sep 6 13:25:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 05:25:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-435455 ] Python 2.0.1c1 fails to build on RH7.1 Message-ID: Bugs item #435455, was opened at 2001-06-22 06:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435455&group_id=5470 Category: Distutils Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Ole H. Nielsen (ohnielse) >Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.0.1c1 fails to build on RH7.1 Initial Comment: Building Python 2.0.1c1 on a RedHat 7.1 (2.4.2-2 on i586) fails at this point: cd Modules; make OPT="-g -O2 -Wall -Wstrict-prototypes -fPIC" VERSION="2.0" \ prefix="/usr/local" exec_prefix="/usr/local" \ sharedmods make[1]: Entering directory `/scratch/ohnielse/Python-2.0.1/Modules' gcc -fpic -g -O2 -Wall -Wstrict-prototypes -fPIC -I./../Include -I.. -DHAVE_CONFIG_H -c ./bsddbmodule.c ./bsddbmodule.c: In function `newdbhashobject': ./bsddbmodule.c:55: `HASHINFO' undeclared (first use in this function) ./bsddbmodule.c:55: (Each undeclared identifier is reported only once ./bsddbmodule.c:55: for each function it appears in.) ./bsddbmodule.c:55: parse error before `info' ./bsddbmodule.c:60: `info' undeclared (first use in this function) ./bsddbmodule.c:71: warning: implicit declaration of function `dbopen' ./bsddbmodule.c:71: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `newdbbtobject': ./bsddbmodule.c:100: `BTREEINFO' undeclared (first use in this function) ./bsddbmodule.c:100: parse error before `info' ./bsddbmodule.c:105: `info' undeclared (first use in this function) ./bsddbmodule.c:118: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `newdbrnobject': ./bsddbmodule.c:147: `RECNOINFO' undeclared (first use in this function) ./bsddbmodule.c:147: parse error before `info' ./bsddbmodule.c:152: `info' undeclared (first use in this function) ./bsddbmodule.c:164: warning: assignment makes pointer from integer without a cast ./bsddbmodule.c: In function `bsddb_dealloc': ./bsddbmodule.c:202: too few arguments to function ./bsddbmodule.c: In function `bsddb_length': ./bsddbmodule.c:232: structure has no member named `seq' ./bsddbmodule.c:233: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c:235: structure has no member named `seq' ./bsddbmodule.c:236: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c:229: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_subscript': ./bsddbmodule.c:265: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:265: too few arguments to function ./bsddbmodule.c: In function `bsddb_ass_sub': ./bsddbmodule.c:307: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:307: too few arguments to function ./bsddbmodule.c:330: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:330: too few arguments to function ./bsddbmodule.c: In function `bsddb_close': ./bsddbmodule.c:357: too few arguments to function ./bsddbmodule.c: In function `bsddb_keys': ./bsddbmodule.c:386: structure has no member named `seq' ./bsddbmodule.c:386: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c:407: structure has no member named `seq' ./bsddbmodule.c:407: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c:376: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_has_key': ./bsddbmodule.c:440: warning: passing arg 2 of pointer to function from incompatible pointer type ./bsddbmodule.c:440: too few arguments to function ./bsddbmodule.c: In function `bsddb_set_location': ./bsddbmodule.c:466: structure has no member named `seq' ./bsddbmodule.c:466: `R_CURSOR' undeclared (first use in this function) ./bsddbmodule.c:453: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_seq': ./bsddbmodule.c:503: structure has no member named `seq' ./bsddbmodule.c:489: warning: `status' might be used uninitialized in this function ./bsddbmodule.c: In function `bsddb_next': ./bsddbmodule.c:531: `R_NEXT' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_previous': ./bsddbmodule.c:536: `R_PREV' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_first': ./bsddbmodule.c:541: `R_FIRST' undeclared (first use in this function) ./bsddbmodule.c: In function `bsddb_last': ./bsddbmodule.c:546: `R_LAST' undeclared (first use in this function) make[1]: *** [bsddbmodule.o] Error 1 ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:25 Message: Logged In: YES user_id=34209 Okay, unassigning. Why I had it ? unsure. It probably dates back from the time I still had a RedHat box. I swapped them all with Debian and I live a much happier life as a result :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:25 Message: Logged In: YES user_id=6380 Can someone see if this is still a problem with current CVS (or even with 2.2a2)? I believe we've added another layer of patchwork around the bsddb compilation in setup.py. Why does Thomas own this item? Thomas, if you don't want it, feel free to unassign it. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-07-10 01:30 Message: Logged In: YES user_id=43607 I have no trouble building the current CVS version on RedHat 7.1. However, when I try the gcc command given in the error message, I get much the same errors. The deciding difference was: setup.py (part of the standard current build process) adds -DHAVE_DB_185_H=1 to the compiler command line. ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-07-09 07:51 Message: Logged In: YES user_id=27232 twouters wrote: > I suspect the problem here is that you don't have the > appropriate -devel RPM installed. I think you need > 'db3-devel', but 'db2-devel', 'db1-devel' or 'db-devel' > might work too. Sorry, no. These RPMs seem to be installed by default on RedHat 7.1: # rpm -qa | grep devel | grep db db1-devel-1.85-5 db2-devel-2.4.14-5 gdbm-devel-1.8.0-5 db3-devel-3.1.17-7 It would be nice if a Python developer could gain access to a RedHat 7.1 machine to sort this problem out :-) ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-07-09 07:06 Message: Logged In: YES user_id=34209 I suspect the problem here is that you don't have the appropriate -devel RPM installed. I think you need 'db3-devel', but 'db2-devel', 'db1-devel' or 'db-devel' might work too. Can you confirm that you have none of those installed ? I think what happens is that distutils can't find an include header to include, so it assumes the DB implementation is included in libc, instead. (Changing catagory to distutils on that assumption.) ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-06-26 14:52 Message: Logged In: YES user_id=27232 loewis wrote: > I have asked you to report things, not to change things. > It is not easy to repeat for me, as I don't have Redhat 7.1. Sorry about the confusion. My report is for RedHat 7.1: 1. Untar the distribution 2.0.1c1 2. ./configure 3. make The errors reported occur. I have changed nothing. I don't know what bsddb is, nor why it's getting compiled. Hopefully, someone knowing Python 2.0.1 and having access to a RedHat 7.1 box could look into the problem. At this point Python building seems broken on RH7.1 :-( ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-06-26 00:02 Message: Logged In: YES user_id=21627 I have asked you to report things, not to change things. It is not easy to repeat for me, as I don't have Redhat 7.1. ---------------------------------------------------------------------- Comment By: Ole H. Nielsen (ohnielse) Date: 2001-06-25 15:20 Message: Logged In: YES user_id=27232 loewis wrote: > Please report the following things: > - the line in Setup that you activated to enable > compilation of bsddb > - the exact version of the bsddb RPM package that provides > db.h > - whether or not this packages includes a file db_185.h Sorry, I didn't change ANYTHING ! I was trying a vanilla build on RedHat 7.1 ! Should be easy to repeat... Maybe the build scripts make some incorrect choices on RedHat 7.1 ? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-06-23 13:58 Message: Logged In: YES user_id=21627 Please report the following things: - the line in Setup that you activated to enable compilation of bsddb - the exact version of the bsddb RPM package that provides db.h - whether or not this packages includes a file db_185.h ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435455&group_id=5470 From noreply@sourceforge.net Thu Sep 6 13:26:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 05:26:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-443042 ] 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Message-ID: Bugs item #443042, was opened at 2001-07-20 04:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 Category: Extension Modules Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: Thomas Wouters (twouters) Summary: 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Initial Comment: gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 160.490u 10.370s 3:09.17 90.3% 0+0k 0+0io 70442pf+0w yetix@/usr/home/ajung/new/Python-2.2a1(318)% make gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 Env: gcc 2.95.3, Linux 2.4.5 i386 ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:26 Message: Logged In: YES user_id=34209 Closing. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-05 11:45 Message: Logged In: YES user_id=11084 Works now in 2.2a2. Andreas ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:22 Message: Logged In: YES user_id=6380 Andreas, is this still a problem in 2.2a2? ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 16:38 Message: Logged In: YES user_id=11084 Compilation works fine after removing HAVE_BROKEN_NICE from config.h - seems to be broken :-) Andreas ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 10:08 Message: Logged In: YES user_id=11084 My system uses glibc 2.1.2. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-07-20 07:33 Message: Logged In: YES user_id=11375 The version of glibc is probably also relevant. Reassigning to Thomas Wouters, as this looks related to the recent nice/getpriority changes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 From noreply@sourceforge.net Thu Sep 6 13:38:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 05:38:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-230075 ] dbmmodule build fails on Debian GNU/Linux unstable (Sid) Message-ID: Bugs item #230075, was opened at 2001-01-25 12:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=230075&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: Wont Fix Priority: 5 Submitted By: Kalle Svensson (krftkndl) >Assigned to: Neil Schemenauer (nascheme) Summary: dbmmodule build fails on Debian GNU/Linux unstable (Sid) Initial Comment: When building on Debian GNU/Linux unstable, the build fails with: /home/kalle/src/python/dist/src/Modules/dbmmodule.c:24: #error "No ndbm.h available!" error: command 'gcc' failed with exit status 1 make: *** [sharedmods] Error 1 The *dbm.h files available are /usr/include/dbm.h /usr/include/gdbm.h /usr/include/gdbm-ndbm.h All are part of the package libgdbmg1-dev. ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:38 Message: Logged In: YES user_id=34209 No, I didn't include it in 2.1.1 because I decided I'd rather keep it broken on Debian than possibly break it on an unknown number of other systems, for a bugfix-release. I see no problem with breaking an unknown number of systems in 2.2aX though :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-07-19 07:28 Message: Logged In: YES user_id=35752 Have you fixed this one in 2.1.1 Thomas? ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-07-19 07:28 Message: Logged In: YES user_id=35752 Have you fixed this one in 2.1.1 Thomas? ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-03-17 08:36 Message: Logged In: YES user_id=11375 What does the patch look like? You can probably go ahead and check it in. I'd be leery of removing the 'not in "cygwin"' check; ask Jason Tishler if it's still needed, since he's the Cygwin guru. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-03-03 22:26 Message: Logged In: YES user_id=35752 db1/ndbm.h from libc6_2.2.2-1 still includes db.h instead of db1/db.h. I think I understand the reason now. If you want to use db1 or gdbm as a dbm compatible database you have to link with the approprate library. Therefore, if you should add both -ldb1 and -Idb1. I've created a patch to setup.py which does this. Andrew? BTW, I'm not sure if the "if platform not in ['cygwin']" is needed anymore. I bet it could be removed. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-03-03 21:50 Message: Logged In: YES user_id=35752 Python is looking for gdbm/ndbm.h. I could add more logic to look for gdbm-ndbm.h but I don't think its worth it. libc6 includes db1 which can be used by dbmmodule. configure is not finding db1/ndbm.h because ndbm.h includes db.h. I think it should include db1/db.h instead. So, it looks like a Debian unstable bug. I'm downloading Debian libc6_2.2.2-1 right now. Perhaps the bug has been fixed. ---------------------------------------------------------------------- Comment By: Kalle Svensson (krftkndl) Date: 2001-01-25 12:21 Message: Forgot to say that it's Python out of CVS, updated Thu Jan 25 21:23:52 CET 2001. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=230075&group_id=5470 From noreply@sourceforge.net Thu Sep 6 14:37:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 06:37:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-230075 ] dbmmodule build fails on Debian GNU/Linux unstable (Sid) Message-ID: Bugs item #230075, was opened at 2001-01-25 12:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=230075&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: Wont Fix Priority: 5 Submitted By: Kalle Svensson (krftkndl) Assigned to: Neil Schemenauer (nascheme) Summary: dbmmodule build fails on Debian GNU/Linux unstable (Sid) Initial Comment: When building on Debian GNU/Linux unstable, the build fails with: /home/kalle/src/python/dist/src/Modules/dbmmodule.c:24: #error "No ndbm.h available!" error: command 'gcc' failed with exit status 1 make: *** [sharedmods] Error 1 The *dbm.h files available are /usr/include/dbm.h /usr/include/gdbm.h /usr/include/gdbm-ndbm.h All are part of the package libgdbmg1-dev. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 06:37 Message: Logged In: YES user_id=6380 Well hurry up then! ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:38 Message: Logged In: YES user_id=34209 No, I didn't include it in 2.1.1 because I decided I'd rather keep it broken on Debian than possibly break it on an unknown number of other systems, for a bugfix-release. I see no problem with breaking an unknown number of systems in 2.2aX though :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-07-19 07:28 Message: Logged In: YES user_id=35752 Have you fixed this one in 2.1.1 Thomas? ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-07-19 07:28 Message: Logged In: YES user_id=35752 Have you fixed this one in 2.1.1 Thomas? ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-03-17 08:36 Message: Logged In: YES user_id=11375 What does the patch look like? You can probably go ahead and check it in. I'd be leery of removing the 'not in "cygwin"' check; ask Jason Tishler if it's still needed, since he's the Cygwin guru. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-03-03 22:26 Message: Logged In: YES user_id=35752 db1/ndbm.h from libc6_2.2.2-1 still includes db.h instead of db1/db.h. I think I understand the reason now. If you want to use db1 or gdbm as a dbm compatible database you have to link with the approprate library. Therefore, if you should add both -ldb1 and -Idb1. I've created a patch to setup.py which does this. Andrew? BTW, I'm not sure if the "if platform not in ['cygwin']" is needed anymore. I bet it could be removed. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2001-03-03 21:50 Message: Logged In: YES user_id=35752 Python is looking for gdbm/ndbm.h. I could add more logic to look for gdbm-ndbm.h but I don't think its worth it. libc6 includes db1 which can be used by dbmmodule. configure is not finding db1/ndbm.h because ndbm.h includes db.h. I think it should include db1/db.h instead. So, it looks like a Debian unstable bug. I'm downloading Debian libc6_2.2.2-1 right now. Perhaps the bug has been fixed. ---------------------------------------------------------------------- Comment By: Kalle Svensson (krftkndl) Date: 2001-01-25 12:21 Message: Forgot to say that it's Python out of CVS, updated Thu Jan 25 21:23:52 CET 2001. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=230075&group_id=5470 From noreply@sourceforge.net Thu Sep 6 14:39:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 06:39:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-459160 ] Py closes COM instances not loaded by Py Message-ID: Bugs item #459160, was opened at 2001-09-06 06:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459160&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Py closes COM instances not loaded by Py Initial Comment: I have a script using win32com. An instance of a COM object is loaded. As part of the load, the server loads an instance of another com object. The server has a get property returning the IDisp of the server loaded object. In a def, the get property is used thus:- ocp.Msg1001.Data where, ocp is the Python loaded ocject and Msg1001 is the serverloaded object. As soon as the def ends, Python garbage collects ocp.Msg1001 rendering it unusable. If I create a variable in __main of ocp.Msg1001, all is well. The problem is caused by the fact that Python cannot tell between a com instance it created and one it has been passed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459160&group_id=5470 From noreply@sourceforge.net Thu Sep 6 15:38:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 07:38:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 15:51:35 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 07:51:35 -0700 Subject: [Python-bugs-list] [ python-Bugs-458860 ] delitem not supported by Weak*Dicts Message-ID: Bugs item #458860, was opened at 2001-09-05 13:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Hochberg (tim-hochberg) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: delitem not supported by Weak*Dicts Initial Comment: Python 2.2a1 Example: >>> w = weakref.WeakKeyDictionary() >>> w[c] = 1 >>> del w[c] Traceback (most recent call last): File "", line 1, in ? File "C:\Python22\lib\UserDict.py", line 16, in __delitem__ def __delitem__(self, key): del self.data[key] KeyError: <__main__.C instance at 0081DB54> >>> ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 07:51 Message: Logged In: YES user_id=3066 Fixed in Lib/weakref.py revision 1.12. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:15 Message: Logged In: YES user_id=6380 Yup, still the case in CVS. Looks like a straightforward bug. Assigned to weakref's author, Fred Drake. (Fred: you can use any instance as 'c' in the example.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458860&group_id=5470 From noreply@sourceforge.net Thu Sep 6 15:53:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 07:53:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-436732 ] install.py does not record path file Message-ID: Bugs item #436732, was opened at 2001-06-27 07:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 Category: Distutils Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: install.py does not record path file Initial Comment: install.py does not record in INSTALLED_FILES when it creates the .pth file which is created when extra_path is used. Included is a patch: --- install.py.orig Wed Jun 27 08:55:39 2001 +++ install.py Wed Jun 27 08:56:30 2001 @@ -489,6 +489,9 @@ # write list of installed files, if requested. if self.record: outputs = self.get_outputs() + if self.path_file and self.install_path_file: + outputs.append(os.path.join(self.install_libbase, + self.path_file + ".pth")) if self.root: # strip any package prefix root_len = len(self.root) for counter in xrange(len(outputs)): ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-09-04 13:21 Message: Logged In: YES user_id=8446 Yes! This appears to work, and is, in fact, cleaner! Whoohoo! Now please fix 444589 (also with patch). Yes! ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 13:07 Message: Logged In: YES user_id=11375 I've modified your patch to change get_outputs() instead, and checked it in as revision 1.59 of commands/install.py. Can you please check that it still works, and that it fixes the problem? ---------------------------------------------------------------------- Comment By: Jon Nelson (jnelson) Date: 2001-07-25 13:35 Message: Logged In: YES user_id=8446 Is anything going to be done about this? It's really quite necessary. Thanks! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=436732&group_id=5470 From noreply@sourceforge.net Thu Sep 6 16:08:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 08:08:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-458885 ] rfc822.Message.unixfrom is not documented Message-ID: Bugs item #458885, was opened at 2001-09-05 13:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: rfc822.Message.unixfrom is not documented Initial Comment: The mailbox.UnixMailbox class makes it easy to walk over a Unix From_-style mailbox. Unfortunately, it loses the From_ line. From_ lines are not part of RFC822 message headers, so they should be kept by the UnixMailbox instance. I tried a couple things in a private subclass of UnixMailbox, but didn't come up with something workable. Ideally, when I have an rfc822.Message object from Unixmailbox I should be able to ask the mailbox object for its from_ line. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 08:08 Message: Logged In: YES user_id=3066 Fixed the documentation of the rfc822.Message class with a slightly different patch. Checked in as Doc/lib/librfc822.tex revision 1.38. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 15:03 Message: Logged In: YES user_id=44345 Ah! Thanks! Reopening as a doc bug and reassigning to Fred, which explains why I didn't find it. ;-) Patch attached... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:51 Message: Logged In: YES user_id=6380 The From_ line is saved as the 'unixfrom' attribute of the message objects -- this is a standard feature of the rfc822.Message class. Example: >>> fn = "/var/spool/mail/guido" >>> box = mailbox.UnixMailbox(open(fn)) >>> m = box.next() >>> m.unixfrom 'From python-bugs-list-admin@python.org Wed Sep 5 16:42:21 2001\n\ ' >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458885&group_id=5470 From noreply@sourceforge.net Thu Sep 6 16:13:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 08:13:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 08:13 Message: Logged In: YES user_id=6380 This is not a bug. These (immutable) types don't implement those operations, and then the system falls back to implementing x+=y as x=x+y. If you define a regular class without __iadd__ etc., += is implemented in the same way. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 16:52:19 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 08:52:19 -0700 Subject: [Python-bugs-list] [ python-Bugs-458771 ] unittest things to be doc'd Message-ID: Bugs item #458771, was opened at 2001-09-05 08:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: unittest things to be doc'd Initial Comment: We're starting to use the unittest module, and am noticing some things that need documentation or doc fixes. TestSuite class: the run() method requires the result object; unlike TestCase, it's not optional. TestSuite objects "prefer" to be invoked by a test runner (according to comments in the source); the run() method of the TextTestRunner should be documented. If not, then TestSuite.__call__ needs to be changed to make the result object optional. I don't think the docs explain using the first line of the docstring as the "short description" for tests. TestLoader.loadTestFromName needs to define what a "string specifier" is, as dis ltnNames. :) ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 08:52 Message: Logged In: YES user_id=3066 The use of the docstring as a source for the short description is explained in the docs for TestCase.shortDescription(). I think I've addressed your other comments in Doc/lib/libunittest.tex revision 1.6. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 From noreply@sourceforge.net Thu Sep 6 17:04:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 09:04:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-458771 ] unittest things to be doc'd Message-ID: Bugs item #458771, was opened at 2001-09-05 08:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 Category: Documentation Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: unittest things to be doc'd Initial Comment: We're starting to use the unittest module, and am noticing some things that need documentation or doc fixes. TestSuite class: the run() method requires the result object; unlike TestCase, it's not optional. TestSuite objects "prefer" to be invoked by a test runner (according to comments in the source); the run() method of the TextTestRunner should be documented. If not, then TestSuite.__call__ needs to be changed to make the result object optional. I don't think the docs explain using the first line of the docstring as the "short description" for tests. TestLoader.loadTestFromName needs to define what a "string specifier" is, as dis ltnNames. :) ---------------------------------------------------------------------- >Comment By: Rich Salz (rsalz) Date: 2001-09-06 09:04 Message: Logged In: YES user_id=36737 Looks good, except now you need to document makeSuite, in particular that the 2nd string argument means "all functions that start with this prefix are tests" :) ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 08:52 Message: Logged In: YES user_id=3066 The use of the docstring as a source for the short description is explained in the docs for TestCase.shortDescription(). I think I've addressed your other comments in Doc/lib/libunittest.tex revision 1.6. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 From noreply@sourceforge.net Thu Sep 6 17:29:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 09:29:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- >Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:29 Message: Logged In: YES user_id=89016 What about __radd__? It seems to be missing too. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 08:13 Message: Logged In: YES user_id=6380 This is not a bug. These (immutable) types don't implement those operations, and then the system falls back to implementing x+=y as x=x+y. If you define a regular class without __iadd__ etc., += is implemented in the same way. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 17:31:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 09:31:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-458768 ] Python.h conventions. Message-ID: Bugs item #458768, was opened at 2001-09-05 08:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458768&group_id=5470 Category: Documentation Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Python.h conventions. Initial Comment: Most system headers are included by Python.h, which includes pyconfig.h before any system headers. We can make a new rule: "Python.h must be included first, instead of most system headers, and before any other system headers are included." ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 09:31 Message: Logged In: YES user_id=3066 Fixed in the C API and Extending & Embedding manuals, including several bits of example code. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458768&group_id=5470 From noreply@sourceforge.net Thu Sep 6 17:35:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 09:35:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 09:35 Message: Logged In: YES user_id=6380 Oh? It's there for me. $ python Python 2.2a2 (#176, Aug 22 2001, 16:23:28) [GCC 2.95.3 19991030 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1 .__radd__ >>> 1 .__radd__(2) 3 >>> ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:29 Message: Logged In: YES user_id=89016 What about __radd__? It seems to be missing too. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 08:13 Message: Logged In: YES user_id=6380 This is not a bug. These (immutable) types don't implement those operations, and then the system falls back to implementing x+=y as x=x+y. If you define a regular class without __iadd__ etc., += is implemented in the same way. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 17:49:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 09:49:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- >Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:49 Message: Logged In: YES user_id=89016 Not for str and unicode: > python2.2 Python 2.2a2+ (#1, Sep 6 2001, 15:47:43) [GCC 2.95.2 19991024 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> u"foo".__radd__(u"bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__radd__' ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 09:35 Message: Logged In: YES user_id=6380 Oh? It's there for me. $ python Python 2.2a2 (#176, Aug 22 2001, 16:23:28) [GCC 2.95.3 19991030 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1 .__radd__ >>> 1 .__radd__(2) 3 >>> ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:29 Message: Logged In: YES user_id=89016 What about __radd__? It seems to be missing too. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 08:13 Message: Logged In: YES user_id=6380 This is not a bug. These (immutable) types don't implement those operations, and then the system falls back to implementing x+=y as x=x+y. If you define a regular class without __iadd__ etc., += is implemented in the same way. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 18:11:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 10:11:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-459188 ] unicode.__imul__ etc. missing Message-ID: Bugs item #459188, was opened at 2001-09-06 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 Category: Type/class unification Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: unicode.__imul__ etc. missing Initial Comment: The str and the unicode type are missing all the __i*__ methods in 2.2a2: >>> s = u"foo" >>> s*=5 >>> s u'foofoofoofoofoo' >>> s.__imul__(5) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__imul__' >>> s+="bar" >>> s u'foofoofoofoofoobar' >>> s.__iadd__("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__iadd__' ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 10:11 Message: Logged In: YES user_id=6380 That's because these are sequence concatenations, and "reversed-argument" add is not defined there. s+u works because the string.__add__ () method special-cases a Unicode right argument, not because unicode has a __radd__(). ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:49 Message: Logged In: YES user_id=89016 Not for str and unicode: > python2.2 Python 2.2a2+ (#1, Sep 6 2001, 15:47:43) [GCC 2.95.2 19991024 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> u"foo".__radd__(u"bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'unicode' object has no attribute '__radd__' ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 09:35 Message: Logged In: YES user_id=6380 Oh? It's there for me. $ python Python 2.2a2 (#176, Aug 22 2001, 16:23:28) [GCC 2.95.3 19991030 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1 .__radd__ >>> 1 .__radd__(2) 3 >>> ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-06 09:29 Message: Logged In: YES user_id=89016 What about __radd__? It seems to be missing too. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 08:13 Message: Logged In: YES user_id=6380 This is not a bug. These (immutable) types don't implement those operations, and then the system falls back to implementing x+=y as x=x+y. If you define a regular class without __iadd__ etc., += is implemented in the same way. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459188&group_id=5470 From noreply@sourceforge.net Thu Sep 6 18:11:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 10:11:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-459235 ] tuple __getitem__ limited Message-ID: Bugs item #459235, was opened at 2001-09-06 10:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: tuple __getitem__ limited Initial Comment: The __getitem__ of a tuple does not support the extended slicing. That makes it difficult to delegate from an object's __getitem__ to a builtin container, which ought to work through delegating __getitem__
class GI:
    def __getitem__(self,a):
        print a

a = GI()
a[1:2]
(1,2,3,4).__getitem__(slice(1,2,None))
gives slice(1, 2, None) Traceback (most recent call last): File "bar.py", line 7, in ? (1,2,3,4).__getitem__(slice(1,2,None)) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:08:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:08:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-459235 ] tuple __getitem__ limited Message-ID: Bugs item #459235, was opened at 2001-09-06 10:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None >Priority: 4 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: tuple __getitem__ limited Initial Comment: The __getitem__ of a tuple does not support the extended slicing. That makes it difficult to delegate from an object's __getitem__ to a builtin container, which ought to work through delegating __getitem__
class GI:
    def __getitem__(self,a):
        print a

a = GI()
a[1:2]
(1,2,3,4).__getitem__(slice(1,2,None))
gives slice(1, 2, None) Traceback (most recent call last): File "bar.py", line 7, in ? (1,2,3,4).__getitem__(slice(1,2,None)) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 11:08 Message: Logged In: YES user_id=6380 This is not just the __getitem__ -- t[...] also has this problem. As a workaround, you can define __getslice__ or parse the slice() object yourself. I'll eventually get around to fixing this, but it's a bit messy. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:09:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:09:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-458745 ] PyInt_Check doc amiss in API manual Message-ID: Bugs item #458745, was opened at 2001-09-05 07:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458745&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: PyInt_Check doc amiss in API manual Initial Comment: In the API manual, PyInt_Check is listed as returning a borrowed reference. This is almost certainly incorrect. ;-) http://www.python.org/doc/api/intObjects.html I checked Doc/api/refcounts.dat and it looks okay. There is nothing in the api.tex file to suggest it would put anything there, so there must be some postprocessing step where this erroneous bit is added. Skip ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 11:09 Message: Logged In: YES user_id=3066 Actually, this was a problem in refcounts.dat, but with the entry for the parameter: it was missing the name, so it was thought to be the return! Fixed in Doc/api/refcounts.dat revision 1.30. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458745&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:17:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:17:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-459256 ] Link to PyOpenGL obsolete Message-ID: Bugs item #459256, was opened at 2001-09-06 11:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459256&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Link to PyOpenGL obsolete Initial Comment: Section 18.8, module gl links to a defunct address for PyOpenGL, should link to: http://pyopengl.sourceforge.net/ ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459256&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:21:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:21:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-458654 ] Code Bug Message-ID: Bugs item #458654, was opened at 2001-09-05 02:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458654&group_id=5470 Category: Documentation Group: Python 2.1.1 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Code Bug Initial Comment: 4.7.1 Default Argument Values def f(a, l = []): l.append(a) return l print f(1) print f(2) print f(3) Needs a after return l ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 11:21 Message: Logged In: YES user_id=3066 This isn't a bug; it works as given. Typing this at an interative prompt without a blank line there would *not* work, however, so I'll add the blank line anyway. Fixed in Doc/tut/tut.tex revision 1.148. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458654&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:42:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:42:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-459270 ] System-wide distutils cfg file misnamed Message-ID: Bugs item #459270, was opened at 2001-09-06 11:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459270&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Paul Sidorsky (paulsid) Assigned to: A.M. Kuchling (akuchling) Summary: System-wide distutils cfg file misnamed Initial Comment: Not sure whether this is a bug or a documentation error. The documentation says you can put a pydistutils.cfg file in your distutils directory to configure Distutils, as seen here: http://python.sourceforge.net/devel-docs/inst/config-syntax.html Distutils wouldn't load this file for me, so I did some digging and I found that Distutils' dist.py contains this line (around line 284): sys_file = os.path.join(sys_dir, "distutils.cfg") I renamed my pydistutils.cfg file to distutils.cfg and it worked, as verified with DISTUTILS_DEBUG turned on: Distribution.parse_config_files(): reading e:\python21\lib\distutils\distutils.cfg The docstring for parse_config_files() also specifies pydistutils.cfg as the system-wide file in a couple of places, which added to the confusion. On a related note, that same docstring seems to be all wrong WRT its behaviour under Windows: On Windows and Mac OS, there are two possible config files: pydistutils.cfg in the Python installation directory (sys.prefix) and setup.cfg in the current directory. >From what I can tell, sys.prefix isn't the right directory (the distutils path is), and you can also put a config file in a home directory (a la Unix) if the home directory is defined by a HOME environment variable. I'm running Python 2.1 under Windows ME. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459270&group_id=5470 From noreply@sourceforge.net Thu Sep 6 19:44:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 11:44:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-453728 ] Tutorial: string lits & cont. lines Message-ID: Bugs item #453728, was opened at 2001-08-21 06:57 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453728&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Fred L. Drake, Jr. (fdrake) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Tutorial: string lits & cont. lines Initial Comment: The text on string literals and continuation lines (esp. the example) assumes a good understanding of how string literals and continuation lines work in C; this needs to be clarified programmers with no experience in C-like languages. (Based on a comment sent to python-docs.) ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 11:44 Message: Logged In: YES user_id=3066 Clarified interaction of continuation lines and string literals in Doc/tut/tut.tex revision 1.149. It's not clear that there's actually a problem relating to the tokenization comment added anonymously. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-27 07:28 Message: Logged In: NO I don't remember what the tutorial said but cont. lines work differently in python than C and I don't see the reason. For example it would be nice to split integer literals, like: a=123\ 456\ 78L If the number is large (100's of digits) it's nice to be able to split it across several lines. Of course one could enter it as a string split across several lines, but that makes the .pyc file larger since the strings will appear in it rather than the marshalled long int. (This example is from a comp.lang.python discussion). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453728&group_id=5470 From noreply@sourceforge.net Thu Sep 6 20:00:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 12:00:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-458785 ] Link in module-sha docs Message-ID: Bugs item #458785, was opened at 2001-09-05 09:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458785&group_id=5470 Category: Documentation Group: Not a Bug >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Link in module-sha docs Initial Comment: http://www.python.org/doc/current/lib/module-sha.html At the bottom of the page, the link seems to be outdated. The new one is http://www.itl.nist.gov/fipspubs/fip180-1.htm PDF version in http://csrc.nist.gov/publications/fips/fips180-1/fips180-1.pdf However, this seems to be a more general link to secure hashing (includes both the above): http://csrc.nist.gov/encryption/tkhash.html ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 12:00 Message: Logged In: YES user_id=3066 The existing links have already been fixed in CVS. I've added the additional link to the documentation as of Doc/lib/libsha.tex revision 1.9. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458785&group_id=5470 From noreply@sourceforge.net Thu Sep 6 20:05:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 12:05:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-420851 ] Missing docs for iteration support. Message-ID: Bugs item #420851, was opened at 2001-05-02 13:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420851&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 6 Submitted By: Fred L. Drake, Jr. (fdrake) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Missing docs for iteration support. Initial Comment: Documentation is needed for the iteration support. At this time, the following things are missing docs: - iter() function - {}.iteritems(), .iterkeys(), .itervalues() - tp_iter/tp_iternext - __iter__() (ref. manual -- "Object Customization") If you can think of other aspects of this that I've missed, please note them as comments on this bug report so I can address these (or at least keep track of these) in a single place. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 12:05 Message: Logged In: YES user_id=3066 Documented the iter() function in Doc/lib/libfuncs.tex revision 1.84. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-08-20 09:46 Message: Logged In: YES user_id=12800 Setting to priority 6 so that it won't hold up the 2.2a2 release. Although it would be good to have these docs, remember that priorities >= 7 must be fixed before the release can happen. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-05-25 06:52 Message: Logged In: YES user_id=3066 Docs for {}.iteritems(), {}.iterkeys(), and {}.itervalues() checked in as Doc/lib/libstdtypes.tex revision 1.59. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420851&group_id=5470 From noreply@sourceforge.net Thu Sep 6 20:11:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 12:11:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-458771 ] unittest things to be doc'd Message-ID: Bugs item #458771, was opened at 2001-09-05 08:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 Category: Documentation Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: unittest things to be doc'd Initial Comment: We're starting to use the unittest module, and am noticing some things that need documentation or doc fixes. TestSuite class: the run() method requires the result object; unlike TestCase, it's not optional. TestSuite objects "prefer" to be invoked by a test runner (according to comments in the source); the run() method of the TextTestRunner should be documented. If not, then TestSuite.__call__ needs to be changed to make the result object optional. I don't think the docs explain using the first line of the docstring as the "short description" for tests. TestLoader.loadTestFromName needs to define what a "string specifier" is, as dis ltnNames. :) ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 12:11 Message: Logged In: YES user_id=3066 makeSuite() should not be documented; it was marked obsolete in the PyUnit sourcecode before it was accepted into the standard library. ---------------------------------------------------------------------- Comment By: Rich Salz (rsalz) Date: 2001-09-06 09:04 Message: Logged In: YES user_id=36737 Looks good, except now you need to document makeSuite, in particular that the 2nd string argument means "all functions that start with this prefix are tests" :) ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 08:52 Message: Logged In: YES user_id=3066 The use of the docstring as a source for the short description is explained in the docs for TestCase.shortDescription(). I think I've addressed your other comments in Doc/lib/libunittest.tex revision 1.6. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458771&group_id=5470 From noreply@sourceforge.net Thu Sep 6 20:23:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 12:23:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-459256 ] Link to PyOpenGL obsolete Message-ID: Bugs item #459256, was opened at 2001-09-06 11:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459256&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Link to PyOpenGL obsolete Initial Comment: Section 18.8, module gl links to a defunct address for PyOpenGL, should link to: http://pyopengl.sourceforge.net/ ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-06 12:23 Message: Logged In: YES user_id=3066 Updated the reference in Doc/lib/libgl.tex revision 1.16. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459256&group_id=5470 From noreply@sourceforge.net Thu Sep 6 23:18:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 15:18:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-459334 ] urllib2 __getitem__ problem Message-ID: Bugs item #459334, was opened at 2001-09-06 15:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 Category: Extension Modules Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: urllib2 __getitem__ problem Initial Comment: urllib2's file-like object has a bug in its __getitem__ method. Try getting item 5 or item [], both valid queries as far as dict-like objects go, however it naively tries to execute .lower() on the supplied name. If the item does not exist in self.dict then it would seem that a KeyError should be raised - not AttributeError. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 From noreply@sourceforge.net Fri Sep 7 00:23:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 16:23:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-442142 ] DLL base assignments need update Message-ID: Bugs item #442142, was opened at 2001-07-17 13:28 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442142&group_id=5470 Category: Windows Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Mark Hammond (mhammond) Summary: DLL base assignments need update Initial Comment: >From c.l.py. The core DLL has grown quite a bit since these addresses were first assigned, and it systematically collides with, e.g. the bsddb and zip DLLs now too. pythonw.exe is also assigned the same base address as the tkinter DLL, which is "a bug". Since any change here has ripple effects into your (Mark's) Win32 extension assignments, I'm assigning this to you for pondering. Heck, you can even feel free to fix it . """ From: Robin Becker Sent: Tuesday, July 17, 2001 9:21 AM To: python-list@python.org Subject: python2.1 pythonw.exe base address I don't know how much this is of real interest, but using the latest proc explorer from http://www.sysinternals.com/ I notice that pythonw.exe has a base address of 0x1e190000, but that python21.dll wants to reside at 0x1e100000 and has a length of 0xAF000, the result is that python21.dll gets relocated. Redefining the base address of pythonw to be something non-controversial that didn't overlap would be a zero cost win for tk apps. as an aside it seems that tcl83.dll and _tkinter.pyd are also relocated, but I don't know the desired base address. """ ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-06 16:23 Message: Logged In: YES user_id=14198 New .dsp files and new dllbase_nt.txt checked in. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-07-17 22:57 Message: Logged In: YES user_id=14198 [From a followup on the newsgroup] Yes; "link /dump /headers" shows the same thing. Why isn't pythonw.exe based at 00400000 like most well- behaved executables? Rebasing to 1E190000 unnecessarily fragments linear space. --- tcl83.dll is at the default base of 10000000. _tkinter.pyd is set to 1E190000, same as pythonw.exe. I have to believe the pythonw.exe base address is a bug. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442142&group_id=5470 From noreply@sourceforge.net Fri Sep 7 02:02:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 18:02:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-404539 ] os.listdir() can't grok Unicode filename Message-ID: Bugs item #404539, was opened at 2001-02-27 01:15 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404539&group_id=5470 Category: Unicode Group: Feature Request >Status: Pending >Resolution: Works For Me Priority: 5 Submitted By: Itamar Shtull-Trauring (itamar) Assigned to: Mark Hammond (mhammond) Summary: os.listdir() can't grok Unicode filename Initial Comment: I have a file whose name is part Hebrew, part English on my W2K VMware install. Filenames on Win2000 are Unicode, if I'm not mistaken. I'm running BeOpen Python 2.0, with the latest Pythonwin installed. My problem - the os.listdir() command doesn't return the name of the file in unicode, it just replaces the hebrew characters with question marks - '?': >>> l = os.listdir("c:\") >>> l[-1] '????.txt' >>> type(l[-1]) Perhaps the os.listdir() function could be extended with a unicode keyword, which would tell it to return the filenames as unicode strings? filenames = os.listdir(path, unicode=1) ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-06 18:02 Message: Logged In: YES user_id=14198 Works for me. Specifically, see "Lib/test/test_unicode_file.py". This test specifically creates a Unicode file (with extended characters), and performs all sorts of tests - including that it appears in os.listdir(). If you still feel this is a bug, please: a) Check that test succeeds on your platform and with your locale settings. b) If it does work, try and change the test so it fails. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-02-28 11:29 Message: Logged In: YES user_id=31435 Assigned to MarkH in case he has a clue. The core Python code doesn't know about any of MS's TCHAR-related tricks (it uses plain 8-bit C strings everywhere). ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-02-28 11:13 Message: Logged In: YES user_id=3066 Tim, are you familiar with the directory searching functions under Windows? Can you determine the right thing to do? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404539&group_id=5470 From noreply@sourceforge.net Fri Sep 7 02:46:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 18:46:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-459334 ] urllib2 __getitem__ problem Message-ID: Bugs item #459334, was opened at 2001-09-06 15:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 Category: Extension Modules Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: urllib2 __getitem__ problem Initial Comment: urllib2's file-like object has a bug in its __getitem__ method. Try getting item 5 or item [], both valid queries as far as dict-like objects go, however it naively tries to execute .lower() on the supplied name. If the item does not exist in self.dict then it would seem that a KeyError should be raised - not AttributeError. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 18:46 Message: Logged In: YES user_id=6380 Ehh??? I don't see a file-like object in urllib2, and I don't see a __getitem__ method anywhere in the file, and I don't see a call to .lower() that could be suspect. Which file are you really talking about? Or can you show a sample session or program exhibiting the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 From noreply@sourceforge.net Fri Sep 7 07:07:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 23:07:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-459160 ] Py closes COM instances not loaded by Py Message-ID: Bugs item #459160, was opened at 2001-09-06 06:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459160&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Mark Hammond (mhammond) Summary: Py closes COM instances not loaded by Py Initial Comment: I have a script using win32com. An instance of a COM object is loaded. As part of the load, the server loads an instance of another com object. The server has a get property returning the IDisp of the server loaded object. In a def, the get property is used thus:- ocp.Msg1001.Data where, ocp is the Python loaded ocject and Msg1001 is the serverloaded object. As soon as the def ends, Python garbage collects ocp.Msg1001 rendering it unusable. If I create a variable in __main of ocp.Msg1001, all is well. The problem is caused by the fact that Python cannot tell between a com instance it created and one it has been passed. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-06 23:07 Message: Logged In: YES user_id=31435 Reassigned to Mark. Anonymous, you should really report this to ActiveState instead (the SourceForge Python project doesn't supply the Win32 extensions). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459160&group_id=5470 From noreply@sourceforge.net Fri Sep 7 07:23:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 06 Sep 2001 23:23:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-459423 ] setup.py ignores OPT make variable Message-ID: Bugs item #459423, was opened at 2001-09-06 23:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: setup.py ignores OPT make variable Initial Comment: If you build Python using something like make OPT=-O6 when it gets around to building the extension modules it's forgotten (or it ignores) OPT: $ make OPT=-O3 PYTHONPATH= ./python ../setup.py build running build running build_ext building 'struct' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/home/skip/src/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /home/skip/src/Python-2.1.1/Modules/structmodule.c -o build/temp.linux-i686-2.1/structmodule.o gcc -shared build/temp.linux-i686-2.1/structmodule.o -L/usr/local/lib -o build/lib.linux-i686-2.1/struct.so ... Shouldn't setup.py recognize and use the value of OPT? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 From noreply@sourceforge.net Fri Sep 7 09:48:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 01:48:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-458941 ] Looks like a unary minus bug Message-ID: Bugs item #458941, was opened at 2001-09-05 16:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 Category: Parser/Compiler Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 6 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: Looks like a unary minus bug Initial Comment: The attached program should print the same stuff in both calls to drive(). It actually prints Using literals: 0.0 0.0 0.0 0.0 Using computation: 0.0 3.14159265359 0.0 -3.14159265359 on Windows. The disassembly of driver() suggests the compiler is optimizing -0.0 into 0.0, but the sign of a *floating* zero is significant. This works as expected in 2.1.1; the behavior changed after that. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-07 01:48 Message: Logged In: YES user_id=31435 Well, it's a very ordinary kind of optimization to do, and it's good for my coworkers to learn how delicate optimization really is <0.9 wink>. This kind of thing is usually done in a peephole pass, although there's so little difference between parse tree and bytecode perhaps this counts as a peephole opt. The primary reason I liked this at first glance was because it finally squashed an ancient & repeated complaint, that (on a 32-bit box) int("-2147483648") worked fine but eval("-2147483648") blew up. OTOH, Jeremy later solved that in a different way too (by auto-converting big int literals to longs). If for nothing else, I think we should leave this (now even uglier!) code in as a cautionary object lesson for youth . Fixed in Python/compile.c rev 2.222 Quad deuces! Cool. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 02:24 Message: Logged In: YES user_id=6380 The com_addconst code was never intended to deal with anything except positive literals. I wonder if we are doing ourselves a favor with the unary-minus optimization? This is the second time we have a problem in it. If we want to keep it, making the exception for 0.0 and 0j makes sense. Back to Tim (or to Fred?) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 21:45 Message: Logged In: YES user_id=31435 Reassigned to Guido for pondering. The unary minus optimization doesn't appear to be the true cause here, but rather unmasked a different problem: com_addconst uses a dict to map (value, type) pairs to consts, and +0.0 compares equal to -0.0. Thus in the test case, compilation of the tuple (+0.0, -0.0) finds +0.0 first, and despite that "-0.0" is correctly converted to a negative 0 on my box, add_const thinks it's the same thing: *all* literal float zeroes are treated like +0.0 just because +0.0 was the first one added to the consts. If I change the tuple to (-0.0, +0.0) instead, then all literal 0.0 thingies get treated like minus 0 instead, and the test case prints 4 instances of - pi (instead of 4 instances of 0). A sufficient hack to hide this again may be to disable the unary minus optimization when the NUMBER is a float or imaginary zero. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-05 19:50 Message: Logged In: YES user_id=44345 >From the checkin comments, it looks like v 2.216 of Python/compile.c is the culprit. Getting rid of com_invert_constant and reverting com_factor to the version from 2.215 fixes the problem. Looks like it was strictly an optimization, so it can probably be safely removed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458941&group_id=5470 From noreply@sourceforge.net Fri Sep 7 10:34:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 02:34:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-459464 ] Math_test overflowerror on sparc64 linux Message-ID: Bugs item #459464, was opened at 2001-09-07 02:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 Category: Installation Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Math_test overflowerror on sparc64 linux Initial Comment: Traceback(most recent call last): testit('asin(-1)',math.asin(-1),-math.pi/2) OverflowError: math range error ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 From noreply@sourceforge.net Fri Sep 7 10:39:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 02:39:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and socketmodule.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) Summary: gcc -Wall and socketmodule.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:39 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:47 Message: Logged In: YES user_id=21627 Can you please report what the compiler says? On all of my systems, getaddrinfo.c isn't used, since the C library offers its own getaddrinfo/getnameinfo (which actually works, compared to the one on OS X :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Fri Sep 7 10:41:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 02:41:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and socketmodule.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) Summary: gcc -Wall and socketmodule.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:41 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:39 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:47 Message: Logged In: YES user_id=21627 Can you please report what the compiler says? On all of my systems, getaddrinfo.c isn't used, since the C library offers its own getaddrinfo/getnameinfo (which actually works, compared to the one on OS X :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Fri Sep 7 10:44:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 02:44:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Nobody/Anonymous (nobody) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:44 Message: Logged In: YES user_id=45365 Sorry, I was being obscure. The problem at hand is that gcc on MacOSX wants all declarations to be prototype-style, so no K7R style even for static routines, if you give -Wall -Wstrict-prototypes. Attached is the compiler output. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Fri Sep 7 10:58:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 02:58:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-459464 ] Math_test overflowerror on sparc64 linux Message-ID: Bugs item #459464, was opened at 2001-09-07 02:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 >Category: Extension Modules Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Tim Peters (tim_one) Summary: Math_test overflowerror on sparc64 linux Initial Comment: Traceback(most recent call last): testit('asin(-1)',math.asin(-1),-math.pi/2) OverflowError: math range error ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-07 02:58 Message: Logged In: YES user_id=31435 Needs more info. Which version of Python? If you try asin(-1) in a C program on this box, does the math library set errno? If so, it's a platform C bug, and you should report it to your C vendor (Python doesn't do anything with asin except call the platform asin, and if that sets errno to ERANGE, Python raises OverflowError; asin (-1) should not set errno to ERANGE, but if it does there's nothing Python can do about that). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 From noreply@sourceforge.net Fri Sep 7 13:34:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 05:34:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-459423 ] setup.py ignores OPT make variable Message-ID: Bugs item #459423, was opened at 2001-09-06 23:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: setup.py ignores OPT make variable Initial Comment: If you build Python using something like make OPT=-O6 when it gets around to building the extension modules it's forgotten (or it ignores) OPT: $ make OPT=-O3 PYTHONPATH= ./python ../setup.py build running build running build_ext building 'struct' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/home/skip/src/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /home/skip/src/Python-2.1.1/Modules/structmodule.c -o build/temp.linux-i686-2.1/structmodule.o gcc -shared build/temp.linux-i686-2.1/structmodule.o -L/usr/local/lib -o build/lib.linux-i686-2.1/struct.so ... Shouldn't setup.py recognize and use the value of OPT? ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:34 Message: Logged In: YES user_id=6380 The setup.py script reads the Makefile but has no access to the options you pass dynamically to Make. I'm not sure it's worth fixing. You can edit the Makefile instead. But I'm not setup.py's maintainer, so I'll shut up now. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 From noreply@sourceforge.net Fri Sep 7 13:47:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 05:47:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core >Group: Platform-specific Status: Open >Resolution: Wont Fix Priority: 2 Submitted By: Jack Jansen (jackjansen) >Assigned to: Jack Jansen (jackjansen) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:47 Message: Logged In: YES user_id=6380 Jack, am I right that you didn't even LOOK at the lines indicated by those errors? :-) The compiler flagged all occurrences of SIG_IGN, SIG_DFL, and SIG_ERR. Those are macros that come from , that contain a cast to a function type. Apparently that function type doesn't have a prototype. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:44 Message: Logged In: YES user_id=45365 Sorry, I was being obscure. The problem at hand is that gcc on MacOSX wants all declarations to be prototype-style, so no K7R style even for static routines, if you give -Wall -Wstrict-prototypes. Attached is the compiler output. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Fri Sep 7 15:09:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 07:09:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-410274 ] sys.prefix isn't always set Message-ID: Bugs item #410274, was opened at 2001-03-21 01:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410274&group_id=5470 Category: Python Interpreter Core Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 6 Submitted By: Fredrik Lundh (effbot) Assigned to: Mark Hammond (mhammond) Summary: sys.prefix isn't always set Initial Comment: (2.0 and earlier, Windows only) it looks like sys.prefix isn't set unless 1) PYTHONHOME is set (either via an environment variable, or via a call to Py_SetPythonHome), or 2) lib/os.py (or lib/string.py, in 1.5.2) can be found somewhere between the directory your executable is found in, and the root. if neither is set, the path is taken from the registry, but sys.prefix is left blank, and code depending on sys.prefix (e.g. FixTk.py) no longer works. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-07 07:09 Message: Logged In: YES user_id=14198 Fixed: Checking in getpathp.c; /cvsroot/python/python/dist/src/PC/getpathp.c,v <-- getpathp.c new revision: 1.25; previous revision: 1.24 ---------------------------------------------------------------------- Comment By: Fredrik Lundh (effbot) Date: 2001-03-26 11:54 Message: Logged In: YES user_id=38376 InstallPath? (I'd deprecate InstallPath, teach the installers to use PythonHome as a fallback, and use PythonHome for this purpose. but that's me) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-03-21 13:44 Message: Logged In: YES user_id=14198 The main problem here is exactly how to detect it. If the executable is not in the Python directory there are no reasonable hints. The DLL is always in the system directory. The core path entries may not may not be in the home. But 228685 depends on this too. The only solution I can come up with is to use the core sys.path entries, and one at a time try and see if the root could be the parent of one of them. Any other ideas? I would prefer to not assume another registry entry is written by installers. I will try and write registry docs soon, but this isn't really relevant - I agree that sys.prefix should always be set, but just not sure how. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-03-21 10:19 Message: Logged In: YES user_id=31435 Boosted priority a notch. Mark, is this intentional or a bug? You're a bit overdue in writing up the intended rules for Windows, and I'm very reluctant to go changing things like this myself in the absence of clarity. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=410274&group_id=5470 From noreply@sourceforge.net Fri Sep 7 15:34:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 07:34:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: Platform-specific Status: Open Resolution: Wont Fix Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Jack Jansen (jackjansen) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 07:34 Message: Logged In: YES user_id=45365 Ow, bah! Always playing the smart guy, brr.... :-) You're right, of course: I looked at socketmodule and found real errors there and just assumed socket had the same problem. I'll file a bug with Apple and close it when I've actually remembered to do that. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:47 Message: Logged In: YES user_id=6380 Jack, am I right that you didn't even LOOK at the lines indicated by those errors? :-) The compiler flagged all occurrences of SIG_IGN, SIG_DFL, and SIG_ERR. Those are macros that come from , that contain a cast to a function type. Apparently that function type doesn't have a prototype. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:44 Message: Logged In: YES user_id=45365 Sorry, I was being obscure. The problem at hand is that gcc on MacOSX wants all declarations to be prototype-style, so no K7R style even for static routines, if you give -Wall -Wstrict-prototypes. Attached is the compiler output. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Fri Sep 7 15:46:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 07:46:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and getaddrinfo.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) >Summary: gcc -Wall and getaddrinfo.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 07:46 Message: Logged In: YES user_id=6380 The warnings for getaddrinfo.c are correct: this uses a K&R style function definition for getaddrinfo(), and some braces around a complex statement would be enough to shut up the compiler. Martin, can you fix this? (I wonder why you didn't you get these warnings?) For the warnings about socketmodule.c: these are spurious, caused by poor definitions for SIG_IGN in . That's Apple's problem. See bug #458878. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:41 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:39 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:47 Message: Logged In: YES user_id=21627 Can you please report what the compiler says? On all of my systems, getaddrinfo.c isn't used, since the C library offers its own getaddrinfo/getnameinfo (which actually works, compared to the one on OS X :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Fri Sep 7 17:23:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 09:23:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: Platform-specific Status: Open Resolution: Wont Fix Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Jack Jansen (jackjansen) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-07 09:23 Message: Logged In: YES user_id=21627 I got myself access to a Mac OS X system, and found that the SIG_ macros are replaced as (void (*)())1 gcc would be happy if that was written as (void (*)(int))1 ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 07:34 Message: Logged In: YES user_id=45365 Ow, bah! Always playing the smart guy, brr.... :-) You're right, of course: I looked at socketmodule and found real errors there and just assumed socket had the same problem. I'll file a bug with Apple and close it when I've actually remembered to do that. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:47 Message: Logged In: YES user_id=6380 Jack, am I right that you didn't even LOOK at the lines indicated by those errors? :-) The compiler flagged all occurrences of SIG_IGN, SIG_DFL, and SIG_ERR. Those are macros that come from , that contain a cast to a function type. Apparently that function type doesn't have a prototype. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:44 Message: Logged In: YES user_id=45365 Sorry, I was being obscure. The problem at hand is that gcc on MacOSX wants all declarations to be prototype-style, so no K7R style even for static routines, if you give -Wall -Wstrict-prototypes. Attached is the compiler output. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Fri Sep 7 17:23:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 09:23:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-458880 ] gcc -Wall and getaddrinfo.c Message-ID: Bugs item #458880, was opened at 2001-09-05 13:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Martin v. Löwis (loewis) Summary: gcc -Wall and getaddrinfo.c Initial Comment: gcc -Wall -Wstrict-prototypes complains about all sorts of thing in socketmodule.c and its friends getaddrinfo.c and such. Assigned to Martin because he seems to be the most active with this IPV6 stuff (at which point these problems were introduced), but feel free to drop it, assign it back, whatever. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-07 09:23 Message: Logged In: YES user_id=21627 I've now fixed the getaddrinfo problems; I did not see them because getaddrinfo is not used on the systems which I regularly use (Linux, Solaris 8). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 07:46 Message: Logged In: YES user_id=6380 The warnings for getaddrinfo.c are correct: this uses a K&R style function definition for getaddrinfo(), and some braces around a complex statement would be enough to shut up the compiler. Martin, can you fix this? (I wonder why you didn't you get these warnings?) For the warnings about socketmodule.c: these are spurious, caused by poor definitions for SIG_IGN in . That's Apple's problem. See bug #458878. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:41 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:39 Message: Logged In: YES user_id=45365 I've attached the error output from the build. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:47 Message: Logged In: YES user_id=21627 Can you please report what the compiler says? On all of my systems, getaddrinfo.c isn't used, since the C library offers its own getaddrinfo/getnameinfo (which actually works, compared to the one on OS X :-). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458880&group_id=5470 From noreply@sourceforge.net Fri Sep 7 17:32:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 09:32:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-459423 ] setup.py ignores OPT make variable Message-ID: Bugs item #459423, was opened at 2001-09-06 23:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: setup.py ignores OPT make variable Initial Comment: If you build Python using something like make OPT=-O6 when it gets around to building the extension modules it's forgotten (or it ignores) OPT: $ make OPT=-O3 PYTHONPATH= ./python ../setup.py build running build running build_ext building 'struct' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/home/skip/src/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /home/skip/src/Python-2.1.1/Modules/structmodule.c -o build/temp.linux-i686-2.1/structmodule.o gcc -shared build/temp.linux-i686-2.1/structmodule.o -L/usr/local/lib -o build/lib.linux-i686-2.1/struct.so ... Shouldn't setup.py recognize and use the value of OPT? ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2001-09-07 09:32 Message: Logged In: YES user_id=44345 I recall that GNU make at least passes variables to sub-makes in the environment. Perhaps it does that for all programs it forks. If so, then setup.py should be able to read OPT and other interesting bits from the environment. Also, perhaps configure can be made to set OPT in the Makefile if it's found when it runs. I don't have time to look into this today but if it's not taken care of by the weekend I'll try to fix it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:34 Message: Logged In: YES user_id=6380 The setup.py script reads the Makefile but has no access to the options you pass dynamically to Make. I'm not sure it's worth fixing. You can edit the Makefile instead. But I'm not setup.py's maintainer, so I'll shut up now. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 From noreply@sourceforge.net Fri Sep 7 22:12:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 14:12:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-443239 ] Python 2.2 & Boost.Python Message-ID: Bugs item #443239, was opened at 2001-07-20 18:06 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443239&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Ralf W. Grosse-Kunstleve (rwgk) Assigned to: Guido van Rossum (gvanrossum) >Summary: Python 2.2 & Boost.Python Initial Comment: Boost.Python is a C++ library for exposing C++ classes to Python: http://www.boost.org/libs/python/doc/index.html Python's metaclass feature is used to provide objects which look almost exactly like regular Python classes: http://www.boost.org/libs/python/doc/extending.html I have compiled the Boost.Python library using Python 2.2a1 under Linux without getting any compile-time error messages. However, with versions earlier than 2.2, we were able to derive extension classes from a mixture of built-in classes and extension classes, /even if the built-in class was the first listed base/, but that no longer works: Python 2.2a1 (#1, Jul 18 2001, 16:24:59) [GCC 2.95.2 19991024 (release)] on linux2 Type "copyright", "credits" or "license" for more information. >>> from boost_python_test import Bar >>> >>> class RealPythonClass: ... def real_python_method(self): ... print 'RealPythonClass.real_python_method ()' ... >>> class MISubclass2(RealPythonClass, Bar): ... def new_method(self): ... print 'MISubclass2.new_method()' ... Traceback (most recent call last): File "", line 1, in ? TypeError: PyClass_New: base must be a class >>> This example works if the extension class appears first: >>> class MISubclass2(Bar, RealPythonClass): It is somewhat important that built-in Python classes may appear first in the list of bases. Would it be possible to support this in Python 2.2? Thanks! Ralf ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 14:12 Message: Logged In: YES user_id=6380 Ralf, can you try this again with the current CVS? I've made a bit of progress in supporting ExtensionClass. Unfortunately, all the progress was made right after Barry released 2.2a3, so downloading 2.2a3 won't work. (If you don't have access to CVS, drop me a note and I'll send you a patch.) You need classobject.c 2.145, typeobject.c 2.57, and abstract.c 2.73. (Or newer, of course.) Note: I don't know if Boost uses ExtensionClass or a similar mechanism. In either case, it's possible that there are still problems -- that's why I'm not closing this bug report yet. But I'm hopeful! Please help! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443239&group_id=5470 From noreply@sourceforge.net Sat Sep 8 01:04:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 17:04:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-459423 ] setup.py ignores OPT make variable Message-ID: Bugs item #459423, was opened at 2001-09-06 23:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: setup.py ignores OPT make variable Initial Comment: If you build Python using something like make OPT=-O6 when it gets around to building the extension modules it's forgotten (or it ignores) OPT: $ make OPT=-O3 PYTHONPATH= ./python ../setup.py build running build running build_ext building 'struct' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/home/skip/src/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /home/skip/src/Python-2.1.1/Modules/structmodule.c -o build/temp.linux-i686-2.1/structmodule.o gcc -shared build/temp.linux-i686-2.1/structmodule.o -L/usr/local/lib -o build/lib.linux-i686-2.1/struct.so ... Shouldn't setup.py recognize and use the value of OPT? ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-07 17:04 Message: Logged In: YES user_id=21627 GNU make does indeed pass all make variables to subprocesses. According to the recent POSIX drafts, this behaviour is in clear violation to POSIX make behaviour, see #438786 for details. So if anything is done to get OPT from the environment, you also need to pass it from the make variable to the environment of the subprocess, for it to work on all systems. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-09-07 09:32 Message: Logged In: YES user_id=44345 I recall that GNU make at least passes variables to sub-makes in the environment. Perhaps it does that for all programs it forks. If so, then setup.py should be able to read OPT and other interesting bits from the environment. Also, perhaps configure can be made to set OPT in the Makefile if it's found when it runs. I don't have time to look into this today but if it's not taken care of by the weekend I'll try to fix it. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:34 Message: Logged In: YES user_id=6380 The setup.py script reads the Makefile but has no access to the options you pass dynamically to Make. I'm not sure it's worth fixing. You can edit the Makefile instead. But I'm not setup.py's maintainer, so I'll shut up now. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459423&group_id=5470 From noreply@sourceforge.net Sat Sep 8 02:29:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 07 Sep 2001 18:29:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-459705 ] always return 0 command status Message-ID: Bugs item #459705, was opened at 2001-09-07 18:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459705&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: A.M. Kuchling (akuchling) Summary: always return 0 command status Initial Comment: Context: Python 2.1.1 Description: Python's setup.py build script always return 0 status, without regard to failures. Looking more closely at the problem, it seems that the function distutils.core.setup() has no means of effectively returning to the caller its execution status, and no exception is raised when an extension fails to build. This prevents integration of setup.py programs in scripts (ksh...) or Makefiles which rely on testing the command exit status... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459705&group_id=5470 From noreply@sourceforge.net Sat Sep 8 11:31:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 03:31:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-459767 ] ftplib fails with files > 2GB Message-ID: Bugs item #459767, was opened at 2001-09-08 03:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 Category: Extension Modules Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Martin Preishuber (preisl) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib fails with files > 2GB Initial Comment: The ftplib.py module is not ready for large files > 2GB. The funtions size and parse150 return integer values as file size which causes overflows on large files. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 From noreply@sourceforge.net Sat Sep 8 12:08:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 04:08:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-459767 ] ftplib fails with files > 2GB Message-ID: Bugs item #459767, was opened at 2001-09-08 03:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 >Category: Python Library >Group: None Status: Open Resolution: None >Priority: 2 Submitted By: Martin Preishuber (preisl) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib fails with files > 2GB Initial Comment: The ftplib.py module is not ready for large files > 2GB. The funtions size and parse150 return integer values as file size which causes overflows on large files. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 04:08 Message: Logged In: YES user_id=6380 Do you have an actual use for this, or it this just a theoretical complaint? Show me an FTP server with a file > 2GB and I'll consider fixing it. In the future (Python 2.3), int() will auto-convert to long if necessary -- see PEP 237. So this will be fixed eventually anyway -- probably long before such large files will become an issue. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 From noreply@sourceforge.net Sat Sep 8 12:14:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 04:14:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-459767 ] ftplib fails with files > 2GB Message-ID: Bugs item #459767, was opened at 2001-09-08 03:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 2 Submitted By: Martin Preishuber (preisl) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib fails with files > 2GB Initial Comment: The ftplib.py module is not ready for large files > 2GB. The funtions size and parse150 return integer values as file size which causes overflows on large files. ---------------------------------------------------------------------- >Comment By: Martin Preishuber (preisl) Date: 2001-09-08 04:14 Message: Logged In: YES user_id=29575 well, I've written emirror, some ftp mirroring software. There are people, who use it to make backups of such large files. I already use some modified ftp library, which fixes some bugs in the 1.52 library (those bugs are included in >2.0 versions) and I have made the necessary changes for large file support myself ... I just thought it'd be nice to have that support generally. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 04:08 Message: Logged In: YES user_id=6380 Do you have an actual use for this, or it this just a theoretical complaint? Show me an FTP server with a file > 2GB and I'll consider fixing it. In the future (Python 2.3), int() will auto-convert to long if necessary -- see PEP 237. So this will be fixed eventually anyway -- probably long before such large files will become an issue. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 From noreply@sourceforge.net Sat Sep 8 20:12:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 12:12:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Sat Sep 8 20:22:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 12:22:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Sat Sep 8 21:10:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 13:10:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Sun Sep 9 05:18:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 08 Sep 2001 21:18:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Sun Sep 9 09:44:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 01:44:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-09 01:44 Message: Logged In: YES user_id=21627 I'd recommend to always ac_define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. It will be very hard to find in a test what exactly they change. Instead, we should trust that if they are recognized at all, they do the right thing. If there is an early AC_DEFINE for them, they will get into confdefs.h and influence the outcome of all later tests (e.g. the one measuring off_t). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Sun Sep 9 16:41:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 08:41:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Mon Sep 10 03:09:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 19:09:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-09 19:09 Message: Logged In: YES user_id=6380 I've done this in CVS now, but now the largefile build even triggers on systems where the kernel (or the filesystem?) doesn't support large files, but glibc does. Seeking to a position > 2GB works, but writing triggers an IOError exception on flush() or close(). In some sense this is right (the binary might be moved to another kernel). But on such a system test_largefile now fails, because its test for largefile "support" isn't good enough. What to do next? Put some test for a largefile-supporting kernel in the configure script, or in test_largefile? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-09 01:44 Message: Logged In: YES user_id=21627 I'd recommend to always ac_define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. It will be very hard to find in a test what exactly they change. Instead, we should trust that if they are recognized at all, they do the right thing. If there is an early AC_DEFINE for them, they will get into confdefs.h and influence the outcome of all later tests (e.g. the one measuring off_t). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Mon Sep 10 03:35:14 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 19:35:14 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2001-09-09 19:35 Message: Logged In: YES user_id=163326 Just a quick update. I've tested your latest CVS changes and I can seek and write with offsets above sys.maxint just fine now. Out of the box (on my Linux). The filesystem must support LFS, too, of course. Even reiserfs doesn't support that w/o formatting the partition with "-v 2". I can't speak for ext2, but I guess you must format the partition with some special option, to to support files > 2 GB. (Just FYI, to save some time: for just testing seek, you can open "/dev/null" or "/dev/zero".) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-09 19:09 Message: Logged In: YES user_id=6380 I've done this in CVS now, but now the largefile build even triggers on systems where the kernel (or the filesystem?) doesn't support large files, but glibc does. Seeking to a position > 2GB works, but writing triggers an IOError exception on flush() or close(). In some sense this is right (the binary might be moved to another kernel). But on such a system test_largefile now fails, because its test for largefile "support" isn't good enough. What to do next? Put some test for a largefile-supporting kernel in the configure script, or in test_largefile? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-09 01:44 Message: Logged In: YES user_id=21627 I'd recommend to always ac_define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. It will be very hard to find in a test what exactly they change. Instead, we should trust that if they are recognized at all, they do the right thing. If there is an early AC_DEFINE for them, they will get into confdefs.h and influence the outcome of all later tests (e.g. the one measuring off_t). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Mon Sep 10 04:31:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 20:31:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-412436 ] compileall doesn't notice syntax errors Message-ID: Bugs item #412436, was opened at 2001-03-30 02:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=412436&group_id=5470 Category: Python Library Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jeremy Hylton (jhylton) Summary: compileall doesn't notice syntax errors Initial Comment: compileall.py returns an exit code to indicate the success or failure of compilation. This feature was added in compileall.py revision 1.7 in response to distutils message http://mail.python.org/pipermail/distutils-sig/1999-March/000201.html This is not as useful as it looks because a prior change to py_compile.py (revision 1.13) catches syntax errors, hiding them completely from compileall.py, so compileall.py can't report the failure to its caller. ---------------------------------------------------------------------- Comment By: Peter Maxwell (pm67nz) Date: 2001-09-09 20:31 Message: Logged In: YES user_id=320286 I don't see how this can be fixed in compileall.py since the problem is with py_compile.py. py_compile.compile (up to and including the latest version I see in CVS, revision 1.18) only ever returns None, so the code in compileall.py revision 1.19 that says: ok = py_compile.compile(fullname, None, dfile) and if ok == 0: can't possibly work. Caveat: this comment based on reading code, not running it. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-17 18:23 Message: Logged In: YES user_id=31392 Fixed in rev 1.9 of compileall.py. Note that this fix causes a bunch of changes to the test suite, so that files containing syntaxerrors are not compiled by compileall. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-13 14:16 Message: Logged In: YES user_id=31392 Will fix following the 2.1 release ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-04-13 07:31 Message: Logged In: YES user_id=31392 I think this is easy enough to fix, but I don't know what unintended side-effects the fix will have. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=412436&group_id=5470 From noreply@sourceforge.net Mon Sep 10 07:05:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 23:05:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-460151 ] math module - sin and cos ERROR Message-ID: Bugs item #460151, was opened at 2001-09-09 23:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460151&group_id=5470 Category: Extension Modules Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: math module - sin and cos ERROR Initial Comment: I have python 2.0 and 2.1 running on a Win98 platform. The sin and cos functions in the math module are not functioning correctly. They return false results. For example, it says cos(90) is -0.4 or somthing, when it is clearly supposed to be 0, and sin(90) returns some other outrageous value besides the real answer. I don't think i'm doing anything wrong - It's just defective!!! Mike Balamotis balamoti@ucla.edu ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460151&group_id=5470 From noreply@sourceforge.net Mon Sep 10 07:22:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 09 Sep 2001 23:22:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-460151 ] math module - sin and cos ERROR Message-ID: Bugs item #460151, was opened at 2001-09-09 23:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460151&group_id=5470 Category: Extension Modules >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Tim Peters (tim_one) Summary: math module - sin and cos ERROR Initial Comment: I have python 2.0 and 2.1 running on a Win98 platform. The sin and cos functions in the math module are not functioning correctly. They return false results. For example, it says cos(90) is -0.4 or somthing, when it is clearly supposed to be 0, and sin(90) returns some other outrageous value besides the real answer. I don't think i'm doing anything wrong - It's just defective!!! Mike Balamotis balamoti@ucla.edu ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-09 23:22 Message: Logged In: YES user_id=31435 Not a bug. The trigonometric functions work with angles measured in radians, not degrees. In 2.2 the docstrings will say so, since some people are confused by this. 180 degrees == pi radians, so, e.g., >>> def degrees_to_radians(d): ... return d * math.pi / 180 ... >>> math.sin(degrees_to_radians(90)) 1.0 >>> math.cos(degrees_to_radians(90)) 6.1230317691118863e-017 >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460151&group_id=5470 From noreply@sourceforge.net Mon Sep 10 08:27:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 00:27:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-10 00:27 Message: Logged In: YES user_id=21627 Gerhard's comment is right on target: it certainly depends on the file system. E.g. in case of NFS, you not only need NFSv3, but also the remote file system must support large files. So even on a single installation, large files may work in some directory, but not in another. Therefore, I recommend to remove the configuration-time test whether creating a large file is possible. Notice that your test may well consume unreasonable amounts of disk space before failing, on some broken system. With the configure-time test removed, test_largefile might be skipped. This is no big deal; the same test may pass if the binary is moved to another system. ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-09 19:35 Message: Logged In: YES user_id=163326 Just a quick update. I've tested your latest CVS changes and I can seek and write with offsets above sys.maxint just fine now. Out of the box (on my Linux). The filesystem must support LFS, too, of course. Even reiserfs doesn't support that w/o formatting the partition with "-v 2". I can't speak for ext2, but I guess you must format the partition with some special option, to to support files > 2 GB. (Just FYI, to save some time: for just testing seek, you can open "/dev/null" or "/dev/zero".) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-09 19:09 Message: Logged In: YES user_id=6380 I've done this in CVS now, but now the largefile build even triggers on systems where the kernel (or the filesystem?) doesn't support large files, but glibc does. Seeking to a position > 2GB works, but writing triggers an IOError exception on flush() or close(). In some sense this is right (the binary might be moved to another kernel). But on such a system test_largefile now fails, because its test for largefile "support" isn't good enough. What to do next? Put some test for a largefile-supporting kernel in the configure script, or in test_largefile? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-09 01:44 Message: Logged In: YES user_id=21627 I'd recommend to always ac_define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. It will be very hard to find in a test what exactly they change. Instead, we should trust that if they are recognized at all, they do the right thing. If there is an early AC_DEFINE for them, they will get into confdefs.h and influence the outcome of all later tests (e.g. the one measuring off_t). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Mon Sep 10 14:35:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 06:35:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-451890 ] Building with Large File Support fails Message-ID: Bugs item #451890, was opened at 2001-08-16 18:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 Category: Build Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Gerhard Häring (ghaering) Assigned to: Guido van Rossum (gvanrossum) Summary: Building with Large File Support fails Initial Comment: (At least) on Linux, building 2.2-HEAD fails when building with Large File Support. In Objects/fileobject.c function _portable_ftell line 262. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 06:35 Message: Logged In: YES user_id=6380 The config-time test is already removed. I've just checked in changes to test_largefile.py that make it skip itself when the filesystem doesn't support files > 2GB. Closing this now. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-10 00:27 Message: Logged In: YES user_id=21627 Gerhard's comment is right on target: it certainly depends on the file system. E.g. in case of NFS, you not only need NFSv3, but also the remote file system must support large files. So even on a single installation, large files may work in some directory, but not in another. Therefore, I recommend to remove the configuration-time test whether creating a large file is possible. Notice that your test may well consume unreasonable amounts of disk space before failing, on some broken system. With the configure-time test removed, test_largefile might be skipped. This is no big deal; the same test may pass if the binary is moved to another system. ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-09 19:35 Message: Logged In: YES user_id=163326 Just a quick update. I've tested your latest CVS changes and I can seek and write with offsets above sys.maxint just fine now. Out of the box (on my Linux). The filesystem must support LFS, too, of course. Even reiserfs doesn't support that w/o formatting the partition with "-v 2". I can't speak for ext2, but I guess you must format the partition with some special option, to to support files > 2 GB. (Just FYI, to save some time: for just testing seek, you can open "/dev/null" or "/dev/zero".) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-09 19:09 Message: Logged In: YES user_id=6380 I've done this in CVS now, but now the largefile build even triggers on systems where the kernel (or the filesystem?) doesn't support large files, but glibc does. Seeking to a position > 2GB works, but writing triggers an IOError exception on flush() or close(). In some sense this is right (the binary might be moved to another kernel). But on such a system test_largefile now fails, because its test for largefile "support" isn't good enough. What to do next? Put some test for a largefile-supporting kernel in the configure script, or in test_largefile? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-09 01:44 Message: Logged In: YES user_id=21627 I'd recommend to always ac_define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. It will be very hard to find in a test what exactly they change. Instead, we should trust that if they are recognized at all, they do the right thing. If there is an early AC_DEFINE for them, they will get into confdefs.h and influence the outcome of all later tests (e.g. the one measuring off_t). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 21:18 Message: Logged In: YES user_id=6380 Interesting! My test script for large files worked, so _FILE_OFFSET_BITS and _LARGEFILE_SOURCE are defined in your pyconfig.h, but apparently the test for HAVE_LARGEFILE_SUPPORT failed, because that symbol is *not* set in your pyconfig.h -- and everthing else keys off it! So the only symbol you really need to pass is HAVE_LARGEFILE_SUPPORT, and as a workaround you can define that yourself in pyconfig.h. This symbol is defined by a bit of configure code that looks like this in the m4 input: AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi Can you upload config.status? That should tell me which of those symbols doesn't have the right value. My guess is that off_t is measured at 32 bits because _FILE_OFFSET_BITS is not defined as 64 at the point that the symbol is measured. So I have to tweak more stuff... Back to the drawing board. :-( ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 13:10 Message: Logged In: YES user_id=163326 To find out the glibc version, you can invoke "glibcbug". My default bug report says: ... Release: libc-2.2.2 No, I don't get LFS support without manual work, with CVS-HEAD and 2.2a3. I've uploaded my entire config.log file, maybe you can make some sense of it. (it does find fello and fseeko, but my pyconfig.h doesn't define the needed macros). Come to think of it, I'll upload my pyconfig.h, too. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-08 12:22 Message: Logged In: NO (This is Guido, in a hurry, not logged in :-) Gerhard, I'm surprised you still had to pass options to make. It works without those for me. (How do I tell the version of glibc I'm using?) Can you tell me what config.log says after "checking for CFLAGS to enable large files"? Have you tried 2.2a3? ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-08 12:12 Message: Logged In: YES user_id=163326 Guido, I can build the current CVS now with LFS, too (Linux 2.4, glibc 2.2). I saw you did a lot in the configure script, but I still had to give options to the make command (grabbed them from Sean's latest source RPMs). This worked for me: ./configure make OPT="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" CFLAGS="-g -O3 -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT" Shouldn't the feature define HAVE_LARGEFILE_SUPPORT be automatically added to pyconfig.h? It would perhaps be a good idea add the info on how to build with LFS to the build instructions. Thanks, Gerhard ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:36 Message: Logged In: YES user_id=6380 Gerhard, can you try the current CVS? I've done a few things to try and fix this. I can now build just fine on a pretty recent Linux 2.4 kernel. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 02:23 Message: Logged In: YES user_id=21627 To fix the bug at hand (building fails), the following strategy might be sufficient: - produce an autoconf test that checks whether fpos_t is integral, and "large"; define this by default for MSVC - use this test in portable_fseek/portable_ftell. I also wonder why the order in which APIs are tried is different in fseek and ftell (fseek tries fseeko first, ftell tries ftello only second). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-20 13:19 Message: Logged In: YES user_id=31435 By itself, adding opaque getpos/setpos sounds pretty easy (BTW, f{get,set}pos are std in C99). Returning a usable 64-bit integer remains a x-platform mess. The C99 rationale sez f{get,set}pos are the intended way to work with large files, but they provide no way to break the abstraction (Jeremy & I both looked in vain -- there is no defined way to extract the stream position from an fpos_t object, neither to do arithmetic on one). On Windows, f{get,set}pos are (currently) the only way to get a 64-bit stream position from the MS C library (and MS doesn't (currently) mix that in with a state encoding; the Win32 API has other ways to deal with this). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-20 06:21 Message: Logged In: YES user_id=6380 OK, so we need to add separate getpos() and setpos() methods that return an opaque wrapper for an fpos_t. That sounds like serious work, plus it will require changing Python apps that use seek and tell. So I think we shold *also* continue to search for a way to use a 64-bit seek offset for Python's seek() and tell() methods -- I'm presuming this is hidden *somewhere* in the fpos_t still, since the underlying OS certainly uses lseek64(). If there's no way to extract it out of the fpos_t, I propose to call lseek64() directly (after using a fflush()) on the file descriptor. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-19 22:24 Message: Logged In: YES user_id=31435 Noting that C99 *requires* fpos_t values to hold all the info in an mbstate_t, in addition to stream position info. So we have to expect others to follow glibc in this, and eventually everyone. fpos_t cannot resolve to an array type, but anything else is fair (in particular it need not map to an integral type -- and probably won't anymore). We have to give up belief that fpos_t is a number, because it's not. We can believe that ftell returns a number, because it does -- but ftell isn't suitable for large file support. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 06:13 Message: Logged In: YES user_id=21627 This started in glibc 2.2, I believe, so it would appear in Redhat 7, SuSE 7, etc. To see the problem, you have to ./configure with CFLAGS="-D_FILE_OFFSET_BITS=64" OPT="-O2 $(CFLAGS)"; see pyconfig.h. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 03:55 Message: Logged In: YES user_id=6380 Whoa. Interesting. Which Linux version is this? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-08-17 00:21 Message: Logged In: YES user_id=21627 This fails because in glibc, fpos_t contains an mb_state field, so that on restoring the file position, the multibyte encoding state of the file can be restored. I see two solutions here: - Python could give up the guarantee that the ftell result is a number, and return an object that embeds the fpos_t. - Python could give up that guarantee that ftell/fseek works in all cases, and only use ftell(o), which should always return a number (atleast in Posix). If that approach is taken, an additional fgetpos/fsetpos call may be appropriate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451890&group_id=5470 From noreply@sourceforge.net Mon Sep 10 14:36:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 06:36:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-459767 ] ftplib fails with files > 2GB Message-ID: Bugs item #459767, was opened at 2001-09-08 03:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 2 Submitted By: Martin Preishuber (preisl) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib fails with files > 2GB Initial Comment: The ftplib.py module is not ready for large files > 2GB. The funtions size and parse150 return integer values as file size which causes overflows on large files. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 06:36 Message: Logged In: YES user_id=6380 Please upload your patches and I'll see... ---------------------------------------------------------------------- Comment By: Martin Preishuber (preisl) Date: 2001-09-08 04:14 Message: Logged In: YES user_id=29575 well, I've written emirror, some ftp mirroring software. There are people, who use it to make backups of such large files. I already use some modified ftp library, which fixes some bugs in the 1.52 library (those bugs are included in >2.0 versions) and I have made the necessary changes for large file support myself ... I just thought it'd be nice to have that support generally. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-08 04:08 Message: Logged In: YES user_id=6380 Do you have an actual use for this, or it this just a theoretical complaint? Show me an FTP server with a file > 2GB and I'll consider fixing it. In the future (Python 2.3), int() will auto-convert to long if necessary -- see PEP 237. So this will be fixed eventually anyway -- probably long before such large files will become an issue. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470 From noreply@sourceforge.net Mon Sep 10 15:48:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 07:48:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Mon Sep 10 15:55:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 07:55:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-460315 ] call_trace() arg for 'call' Message-ID: Bugs item #460315, was opened at 2001-09-10 07:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: call_trace() arg for 'call' Initial Comment: The documentation says that the extra argument for 'call' events is the argument list to the function. As far as I can tell, this hasn't been the case since around 1.2. Since then the code has had an XXX comment about how to do it "now." Since the feature hasn't been present for about six years, maybe we should agree to give up on it and change the documentation <0.2 wink>. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:01:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:01:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-460315 ] call_trace() arg for 'call' Message-ID: Bugs item #460315, was opened at 2001-09-10 07:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: call_trace() arg for 'call' Initial Comment: The documentation says that the extra argument for 'call' events is the argument list to the function. As far as I can tell, this hasn't been the case since around 1.2. Since then the code has had an XXX comment about how to do it "now." Since the feature hasn't been present for about six years, maybe we should agree to give up on it and change the documentation <0.2 wink>. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:01 Message: Logged In: YES user_id=6380 Agreed. Especially since now that the code has been moved, it's no longer easy "in theory" to calculate the arguments. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:12:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:12:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:29:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:29:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-457360 ] Nested scopes crash when tracing (v2.1) Message-ID: Bugs item #457360, was opened at 2001-08-31 12:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None >Priority: 5 Submitted By: Stephan R.A. Deibel (sdeibel) Assigned to: Jeremy Hylton (jhylton) Summary: Nested scopes crash when tracing (v2.1) Initial Comment: Python will crash on post-trace processing if the tracer is installed during a class def nested inside of a nest function def, under certain conditions at least. I tried to make a small test case but that didn't bring out the bug. As a result, this is best illustrated by installing Zope 2.4.0 (I did this on Linux) and altering z2.py by inserting the following near the top of the file: def tracer(*args): print "trace" return tracer import sys sys.settrace(tracer) Then run with the './start' command. Python will segfault during the following around line 570 of z2.py: exec "import "+MODULE in {} The real problem is the LocalsToFast() call after the tracer has been called while the interpreter is doing the 'line' tracing for line 118 of libs/python/RestrictedPython/Gaurds.py in Zope, where "class Wrapper" is defined nested inside of a nested function. The innermost part of the C backtrace is: #0 PyCell_Set (op=0x0, obj=0x8322e04) at Objects/cellobject.c:32 (gdb) up #1 0x808068a in dict_to_map (map=0x81d5cc4, nmap=1, dict=0x81d269c, values=0x8195db0, deref=1, clear=1) at Objects/frameobject.c:287 (gdb) up #2 0x8080903 in PyFrame_LocalsToFast (f=0x8195c68, clear=1) at Objects/frameobject.c:371 (gdb) up #3 0x80587e3 in call_trace (p_trace=0x8195c88, p_newtrace=0x8195c88, f=0x8195c68, msg=0x809c3a2 "line", arg=0x80b5c0c) at Python/ceval.c:2595 I tested this under RedHat 6.1 with Python 2.1 (both the copy that comes with Zope and one I built from source with debug symbols). For more info, contact via email: info at wingide.com. ---------------------------------------------------------------------- >Comment By: Jeremy Hylton (jhylton) Date: 2001-09-10 08:29 Message: Logged In: YES user_id=31392 I made a half-hearted effort to reproduce. I tried to just import and execute the code in Guards with a trace function installed. I got that to work correctly with Python 2.1.1. There was a nested scopes core dump that was fixed in 2.1.1. The bug that triggered it was reported by Evan and triggered by RestrictedPython. Can you try to reproduce against 2.1.1? I suspect that the fix in 2.1.1 fixes this, too. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:30:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:30:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-451309 ] don't store traceback objects Message-ID: Bugs item #451309, was opened at 2001-08-15 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 Category: Python Library Group: None >Status: Closed Resolution: Fixed Priority: 6 Submitted By: Jeremy Hylton (jhylton) Assigned to: Jeremy Hylton (jhylton) Summary: don't store traceback objects Initial Comment: A TestResult object stores the exceptions raised when tests fail. The only use of these stored tracebacks, it seems, is to print a stack trace when the test run's report is generated. The traceback objects, however, keep pointers to a bunch of objects that might otherwise be garbage collected. I ran into this on Windows, where the traceback was keeping a file object alive. Because the file object was not collected, my tearDown() method could not remove the file. This patch changes unittest to generate the formatted traceback immediately, so that it does not keep tracebacks around any longer than needed. ---------------------------------------------------------------------- Comment By: Steve Purcell (purcell) Date: 2001-09-06 01:27 Message: Logged In: YES user_id=21477 I've made a fix now. From the CVS checkin message: Changed TestResult to store only the text representation of an error. This patch is similar to that proposed by Jeremy. The proposed patch altered the interface of TestResult such that it would be passed the error information as a string rather than an exc_info() tuple. The implemented change leaves the interface untouched so that TestResults are still passed the tracebacks, but stor them in stringified form for later reporting. Notes: - Custom subclasses of TestResult written by users should be unaffected. - The existing 'unittestgui.py' will still work with this module after the change. - Support can later be added to pop into the debugger when an error occurs; this support should be added to a TestRunner rather than to TestCase itself, which this change will enable. (Jeremy, Fred, Guido: Thanks for all the feedback) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:12 Message: Logged In: YES user_id=6380 Jeremy, can you propose a patch for this? Steve isn't going to fix it without some help. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 08:27 Message: Logged In: YES user_id=31392 We had a water-cooler conversation about this issue. It was observed that keeping tracebacks alive until the end of a test suite isn't very useful, because any number of objects on the stack may be mutated during the subsequent run of the program. In general, a traceback object should be handed to the debugger right away or processed in some other way. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-16 08:38 Message: Logged In: YES user_id=31392 I think this feature is more trouble than it's worth. If a testrunner wants to capture the actual exception, it could easily override the addError or addFailure method to get the traceback then. The cost of the feature is high, particularly since it is not used by anyone. The effects of preserving tracebacks can be hard to discern, and I expect when it happens it will cause a lot of confusion. In my case, two experienced Python programmers, who are novices with unittest, spent several hours trying to figure out what went wrong. I don't think updating the docs will be particularly helpful, because this situation is somewhat unusual and the current behavior so surprising. ---------------------------------------------------------------------- Comment By: Steve Purcell (purcell) Date: 2001-08-15 14:46 Message: Logged In: YES user_id=21477 Hi Jeremy, This behaviour is actually known and intentional; the dangers are documented as a caveat in the PyUnit docs. The intention was that a test runner (GUI or otherwise) could potentially make the traceback available for inspection when a test fails, to aid in debugging. In your particular case, relying on GC to close the file might have caused problems with following code even if PyUnit didn't store the traceback. Overall I'd prefer to keep storing the tracebacks, especially since they only get stored when tests fail. It would be worth me adding a note about GC interaction to the docs, though. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:43:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:43:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-459464 ] Math_test overflowerror on sparc64 linux Message-ID: Bugs item #459464, was opened at 2001-09-07 02:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Math_test overflowerror on sparc64 linux Initial Comment: Traceback(most recent call last): testit('asin(-1)',math.asin(-1),-math.pi/2) OverflowError: math range error ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-10 08:43 Message: Logged In: YES user_id=21627 Also, what compiler did you use? gcc on sparc64 (all versions) has known floating point bugs, so that it is not capable of building reliable 64-bit binaries, see gcc.gnu.org for details. The test works fine for me on Solaris 8, with the Sun WS6U1 compiler. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-07 02:58 Message: Logged In: YES user_id=31435 Needs more info. Which version of Python? If you try asin(-1) in a C program on this box, does the math library set errno? If so, it's a platform C bug, and you should report it to your C vendor (Python doesn't do anything with asin except call the platform asin, and if that sets errno to ERANGE, Python raises OverflowError; asin (-1) should not set errno to ERANGE, but if it does there's nothing Python can do about that). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 From noreply@sourceforge.net Mon Sep 10 16:58:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 08:58:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-460357 ] test_time fails on Sparc64 Message-ID: Bugs item #460357, was opened at 2001-09-10 08:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460357&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Nobody/Anonymous (nobody) Summary: test_time fails on Sparc64 Initial Comment: On Solaris8, with the WS6U1 compiler, after setting CC to 'cc -xarch=v9', test_time.py fails with File "Lib/test/test_time.py", line 46, in test_mktime time.mktime, (999999, 999999, 999999, 999999, File "/vol/marvin-vol8/loewis/python/dist/src/Lib/unittest.py", line 273, in failUnlessRaises raise self.failureException, excName AssertionError: OverflowError The problem is that the test doesn't overflow. Instead, it gives the value 34214554704339.0. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460357&group_id=5470 From noreply@sourceforge.net Mon Sep 10 17:45:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 09:45:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-457360 ] Nested scopes crash when tracing (v2.1) Message-ID: Bugs item #457360, was opened at 2001-08-31 12:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Stephan R.A. Deibel (sdeibel) Assigned to: Jeremy Hylton (jhylton) Summary: Nested scopes crash when tracing (v2.1) Initial Comment: Python will crash on post-trace processing if the tracer is installed during a class def nested inside of a nest function def, under certain conditions at least. I tried to make a small test case but that didn't bring out the bug. As a result, this is best illustrated by installing Zope 2.4.0 (I did this on Linux) and altering z2.py by inserting the following near the top of the file: def tracer(*args): print "trace" return tracer import sys sys.settrace(tracer) Then run with the './start' command. Python will segfault during the following around line 570 of z2.py: exec "import "+MODULE in {} The real problem is the LocalsToFast() call after the tracer has been called while the interpreter is doing the 'line' tracing for line 118 of libs/python/RestrictedPython/Gaurds.py in Zope, where "class Wrapper" is defined nested inside of a nested function. The innermost part of the C backtrace is: #0 PyCell_Set (op=0x0, obj=0x8322e04) at Objects/cellobject.c:32 (gdb) up #1 0x808068a in dict_to_map (map=0x81d5cc4, nmap=1, dict=0x81d269c, values=0x8195db0, deref=1, clear=1) at Objects/frameobject.c:287 (gdb) up #2 0x8080903 in PyFrame_LocalsToFast (f=0x8195c68, clear=1) at Objects/frameobject.c:371 (gdb) up #3 0x80587e3 in call_trace (p_trace=0x8195c88, p_newtrace=0x8195c88, f=0x8195c68, msg=0x809c3a2 "line", arg=0x80b5c0c) at Python/ceval.c:2595 I tested this under RedHat 6.1 with Python 2.1 (both the copy that comes with Zope and one I built from source with debug symbols). For more info, contact via email: info at wingide.com. ---------------------------------------------------------------------- >Comment By: Stephan R.A. Deibel (sdeibel) Date: 2001-09-10 09:45 Message: Logged In: YES user_id=12608 Oops, this is indeed a duplicate of bug #439798, fixed in 2.1.1. I must have gotten confused when testing because Zope was running with its own opy of 2.1.0. This also explains why my small example didn't work... it was running under 2.1.1. Sorry. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-09-10 08:29 Message: Logged In: YES user_id=31392 I made a half-hearted effort to reproduce. I tried to just import and execute the code in Guards with a trace function installed. I got that to work correctly with Python 2.1.1. There was a nested scopes core dump that was fixed in 2.1.1. The bug that triggered it was reported by Evan and triggered by RestrictedPython. Can you try to reproduce against 2.1.1? I suspect that the fix in 2.1.1 fixes this, too. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=457360&group_id=5470 From noreply@sourceforge.net Mon Sep 10 21:45:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 13:45:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) >Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Mon Sep 10 21:57:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 13:57:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Mon Sep 10 22:23:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 14:23:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-229288 ] urllib.quote et al do lowercase %xx Message-ID: Bugs item #229288, was opened at 2001-01-18 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 Category: Python Library Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: urllib.quote et al do lowercase %xx Initial Comment: The python 2.0 urllib has %%%x as a format when quoting forbidden characters. There are scripts out there that break with lower case, therefore I guess %%%X should be used. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-10 14:23 Message: Logged In: NO Actually, now there are scripts that break the new way (with upper case)! Perhaps this should be a selectable option...minimally, a optional argument to urllib.quote and urllib.quote_plus. -Ron ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-01-18 19:28 Message: Agreed. Fixed in CVS, will be released with 2.1a1. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 From noreply@sourceforge.net Mon Sep 10 22:29:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 14:29:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Mon Sep 10 22:32:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 14:32:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-460467 ] file objects should be subclassable Message-ID: Bugs item #460467, was opened at 2001-09-10 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: file objects should be subclassable Initial Comment: We should be able to use fileobject as a base clase in 2.2 (but can't yet). A file() constructor should be made a new builtin, and work like builtin open() works. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 From noreply@sourceforge.net Mon Sep 10 22:35:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 14:35:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-229288 ] urllib.quote et al do lowercase %xx Message-ID: Bugs item #229288, was opened at 2001-01-18 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 Category: Python Library Group: None >Status: Open Resolution: Fixed >Priority: 3 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: urllib.quote et al do lowercase %xx Initial Comment: The python 2.0 urllib has %%%x as a format when quoting forbidden characters. There are scripts out there that break with lower case, therefore I guess %%%X should be used. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 14:35 Message: Logged In: YES user_id=6380 OK, reopened, but I'd like to find out what the problem is here. It sounds like there are servers that only accept lowercase in %xx-encoded URLs. It seems that those servers are broken, right? Or is there a different problem? (PS. Please don't post anonymously if you want a response!) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-10 14:23 Message: Logged In: NO Actually, now there are scripts that break the new way (with upper case)! Perhaps this should be a selectable option...minimally, a optional argument to urllib.quote and urllib.quote_plus. -Ron ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-01-18 19:28 Message: Agreed. Fixed in CVS, will be released with 2.1a1. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 From noreply@sourceforge.net Mon Sep 10 22:49:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 14:49:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-229288 ] urllib.quote et al do lowercase %xx Message-ID: Bugs item #229288, was opened at 2001-01-18 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Fixed Priority: 3 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: urllib.quote et al do lowercase %xx Initial Comment: The python 2.0 urllib has %%%x as a format when quoting forbidden characters. There are scripts out there that break with lower case, therefore I guess %%%X should be used. ---------------------------------------------------------------------- Comment By: Ronald Hiller (rhiller) Date: 2001-09-10 14:49 Message: Logged In: YES user_id=321016 I'm using the .quote and .quote_plus routines independent of the rest of the urllib facilities. The case that came up was where a Java application is encoding URLs (it generated lower case hexadecimal) and stuffing them into a database. My python application was passed a URL as an argument and then quoting it and querying for it. Since the case of the hexadecimal didn't match, no results were returned. Now, I will agree that my use of these quote/unquote routines may be a bit unusual, but they're so handy, and they worked with Python 2.0 :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 14:35 Message: Logged In: YES user_id=6380 OK, reopened, but I'd like to find out what the problem is here. It sounds like there are servers that only accept lowercase in %xx-encoded URLs. It seems that those servers are broken, right? Or is there a different problem? (PS. Please don't post anonymously if you want a response!) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-10 14:23 Message: Logged In: NO Actually, now there are scripts that break the new way (with upper case)! Perhaps this should be a selectable option...minimally, a optional argument to urllib.quote and urllib.quote_plus. -Ron ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-01-18 19:28 Message: Agreed. Fixed in CVS, will be released with 2.1a1. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 From noreply@sourceforge.net Tue Sep 11 00:39:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 16:39:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 01:03:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 17:03:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-460512 ] Unclear how to get popen2 exit statii Message-ID: Bugs item #460512, was opened at 2001-09-10 17:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460512&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Unclear how to get popen2 exit statii Initial Comment: The docs for the popen2.{popen2, popen3, popen4} functions don't say how to get the exit status of the spawned process. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460512&group_id=5470 From noreply@sourceforge.net Tue Sep 11 02:40:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 18:40:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-229288 ] urllib.quote et al do lowercase %xx Message-ID: Bugs item #229288, was opened at 2001-01-18 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 Category: Python Library Group: None >Status: Closed Resolution: Fixed Priority: 3 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: urllib.quote et al do lowercase %xx Initial Comment: The python 2.0 urllib has %%%x as a format when quoting forbidden characters. There are scripts out there that break with lower case, therefore I guess %%%X should be used. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 18:40 Message: Logged In: YES user_id=6380 Oh well. Too bad for you. :-) ---------------------------------------------------------------------- Comment By: Ronald Hiller (rhiller) Date: 2001-09-10 14:49 Message: Logged In: YES user_id=321016 I'm using the .quote and .quote_plus routines independent of the rest of the urllib facilities. The case that came up was where a Java application is encoding URLs (it generated lower case hexadecimal) and stuffing them into a database. My python application was passed a URL as an argument and then quoting it and querying for it. Since the case of the hexadecimal didn't match, no results were returned. Now, I will agree that my use of these quote/unquote routines may be a bit unusual, but they're so handy, and they worked with Python 2.0 :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 14:35 Message: Logged In: YES user_id=6380 OK, reopened, but I'd like to find out what the problem is here. It sounds like there are servers that only accept lowercase in %xx-encoded URLs. It seems that those servers are broken, right? Or is there a different problem? (PS. Please don't post anonymously if you want a response!) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-10 14:23 Message: Logged In: NO Actually, now there are scripts that break the new way (with upper case)! Perhaps this should be a selectable option...minimally, a optional argument to urllib.quote and urllib.quote_plus. -Ron ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-01-18 19:28 Message: Agreed. Fixed in CVS, will be released with 2.1a1. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=229288&group_id=5470 From noreply@sourceforge.net Tue Sep 11 02:43:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 18:43:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 04:09:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Sep 2001 20:09:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 09:03:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 01:03:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific >Status: Open >Resolution: Invalid Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 01:03 Message: Logged In: YES user_id=43607 I am reopening this bug. In the current version of Python, with a current version of IRIX (6.5.13), the test still fails. If you look closely at the output and compare it with the comment and code in the test file, you can see why: The output that the test got was 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n'. The test removes a final \r\n and replaces it with just \n before comparing (the result is shown above), but it doesn't do that for embedded \r\n, and that is what is wrong with the output. I suggest changing the lines if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" to something like s1 = string.join(string.split(s1, '\r\n'), '\n') (or s1 = '\n'.join(s1.split('\r\n')) ). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Tue Sep 11 09:12:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 01:12:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-460613 ] test_commands fails on SGI Message-ID: Bugs item #460613, was opened at 2001-09-11 01:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460613&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: test_commands fails on SGI Initial Comment: test_commands fails on SGI. The problem is that the test expects /bin/ls to be a file, whereas on IRIX it's a symbolic link. For completeness, here is the output of running the test: + ./python ../Lib/test/regrtest.py test_commands.py test_commands test test_commands failed -- Traceback (most recent call last): File "../Lib/test/test_commands.py", line 43, in test_getstatus self.assert_(re.match(pat, getstatus("/bin/ls"), re.VERBOSE)) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 256, in failUnless if not expr: raise self.failureException, msg AssertionError 1 test failed: test_commands ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460613&group_id=5470 From noreply@sourceforge.net Tue Sep 11 09:26:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 01:26:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI Message-ID: Bugs item #460615, was opened at 2001-09-11 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: test_fpformat fails on SGI Initial Comment: With the current version of Python on IRIX 6.5.13, compiled without -O, test_fpformat fails. It boils down to this: fpformat.fix(-0.003, 0) results in the string "-0" whereas "%.*f" % (0, float(-0.003)) results in "0". The output of the test is + ./python ../Lib/test/regrtest.py test_fpformat.py test_fpformat test test_fpformat failed -- Traceback (most recent call last): File "../Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "../Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 280, in failUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 1 test failed: test_fpformat ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 From noreply@sourceforge.net Tue Sep 11 12:31:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 04:31:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:01:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:01:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Closed Resolution: Fixed Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:04:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:04:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None >Status: Open >Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:25:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:25:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-228685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe Message-ID: Bugs item #228685, was opened at 2001-01-13 11:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open >Resolution: Fixed Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: popen on Win9x isnt smart enough about finding w9xpopen.exe Initial Comment: The code in posixmodule that emulates popen*() isnt very smart about locating the .exe for the Win9x popen hacks. It assumes that w9xpopen.exe can be located in the directory of the main executable, which fails in may embedding situations. A reasonable fix would be to also attempt to locate the file in the "sys.prefix" directory - typically this will be set correctly. Im not at my main dev machine, hence I am submitting a bug rather than a patch. I will submit a patch ASAP. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:25 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-30 23:32 Message: Partial fix checked in Rev 2.183 of Modules/posixmodule.c As per the comments in that checkin, the code now tries sys.prefix, but in many embedded situations this is still NULL/empty. As soon as source-force is accepting new bugs I will close this and open a new one for sys.prefix being empty in some conditions. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-13 11:39 Message: Giving to me! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:26:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:26:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-228685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe Message-ID: Bugs item #228685, was opened at 2001-01-13 11:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: Fixed Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: popen on Win9x isnt smart enough about finding w9xpopen.exe Initial Comment: The code in posixmodule that emulates popen*() isnt very smart about locating the .exe for the Win9x popen hacks. It assumes that w9xpopen.exe can be located in the directory of the main executable, which fails in may embedding situations. A reasonable fix would be to also attempt to locate the file in the "sys.prefix" directory - typically this will be set correctly. Im not at my main dev machine, hence I am submitting a bug rather than a patch. I will submit a patch ASAP. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:26 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:25 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-30 23:32 Message: Partial fix checked in Rev 2.183 of Modules/posixmodule.c As per the comments in that checkin, the code now tries sys.prefix, but in many embedded situations this is still NULL/empty. As soon as source-force is accepting new bugs I will close this and open a new one for sys.prefix being empty in some conditions. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-13 11:39 Message: Giving to me! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:37:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:37:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-228685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe Message-ID: Bugs item #228685, was opened at 2001-01-13 11:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: Fixed Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: popen on Win9x isnt smart enough about finding w9xpopen.exe Initial Comment: The code in posixmodule that emulates popen*() isnt very smart about locating the .exe for the Win9x popen hacks. It assumes that w9xpopen.exe can be located in the directory of the main executable, which fails in may embedding situations. A reasonable fix would be to also attempt to locate the file in the "sys.prefix" directory - typically this will be set correctly. Im not at my main dev machine, hence I am submitting a bug rather than a patch. I will submit a patch ASAP. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:37 Message: Logged In: YES user_id=14198 oops - meant "now that sys.prefix is always set correctly." in the last entry. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:26 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:25 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-30 23:32 Message: Partial fix checked in Rev 2.183 of Modules/posixmodule.c As per the comments in that checkin, the code now tries sys.prefix, but in many embedded situations this is still NULL/empty. As soon as source-force is accepting new bugs I will close this and open a new one for sys.prefix being empty in some conditions. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-13 11:39 Message: Giving to me! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 From noreply@sourceforge.net Tue Sep 11 13:57:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 05:57:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-460686 ] iter() over non-sequence message Message-ID: Bugs item #460686, was opened at 2001-09-11 05:57 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460686&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Nobody/Anonymous (nobody) Summary: iter() over non-sequence message Initial Comment: Effbot writes: maybe it's just me, but I just spent five minutes trying to figure out why an innocent-looking line of code resulted in an "iter() of non-sequence" type error. I finally ran it under 2.1, and immediately realized what was wrong. is there any chance of getting the old, far more helpful "unpack non-sequence" and "loop over non-sequence" error messages back before 2.2 final? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460686&group_id=5470 From noreply@sourceforge.net Tue Sep 11 14:00:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 06:00:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-443239 ] Python 2.2 & Boost.Python Message-ID: Bugs item #443239, was opened at 2001-07-20 18:06 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443239&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Ralf W. Grosse-Kunstleve (rwgk) Assigned to: Guido van Rossum (gvanrossum) Summary: Python 2.2 & Boost.Python Initial Comment: Boost.Python is a C++ library for exposing C++ classes to Python: http://www.boost.org/libs/python/doc/index.html Python's metaclass feature is used to provide objects which look almost exactly like regular Python classes: http://www.boost.org/libs/python/doc/extending.html I have compiled the Boost.Python library using Python 2.2a1 under Linux without getting any compile-time error messages. However, with versions earlier than 2.2, we were able to derive extension classes from a mixture of built-in classes and extension classes, /even if the built-in class was the first listed base/, but that no longer works: Python 2.2a1 (#1, Jul 18 2001, 16:24:59) [GCC 2.95.2 19991024 (release)] on linux2 Type "copyright", "credits" or "license" for more information. >>> from boost_python_test import Bar >>> >>> class RealPythonClass: ... def real_python_method(self): ... print 'RealPythonClass.real_python_method ()' ... >>> class MISubclass2(RealPythonClass, Bar): ... def new_method(self): ... print 'MISubclass2.new_method()' ... Traceback (most recent call last): File "", line 1, in ? TypeError: PyClass_New: base must be a class >>> This example works if the extension class appears first: >>> class MISubclass2(Bar, RealPythonClass): It is somewhat important that built-in Python classes may appear first in the list of bases. Would it be possible to support this in Python 2.2? Thanks! Ralf ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:00 Message: Logged In: YES user_id=6380 Fixed according to private communication, so closing. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 14:12 Message: Logged In: YES user_id=6380 Ralf, can you try this again with the current CVS? I've made a bit of progress in supporting ExtensionClass. Unfortunately, all the progress was made right after Barry released 2.2a3, so downloading 2.2a3 won't work. (If you don't have access to CVS, drop me a note and I'll send you a patch.) You need classobject.c 2.145, typeobject.c 2.57, and abstract.c 2.73. (Or newer, of course.) Note: I don't know if Boost uses ExtensionClass or a similar mechanism. In either case, it's possible that there are still problems -- that's why I'm not closing this bug report yet. But I'm hopeful! Please help! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443239&group_id=5470 From noreply@sourceforge.net Tue Sep 11 14:07:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 06:07:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI Message-ID: Bugs item #460615, was opened at 2001-09-11 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: test_fpformat fails on SGI Initial Comment: With the current version of Python on IRIX 6.5.13, compiled without -O, test_fpformat fails. It boils down to this: fpformat.fix(-0.003, 0) results in the string "-0" whereas "%.*f" % (0, float(-0.003)) results in "0". The output of the test is + ./python ../Lib/test/regrtest.py test_fpformat.py test_fpformat test test_fpformat failed -- Traceback (most recent call last): File "../Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "../Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 280, in failUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 1 test failed: test_fpformat ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:07 Message: Logged In: YES user_id=6380 Channeling Tim: Congratulations! You have found a bug in the C standard library implementation on your platform. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 From noreply@sourceforge.net Tue Sep 11 14:09:35 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 06:09:35 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: Invalid Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:09 Message: Logged In: YES user_id=6380 Oops. Can you try the attached patch? ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 01:03 Message: Logged In: YES user_id=43607 I am reopening this bug. In the current version of Python, with a current version of IRIX (6.5.13), the test still fails. If you look closely at the output and compare it with the comment and code in the test file, you can see why: The output that the test got was 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n'. The test removes a final \r\n and replaces it with just \n before comparing (the result is shown above), but it doesn't do that for embedded \r\n, and that is what is wrong with the output. I suggest changing the lines if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" to something like s1 = string.join(string.split(s1, '\r\n'), '\n') (or s1 = '\n'.join(s1.split('\r\n')) ). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Tue Sep 11 14:33:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 06:33:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: Invalid Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 06:33 Message: Logged In: YES user_id=43607 The patch does the trick. The test no longer fails. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:09 Message: Logged In: YES user_id=6380 Oops. Can you try the attached patch? ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 01:03 Message: Logged In: YES user_id=43607 I am reopening this bug. In the current version of Python, with a current version of IRIX (6.5.13), the test still fails. If you look closely at the output and compare it with the comment and code in the test file, you can see why: The output that the test got was 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n'. The test removes a final \r\n and replaces it with just \n before comparing (the result is shown above), but it doesn't do that for embedded \r\n, and that is what is wrong with the output. I suggest changing the lines if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" to something like s1 = string.join(string.split(s1, '\r\n'), '\n') (or s1 = '\n'.join(s1.split('\r\n')) ). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Tue Sep 11 15:03:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 07:03:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 15:25:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 07:25:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:25 Message: Logged In: YES user_id=6380 OK. Closed again. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 06:33 Message: Logged In: YES user_id=43607 The patch does the trick. The test no longer fails. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:09 Message: Logged In: YES user_id=6380 Oops. Can you try the attached patch? ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 01:03 Message: Logged In: YES user_id=43607 I am reopening this bug. In the current version of Python, with a current version of IRIX (6.5.13), the test still fails. If you look closely at the output and compare it with the comment and code in the test file, you can see why: The output that the test got was 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n'. The test removes a final \r\n and replaces it with just \n before comparing (the result is shown above), but it doesn't do that for embedded \r\n, and that is what is wrong with the output. I suggest changing the lines if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" to something like s1 = string.join(string.split(s1, '\r\n'), '\n') (or s1 = '\n'.join(s1.split('\r\n')) ). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Tue Sep 11 15:49:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 07:49:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 17:22:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 09:22:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-228685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe Message-ID: Bugs item #228685, was opened at 2001-01-13 11:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: Fixed Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: popen on Win9x isnt smart enough about finding w9xpopen.exe Initial Comment: The code in posixmodule that emulates popen*() isnt very smart about locating the .exe for the Win9x popen hacks. It assumes that w9xpopen.exe can be located in the directory of the main executable, which fails in may embedding situations. A reasonable fix would be to also attempt to locate the file in the "sys.prefix" directory - typically this will be set correctly. Im not at my main dev machine, hence I am submitting a bug rather than a patch. I will submit a patch ASAP. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:22 Message: Logged In: YES user_id=31435 Mark, I haven't noticed any differences in the behavior of test_popen2 on Win98SE, whether from an installed Python or from PCBuild. Did you expect something to break in the latter case? It doesn't for me. You can test it yourself on Win2K by setting COMSPEC to point to command.com (in which case a recent patch makes Python use w9xpopen.exe even on NT/2000). ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:37 Message: Logged In: YES user_id=14198 oops - meant "now that sys.prefix is always set correctly." in the last entry. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:26 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:25 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-30 23:32 Message: Partial fix checked in Rev 2.183 of Modules/posixmodule.c As per the comments in that checkin, the code now tries sys.prefix, but in many embedded situations this is still NULL/empty. As soon as source-force is accepting new bugs I will close this and open a new one for sys.prefix being empty in some conditions. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-13 11:39 Message: Giving to me! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 From noreply@sourceforge.net Tue Sep 11 17:48:19 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 09:48:19 -0700 Subject: [Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI Message-ID: Bugs item #460615, was opened at 2001-09-11 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 Category: None >Group: 3rd Party Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: test_fpformat fails on SGI Initial Comment: With the current version of Python on IRIX 6.5.13, compiled without -O, test_fpformat fails. It boils down to this: fpformat.fix(-0.003, 0) results in the string "-0" whereas "%.*f" % (0, float(-0.003)) results in "0". The output of the test is + ./python ../Lib/test/regrtest.py test_fpformat.py test_fpformat test test_fpformat failed -- Traceback (most recent call last): File "../Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "../Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 280, in failUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 1 test failed: test_fpformat ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:48 Message: Logged In: YES user_id=31435 Guido's getting pretty good at this . Try printf("%.0f\n", -0.003); in C on this box. If that omits a minus sign, the platform libc is in error. Changed Group to 3rd Party assuming that's what's happening. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:07 Message: Logged In: YES user_id=6380 Channeling Tim: Congratulations! You have found a bug in the C standard library implementation on your platform. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 From noreply@sourceforge.net Tue Sep 11 17:56:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 09:56:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 17:59:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 09:59:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 18:45:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 10:45:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-453099 ] select in asyncore not defensive Message-ID: Bugs item #453099, was opened at 2001-08-19 15:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453099&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jeremy Hylton (jhylton) Summary: select in asyncore not defensive Initial Comment: The poll method in asyncore.py does not wrap the select.select call on line 86 in a try/except block to test for EINTR/EWOULDBLOCK and then try the select call again. This was brought to my attention during the perusal of the Zope-dev list. Seems like the person who originally reported the symptom did not open a bug so I thought I would. Platform: SunOS 5.8/Sparc Python version: 2.1.1 Zope version: 2.4.0 Thanks. Here is the mail from a person on the Zope-dev mailing list: I am moving this thread over from the zope list in the hope that someone here may have more insight into the nature of this problem, and perhaps how to go about better diagnosing/fixing the problem. To sum up: Under apparently random circumstances and rather mild amounts of traffic, Zope is crashing and printing the Traceback below to the console. This is Zope-2.4.0, Python-2.1.1 on SunOS 5.8/Sparc. Traceback (most recent call last): File "/u01/zope/Zope-2.4.0-src/z2.py", line 774, in ? asyncore.loop() File "/u01/zope//lib/python2.1/asyncore.py", line 194, in loop poll_fun (timeout, map) File "/u01/zope//lib/python2.1/asyncore.py", line 86, in poll r,w,e = select.select (r,w,e, timeout) select.error: (4, 'Interrupted system call') ---------------------------------------------------------------------- >Comment By: Jeremy Hylton (jhylton) Date: 2001-09-11 10:45 Message: Logged In: YES user_id=31392 I thkn the select() and poll() calls should be defensive and be resumed as long as a timeout was specified and not yet exceeded. I'll check with Sam and see what he things. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-08-20 09:57 Message: Logged In: YES user_id=12800 Assigning to Jeremy. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-19 15:47 Message: Logged In: NO Sorry, the user's email is jziniti@speakeasy.org. EWOULDBLOCK was reported by that user for a different method in asyncore called accept though it seems that EWOULDBLOCK is being handled correctly in accept. It seems that the user did add the try/except block around the select call on line 86 which resulted in later call to accept() throwing EWOULDBLOCK. The trace is as follows: system.error 4((4, 'Interrupted system call')) ------ 2001-08-16T13:16:01 ERROR(200) ZServer uncaptured python exception, closing channel <__repr__ (self) failed for object at dee7bc (addr='/tmp/zope.soc')> (exceptions.TypeError:unpack non-sequence [/u01/zope/lib/python2.1/asyncore.py|poll|101] [/u01/zope/lib/python2.1/asyncore.py|handle_read_event|383] [/u01/zope/Zope-2.4.0-src/ZServer/FCGIServer.py|handle_accept|697]) ------ 2001-08-16T13:16:01 ERROR(200) ZServer uncaptured python exception, closing channel <__repr__ (self) failed for object at dec4bc (addr='/u01/zope/Zope-2.4.0-src/var/pcgi.soc')> (exceptions.TypeError:unpack non-sequence [/u01/zope/lib/python2.1/asyncore.py|poll|101] [/u01/zope/lib/python2.1/asyncore.py|handle_read_event|383] [/u01/zope/Zope-2.4.0-src/ZServer/PCGIServer.py|handle_accept|380]) ------ 2001-08-16T13:16:01 ERROR(200) ZServer uncaptured python exception, closing channel (exceptions.TypeError:unpack non-sequence [/u01/zope/lib/python2.1/asyncore.py|poll|101] [/u01/zope/lib/python2.1/asyncore.py|handle_read_event|383] [/u01/zope/Zope-2.4.0-src/ZServer/FTPServer.py|handle_accept|694]) ------ 2001-08-16T13:16:01 PROBLEM(100) ZServer warning: server accept() threw EWOULDBLOCK ------ 2001-08-16T13:16:01 ERROR(200) ZServer uncaptured python exception, closing channel (exceptions.OSError:[Errno 11] Resource temporarily unavailable [/u01/zope/lib/python2.1/asyncore.py|poll|101] [/u01/zope/lib/python2.1/asyncore.py|handle_read_event|389] [/u01/zope/Zope-2.4.0-src/ZServer/medusa/thread/select_trigger.py|handle_read|77] [/u01/zope/lib/python2.1/asyncore.py|recv|341] [/u01/zope/lib/python2.1/asyncore.py|recv|523]) Thanks. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453099&group_id=5470 From noreply@sourceforge.net Tue Sep 11 20:50:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 12:50:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 20:57:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 12:57:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-460512 ] Unclear how to get popen2 exit statii Message-ID: Bugs item #460512, was opened at 2001-09-10 17:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460512&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Unclear how to get popen2 exit statii Initial Comment: The docs for the popen2.{popen2, popen3, popen4} functions don't say how to get the exit status of the spawned process. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-11 12:57 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libos.tex revision 1.64 and Doc/lib/libpopen2.tex revision 1.15. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460512&group_id=5470 From noreply@sourceforge.net Tue Sep 11 21:01:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 13:01:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-416901 ] 2.1 on OpenBSD 2.8: lots of bugs @ build Message-ID: Bugs item #416901, was opened at 2001-04-17 17:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416901&group_id=5470 Category: None >Group: Irreproducible >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Brad Allen (valaulmo) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: 2.1 on OpenBSD 2.8: lots of bugs @ build Initial Comment: I am doing a survey of current distributed information systems, to see if they are close to what they should be (I figured out what they should be in 1984), and am forced to find a Python which Mojo Nation is compatible with. I will probably go back to Python 2.0, but since the latest released version (released today!) was 2.1, I just started there (since the stable one for OpenBSD 2.8 was way back at Python 1.6 and I figured anything past that was experimenting anyway). --- Python 2.1 on OpenBSD 2.8 with Pentium I: I'm getting these warnings while compiling Python 2.1 on OpenBSD 2.8: cc -o python \ Modules/python.o \ libpython2.1.a -lc_r -lutil -L/usr/local/lib -lz -lm ./Modules/posixmodule.c:2995: warning: this program uses setreuid(), which is deprecated. ./Modules/posixmodule.c:3014: warning: this program uses setregid(), which is deprecated. ./Modules/posixmodule.c:4147: warning: tempnam() possibly used unsafely; consider using mkstemp() ./Modules/posixmodule.c:4193: warning: tmpnam() possibly used unsafely; consider using mkstemp() ld: libpython2.1.a(fileobject.o): RRS text relocation at 0x31168 for "_flockfile" ld: libpython2.1.a(fileobject.o): RRS text relocation at 0x311af for "_funlockfile" PYTHONPATH= ./python ./setup.py build running build Please consider fixing those things. --- *** HUNG test_bufio.py When running tests as "MAKE=gmake gmake test", it hung under test_bufio. It required a SIGKILL to stop. I tried two things: * Running test as README says manually with "python ...". python ./Lib/test/test_bufio.py This worked OK and produced no output that I was aware of (unless it was hidden). * Tried defining DONT_USE_FGETS_IN_GETLINE in the file where it was looked at (./Objects/fileobject.c). This did not help; it still hung. Running the test manually again at this point worked also. So, I had to find a way to skip that test (hid it in a subdirectory called HIDE). *** HUNG test_complex.py The same thing happened with test_complex.py: it hung during "...make test", but ran OK manually; then I hid it to skip. For test_dl, I got slightly different results; after the usual hanging, I then manually ran it and got: *** HUNG test_dl.py* Q:/usr/local/src/python/Python-2.1:2148$ python Lib/test/test_dl.py Traceback (most recent call last): File "Lib/test/test_dl.py", line 6, in ? import dl ImportError: No module named dl Q:/usr/local/src/python/Python-2.1:2149$ In each case, lots of CPU by the "python" process was used as its "hung" state. I waited approximately three minutes of CPU. A 133Megahertz Pentium with a CPU cache on a Dell computer is extremely fast, and ought to finish any test within two minutes. Tell me if I just failed to wait long enough for an increadibly inefficiently programmed test to complete, and I'll retry it. The fact that it did not respond to signals except KILL also indicates to me that it was comotose. (This discussion reminds me of a date where the person told me that the commands in Unix are very violent sounding and the names of the principles used by programmers are very anti-social. I'm glad someone thinks that way, since English itself is far, far worse, according to http://www.islandnet.com/~edonon/decoding.htm, and I said to myself "how can anybody use this language?" in disgust. Someday we'll fix that, too (and not just for historical politeness; for pureness of utility and efficiency -- snowballed efficiency!).) --- *** MEMORY FAULT test_fork1.py While the tests were running "test_fork1", I got a Memory Fault. Rerunning it manually worked, though, and I hid it also. (I did not test rerunning it.) While waiting for all these tests to hang, I got tired of it and now I want to request that you have all the tests run in parallel. That way, it is easier to weed out all the hanging ones in one shot. This is easy, right? *** HUNG test_compile.py Next to hang was this one: $ python ./Lib/test/test_compile.py Running tests on argument handling testing complex args 1 2 1 2 3 4 1 2 3 1 2 3 2 3 4 $ As you can see, it ran OK manually, and this time I had some output to look at. While looking at it I realized that I do not know if those are the expected results, and in the house I'm in, I have to listen to too much hollaring to be able to learn Python in a few minutes like I am usually able to do in proper environments. *** HUNG test_doctest.py test_doctest.py passed manually but automatically hung, too. It had too much output to include it all, but the last line said the test passed. *** HUNG & SEGFAULT test_threadedtempfile.py For test_threadedtempfile, I got a bad error: $ python Lib/test/test_threadedtempfile.py Creating Starting Reaping Segmentation fault (core dumped) $ rm *core $ python Lib/test/test_threadedtempfile.py Creating Starting Reaping ^C^C^C^Z ^Z^X^C Killed $ $ jobs [1]- Stopped less README [2]+ Stopped MAKE=gmake gmake test $ sync $ rm Lib/test/test_threadedt So far, a few tests ran better the second time than the first. Is the compiling working better than the interpreting? --- Brad Allen * ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-11 13:01 Message: Logged In: YES user_id=3066 Not able to reproduce this, and there are no corroborating reports. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-01 20:21 Message: Logged In: YES user_id=3066 --sigh-- Still having problems getting access on an OpenBSD machine. Appearantly one has been set up at my employers main office, but I can't get to it from the PythonLabs office yet. ;-( No, I'm not ignoring this, but the priority isn't high given that I can't get to a usable installation. (It would be great if SourceForge could provide one on the compile farm, or if their FreeBSD machine actually responded.) ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-07-17 08:22 Message: Logged In: YES user_id=3066 I'm looking into getting access to an OpenBSD machine to test on. The last comment in the bug report makes me wonder a bit, however: did you wait for long to see if the tests terminated? Many of the tests will appear to run faster during the second phase of the test since the test modules will have already been byte-compiled, but the byte-code used to execute the tests will be the same during both phases. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-07-11 11:29 Message: Logged In: YES user_id=3066 The warnings are irrelevant -- any package that wraps those functions to make them available to applications will cause those warnings on OpenBSD, even if they are never used. The other issues require more attention than I can spare this week, so I'll leave this open. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416901&group_id=5470 From noreply@sourceforge.net Tue Sep 11 22:27:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 14:27:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-458878 ] strict-protypes and signalmodule.c Message-ID: Bugs item #458878, was opened at 2001-09-05 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 Category: Python Interpreter Core Group: Platform-specific >Status: Closed Resolution: Wont Fix Priority: 2 Submitted By: Jack Jansen (jackjansen) Assigned to: Jack Jansen (jackjansen) Summary: strict-protypes and signalmodule.c Initial Comment: Signalmodule.c generates lots of warnings when compiled with gcc -Wstrict-prototypes. If someone wants to pick this up: fine, otherwise I'll do it myself, but it will be a while until I find the time. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-11 14:27 Message: Logged In: YES user_id=45365 Filed a bug report on this with Apple. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-07 09:23 Message: Logged In: YES user_id=21627 I got myself access to a Mac OS X system, and found that the SIG_ macros are replaced as (void (*)())1 gcc would be happy if that was written as (void (*)(int))1 ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 07:34 Message: Logged In: YES user_id=45365 Ow, bah! Always playing the smart guy, brr.... :-) You're right, of course: I looked at socketmodule and found real errors there and just assumed socket had the same problem. I'll file a bug with Apple and close it when I've actually remembered to do that. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-07 05:47 Message: Logged In: YES user_id=6380 Jack, am I right that you didn't even LOOK at the lines indicated by those errors? :-) The compiler flagged all occurrences of SIG_IGN, SIG_DFL, and SIG_ERR. Those are macros that come from , that contain a cast to a function type. Apparently that function type doesn't have a prototype. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-07 02:44 Message: Logged In: YES user_id=45365 Sorry, I was being obscure. The problem at hand is that gcc on MacOSX wants all declarations to be prototype-style, so no K7R style even for static routines, if you give -Wall -Wstrict-prototypes. Attached is the compiler output. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:55 Message: Logged In: YES user_id=6380 Do you mean that it wants a separate declaration, before the definition? That's outright silly. Complain to Apple. We're not going to fix that. I get zero warnings on Linux, with the same options. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-05 13:41 Message: Logged In: YES user_id=45365 No, it's not in the header files or anything. Gcc on OSX (at least with -Wall -Wstrict-prototypes) requires that all routines, *including static ones*, have prototype-style declarations. I'm not sure how well gcc versions compare between platforms, but mine says it is "2.95.2". And then I'm not even complaining (yet) about the MetroWerks compiler, which requires that for every external routine defined there is already a prototyped declaration in scope:-) And according to the letter of the ANSI standard it is right about requiring this, but every single ...init() routine fails this test. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:33 Message: Logged In: YES user_id=6380 Not for me on Linux. It's probably something in your header files. What platform? IRIX or MacOSX? :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458878&group_id=5470 From noreply@sourceforge.net Tue Sep 11 22:29:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 14:29:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-450510 ] results of build on Mac OS X 10.0.4 Message-ID: Bugs item #450510, was opened at 2001-08-13 08:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=450510&group_id=5470 Category: Macintosh Group: Python 2.2 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jack Jansen (jackjansen) Summary: results of build on Mac OS X 10.0.4 Initial Comment: I simply wanted to post my list of compiler warnings and so on, as maybe these are things that need to be addressed/fixed, or maybe not :) -John Buell ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2001-09-11 14:29 Message: Logged In: YES user_id=45365 All the warnings that are under our control have been fixed. Two remain: - Missing prototypes in socketmodule.c - Missing prototypes in Carbon/Carbon.h These are bugs in Apple-supplied headers, and they have been submitted to Apple. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-08-21 01:13 Message: Logged In: YES user_id=45365 The saveFP/restFP bug has been fixed in the repository. The warnings have not been fixed yet, so I'll leave the bug report open. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-17 08:25 Message: Logged In: NO Okay, since posting my .txt file failed miserably the other day (darn Netscape 6.1 preview ;), I'm going to cut and paste a couple of the warnings I got building yesterday. None are "doozies", it WILL build and install. In file included from /System/Library/Frameworks/CoreServices.framework/Framewor ks/CarbonCore.framework/Headers/CarbonCore.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from Include/pymactoolbox.h:19, from Python/mactoolboxglue.c:27: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype Python/mactoolboxglue.c:97: warning: function declaration isn't a prototype ./Modules/signalmodule.c:93: warning: function declaration isn't a prototype ./Modules/signalmodule.c: In function `signal_signal': ./Modules/signalmodule.c:217: warning: function declaration isn't a prototype ./Modules/signalmodule.c:219: warning: function declaration isn't a prototype ./Modules/signalmodule.c:230: warning: function declaration isn't a prototype ./Modules/signalmodule.c: In function `initsignal': ./Modules/signalmodule.c:337: warning: function declaration isn't a prototype ./Modules/signalmodule.c:341: warning: function declaration isn't a prototype ./Modules/signalmodule.c:360: warning: function declaration isn't a prototype ./Modules/signalmodule.c:362: warning: function declaration isn't a prototype ./Modules/signalmodule.c: In function `finisignal': ./Modules/signalmodule.c:561: warning: function declaration isn't a prototype ./Modules/signalmodule.c:569: warning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Modules/getaddrinfo.c:240: warnin g: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Modules/getaddrinfo.c: In functio n `fake_getaddrinfo': /Users/jbuell/Documents/Python/python/dist/src/Modules/getaddrinfo.c:370: warnin g: suggest explicit braces to avoid ambiguous `else' In file included from /Users/jbuell/Documents/Python/python/dist/src/Modules/soc ketmodule.c:240: /Users/jbuell/Documents/Python/python/dist/src/Modules/getnameinfo.c: At top lev el: /Users/jbuell/Documents/Python/python/dist/src/Modules/getnameinfo.c:86: warning : function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Modules/socketmodule.c: In functi on `PySocket_socket': /Users/jbuell/Documents/Python/python/dist/src/Modules/socketmodule.c:2146: warn ing: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Modules/socketmodule.c: In functi on `PySocket_fromfd': /Users/jbuell/Documents/Python/python/dist/src/Modules/socketmodule.c:2184: warn ing: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Modules/dbmmodule.c: In function `dbm_subscript': /Users/jbuell/Documents/Python/python/dist/src/Modules/dbmmodule.c:104: warning: implicit declaration of function `dbm_error' /Users/jbuell/Documents/Python/python/dist/src/Modules/dbmmodule.c:105: warning: implicit declaration of function `dbm_clearerr' /Users/jbuell/Documents/Python/python/dist/src/Modules/nismodule.c: In function `nis_cat': /Users/jbuell/Documents/Python/python/dist/src/Modules/nismodule.c:159: warning: assignment from incompatible pointer type In file included from /System/Library/Fra meworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCor e.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Include /macglue.h:31, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules /gestaltmodule.c:28: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/gestaltmodule.c:39: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/gestaltmodule.c:67: w arning: function declaration isn't a prototype In file included from /System/Library/Frameworks/CoreServices.framework/Framewor ks/CarbonCore.framework/Headers/CarbonCore.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Include /macglue.h:31, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules /macosmodule.c:28: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype In file included from /System/Library/Frameworks/CoreServices.framework/Framewor ks/CarbonCore.framework/Headers/CarbonCore.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Include /macglue.h:31, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules /icgluemodule.c:33: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:173: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:193: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:214: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:236: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:262: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:282: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:303: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:324: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:344: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:365: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:391: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:416: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:446: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:521: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:529: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:574: w arning: function declaration isn't a prototype /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules/icgluemodule.c:601: w arning: function declaration isn't a prototype In file included from /System/Library/Frameworks/CoreServices.framework/Framewor ks/CarbonCore.framework/Headers/CarbonCore.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Include /macglue.h:31, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules /macfsmodule.c:26: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype In file included from /System/Library/Frameworks/CoreServices.framework/Framewor ks/CarbonCore.framework/Headers/CarbonCore.h:25, from /System/Library/Frameworks/CoreServices.framework/Headers/ CoreServices.h:22, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon .h:21, from /Users/jbuell/Documents/Python/python/dist/src/Mac/Modules /../Python/getapplbycreator.c:49: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:317: warning: function declaration isn't a prototype /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framewor k/Headers/MacTypes.h:318: warning: function declaration isn't a prototype If anyone wants to see my complete log of this build, e-mail me personally: dadaist@mac.com -John Buell ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-08-14 18:31 Message: Logged In: YES user_id=45365 Ah, thanks! I had noticed the saveFP and restFP errors suddenly popping up but I didn't know where they came from. I'll fix this shortly, but depending on platform (I assume the '-shared' option wasn't added for nothing, so it'll be needed on some other platform, probably). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-14 10:48 Message: Logged In: NO I had to make a change to setup.py to get some of the modules to build correctly (even after Jack's changes in cvs 8/13). I think there is an interaction with the -bundle and -shared ld flags. --Bill Noon Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.47 diff -r1.47 setup.py 144c144 < args['linker_so'] = linker_so + ' -shared' --- > args['linker_so'] = linker_so + '' ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=450510&group_id=5470 From noreply@sourceforge.net Tue Sep 11 22:45:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 14:45:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 22:55:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 14:55:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 23:32:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 15:32:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 15:32 Message: Logged In: YES user_id=31435 A number of similar long optimizations were disabled for long subclasses, in Lib/test/test_descr.py; new revision: 1.44 Objects/longobject.c; new revision: 1.105 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Tue Sep 11 23:41:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 15:41:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-228685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe Message-ID: Bugs item #228685, was opened at 2001-01-13 11:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: Fixed Priority: 5 Submitted By: Mark Hammond (mhammond) Assigned to: Mark Hammond (mhammond) Summary: popen on Win9x isnt smart enough about finding w9xpopen.exe Initial Comment: The code in posixmodule that emulates popen*() isnt very smart about locating the .exe for the Win9x popen hacks. It assumes that w9xpopen.exe can be located in the directory of the main executable, which fails in may embedding situations. A reasonable fix would be to also attempt to locate the file in the "sys.prefix" directory - typically this will be set correctly. Im not at my main dev machine, hence I am submitting a bug rather than a patch. I will submit a patch ASAP. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-11 15:41 Message: Logged In: YES user_id=14198 You will see the problem if w9xpopen.exe can not be found either in: * the directory of the executable * the sys.prefix directory. In a build environment, you will have problems if you run an executable from *outside* the pcbuild directory (eg pythonwin.exe, or a copy of python.exe copied elsewhere) In a pre-installed Python, this scenario ('external' .exe) should work correctly. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:22 Message: Logged In: YES user_id=31435 Mark, I haven't noticed any differences in the behavior of test_popen2 on Win98SE, whether from an installed Python or from PCBuild. Did you expect something to break in the latter case? It doesn't for me. You can test it yourself on Win2K by setting COMSPEC to point to command.com (in which case a recent patch makes Python use w9xpopen.exe even on NT/2000). ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:37 Message: Logged In: YES user_id=14198 oops - meant "now that sys.prefix is always set correctly." in the last entry. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:26 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-11 05:25 Message: Logged In: YES user_id=14198 I consider this bug fixed, now that sys.path is always set correctly. Code already in the popen() implementation will attempt to locate w9xopen.exe in sys.prefix, which will be correct in all "installed" Pythons. Note that this does not work in a build python - sys.prefix points to the top-level Python source directory, while the executables are in ".\pcbuild". I don't care enough to fix this, as I never test on win9x, and it can't bother Tim too much as he would have just screamed louder before now. Leaving open until I test some more on a on installed versions on my w98 box. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-30 23:32 Message: Partial fix checked in Rev 2.183 of Modules/posixmodule.c As per the comments in that checkin, the code now tries sys.prefix, but in many embedded situations this is still NULL/empty. As soon as source-force is accepting new bugs I will close this and open a new one for sys.prefix being empty in some conditions. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-01-13 11:39 Message: Giving to me! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=228685&group_id=5470 From noreply@sourceforge.net Wed Sep 12 03:19:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 19:19:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 19:19 Message: Logged In: YES user_id=31435 Lots of str optimizations inhibited ("the usual", + replace, translate, ljust, rjust, center, strip), in Lib/test/test_descr.py; new revision: 1.45 Objects/stringobject.c; new revision: 2.131 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 15:32 Message: Logged In: YES user_id=31435 A number of similar long optimizations were disabled for long subclasses, in Lib/test/test_descr.py; new revision: 1.44 Objects/longobject.c; new revision: 1.105 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Wed Sep 12 04:04:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 11 Sep 2001 20:04:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-11 20:04 Message: Logged In: YES user_id=31435 And lots of unicode optimizations (on subclass instances) were disabled in Lib/test/test_descr.py; new revision: 1.46 Objects/unicodeobject.c; new revision: 2.112 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 19:19 Message: Logged In: YES user_id=31435 Lots of str optimizations inhibited ("the usual", + replace, translate, ljust, rjust, center, strip), in Lib/test/test_descr.py; new revision: 1.45 Objects/stringobject.c; new revision: 2.131 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 15:32 Message: Logged In: YES user_id=31435 A number of similar long optimizations were disabled for long subclasses, in Lib/test/test_descr.py; new revision: 1.44 Objects/longobject.c; new revision: 1.105 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Wed Sep 12 09:04:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 01:04:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI Message-ID: Bugs item #460615, was opened at 2001-09-11 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 Category: None Group: 3rd Party Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: test_fpformat fails on SGI Initial Comment: With the current version of Python on IRIX 6.5.13, compiled without -O, test_fpformat fails. It boils down to this: fpformat.fix(-0.003, 0) results in the string "-0" whereas "%.*f" % (0, float(-0.003)) results in "0". The output of the test is + ./python ../Lib/test/regrtest.py test_fpformat.py test_fpformat test test_fpformat failed -- Traceback (most recent call last): File "../Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "../Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 280, in failUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 1 test failed: test_fpformat ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-12 01:04 Message: Logged In: YES user_id=43607 The result is indeed "0". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:48 Message: Logged In: YES user_id=31435 Guido's getting pretty good at this . Try printf("%.0f\n", -0.003); in C on this box. If that omits a minus sign, the platform libc is in error. Changed Group to 3rd Party assuming that's what's happening. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:07 Message: Logged In: YES user_id=6380 Channeling Tim: Congratulations! You have found a bug in the C standard library implementation on your platform. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 From noreply@sourceforge.net Wed Sep 12 09:09:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 01:09:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-460838 ] compilation warning from missing cast Message-ID: Bugs item #460838, was opened at 2001-09-12 01:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Nobody/Anonymous (nobody) Summary: compilation warning from missing cast Initial Comment: When compiling _localemodule.c under IRIX I get the warning "/usr2/people/dalke/cvses/python/dist/src/Modules/_loca lemodule.c", line 218: warning(1164): argument of type "const char *" is incompatible with parameter of type "void *" free (Py_FileSystemDefaultEncoding); There should be a cast throwing constness away to get rid of that warning. Here's a patch that doesn't have the warning Index: Modules/_localemodule.c ======================================================= ============ RCS file: /cvsroot/python/python/dist/src/Modules/_localemo dule.c,v retrieving revision 2.23 diff -c -r2.23 _localemodule.c *** Modules/_localemodule.c 2001/09/05 17:09:48 2.23 --- Modules/_localemodule.c 2001/09/12 08:04:25 *************** *** 215,221 **** if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free (Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else --- 215,221 ---- if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free ((char *) Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else Andrew ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 From noreply@sourceforge.net Wed Sep 12 09:11:27 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 01:11:27 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-12 01:11 Message: Logged In: YES user_id=31435 Additional patches: + Repaired hash() applied to str and unicode subclass instances (was always returning 0, with baffling consequences for dict operations). + Ensured that interning an object of a str subclass interned a genuine string (w/ the same value) instead. The complex type got overlooked in all this, so keeping this open until that's done too. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 20:04 Message: Logged In: YES user_id=31435 And lots of unicode optimizations (on subclass instances) were disabled in Lib/test/test_descr.py; new revision: 1.46 Objects/unicodeobject.c; new revision: 2.112 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 19:19 Message: Logged In: YES user_id=31435 Lots of str optimizations inhibited ("the usual", + replace, translate, ljust, rjust, center, strip), in Lib/test/test_descr.py; new revision: 1.45 Objects/stringobject.c; new revision: 2.131 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 15:32 Message: Logged In: YES user_id=31435 A number of similar long optimizations were disabled for long subclasses, in Lib/test/test_descr.py; new revision: 1.44 Objects/longobject.c; new revision: 1.105 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Wed Sep 12 09:29:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 01:29:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX Message-ID: Bugs item #456395, was opened at 2001-08-28 21:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 Category: None Group: Platform-specific Status: Closed Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Guido van Rossum (gvanrossum) Summary: test_pty failure under IRIX Initial Comment: Under IRIX 6.4 (which is at least two years old) I get the following regression failure in test_pty. It appears newlines are converted to "\r\n". I don't know enough about ptys to suggest a solution. test_pty The actual stdout doesn't match the expected stdout. This much did match (between asterisk lines): ******************************************************* *************** test_pty ******************************************************* *************** Then ... We expected (repr): 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' But instead we got: 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n' test test_pty failed -- Writing: 'I wish to buy a fish license.\r\nFor my pet fish , Eric.\n', expected: 'I wish to buy a fish license.\nFor my pet fish, Eric.\n' Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Andrew Dalke (dalke) Date: 2001-09-12 01:29 Message: Logged In: YES user_id=190903 Sorry, was busy doing work for a client. The code was from CVS. I see you've worked with sjoerd to resolve the problem. I've confirmed the fix in CVS on my IRIX system, given the CVS version of Sept. 12, 2001. (This comment is only because I'm used to a process where the original bug submitter should confirm any fixes before it's closed. I know that isn't the std. Python/SF way, but old habits die hard :) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:25 Message: Logged In: YES user_id=6380 OK. Closed again. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 06:33 Message: Logged In: YES user_id=43607 The patch does the trick. The test no longer fails. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:09 Message: Logged In: YES user_id=6380 Oops. Can you try the attached patch? ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-11 01:03 Message: Logged In: YES user_id=43607 I am reopening this bug. In the current version of Python, with a current version of IRIX (6.5.13), the test still fails. If you look closely at the output and compare it with the comment and code in the test file, you can see why: The output that the test got was 'I wish to buy a fish license.\r\nFor my pet fish, Eric.\n'. The test removes a final \r\n and replaces it with just \n before comparing (the result is shown above), but it doesn't do that for embedded \r\n, and that is what is wrong with the output. I suggest changing the lines if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" to something like s1 = string.join(string.split(s1, '\r\n'), '\n') (or s1 = '\n'.join(s1.split('\r\n')) ). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:12 Message: Logged In: YES user_id=6380 No followup. Closed as Fixed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:04 Message: Logged In: YES user_id=6380 Andrew, which Python version did you use? The current CVS version has this comment somewhere in its CVS log, suggesting that this might be fixed in CVS: Allow the process of reading back what we wrote to a pty to transform linefeeds into carriagereturn-linefeeds (which is apparently what IRIX does.) So I'm tempted to close this as Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470 From noreply@sourceforge.net Wed Sep 12 20:14:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 12:14:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-460020 ] bug or feature: unicode() and subclasses Message-ID: Bugs item #460020, was opened at 2001-09-09 08:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 Category: Type/class unification Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Tim Peters (tim_one) Summary: bug or feature: unicode() and subclasses Initial Comment: The unicode constructor returns the object passed in, when an instance of a subclass of unicode is passed in: -- class U(unicode): pass u1 = U(u"foo") print type(u1) u2 = unicode(u1) print type(u2) -- this gives -- -- instead of -- -- as it probably should be (The unicode constructor should construct unicode objects). With the current behaviour it is nearly impossible to construct a unicode object with the value of an instance of a unicode subclass, because most methods are optimized to return the original object if possible, e.g. -- print type(unicode.__getslice__(u1, 0, 3)) print type(unicode.__getslice__(u1, 0, 2)) -- gives -- -- This should be made consistent, so that either a unicode object is always returned, or all methods use a "virtual constructor", i.e. create an object of the type passed in. This would simplify deriving classes from unicode as far fewer methods have to be overwritten. But first of all the constructor should be fixed, so that the argument is returned unmodified only when it is an instance of unicode and not of a unicode subclass. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-12 12:14 Message: Logged In: YES user_id=31435 Similar changes also completed for the complex type, and closing this bug report as Fixed again: Include/complexobject.h; new revision: 2.9 Lib/test/test_descr.py; new revision: 1.49 Objects/complexobject.c; new revision: 2.45 Objects/floatobject.c; new revision: 2.99 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-12 01:11 Message: Logged In: YES user_id=31435 Additional patches: + Repaired hash() applied to str and unicode subclass instances (was always returning 0, with baffling consequences for dict operations). + Ensured that interning an object of a str subclass interned a genuine string (w/ the same value) instead. The complex type got overlooked in all this, so keeping this open until that's done too. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 20:04 Message: Logged In: YES user_id=31435 And lots of unicode optimizations (on subclass instances) were disabled in Lib/test/test_descr.py; new revision: 1.46 Objects/unicodeobject.c; new revision: 2.112 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 19:19 Message: Logged In: YES user_id=31435 Lots of str optimizations inhibited ("the usual", + replace, translate, ljust, rjust, center, strip), in Lib/test/test_descr.py; new revision: 1.45 Objects/stringobject.c; new revision: 2.131 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 15:32 Message: Logged In: YES user_id=31435 A number of similar long optimizations were disabled for long subclasses, in Lib/test/test_descr.py; new revision: 1.44 Objects/longobject.c; new revision: 1.105 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:55 Message: Logged In: YES user_id=31435 For F a subclass of float, disabled the +F(whatever) optimization, in Lib/test/test_descr.py; new revision: 1.43 Objects/floatobject.c; new revision: 2.98 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 14:45 Message: Logged In: YES user_id=31435 For I a subclass of int, disabled the +I(whatever) I(0) << whatever I(0) >> whatever I(whatever) << 0 I(whatever) >> 0 optimizations, in Lib/test/test_descr.py; new revision: 1.42 Objects/intobject.c; new revision: 2.74 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 12:50 Message: Logged In: YES user_id=31435 Here we go again. For tuples, hunted down and disabled t [:], t*0 and t*1 optimizations when t is of a tuple subclass type: Lib/test/test_descr.py; new revision: 1.41 Objects/tupleobject.c; new revision: 2.60 More later (this is time-consuming work). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:59 Message: Logged In: YES user_id=31435 Oh well -- it's stuck at "Accepted". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:56 Message: Logged In: YES user_id=31435 Trying to change Resolution to something sensible ("Accepted" doesn't make sense). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 07:49 Message: Logged In: YES user_id=6380 > Python uses it, e.g. in Lib/UserString.py: [and other cases] Yes, and I'm no longer comfortable with such code, for exactly the reason I mentioned, unless it's an explicit and intentional part of the class specification. :-( Doing this consistenyly for all built-in types would cause too much upheaval -- we'd have to change every single built-in operation. But the other interpretation stands: unicode (and other) operations should only optimize by returning "self" when self is a strict instance of the type. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 07:03 Message: Logged In: YES user_id=89016 > You're asking for the impossible though. > I don't think any other OO language supports > this automatically (although I > could be wrong). Python uses it, e.g. in Lib/UserString.py: def rstrip(self): return self.__class__(self.data.rstrip ()) So if someone derives a new class X from UserString, calling X("y ").rstrip() returns an X object. The only assumption that UserString makes, is that the derived class has a constructor that can handle at least the same arguments as UserString.__init__. This "virtual constructor" is used in several places: grep -l "self.__class__(" `find -name '*.py' | grep -v Mac` returns: ./dist/src/Lib/UserString.py ./dist/src/Lib/copy.py ./dist/src/Lib/MimeWriter.py ./dist/src/Lib/test/test_descr.py ./dist/src/Lib/xml/sax/xmlreader.py ./dist/src/Lib/UserList.py ./dist/src/Demo/pdist/rcvs.py ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:04 Message: Logged In: YES user_id=6380 Apologies. I missed half of what you were asking. It's impossible for U(...)[0:2] to return a U instance, but I agree that then at least then it should *always* return a unicode instance. So this is still open. For Tim: the problem is that a slice (or other) operation may decide to return the original object unchanged; this should (probably?) only be done when the original object is exactly a unicode instance. I'm afraid that we'll have to systematically look through all 144 Unicode methods to see where they exhibit this behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 05:01 Message: Logged In: YES user_id=6380 You're asking for the impossible though. I don't think any other OO language supports this automatically (although I could be wrong). The problem is, what to do with a subclass of unicode like this: class U(unicode): def __init__(self, arg): self.orig = arg How is U("foobar")[0:3] going to know what argument to pass in to __init__? The base class simply can't know what additional invariants the subclass imposes. ---------------------------------------------------------------------- Comment By: Walter Dörwald (doerwalter) Date: 2001-09-11 04:31 Message: Logged In: YES user_id=89016 Thanks for the quick fix, but the second problem still remains: --- class U(unicode): pass u = U(u"foo") print type(u[0:3]) print type(u[0:2]) --- This gives: --- --- I think this should be changed to either always return a unicode object, or to always return an instance of the real class passed in. (This should be done for all unicode methods that return a new unicode object). The second solution would simplify creating derived classes, because all the methods that return unicode objects would automatically return the derived type, so these methods don't have to be overwritten. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 20:09 Message: Logged In: YES user_id=31435 unicode() repaired in Include/unicodeobject.h; new revision: 2.33 Lib/test/test_descr.py; new revision: 1.39 Objects/unicodeobject.c; new revision: 2.111 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 18:43 Message: Logged In: YES user_id=31435 str() repaired (yes, unicode is next ), in Include/stringobject.h; new revision: 2.31 Lib/test/test_descr.py; new revision: 1.37 Objects/object.c; new revision: 2.146 Objects/stringobject.c; new revision: 2.130 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 16:39 Message: Logged In: YES user_id=31435 tuple() repaired, in Include/tupleobject.h; new revision: 2.27 Lib/test/test_descr.py; new revision: 1.36 Objects/abstract.c; new revision: 2.77 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 14:29 Message: Logged In: YES user_id=31435 float() also repaired, in Include/floatobject.h; new revision: 2.20 Lib/test/test_descr.py; new revision: 1.34 Objects/abstract.c; new revision: 2.76 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:57 Message: Logged In: YES user_id=31435 Partially repaired (for int and long) in: Include/intobject.h; new revision: 2.24 Include/longintrepr.h; new revision: 2.12 Include/longobject.h; new revision: 2.24 Lib/test/test_descr.py; new revision: 1.33 Objects/abstract.c; new revision: 2.75 Objects/longobject.c; new revision: 1.104 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-10 13:45 Message: Logged In: YES user_id=31435 Reassigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 07:48 Message: Logged In: YES user_id=6380 Good catch! Other types also suffer from this, e.g. int. added to my to-do list. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460020&group_id=5470 From noreply@sourceforge.net Wed Sep 12 20:21:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 12:21:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-456390 ] test_fpformat fails on IRIX Message-ID: Bugs item #456390, was opened at 2001-08-28 21:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456390&group_id=5470 >Category: Python Interpreter Core Group: Platform-specific >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Tim Peters (tim_one) Summary: test_fpformat fails on IRIX Initial Comment: Given it involves "-0" this failure is beyond my floating point ken. I also note the comment: # Test the old and obsolescent fpformat module so I'll put no more effort into understanding. :) This is on an old IRIX machine running 6.4, which means it's at least 2 years out of date. origin> ./python Lib/test/test_fpformat.py test_basic_cases (__main__.FpformatTest) ... ok test_failing_values (__main__.FpformatTest) ... ok test_reasonable_values (__main__.FpformatTest) ... FAIL ======================================================= =============== FAIL: test_reasonable_values (__main__.FpformatTest) ------------------------------------------------------- --------------- Traceback (most recent call last): File "Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/usr2/people/dalke/cvses/python/dist/src/Lib/unit test.py", line 273, in fa ilUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 ------------------------------------------------------- --------------- Ran 3 tests in 0.009s FAILED (failures=1) Traceback (most recent call last): File "Lib/test/test_fpformat.py", line 69, in ? run_unittest(FpformatTest) File "./Lib/test/test_support.py", line 159, in run_unittest raise TestFailed(str(err[1])) test_support.TestFailed: -0 != 0 Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-12 12:21 Message: Logged In: YES user_id=31435 Closed as a Duplicate of 460615 (which actually got entered later, but has more commentary attached so is more worth keeping at this point). It appears to be a platform libc bug (see 460615). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456390&group_id=5470 From noreply@sourceforge.net Wed Sep 12 20:28:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 12:28:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI Message-ID: Bugs item #460615, was opened at 2001-09-11 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 >Category: Python Interpreter Core Group: 3rd Party >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) >Assigned to: Tim Peters (tim_one) Summary: test_fpformat fails on SGI Initial Comment: With the current version of Python on IRIX 6.5.13, compiled without -O, test_fpformat fails. It boils down to this: fpformat.fix(-0.003, 0) results in the string "-0" whereas "%.*f" % (0, float(-0.003)) results in "0". The output of the test is + ./python ../Lib/test/regrtest.py test_fpformat.py test_fpformat test test_fpformat failed -- Traceback (most recent call last): File "../Lib/test/test_fpformat.py", line 51, in test_reasonable_values self.checkFix(realVal, d) File "../Lib/test/test_fpformat.py", line 28, in checkFix self.assertEquals(result, expected) File "/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line 280, in failUnlessEqual raise self.failureException, (msg or '%s != %s' % (first, second)) AssertionError: -0 != 0 1 test failed: test_fpformat ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-12 12:28 Message: Logged In: YES user_id=31435 So I'm closing this as WontFix. Python has an ever- increasing number of internal sprintf partial workalikes, but we never bit the bullet on trying to take over floating formats from libc, and doing so isn't in our plans. So long as we let the platform libc format floats, platform fp format bugs will shine through. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2001-09-12 01:04 Message: Logged In: YES user_id=43607 The result is indeed "0". ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-11 09:48 Message: Logged In: YES user_id=31435 Guido's getting pretty good at this . Try printf("%.0f\n", -0.003); in C on this box. If that omits a minus sign, the platform libc is in error. Changed Group to 3rd Party assuming that's what's happening. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-11 06:07 Message: Logged In: YES user_id=6380 Channeling Tim: Congratulations! You have found a bug in the C standard library implementation on your platform. :-) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470 From noreply@sourceforge.net Wed Sep 12 21:15:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 13:15:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-461001 ] inspect & pydoc vs new-style classes Message-ID: Bugs item #461001, was opened at 2001-09-12 13:15 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461001&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: inspect & pydoc vs new-style classes Initial Comment: I've heard that inspect & pydoc don't work well with new-style classe. This needs attention if so. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461001&group_id=5470 From noreply@sourceforge.net Thu Sep 13 01:40:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 17:40:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-461073 ] mailbox __iter__ bug Message-ID: Bugs item #461073, was opened at 2001-09-12 17:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461073&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Nobody/Anonymous (nobody) Summary: mailbox __iter__ bug Initial Comment: This is with the most recent version code from CVS (Sept. 12). The following never stops infile = open("test.mbox") for msg in mailbox.PortableUnixMailbox(infile): pass More specifically, >>> import mailbox >>> for msg in mailbox.PortableUnixMailbox( \ ... open("test.mbox")): ... assert msg is not None ... Traceback (most recent call last): File "", line 2, in ? AssertionError >>> The problem is the iterator in mailbox.py. It is defined def __iter__(self): return self but needs to be def __iter__(self): return iter(self.next, None) There are a few places that need to be changed. Context diff of a working version is below. I've only tested the PortableUnixMailbox code. Andrew dalke@dalkescientific.com Index: mailbox.py ======================================================= ============ RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v retrieving revision 1.32 diff -c -r1.32 mailbox.py *** mailbox.py 2001/08/13 15:37:02 1.32 --- mailbox.py 2001/09/13 00:38:51 *************** *** 15,21 **** self.factory = factory def __iter__(self): ! return self def next(self): while 1: --- 15,21 ---- self.factory = factory def __iter__(self): ! return iter(self.next, None) def next(self): while 1: *************** *** 195,201 **** self.factory = factory def __iter__(self): ! return self def next(self): if not self.boxes: --- 195,201 ---- self.factory = factory def __iter__(self): ! return iter(self.next, None) def next(self): if not self.boxes: *************** *** 226,232 **** self.boxes = boxes def __iter__(self): ! return self def next(self): if not self.boxes: --- 226,232 ---- self.boxes = boxes def __iter__(self): ! return iter(self.next, None) def next(self): if not self.boxes: ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461073&group_id=5470 From noreply@sourceforge.net Thu Sep 13 02:29:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 18:29:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-461073 ] mailbox __iter__ bug Message-ID: Bugs item #461073, was opened at 2001-09-12 17:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461073&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Guido van Rossum (gvanrossum) Summary: mailbox __iter__ bug Initial Comment: This is with the most recent version code from CVS (Sept. 12). The following never stops infile = open("test.mbox") for msg in mailbox.PortableUnixMailbox(infile): pass More specifically, >>> import mailbox >>> for msg in mailbox.PortableUnixMailbox( \ ... open("test.mbox")): ... assert msg is not None ... Traceback (most recent call last): File "", line 2, in ? AssertionError >>> The problem is the iterator in mailbox.py. It is defined def __iter__(self): return self but needs to be def __iter__(self): return iter(self.next, None) There are a few places that need to be changed. Context diff of a working version is below. I've only tested the PortableUnixMailbox code. Andrew dalke@dalkescientific.com Index: mailbox.py ======================================================= ============ RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v retrieving revision 1.32 diff -c -r1.32 mailbox.py *** mailbox.py 2001/08/13 15:37:02 1.32 --- mailbox.py 2001/09/13 00:38:51 *************** *** 15,21 **** self.factory = factory def __iter__(self): ! return self def next(self): while 1: --- 15,21 ---- self.factory = factory def __iter__(self): ! return iter(self.next, None) def next(self): while 1: *************** *** 195,201 **** self.factory = factory def __iter__(self): ! return self def next(self): if not self.boxes: --- 195,201 ---- self.factory = factory def __iter__(self): ! return iter(self.next, None) def next(self): if not self.boxes: *************** *** 226,232 **** self.boxes = boxes def __iter__(self): ! return self def next(self): if not self.boxes: --- 226,232 ---- self.boxes = boxes def __iter__(self): ! return iter(self.next, None) def next(self): if not self.boxes: ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-12 18:29 Message: Logged In: YES user_id=6380 Thanks! Checked in as mailbox.py 1.33. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461073&group_id=5470 From noreply@sourceforge.net Thu Sep 13 06:40:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 12 Sep 2001 22:40:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-460467 ] file objects should be subclassable Message-ID: Bugs item #460467, was opened at 2001-09-10 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: file objects should be subclassable Initial Comment: We should be able to use fileobject as a base clase in 2.2 (but can't yet). A file() constructor should be made a new builtin, and work like builtin open() works. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-12 22:40 Message: Logged In: YES user_id=31435 Preliminary support checked in: Include/fileobject.h; new revision: 2.24 Include/moduleobject.h; new revision: 2.19 Lib/types.py; new revision: 1.21 Lib/test/test_descr.py; new revision: 1.51 Misc/NEWS; new revision: 1.242 Objects/fileobject.c; new revision: 2.123 Python/bltinmodule.c; new revision: 2.237 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 From noreply@sourceforge.net Thu Sep 13 08:09:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 00:09:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-455183 ] Cygwin build fails for 2.2a2 Message-ID: Bugs item #455183, was opened at 2001-08-24 19:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: Cygwin build fails for 2.2a2 Initial Comment: The Cygwin build fails at the compile stage with the error message that a working getaddrinfo function is needed, unless the option "--disable-ipv6" is selected. I tried that option (as well as --with-threads=no), and both configure and make ran successfully. I started the interpreter from the Python-2.2a2 directory and successfully imported division and generators from __future__. I ran the interpreter test following the instructions for Cygwin and got this message: 1 test failed: test_strftime 31 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_dbm test_dl test_fork1 test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pty test_pyexpat test_sax test_socket_ssl test_socketserver test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_unicode_file test_winreg test_winsound ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-13 00:09 Message: Logged In: NO Hi. Thanks for responding. Sorry about the anonymity; I didn't realize SourceForge wouldn't even give you my e-mail address. I'm Steve Burr, sburr@home.com. Before responding to your message, I wanted to report some good news about Cygwin. I updated to the latest version of Cygwin today, and it appeared to eliminate the problem with the test_poll hang that was reported in the README file and that I had experienced myself. Both "make test" with test_poll and "python test_poll.py" completed without hanging. The first problem I reported disappeared with the latest alpha release. I downloaded and successfully built v. 2.2a3 on Cygwin without the --disable-ipv6 option. Just in case this information would still be of interest, however, the precise message generated by running ./configure for 2.2a2 (which I still have on my box) is: checking for getaddrinfo... (cached) no Fatal: You must get working getaddrinfo() function. or you can specify "--disable-ipv6". The second problem is still there. As you requested, I am including the output from running test_strftime.py at the end of this message. _However_, in rereading the README, I saw that the strftime problem in Cygwin has already been identified. Moreover, the problems with strftime do not appear serious. All of the time formats identified as being unsupported in the output, except for "%Z", are in the ANSI C standard according to the Python Library Reference (section 6.9). The failure to return a value for "%Z" may be attributable to the fact that I live in Arizona, which does not observe DST. I'm guessing that at this time of year, "%Z" is the same as the second value in the time.tzname tuple, which for Arizona is an empty string. The "%x" format does not return an inaccurate value, just a non-standard format. I don't know why anyone would need "% 3y". So trying to fix these glitches, if they're even fixable, may not be worth your time, especially if you don't have access to Cygwin. Anyway, here's the test output: strftime test for Wed Sep 12 22:45:45 2001 Strftime test, platform: cygwin, Python version: 2.2a3 Supports nonstandard '%c' format (near-asctime() format) Conflict for nonstandard '%x' format (%m/%d/%y %H:%M:%S): Expected 09/12/01, but got Wed Sep 12 2001 Does not appear to support '%Z' format (time zone name) Does not appear to support '%D' format (mm/dd/yy) Does not appear to support '%e' format (day of month as number, blank padded ( 0-31)) Does not appear to support '%h' format (abbreviated month name) Does not appear to support '%k' format (hour, blank padded ( 0-23)) Does not appear to support '%n' format (newline character) Does not appear to support '%r' format (%I:%M:%S %p) Does not appear to support '%R' format (%H:%M) Does not appear to support '%s' format (seconds since the Epoch in UCT) Does not appear to support '%t' format (tab character) Does not appear to support '%T' format (%H:%M:%S) Conflict for nonstandard '%3y' format (year without century rendered using fieldwidth): Expected 001, but got y Conflict for %W (week number of the year (Mon 1st)): Expected 21, but got 20 Conflict for %W (week number of the year (Mon 1st)): Expected 22, but got 21 Conflict for %W (week number of the year (Mon 1st)): Expected 23, but got 22 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 35, but got 34 Conflict for %W (week number of the year (Mon 1st)): Expected 36, but got 35 Conflict for %W (week number of the year (Mon 1st)): Expected 37, but got 36 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 50, but got 49 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 10, but got 09 Conflict for %W (week number of the year (Mon 1st)): Expected 11, but got 10 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 25, but got 24 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 38, but got 37 Conflict for %W (week number of the year (Mon 1st)): Expected 39, but got 38 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 52, but got 51 Conflict for %W (week number of the year (Mon 1st)): Expected 53, but got 52 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 14, but got 13 Conflict for %W (week number of the year (Mon 1st)): Expected 15, but got 14 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 28, but got 27 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 41, but got 40 Conflict for %W (week number of the year (Mon 1st)): Expected 42, but got 41 ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:32 Message: Logged In: YES user_id=21627 Can you give an exact copy of the error message you got without disable-ipv6? I cannot reproduce the problem, as I don't have a cygwin installation. Also, could you please identify yourself? Furthermore, can you please run test_strftime in isolation, and report the output? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 From noreply@sourceforge.net Thu Sep 13 11:34:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 03:34:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-455183 ] Cygwin build fails for 2.2a2 Message-ID: Bugs item #455183, was opened at 2001-08-24 19:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 Category: Build Group: Platform-specific Status: Open >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: Cygwin build fails for 2.2a2 Initial Comment: The Cygwin build fails at the compile stage with the error message that a working getaddrinfo function is needed, unless the option "--disable-ipv6" is selected. I tried that option (as well as --with-threads=no), and both configure and make ran successfully. I started the interpreter from the Python-2.2a2 directory and successfully imported division and generators from __future__. I ran the interpreter test following the instructions for Cygwin and got this message: 1 test failed: test_strftime 31 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_dbm test_dl test_fork1 test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pty test_pyexpat test_sax test_socket_ssl test_socketserver test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_unicode_file test_winreg test_winsound ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-13 03:34 Message: Logged In: YES user_id=21627 The configure abort is intentional: Your system provides a getaddrinfo function, but configure determined that this function is buggy. So it reports that problem, and reports a work-around (configuring with --disable-ipv6). Since the test failure is a well-known and documented platform bug, I close this as "won't fix". ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-13 00:09 Message: Logged In: NO Hi. Thanks for responding. Sorry about the anonymity; I didn't realize SourceForge wouldn't even give you my e-mail address. I'm Steve Burr, sburr@home.com. Before responding to your message, I wanted to report some good news about Cygwin. I updated to the latest version of Cygwin today, and it appeared to eliminate the problem with the test_poll hang that was reported in the README file and that I had experienced myself. Both "make test" with test_poll and "python test_poll.py" completed without hanging. The first problem I reported disappeared with the latest alpha release. I downloaded and successfully built v. 2.2a3 on Cygwin without the --disable-ipv6 option. Just in case this information would still be of interest, however, the precise message generated by running ./configure for 2.2a2 (which I still have on my box) is: checking for getaddrinfo... (cached) no Fatal: You must get working getaddrinfo() function. or you can specify "--disable-ipv6". The second problem is still there. As you requested, I am including the output from running test_strftime.py at the end of this message. _However_, in rereading the README, I saw that the strftime problem in Cygwin has already been identified. Moreover, the problems with strftime do not appear serious. All of the time formats identified as being unsupported in the output, except for "%Z", are in the ANSI C standard according to the Python Library Reference (section 6.9). The failure to return a value for "%Z" may be attributable to the fact that I live in Arizona, which does not observe DST. I'm guessing that at this time of year, "%Z" is the same as the second value in the time.tzname tuple, which for Arizona is an empty string. The "%x" format does not return an inaccurate value, just a non-standard format. I don't know why anyone would need "% 3y". So trying to fix these glitches, if they're even fixable, may not be worth your time, especially if you don't have access to Cygwin. Anyway, here's the test output: strftime test for Wed Sep 12 22:45:45 2001 Strftime test, platform: cygwin, Python version: 2.2a3 Supports nonstandard '%c' format (near-asctime() format) Conflict for nonstandard '%x' format (%m/%d/%y %H:%M:%S): Expected 09/12/01, but got Wed Sep 12 2001 Does not appear to support '%Z' format (time zone name) Does not appear to support '%D' format (mm/dd/yy) Does not appear to support '%e' format (day of month as number, blank padded ( 0-31)) Does not appear to support '%h' format (abbreviated month name) Does not appear to support '%k' format (hour, blank padded ( 0-23)) Does not appear to support '%n' format (newline character) Does not appear to support '%r' format (%I:%M:%S %p) Does not appear to support '%R' format (%H:%M) Does not appear to support '%s' format (seconds since the Epoch in UCT) Does not appear to support '%t' format (tab character) Does not appear to support '%T' format (%H:%M:%S) Conflict for nonstandard '%3y' format (year without century rendered using fieldwidth): Expected 001, but got y Conflict for %W (week number of the year (Mon 1st)): Expected 21, but got 20 Conflict for %W (week number of the year (Mon 1st)): Expected 22, but got 21 Conflict for %W (week number of the year (Mon 1st)): Expected 23, but got 22 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 35, but got 34 Conflict for %W (week number of the year (Mon 1st)): Expected 36, but got 35 Conflict for %W (week number of the year (Mon 1st)): Expected 37, but got 36 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 50, but got 49 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 10, but got 09 Conflict for %W (week number of the year (Mon 1st)): Expected 11, but got 10 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 25, but got 24 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 38, but got 37 Conflict for %W (week number of the year (Mon 1st)): Expected 39, but got 38 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 52, but got 51 Conflict for %W (week number of the year (Mon 1st)): Expected 53, but got 52 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 14, but got 13 Conflict for %W (week number of the year (Mon 1st)): Expected 15, but got 14 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 28, but got 27 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 41, but got 40 Conflict for %W (week number of the year (Mon 1st)): Expected 42, but got 41 ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:32 Message: Logged In: YES user_id=21627 Can you give an exact copy of the error message you got without disable-ipv6? I cannot reproduce the problem, as I don't have a cygwin installation. Also, could you please identify yourself? Furthermore, can you please run test_strftime in isolation, and report the output? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 From noreply@sourceforge.net Thu Sep 13 11:34:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 03:34:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-455183 ] Cygwin build fails for 2.2a2 Message-ID: Bugs item #455183, was opened at 2001-08-24 19:20 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 Category: Build Group: Platform-specific >Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Martin v. Löwis (loewis) Summary: Cygwin build fails for 2.2a2 Initial Comment: The Cygwin build fails at the compile stage with the error message that a working getaddrinfo function is needed, unless the option "--disable-ipv6" is selected. I tried that option (as well as --with-threads=no), and both configure and make ran successfully. I started the interpreter from the Python-2.2a2 directory and successfully imported division and generators from __future__. I ran the interpreter test following the instructions for Cygwin and got this message: 1 test failed: test_strftime 31 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_dbm test_dl test_fork1 test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pty test_pyexpat test_sax test_socket_ssl test_socketserver test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_unicode_file test_winreg test_winsound ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-13 03:34 Message: Logged In: YES user_id=21627 The configure abort is intentional: Your system provides a getaddrinfo function, but configure determined that this function is buggy. So it reports that problem, and reports a work-around (configuring with --disable-ipv6). Since the test failure is a well-known and documented platform bug, I close this as "won't fix". ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-13 00:09 Message: Logged In: NO Hi. Thanks for responding. Sorry about the anonymity; I didn't realize SourceForge wouldn't even give you my e-mail address. I'm Steve Burr, sburr@home.com. Before responding to your message, I wanted to report some good news about Cygwin. I updated to the latest version of Cygwin today, and it appeared to eliminate the problem with the test_poll hang that was reported in the README file and that I had experienced myself. Both "make test" with test_poll and "python test_poll.py" completed without hanging. The first problem I reported disappeared with the latest alpha release. I downloaded and successfully built v. 2.2a3 on Cygwin without the --disable-ipv6 option. Just in case this information would still be of interest, however, the precise message generated by running ./configure for 2.2a2 (which I still have on my box) is: checking for getaddrinfo... (cached) no Fatal: You must get working getaddrinfo() function. or you can specify "--disable-ipv6". The second problem is still there. As you requested, I am including the output from running test_strftime.py at the end of this message. _However_, in rereading the README, I saw that the strftime problem in Cygwin has already been identified. Moreover, the problems with strftime do not appear serious. All of the time formats identified as being unsupported in the output, except for "%Z", are in the ANSI C standard according to the Python Library Reference (section 6.9). The failure to return a value for "%Z" may be attributable to the fact that I live in Arizona, which does not observe DST. I'm guessing that at this time of year, "%Z" is the same as the second value in the time.tzname tuple, which for Arizona is an empty string. The "%x" format does not return an inaccurate value, just a non-standard format. I don't know why anyone would need "% 3y". So trying to fix these glitches, if they're even fixable, may not be worth your time, especially if you don't have access to Cygwin. Anyway, here's the test output: strftime test for Wed Sep 12 22:45:45 2001 Strftime test, platform: cygwin, Python version: 2.2a3 Supports nonstandard '%c' format (near-asctime() format) Conflict for nonstandard '%x' format (%m/%d/%y %H:%M:%S): Expected 09/12/01, but got Wed Sep 12 2001 Does not appear to support '%Z' format (time zone name) Does not appear to support '%D' format (mm/dd/yy) Does not appear to support '%e' format (day of month as number, blank padded ( 0-31)) Does not appear to support '%h' format (abbreviated month name) Does not appear to support '%k' format (hour, blank padded ( 0-23)) Does not appear to support '%n' format (newline character) Does not appear to support '%r' format (%I:%M:%S %p) Does not appear to support '%R' format (%H:%M) Does not appear to support '%s' format (seconds since the Epoch in UCT) Does not appear to support '%t' format (tab character) Does not appear to support '%T' format (%H:%M:%S) Conflict for nonstandard '%3y' format (year without century rendered using fieldwidth): Expected 001, but got y Conflict for %W (week number of the year (Mon 1st)): Expected 21, but got 20 Conflict for %W (week number of the year (Mon 1st)): Expected 22, but got 21 Conflict for %W (week number of the year (Mon 1st)): Expected 23, but got 22 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 35, but got 34 Conflict for %W (week number of the year (Mon 1st)): Expected 36, but got 35 Conflict for %W (week number of the year (Mon 1st)): Expected 37, but got 36 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 49, but got 48 Conflict for %W (week number of the year (Mon 1st)): Expected 50, but got 49 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 10, but got 09 Conflict for %W (week number of the year (Mon 1st)): Expected 11, but got 10 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 24, but got 23 Conflict for %W (week number of the year (Mon 1st)): Expected 25, but got 24 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 38, but got 37 Conflict for %W (week number of the year (Mon 1st)): Expected 39, but got 38 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 51, but got 50 Conflict for %W (week number of the year (Mon 1st)): Expected 52, but got 51 Conflict for %W (week number of the year (Mon 1st)): Expected 53, but got 52 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 01, but got 00 Conflict for %W (week number of the year (Mon 1st)): Expected 12, but got 11 Conflict for %W (week number of the year (Mon 1st)): Expected 13, but got 12 Conflict for %W (week number of the year (Mon 1st)): Expected 14, but got 13 Conflict for %W (week number of the year (Mon 1st)): Expected 15, but got 14 Conflict for %W (week number of the year (Mon 1st)): Expected 26, but got 25 Conflict for %W (week number of the year (Mon 1st)): Expected 27, but got 26 Conflict for %W (week number of the year (Mon 1st)): Expected 28, but got 27 Conflict for %W (week number of the year (Mon 1st)): Expected 40, but got 39 Conflict for %W (week number of the year (Mon 1st)): Expected 41, but got 40 Conflict for %W (week number of the year (Mon 1st)): Expected 42, but got 41 ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-06 00:32 Message: Logged In: YES user_id=21627 Can you give an exact copy of the error message you got without disable-ipv6? I cannot reproduce the problem, as I don't have a cygwin installation. Also, could you please identify yourself? Furthermore, can you please run test_strftime in isolation, and report the output? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=455183&group_id=5470 From noreply@sourceforge.net Thu Sep 13 17:58:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 09:58:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-460315 ] call_trace() arg for 'call' Message-ID: Bugs item #460315, was opened at 2001-09-10 07:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: call_trace() arg for 'call' Initial Comment: The documentation says that the extra argument for 'call' events is the argument list to the function. As far as I can tell, this hasn't been the case since around 1.2. Since then the code has had an XXX comment about how to do it "now." Since the feature hasn't been present for about six years, maybe we should agree to give up on it and change the documentation <0.2 wink>. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-13 09:58 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libpdb.tex revision 1.31 and Python/ceval.c revision 2.275. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-10 08:01 Message: Logged In: YES user_id=6380 Agreed. Especially since now that the code has been moved, it's no longer easy "in theory" to calculate the arguments. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460315&group_id=5470 From noreply@sourceforge.net Thu Sep 13 18:22:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 10:22:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-461280 ] commands.getstatus does an ls? Message-ID: Bugs item #461280, was opened at 2001-09-13 10:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stephan A. Fiedler (sfiedler) Assigned to: Nobody/Anonymous (nobody) Summary: commands.getstatus does an ls? Initial Comment: It seems like the function commands.getstatus() should just return the status of a shell command, rather than interpreting its argument as a filename and doing an "ls -ld" on it and returning the output. I would have thought the function would be implemented like this (based on commands.getoutput): def getstatus(cmd): """Return exit status of executing cmd in a shell.""" return getstatusoutput(cmd)[0] (Sorry for any line wrapping--the point is just to be symmetrical with getoutput.) Note also that closing a pipe can raise an exception, even if useful output was captured from the command; it may be convenient to put the pipe.close() in commands.getstatusoutput() into a try block. But this is probably an unlikely edge condition in most cases, and I won't be sad if it doesn't happen :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 From noreply@sourceforge.net Thu Sep 13 18:23:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 10:23:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-461280 ] commands.getstatus does an ls? Message-ID: Bugs item #461280, was opened at 2001-09-13 10:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 Category: None Group: None Status: Open Resolution: None >Priority: 2 Submitted By: Stephan A. Fiedler (sfiedler) Assigned to: Nobody/Anonymous (nobody) Summary: commands.getstatus does an ls? Initial Comment: It seems like the function commands.getstatus() should just return the status of a shell command, rather than interpreting its argument as a filename and doing an "ls -ld" on it and returning the output. I would have thought the function would be implemented like this (based on commands.getoutput): def getstatus(cmd): """Return exit status of executing cmd in a shell.""" return getstatusoutput(cmd)[0] (Sorry for any line wrapping--the point is just to be symmetrical with getoutput.) Note also that closing a pipe can raise an exception, even if useful output was captured from the command; it may be convenient to put the pipe.close() in commands.getstatusoutput() into a try block. But this is probably an unlikely edge condition in most cases, and I won't be sad if it doesn't happen :) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 From noreply@sourceforge.net Thu Sep 13 20:02:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 12:02:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-461280 ] commands.getstatus does an ls? Message-ID: Bugs item #461280, was opened at 2001-09-13 10:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 Category: None >Group: Not a Bug >Status: Closed >Resolution: Rejected Priority: 2 Submitted By: Stephan A. Fiedler (sfiedler) Assigned to: Nobody/Anonymous (nobody) Summary: commands.getstatus does an ls? Initial Comment: It seems like the function commands.getstatus() should just return the status of a shell command, rather than interpreting its argument as a filename and doing an "ls -ld" on it and returning the output. I would have thought the function would be implemented like this (based on commands.getoutput): def getstatus(cmd): """Return exit status of executing cmd in a shell.""" return getstatusoutput(cmd)[0] (Sorry for any line wrapping--the point is just to be symmetrical with getoutput.) Note also that closing a pipe can raise an exception, even if useful output was captured from the command; it may be convenient to put the pipe.close() in commands.getstatusoutput() into a try block. But this is probably an unlikely edge condition in most cases, and I won't be sad if it doesn't happen :) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:02 Message: Logged In: YES user_id=6380 Check the library reference manual. Despite what the name may suggest to you, this is exactly how the function is defined. Whether that's useful or not is irrelevant -- this is what it is supposed to do. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461280&group_id=5470 From noreply@sourceforge.net Thu Sep 13 20:59:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 12:59:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Thu Sep 13 21:55:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 13:55:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-461350 ] SSL support crashes python Message-ID: Bugs item #461350, was opened at 2001-09-13 13:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461350&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL support crashes python Initial Comment: with a debug version of python on Windows, try: >> import socket >> sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> sl = socket.ssl(sk._sock) This is due to PyObject_Del() calls in socketmodule.c: if ((SSL_connect(self->ssl)) == -1) { /* Actually negotiate SSL connection */ PyErr_SetObject(SSLErrorObject, PyString_FromString ("SSL_connect error")); PyObject_Del(self); return NULL; } these need to be replaced by: Py_DECREF(self); ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461350&group_id=5470 From noreply@sourceforge.net Thu Sep 13 22:01:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 14:01:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-461353 ] SSL write doesn't check return codes Message-ID: Bugs item #461353, was opened at 2001-09-13 14:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461353&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL write doesn't check return codes Initial Comment: routine SSL_SSLwrite() in socketmodule.c does not check the SSL_write() return codes. As a consequence, SSL write errors do not throw exceptions. Something like the following needs to be added: len = SSL_write(self->ssl, data, len); res = SSL_get_error(self->ssl, len); switch (res) { case SSL_ERROR_NONE: assert(len > 0); break; case SSL_ERROR_ZERO_RETURN: /* connection closed */ assert(len == 0); #ifdef MS_WINDOWS ec = WSAENOTCONN; #elif defined(PYOS_OS2) ec = -1; #else ec = ENOTCONN; #endif v = Py_BuildValue("(is)", ec, "Connection closed"); if (v != NULL) { PyErr_SetObject (PySocket_Error, v); Py_DECREF(v); } return NULL; break; case SSL_ERROR_SYSCALL: if (ERR_get_error() == 0 && len == 0) { v = Py_BuildValue("(is)", - 1, "Protocol violation: unexpected EOF"); if (v != NULL) { PyErr_SetObject (PySocket_Error, v); Py_DECREF(v); } return NULL; } else { return PySocket_Err(); } break; default: return PySocket_Err(); } ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461353&group_id=5470 From noreply@sourceforge.net Thu Sep 13 22:17:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 14:17:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-461358 ] SSL constructor/destructor bugs Message-ID: Bugs item #461358, was opened at 2001-09-13 14:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461358&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL constructor/destructor bugs Initial Comment: routine newSSLObject() in socketmodule.c does not initialize variables which SSL_dealloc() frees. SSL_dealloc() calls SSL_CTX_free() and then SSL_free (). However, SSL_free() also frees the CTX. in SSLObject, variable 'x_attr' seems to be unnecessary and maybe the source of a memory leak. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461358&group_id=5470 From noreply@sourceforge.net Fri Sep 14 03:05:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 19:05:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Fri Sep 14 03:06:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 19:06:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None >Status: Deleted Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Fri Sep 14 03:08:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 19:08:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None >Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Fri Sep 14 04:20:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 20:20:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-459464 ] Math_test overflowerror on sparc64 linux Message-ID: Bugs item #459464, was opened at 2001-09-07 02:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 Category: Extension Modules Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Math_test overflowerror on sparc64 linux Initial Comment: Traceback(most recent call last): testit('asin(-1)',math.asin(-1),-math.pi/2) OverflowError: math range error ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-13 20:20 Message: Logged In: YES user_id=31435 If there isn't any followup on this by the weekend, I'm going to close it. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-10 08:43 Message: Logged In: YES user_id=21627 Also, what compiler did you use? gcc on sparc64 (all versions) has known floating point bugs, so that it is not capable of building reliable 64-bit binaries, see gcc.gnu.org for details. The test works fine for me on Solaris 8, with the Sun WS6U1 compiler. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-07 02:58 Message: Logged In: YES user_id=31435 Needs more info. Which version of Python? If you try asin(-1) in a C program on this box, does the math library set errno? If so, it's a platform C bug, and you should report it to your C vendor (Python doesn't do anything with asin except call the platform asin, and if that sets errno to ERANGE, Python raises OverflowError; asin (-1) should not set errno to ERANGE, but if it does there's nothing Python can do about that). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 From noreply@sourceforge.net Fri Sep 14 04:26:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 13 Sep 2001 20:26:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-460467 ] file objects should be subclassable Message-ID: Bugs item #460467, was opened at 2001-09-10 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: file objects should be subclassable Initial Comment: We should be able to use fileobject as a base clase in 2.2 (but can't yet). A file() constructor should be made a new builtin, and work like builtin open() works. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-13 20:26 Message: Logged In: YES user_id=31435 This is complete. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-12 22:40 Message: Logged In: YES user_id=31435 Preliminary support checked in: Include/fileobject.h; new revision: 2.24 Include/moduleobject.h; new revision: 2.19 Lib/types.py; new revision: 1.21 Lib/test/test_descr.py; new revision: 1.51 Misc/NEWS; new revision: 1.242 Objects/fileobject.c; new revision: 2.123 Python/bltinmodule.c; new revision: 2.237 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460467&group_id=5470 From noreply@sourceforge.net Fri Sep 14 15:18:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 07:18:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-461546 ] bug in long_mul Message-ID: Bugs item #461546, was opened at 2001-09-14 07:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Tim Peters (tim_one) Summary: bug in long_mul Initial Comment: Here's a strange exception: >>> class C(long): __dynamic__ = 1 >>> c = C(1) >>> c*1 Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> 1*c Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> If I change __dynamic__ to 0, all's well: >>> class C(long): __dynamic__ = 0 >>> c = C(1) >>> c*1 1L >>> 1*c 1L >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 From noreply@sourceforge.net Fri Sep 14 18:32:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 10:32:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-460838 ] compilation warning from missing cast Message-ID: Bugs item #460838, was opened at 2001-09-12 01:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) >Assigned to: Martin v. Löwis (loewis) Summary: compilation warning from missing cast Initial Comment: When compiling _localemodule.c under IRIX I get the warning "/usr2/people/dalke/cvses/python/dist/src/Modules/_loca lemodule.c", line 218: warning(1164): argument of type "const char *" is incompatible with parameter of type "void *" free (Py_FileSystemDefaultEncoding); There should be a cast throwing constness away to get rid of that warning. Here's a patch that doesn't have the warning Index: Modules/_localemodule.c ======================================================= ============ RCS file: /cvsroot/python/python/dist/src/Modules/_localemo dule.c,v retrieving revision 2.23 diff -c -r2.23 _localemodule.c *** Modules/_localemodule.c 2001/09/05 17:09:48 2.23 --- Modules/_localemodule.c 2001/09/12 08:04:25 *************** *** 215,221 **** if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free (Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else --- 215,221 ---- if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free ((char *) Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else Andrew ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 From noreply@sourceforge.net Fri Sep 14 18:38:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 10:38:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-14 10:38 Message: Logged In: NO Anonymous certainly cannot add files to an existing (anonymous) report. So if you miss the chance when creating the report, you cannot add files later. This doesn't sound like a bug, though. Martin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Fri Sep 14 18:46:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 10:46:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-14 10:46 Message: Logged In: YES user_id=6380 But can a logged in person without admin privs add files to an existing report that's not their own (anonymous or not)? I can't test this because I have admin privs here. :-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-14 10:38 Message: Logged In: NO Anonymous certainly cannot add files to an existing (anonymous) report. So if you miss the chance when creating the report, you cannot add files later. This doesn't sound like a bug, though. Martin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Fri Sep 14 19:01:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 11:01:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-461611 ] listextend memory leak Message-ID: Bugs item #461611, was opened at 2001-09-14 11:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461611&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: listextend memory leak Initial Comment: Under Python 2.0.1, the following leaks: for i in xrange(10000000): lst = ['a'] lst.extend(10*[]) However, this doesn't: for i in xrange(10000000): lst = ['a'] lst.extend(10*['b']) We see this on WinNT and Win2K. It's not clear from looking at listobject.c why this happens. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461611&group_id=5470 From noreply@sourceforge.net Fri Sep 14 20:21:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 12:21:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-461637 ] marshal module won't use gzip module Message-ID: Bugs item #461637, was opened at 2001-09-14 12:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461637&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: marshal module won't use gzip module Initial Comment: marshal.dump/load complain that the file object returned by gzip.open is not a file. f = gzip.open(filename, 'wb') marshal.dump(value, f) f.close() fails, but it is possible do the following which seems to indicate that gzip files should be usable directly by marshal: f = gzip.open(filename, 'wb') f.write(marshal.dumps(value)) f.close() Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461637&group_id=5470 From noreply@sourceforge.net Fri Sep 14 20:29:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 12:29:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-461611 ] listextend memory leak Message-ID: Bugs item #461611, was opened at 2001-09-14 11:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461611&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Out of Date Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: listextend memory leak Initial Comment: Under Python 2.0.1, the following leaks: for i in xrange(10000000): lst = ['a'] lst.extend(10*[]) However, this doesn't: for i in xrange(10000000): lst = ['a'] lst.extend(10*['b']) We see this on WinNT and Win2K. It's not clear from looking at listobject.c why this happens. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-14 12:29 Message: Logged In: YES user_id=6380 The leak is unique to Python 2.0 and/or 2.0.1; it's been fixed in 2.1 and later. (It also didn't happen in 1.5.2.) So I'm closing this as "out of date". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461611&group_id=5470 From noreply@sourceforge.net Fri Sep 14 20:33:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 12:33:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-461637 ] marshal module won't use gzip module Message-ID: Bugs item #461637, was opened at 2001-09-14 12:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461637&group_id=5470 >Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: marshal module won't use gzip module Initial Comment: marshal.dump/load complain that the file object returned by gzip.open is not a file. f = gzip.open(filename, 'wb') marshal.dump(value, f) f.close() fails, but it is possible do the following which seems to indicate that gzip files should be usable directly by marshal: f = gzip.open(filename, 'wb') f.write(marshal.dumps(value)) f.close() Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-14 12:33 Message: Logged In: YES user_id=6380 Closing this as a "won't fix". The marshal module's load() and dump() only accepts real files, not "file-like" objects. This is because load() and dump() extract the stdio FILE * pointer from the file object to do their work. Fortunately, you found the work-around: use loads() and dumps(), which don't have this restriction. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461637&group_id=5470 From noreply@sourceforge.net Fri Sep 14 20:56:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 12:56:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-461546 ] bug in long_mul Message-ID: Bugs item #461546, was opened at 2001-09-14 07:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Guido van Rossum (gvanrossum) Summary: bug in long_mul Initial Comment: Here's a strange exception: >>> class C(long): __dynamic__ = 1 >>> c = C(1) >>> c*1 Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> 1*c Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> If I change __dynamic__ to 0, all's well: >>> class C(long): __dynamic__ = 0 >>> c = C(1) >>> c*1 1L >>> 1*c 1L >>> ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-14 12:56 Message: Logged In: YES user_id=31435 I don't really understand __dynamic__ yet, but I bet this will be clear(er) to you: The cause is that long_mul is trying to figure out whether this is multiplication or sequence repetition. Simplify this by considering c*2L (which also blows up). The LHS has a non-NULL v->ob_type->tp_as_sequence->sq_repeat slot, so long_mul incorrectly decides this *is* sequence repetition. One call to PyLong_AsLong completes, in long_repeat, getting the value 2 (the RHS). Then the LHS v->ob_type- >tp_as_sequence->sq_repeat is called. Then we end up in some macro, go thru some code it looks like you just checked in (lookup_maybe and PyObject_Call), and end up passing the Python int (not long) form of 2 to PyLong_AsLong. That's why it complains -- it was passed an int rather than a long. But we were really hosed at the start of this, when deciding this is sequence repetition rather than multiplication. When __dynamic__ is 0, the v->ob_type- >tp_as_sequence slot is NULL, so long_mul never tries to treat this as sequence repetition. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 From noreply@sourceforge.net Fri Sep 14 22:32:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 14:32:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Gregory Smith (gregsmith) Assigned to: Nobody/Anonymous (nobody) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Fri Sep 14 23:19:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 15:19:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-452252 ] __iadd__ sets object to None Message-ID: Bugs item #452252, was opened at 2001-08-17 15:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452252&group_id=5470 Category: Python Interpreter Core Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: John Shipman (shipman) Assigned to: Nobody/Anonymous (nobody) Summary: __iadd__ sets object to None Initial Comment: Here's my version info: ActivePython 2.1, build 211 (ActiveState) based on Python 2.1 (#1, Jun 15 2001, 02:52:41) [GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2 If I overload `+=' in a class using an __iadd__ method, the object is replaced by None. Here's a script that demonstrates the problem: ===================================================== #!/usr/local/bin/python #-- # iadd: See if __iadd__ actually works #-- class C: def __init__ ( self, value ): self.value = value def __str__ ( self ): return "C<%s>" % self.value def __repr__ ( self ): return str(self) def __iadd__ ( self, x ): self.value = self.value + x # - - - - - m a i n - - - - - c = C(37) print "Before:", c c += 10 print "Add 10:", c ===================================================== And here's the output I get: ===================================================== Before: C<37> Add 10: None ===================================================== ---------------------------------------------------------------------- Comment By: Gregory Smith (gregsmith) Date: 2001-09-14 15:19 Message: Logged In: YES user_id=292741 That should be 'you must return self'. __iadd__ should return self. unlike with 'classnm::operator += (rhs)' in C++, c += 10 is equiv to c = c.__iadd__(10) (if __iadd__ exists). This allows you to morph c into something else if you want. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-17 18:27 Message: Logged In: YES user_id=6380 You must return None. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452252&group_id=5470 From noreply@sourceforge.net Sat Sep 15 00:48:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 16:48:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Gregory Smith (gregsmith) >Assigned to: Tim Peters (tim_one) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-14 16:48 Message: Logged In: YES user_id=31435 Digging thru CVS, the code has always worked this way (contributed code introduced in structmodule.c rev 2.20). There are no tests of the 'p' code in the std test suite, so it's impossible to know for sure what the intent was. I agree that the way it actually works appears useless. Assigned to me. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Sat Sep 15 03:15:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 19:15:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Gregory Smith (gregsmith) >Assigned to: Guido van Rossum (gvanrossum) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-14 19:15 Message: Logged In: YES user_id=31435 Guido, is this just a doc bug? A raw 'p' can't work the way Gregory hopes, as it would make calcsize() ill-defined (and so also break the way struct.pack is implemented). The way the code is written, the only result you can get out of a 'p' pack code without a count is a single '\x00' byte. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 16:48 Message: Logged In: YES user_id=31435 Digging thru CVS, the code has always worked this way (contributed code introduced in structmodule.c rev 2.20). There are no tests of the 'p' code in the std test suite, so it's impossible to know for sure what the intent was. I agree that the way it actually works appears useless. Assigned to me. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Sat Sep 15 04:37:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 20:37:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-461753 ] Opaque context not handled when NULL Message-ID: Bugs item #461753, was opened at 2001-09-14 20:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 Category: XML Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) Assigned to: Nobody/Anonymous (nobody) Summary: Opaque context not handled when NULL Initial Comment: The opaque context string pointer passed to ExternalEntityRefHandler may be NULL in which case None is supplied as an argument. However, ExternalEntityParserCreate demands a non-NULL string and so may fail. Argument passing in Modules/pyexpat.c:ExternalEntityParserCreate should probably use a z rather than an s in ParseTuple. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 From noreply@sourceforge.net Sat Sep 15 04:44:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 14 Sep 2001 20:44:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-461754 ] CDATA should not undergo entity subst. Message-ID: Bugs item #461754, was opened at 2001-09-14 20:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 Category: XML Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) Assigned to: Nobody/Anonymous (nobody) Summary: CDATA should not undergo entity subst. Initial Comment: CDATASection data should not undergo entity substitution when output. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 From noreply@sourceforge.net Sat Sep 15 16:23:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 15 Sep 2001 08:23:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Gregory Smith (gregsmith) >Assigned to: Tim Peters (tim_one) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-15 08:23 Message: Logged In: YES user_id=6380 It's a doc bug. I didn't write the doc, but I did write the code. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 19:15 Message: Logged In: YES user_id=31435 Guido, is this just a doc bug? A raw 'p' can't work the way Gregory hopes, as it would make calcsize() ill-defined (and so also break the way struct.pack is implemented). The way the code is written, the only result you can get out of a 'p' pack code without a count is a single '\x00' byte. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 16:48 Message: Logged In: YES user_id=31435 Digging thru CVS, the code has always worked this way (contributed code introduced in structmodule.c rev 2.20). There are no tests of the 'p' code in the std test suite, so it's impossible to know for sure what the intent was. I agree that the way it actually works appears useless. Assigned to me. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Sat Sep 15 16:36:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 15 Sep 2001 08:36:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-461546 ] bug in long_mul Message-ID: Bugs item #461546, was opened at 2001-09-14 07:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Guido van Rossum (gvanrossum) Summary: bug in long_mul Initial Comment: Here's a strange exception: >>> class C(long): __dynamic__ = 1 >>> c = C(1) >>> c*1 Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> 1*c Traceback (most recent call last): File "", line 1, in ? SystemError: ../Objects/longobject.c:186: bad argument to internal function >>> If I change __dynamic__ to 0, all's well: >>> class C(long): __dynamic__ = 0 >>> c = C(1) >>> c*1 1L >>> 1*c 1L >>> ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-15 08:36 Message: Logged In: YES user_id=6380 Fixed now (also for ints). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 12:56 Message: Logged In: YES user_id=31435 I don't really understand __dynamic__ yet, but I bet this will be clear(er) to you: The cause is that long_mul is trying to figure out whether this is multiplication or sequence repetition. Simplify this by considering c*2L (which also blows up). The LHS has a non-NULL v->ob_type->tp_as_sequence->sq_repeat slot, so long_mul incorrectly decides this *is* sequence repetition. One call to PyLong_AsLong completes, in long_repeat, getting the value 2 (the RHS). Then the LHS v->ob_type- >tp_as_sequence->sq_repeat is called. Then we end up in some macro, go thru some code it looks like you just checked in (lookup_maybe and PyObject_Call), and end up passing the Python int (not long) form of 2 to PyLong_AsLong. That's why it complains -- it was passed an int rather than a long. But we were really hosed at the start of this, when deciding this is sequence repetition rather than multiplication. When __dynamic__ is 0, the v->ob_type- >tp_as_sequence slot is NULL, so long_mul never tries to treat this as sequence repetition. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461546&group_id=5470 From noreply@sourceforge.net Sat Sep 15 19:18:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 15 Sep 2001 11:18:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 >Category: Documentation Group: Python 2.1.1 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Gregory Smith (gregsmith) Assigned to: Tim Peters (tim_one) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-15 11:18 Message: Logged In: YES user_id=31435 Gregory, I'm closing this as a doc bug. The struct module, by design, implements fixed-length structs with fixed- length members, and the 'p' behavior it exhibits is the only kind that fits into that model. The description of the 'p' code in Doc/lib/libstruct.tex revision 1.32 has been changed: """ The \character{p} format character encodes a "Pascal string", meaning a short variable-length string stored in a fixed number of bytes. The count is the total number of bytes stored. The first byte stored is the length of the string, or 255, whichever is smaller. The bytes of the string follow. If the string passed in to \function{pack()} is too long (longer than the count minus 1), only the leading count-1 bytes of the string are stored. If the string is shorter than count-1, it is padded with null bytes so that exactly count bytes in all are used. Note that for \function{unpack()}, the \character{p} format character consumes count bytes, but that the string returned can never contain more than 255 characters. """ The implementation was also changed to make the new stuff about 255 true (for strings longer than that, it was just using the least-significant byte of the true length, and clearly by accident). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-15 08:23 Message: Logged In: YES user_id=6380 It's a doc bug. I didn't write the doc, but I did write the code. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 19:15 Message: Logged In: YES user_id=31435 Guido, is this just a doc bug? A raw 'p' can't work the way Gregory hopes, as it would make calcsize() ill-defined (and so also break the way struct.pack is implemented). The way the code is written, the only result you can get out of a 'p' pack code without a count is a single '\x00' byte. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 16:48 Message: Logged In: YES user_id=31435 Digging thru CVS, the code has always worked this way (contributed code introduced in structmodule.c rev 2.20). There are no tests of the 'p' code in the std test suite, so it's impossible to know for sure what the intent was. I agree that the way it actually works appears useless. Assigned to me. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Sat Sep 15 20:04:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 15 Sep 2001 12:04:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-461674 ] struct 'p' format doesn't work (maybe) Message-ID: Bugs item #461674, was opened at 2001-09-14 14:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 Category: Documentation Group: Python 2.1.1 Status: Closed Resolution: Fixed Priority: 5 Submitted By: Gregory Smith (gregsmith) Assigned to: Tim Peters (tim_one) Summary: struct 'p' format doesn't work (maybe) Initial Comment: Doc says: """ The "p" format character can be used to encode a Pascal string. The first byte is the length of the stored string, with the bytes of the string following. If count is given, it is used as the total number of bytes used, including the length byte. If the string passed in to pack() is too long, the stored representation is truncated. If the string is too short, padding is used to ensure that exactly enough bytes are used to satisfy the count. """ The behaviour implied (to me, anyway) is (1) pack('p','abc') -> '\x03abc' (2) pack('3p','abc') ->'\x02ab' (3) pack('5p','abc') ->'\x03abc\x00' (4) pack('p','a') -> '\x01a' (5) pack('p','') -> '\x00' (6) pack('p','abcdefg') -> '\x07abcdefg' etc, etc. In fact, only (2) and (3) work like this; the rest return empty string. and the corresponding unpack will return empty string. "If count is given" This implies (arguably) that 'p' by itself is useful and behaves as described in the first two sentences. This variable-length string storage would be very useful and it is too bad that it isn't supported. Of course, calcsize() would have to raise an exception if 'p' were used without a count, or return the min size. ---------------------------------------------------------------------- >Comment By: Gregory Smith (gregsmith) Date: 2001-09-15 12:04 Message: Logged In: YES user_id=292741 Fair enough - the name 'struct' itself tends to imply fixed field sizes. I'm looking at xdrlib now - I have a feature request idea for xdrlib and maybe I could code it if it's approved. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-15 11:18 Message: Logged In: YES user_id=31435 Gregory, I'm closing this as a doc bug. The struct module, by design, implements fixed-length structs with fixed- length members, and the 'p' behavior it exhibits is the only kind that fits into that model. The description of the 'p' code in Doc/lib/libstruct.tex revision 1.32 has been changed: """ The \character{p} format character encodes a "Pascal string", meaning a short variable-length string stored in a fixed number of bytes. The count is the total number of bytes stored. The first byte stored is the length of the string, or 255, whichever is smaller. The bytes of the string follow. If the string passed in to \function{pack()} is too long (longer than the count minus 1), only the leading count-1 bytes of the string are stored. If the string is shorter than count-1, it is padded with null bytes so that exactly count bytes in all are used. Note that for \function{unpack()}, the \character{p} format character consumes count bytes, but that the string returned can never contain more than 255 characters. """ The implementation was also changed to make the new stuff about 255 true (for strings longer than that, it was just using the least-significant byte of the true length, and clearly by accident). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-15 08:23 Message: Logged In: YES user_id=6380 It's a doc bug. I didn't write the doc, but I did write the code. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 19:15 Message: Logged In: YES user_id=31435 Guido, is this just a doc bug? A raw 'p' can't work the way Gregory hopes, as it would make calcsize() ill-defined (and so also break the way struct.pack is implemented). The way the code is written, the only result you can get out of a 'p' pack code without a count is a single '\x00' byte. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-14 16:48 Message: Logged In: YES user_id=31435 Digging thru CVS, the code has always worked this way (contributed code introduced in structmodule.c rev 2.20). There are no tests of the 'p' code in the std test suite, so it's impossible to know for sure what the intent was. I agree that the way it actually works appears useless. Assigned to me. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461674&group_id=5470 From noreply@sourceforge.net Sun Sep 16 08:38:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 00:38:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-461980 ] __contains__() underdocumented Message-ID: Bugs item #461980, was opened at 2001-09-16 00:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461980&group_id=5470 Category: Documentation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: __contains__() underdocumented Initial Comment: In http://python.sourceforge.net/devel-docs/ref/sequence-types.html#l2h-126 __contains__() is mentioned, and it's recommended that mappings and sequences implement them, but it's signature and semantics are not described. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461980&group_id=5470 From noreply@sourceforge.net Sun Sep 16 18:37:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 10:37:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-462064 ] Python 2.2 ignores execptions from cmp() Message-ID: Bugs item #462064, was opened at 2001-09-16 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Billy G. Allie (ballie01) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2 ignores execptions from cmp() Initial Comment: In Python 2.2a3, any exceptions set in the compare function of an extension module are not handle properly. In the following example, an exception will be raised during the comparison. I am including output from both Python 2.1 and 2.2. In Python 2.2 there is no traceback and when another exception is raised, the error message from the exception raised during the comparison is printed (without any traceback information), not the actual exception. ------------------ Python 2.1.1 (#4, Aug 13 2001, 18:25:49) [C] on unixware7 Type "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' Traceback (most recent call last): File "", line 1, in ? ValueError: Ivalid format for PgVersion construction. >>> ------------------ Python 2.2a3+ (#1, Sep 15 2001, 18:44:03) [C] on unixware5 Type "help", "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' 0 >>> a # This should raise a NameError exception. ValueError: Ivalid format for PgVersion construction. >>> a Traceback (most recent call last): File "", line 1, in ? NameError: name 'a' is not defined >>> ------------------ ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 From noreply@sourceforge.net Mon Sep 17 03:41:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 19:41:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-462064 ] Python 2.2 ignores execptions from cmp() Message-ID: Bugs item #462064, was opened at 2001-09-16 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Billy G. Allie (ballie01) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2 ignores execptions from cmp() Initial Comment: In Python 2.2a3, any exceptions set in the compare function of an extension module are not handle properly. In the following example, an exception will be raised during the comparison. I am including output from both Python 2.1 and 2.2. In Python 2.2 there is no traceback and when another exception is raised, the error message from the exception raised during the comparison is printed (without any traceback information), not the actual exception. ------------------ Python 2.1.1 (#4, Aug 13 2001, 18:25:49) [C] on unixware7 Type "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' Traceback (most recent call last): File "", line 1, in ? ValueError: Ivalid format for PgVersion construction. >>> ------------------ Python 2.2a3+ (#1, Sep 15 2001, 18:44:03) [C] on unixware5 Type "help", "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' 0 >>> a # This should raise a NameError exception. ValueError: Ivalid format for PgVersion construction. >>> a Traceback (most recent call last): File "", line 1, in ? NameError: name 'a' is not defined >>> ------------------ ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 19:41 Message: Logged In: YES user_id=6380 Sorry, I can't reproduce this. I have tried by adding comparison routines that return an error to the spamlist type of the xxsubtype module in 2.2. The error gets raised properly. Can you upload the source of the comparison routine(s) involved? Is it a rich comparison or a classic three-way compare? (I realize I could track down the code you used myself, but I don't know Postgres at all, so it would be a lot more work for me than for you.) The symptom you report, by the way, means that somewhere an exception is set but the proper error return value (typically NULL or -1) is not returned. It's possible that the code you used is subtly wrong, but it's also possible that your code triggers a path through the 2.2 comparison code that has a bug in it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 From noreply@sourceforge.net Mon Sep 17 04:36:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 20:36:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-462064 ] Python 2.2 ignores execptions from cmp() Message-ID: Bugs item #462064, was opened at 2001-09-16 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Billy G. Allie (ballie01) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2 ignores execptions from cmp() Initial Comment: In Python 2.2a3, any exceptions set in the compare function of an extension module are not handle properly. In the following example, an exception will be raised during the comparison. I am including output from both Python 2.1 and 2.2. In Python 2.2 there is no traceback and when another exception is raised, the error message from the exception raised during the comparison is printed (without any traceback information), not the actual exception. ------------------ Python 2.1.1 (#4, Aug 13 2001, 18:25:49) [C] on unixware7 Type "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' Traceback (most recent call last): File "", line 1, in ? ValueError: Ivalid format for PgVersion construction. >>> ------------------ Python 2.2a3+ (#1, Sep 15 2001, 18:44:03) [C] on unixware5 Type "help", "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' 0 >>> a # This should raise a NameError exception. ValueError: Ivalid format for PgVersion construction. >>> a Traceback (most recent call last): File "", line 1, in ? NameError: name 'a' is not defined >>> ------------------ ---------------------------------------------------------------------- >Comment By: Billy G. Allie (ballie01) Date: 2001-09-16 20:36 Message: Logged In: YES user_id=8500 The code is in a classic three-way compare. Based on your response, I changed the code to always return -1 when an exception is raised. The code was previously returning 1. Apparently, Python 2.0 and 2.1 would recognize the exception no matter what was returned by the comparison routine. Python 2.2 only checks for an exception when -1 is returns. Perhaps this should be noted in a FAQ? Thanks for the response. This bug report can be closed. BTW, in order to detect that the coercion from a string (or number) to a PgVersion object failed, I had to chanve the coercion return a 'special' PgVersion object that contained the error information (retrieved by PyErr_Fetch()). The comparison routine recoginizes this 'special' PgVersion object and restores the error information via PyErr_Restore. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 19:41 Message: Logged In: YES user_id=6380 Sorry, I can't reproduce this. I have tried by adding comparison routines that return an error to the spamlist type of the xxsubtype module in 2.2. The error gets raised properly. Can you upload the source of the comparison routine(s) involved? Is it a rich comparison or a classic three-way compare? (I realize I could track down the code you used myself, but I don't know Postgres at all, so it would be a lot more work for me than for you.) The symptom you report, by the way, means that somewhere an exception is set but the proper error return value (typically NULL or -1) is not returned. It's possible that the code you used is subtly wrong, but it's also possible that your code triggers a path through the 2.2 comparison code that has a bug in it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 From noreply@sourceforge.net Mon Sep 17 04:48:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 20:48:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-462064 ] Python 2.2 ignores execptions from cmp() Message-ID: Bugs item #462064, was opened at 2001-09-16 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Billy G. Allie (ballie01) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2 ignores execptions from cmp() Initial Comment: In Python 2.2a3, any exceptions set in the compare function of an extension module are not handle properly. In the following example, an exception will be raised during the comparison. I am including output from both Python 2.1 and 2.2. In Python 2.2 there is no traceback and when another exception is raised, the error message from the exception raised during the comparison is printed (without any traceback information), not the actual exception. ------------------ Python 2.1.1 (#4, Aug 13 2001, 18:25:49) [C] on unixware7 Type "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' Traceback (most recent call last): File "", line 1, in ? ValueError: Ivalid format for PgVersion construction. >>> ------------------ Python 2.2a3+ (#1, Sep 15 2001, 18:44:03) [C] on unixware5 Type "help", "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' 0 >>> a # This should raise a NameError exception. ValueError: Ivalid format for PgVersion construction. >>> a Traceback (most recent call last): File "", line 1, in ? NameError: name 'a' is not defined >>> ------------------ ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 20:48 Message: Logged In: YES user_id=6380 There's no FAQ for extension builders -- nobody looks there. I hope people will find this bug report though. I'll close it as you request. I'm not sure I understand your last remark. A coercion operation can raise an exception too, by returning -1. (Although it is more customary to say you can't do the coercion by returning 1.) I realize that these APIs aren't always clearly documented (I don't write the docs and I don't use them :-( ). But it sounds like you are not reading enough existing code to look for examples?! ---------------------------------------------------------------------- Comment By: Billy G. Allie (ballie01) Date: 2001-09-16 20:36 Message: Logged In: YES user_id=8500 The code is in a classic three-way compare. Based on your response, I changed the code to always return -1 when an exception is raised. The code was previously returning 1. Apparently, Python 2.0 and 2.1 would recognize the exception no matter what was returned by the comparison routine. Python 2.2 only checks for an exception when -1 is returns. Perhaps this should be noted in a FAQ? Thanks for the response. This bug report can be closed. BTW, in order to detect that the coercion from a string (or number) to a PgVersion object failed, I had to chanve the coercion return a 'special' PgVersion object that contained the error information (retrieved by PyErr_Fetch()). The comparison routine recoginizes this 'special' PgVersion object and restores the error information via PyErr_Restore. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 19:41 Message: Logged In: YES user_id=6380 Sorry, I can't reproduce this. I have tried by adding comparison routines that return an error to the spamlist type of the xxsubtype module in 2.2. The error gets raised properly. Can you upload the source of the comparison routine(s) involved? Is it a rich comparison or a classic three-way compare? (I realize I could track down the code you used myself, but I don't know Postgres at all, so it would be a lot more work for me than for you.) The symptom you report, by the way, means that somewhere an exception is set but the proper error return value (typically NULL or -1) is not returned. It's possible that the code you used is subtly wrong, but it's also possible that your code triggers a path through the 2.2 comparison code that has a bug in it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 From noreply@sourceforge.net Mon Sep 17 04:48:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 20:48:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-462064 ] Python 2.2 ignores execptions from cmp() Message-ID: Bugs item #462064, was opened at 2001-09-16 10:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 Category: Python Interpreter Core >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Billy G. Allie (ballie01) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2 ignores execptions from cmp() Initial Comment: In Python 2.2a3, any exceptions set in the compare function of an extension module are not handle properly. In the following example, an exception will be raised during the comparison. I am including output from both Python 2.1 and 2.2. In Python 2.2 there is no traceback and when another exception is raised, the error message from the exception raised during the comparison is printed (without any traceback information), not the actual exception. ------------------ Python 2.1.1 (#4, Aug 13 2001, 18:25:49) [C] on unixware7 Type "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' Traceback (most recent call last): File "", line 1, in ? ValueError: Ivalid format for PgVersion construction. >>> ------------------ Python 2.2a3+ (#1, Sep 15 2001, 18:44:03) [C] on unixware5 Type "help", "copyright", "credits" or "license" for more information. >>> import libpq >>> cx = libpq.PQconnectdb('host=/tmp') >>> v = cx.version >>> v PostgreSQL 7.1.3 on i586-sco-sysv5uw7.1.1, compiled by cc >>> v == '' 0 >>> a # This should raise a NameError exception. ValueError: Ivalid format for PgVersion construction. >>> a Traceback (most recent call last): File "", line 1, in ? NameError: name 'a' is not defined >>> ------------------ ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 20:48 Message: Logged In: YES user_id=6380 There's no FAQ for extension builders -- nobody looks there. I hope people will find this bug report though. I'll close it as you request. I'm not sure I understand your last remark. A coercion operation can raise an exception too, by returning -1. (Although it is more customary to say you can't do the coercion by returning 1.) I realize that these APIs aren't always clearly documented (I don't write the docs and I don't use them :-( ). But it sounds like you are not reading enough existing code to look for examples?! ---------------------------------------------------------------------- Comment By: Billy G. Allie (ballie01) Date: 2001-09-16 20:36 Message: Logged In: YES user_id=8500 The code is in a classic three-way compare. Based on your response, I changed the code to always return -1 when an exception is raised. The code was previously returning 1. Apparently, Python 2.0 and 2.1 would recognize the exception no matter what was returned by the comparison routine. Python 2.2 only checks for an exception when -1 is returns. Perhaps this should be noted in a FAQ? Thanks for the response. This bug report can be closed. BTW, in order to detect that the coercion from a string (or number) to a PgVersion object failed, I had to chanve the coercion return a 'special' PgVersion object that contained the error information (retrieved by PyErr_Fetch()). The comparison routine recoginizes this 'special' PgVersion object and restores the error information via PyErr_Restore. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-16 19:41 Message: Logged In: YES user_id=6380 Sorry, I can't reproduce this. I have tried by adding comparison routines that return an error to the spamlist type of the xxsubtype module in 2.2. The error gets raised properly. Can you upload the source of the comparison routine(s) involved? Is it a rich comparison or a classic three-way compare? (I realize I could track down the code you used myself, but I don't know Postgres at all, so it would be a lot more work for me than for you.) The symptom you report, by the way, means that somewhere an exception is set but the proper error return value (typically NULL or -1) is not returned. It's possible that the code you used is subtly wrong, but it's also possible that your code triggers a path through the 2.2 comparison code that has a bug in it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462064&group_id=5470 From noreply@sourceforge.net Mon Sep 17 05:00:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 16 Sep 2001 21:00:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-461358 ] SSL constructor/destructor bugs Message-ID: Bugs item #461358, was opened at 2001-09-13 14:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461358&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SSL constructor/destructor bugs Initial Comment: routine newSSLObject() in socketmodule.c does not initialize variables which SSL_dealloc() frees. SSL_dealloc() calls SSL_CTX_free() and then SSL_free (). However, SSL_free() also frees the CTX. in SSLObject, variable 'x_attr' seems to be unnecessary and maybe the source of a memory leak. ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-16 21:00 Message: Logged In: YES user_id=163326 Hello! I'm pretty new to OpenSSL, but I'm trying my best to nail the recently reported SSL bugs down. I could confirm everything you state here. The docs didn't say anything about SSL_free() freeing the CTX, but the OpenSSL source says yes, it does. If you'd log in next time, that would ease communication :-) I'll soon (0-2 days) submit a patch that tries to fix some of the recently reported problems. I'll also try to bug a few people proficient in Python & OpenSSL to review my patch. You seem to be knowledgable in both, so another pair of eyes won't hurt. Btw. I can be reached at gerhard@bigfoot.de ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461358&group_id=5470 From noreply@sourceforge.net Mon Sep 17 08:08:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 00:08:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-17 00:08 Message: Logged In: YES user_id=21627 No, you can only add files to your own report. Not sure what the rationale is, perhaps spam protection? as anybody can attach comments. To see how SF is working, just look at any other project (e.g. /projects/strace); the UI for attaching files is simply not there. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-14 10:46 Message: Logged In: YES user_id=6380 But can a logged in person without admin privs add files to an existing report that's not their own (anonymous or not)? I can't test this because I have admin privs here. :-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-14 10:38 Message: Logged In: NO Anonymous certainly cannot add files to an existing (anonymous) report. So if you miss the chance when creating the report, you cannot add files later. This doesn't sound like a bug, though. Martin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Mon Sep 17 15:18:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 07:18:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-461409 ] testing file upload Message-ID: Bugs item #461409, was opened at 2001-09-13 19:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: testing file upload Initial Comment: I've heard people complain that anonymous can't upload files. Testing if that's true. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-17 07:18 Message: Logged In: YES user_id=6380 OK, got it now. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-17 00:08 Message: Logged In: YES user_id=21627 No, you can only add files to your own report. Not sure what the rationale is, perhaps spam protection? as anybody can attach comments. To see how SF is working, just look at any other project (e.g. /projects/strace); the UI for attaching files is simply not there. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-14 10:46 Message: Logged In: YES user_id=6380 But can a logged in person without admin privs add files to an existing report that's not their own (anonymous or not)? I can't test this because I have admin privs here. :-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-14 10:38 Message: Logged In: NO Anonymous certainly cannot add files to an existing (anonymous) report. So if you miss the chance when creating the report, you cannot add files later. This doesn't sound like a bug, though. Martin ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 19:06 Message: Logged In: YES user_id=6380 Hm. It works fine. People must not understand the upload checkbox. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461409&group_id=5470 From noreply@sourceforge.net Mon Sep 17 16:20:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 08:20:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Guido van Rossum (gvanrossum) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 08:20 Message: Logged In: YES user_id=93657 I'm attaching a simple test program and its Makefile, for build with VC++. Running 'nmake' after sourcing the VC++ environment (vcvars.bat) will do the build and print the test output. Whatever be the configuration (PYTHONPATH set, not set, current working directory...), the directory containing the executable (main.exe) will always be listed in sys.path. This is a potential problem, to the extent that one cannot make assumption on the *.py files and directories contained in the executable directory. I'm pasting below a sample run, where 'c:\local\src\testpath' shows up in sys.path (not normal), in addition ot the current working directory (c:\local\src - normal): C:\local\src\testpath>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl c:\local\src\Python\PCbuild\python21.lib main.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. main.c Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:main.exe c:\local\src\Python\PCbuild\python21.lib main.obj cd .. && testpath\main.exe ['c:\program files\python21\lib\plat-win', 'c:\program files\python21\lib ', 'c:\program files\python21\dlls', 'c:\program files\python21\lib\lib-t k', 'c:\local\src', 'c:\local\src\testpath'] PYTHONPATH=None cwd=C:\local\src C:\local\src\testpath> ----------------------------- As for 'python -i', I was giving an exemple of probelm that occurs when modifying global process ressources [here, the -i option operates a setvbuf() call on stdin; the Java VM also seems to do some operation there (modifying stdin low-level file descriptor flags), that ends up in Python syntax errors on interactive carriage return, after the Java VM is started, but only with 'python -i'...]. I was giving this as an exemple in the same vein as modifying argv[]: one cannot help that there is an unlikely, but nevertheless existing possibility that there be sometimes another library that uses the variable in the same time; and that modifying it could mess up something somewhere... Some would also quote 'Murphy's law' :)) Frederic Giacometti ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:19 Message: Logged In: YES user_id=6380 Reassigning this to me, I don't think Tim can help. Frederic, your explanations are inscrutable. "Py_Main() isn't called, but it is called." "python -i and python -i" does *what*? Who are "the guys"? Sorry, I just don't see the bug report in there. Can you provide a small test program that exhibits the problem? ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Mon Sep 17 16:32:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 08:32:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Guido van Rossum (gvanrossum) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-17 08:32 Message: Logged In: YES user_id=6380 Strange. I cannot reproduce this on Unix. Can you run your test program under the debugger on Windows to see where sys.path is modfied? Let's forget about -i; if Java is doing some low-level messing with stdin, you can't really blame Python if it goes wrong! ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 08:20 Message: Logged In: YES user_id=93657 I'm attaching a simple test program and its Makefile, for build with VC++. Running 'nmake' after sourcing the VC++ environment (vcvars.bat) will do the build and print the test output. Whatever be the configuration (PYTHONPATH set, not set, current working directory...), the directory containing the executable (main.exe) will always be listed in sys.path. This is a potential problem, to the extent that one cannot make assumption on the *.py files and directories contained in the executable directory. I'm pasting below a sample run, where 'c:\local\src\testpath' shows up in sys.path (not normal), in addition ot the current working directory (c:\local\src - normal): C:\local\src\testpath>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl c:\local\src\Python\PCbuild\python21.lib main.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. main.c Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:main.exe c:\local\src\Python\PCbuild\python21.lib main.obj cd .. && testpath\main.exe ['c:\program files\python21\lib\plat-win', 'c:\program files\python21\lib ', 'c:\program files\python21\dlls', 'c:\program files\python21\lib\lib-t k', 'c:\local\src', 'c:\local\src\testpath'] PYTHONPATH=None cwd=C:\local\src C:\local\src\testpath> ----------------------------- As for 'python -i', I was giving an exemple of probelm that occurs when modifying global process ressources [here, the -i option operates a setvbuf() call on stdin; the Java VM also seems to do some operation there (modifying stdin low-level file descriptor flags), that ends up in Python syntax errors on interactive carriage return, after the Java VM is started, but only with 'python -i'...]. I was giving this as an exemple in the same vein as modifying argv[]: one cannot help that there is an unlikely, but nevertheless existing possibility that there be sometimes another library that uses the variable in the same time; and that modifying it could mess up something somewhere... Some would also quote 'Murphy's law' :)) Frederic Giacometti ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:19 Message: Logged In: YES user_id=6380 Reassigning this to me, I don't think Tim can help. Frederic, your explanations are inscrutable. "Py_Main() isn't called, but it is called." "python -i and python -i" does *what*? Who are "the guys"? Sorry, I just don't see the bug report in there. Can you provide a small test program that exhibits the problem? ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Mon Sep 17 17:27:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 09:27:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-462270 ] sub-tle difference between pre and sre Message-ID: Bugs item #462270, was opened at 2001-09-17 09:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462270&group_id=5470 Category: Regular Expressions Group: None Status: Open Resolution: None Priority: 5 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: sub-tle difference between pre and sre Initial Comment: as reported by Carlos Gaston Alvarez on comp.lang.python (verified in 2.1.1 and 2.2a3): >>> import pre >>> p = pre.compile("x*") >>> p.sub("-", "abxd") '-a-b-d-' >>> import sre >>> p = sre.compile("x*") >>> p.sub("-", "abxd") '-a-b--d-' ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462270&group_id=5470 From noreply@sourceforge.net Mon Sep 17 17:37:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 09:37:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-462274 ] Add "l2h-arg" to mkhowto Message-ID: Bugs item #462274, was opened at 2001-09-17 09:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462274&group_id=5470 Category: Demos and Tools Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Rich Salz (rsalz) Assigned to: Nobody/Anonymous (nobody) Summary: Add "l2h-arg" to mkhowto Initial Comment: It would be nice to be able to pass arbitrary latex2html options from the mkhowto command line. I know I can achieve (most of) the same effect by studying latex2html.pl and creating my own init file, but I'd rather stick to the published interface. :) The attached patch adds --l2h-arg= flag which lets you pass args to latex2html. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462274&group_id=5470 From noreply@sourceforge.net Mon Sep 17 17:40:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 09:40:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Guido van Rossum (gvanrossum) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- >Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 09:40 Message: Logged In: YES user_id=93657 I'll try to trace the problem on Windows - but I only have Unix boxes on the client site where I work this month; I have to do it at home, and my wife now gets mad at me any time she sees an xemacs window on my laptop :((. I completely agree with the 'python -i' thing :)) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-17 08:32 Message: Logged In: YES user_id=6380 Strange. I cannot reproduce this on Unix. Can you run your test program under the debugger on Windows to see where sys.path is modfied? Let's forget about -i; if Java is doing some low-level messing with stdin, you can't really blame Python if it goes wrong! ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 08:20 Message: Logged In: YES user_id=93657 I'm attaching a simple test program and its Makefile, for build with VC++. Running 'nmake' after sourcing the VC++ environment (vcvars.bat) will do the build and print the test output. Whatever be the configuration (PYTHONPATH set, not set, current working directory...), the directory containing the executable (main.exe) will always be listed in sys.path. This is a potential problem, to the extent that one cannot make assumption on the *.py files and directories contained in the executable directory. I'm pasting below a sample run, where 'c:\local\src\testpath' shows up in sys.path (not normal), in addition ot the current working directory (c:\local\src - normal): C:\local\src\testpath>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl c:\local\src\Python\PCbuild\python21.lib main.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. main.c Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:main.exe c:\local\src\Python\PCbuild\python21.lib main.obj cd .. && testpath\main.exe ['c:\program files\python21\lib\plat-win', 'c:\program files\python21\lib ', 'c:\program files\python21\dlls', 'c:\program files\python21\lib\lib-t k', 'c:\local\src', 'c:\local\src\testpath'] PYTHONPATH=None cwd=C:\local\src C:\local\src\testpath> ----------------------------- As for 'python -i', I was giving an exemple of probelm that occurs when modifying global process ressources [here, the -i option operates a setvbuf() call on stdin; the Java VM also seems to do some operation there (modifying stdin low-level file descriptor flags), that ends up in Python syntax errors on interactive carriage return, after the Java VM is started, but only with 'python -i'...]. I was giving this as an exemple in the same vein as modifying argv[]: one cannot help that there is an unlikely, but nevertheless existing possibility that there be sometimes another library that uses the variable in the same time; and that modifying it could mess up something somewhere... Some would also quote 'Murphy's law' :)) Frederic Giacometti ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:19 Message: Logged In: YES user_id=6380 Reassigning this to me, I don't think Tim can help. Frederic, your explanations are inscrutable. "Py_Main() isn't called, but it is called." "python -i and python -i" does *what*? Who are "the guys"? Sorry, I just don't see the bug report in there. Can you provide a small test program that exhibits the problem? ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Mon Sep 17 20:45:35 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 12:45:35 -0700 Subject: [Python-bugs-list] [ python-Bugs-459464 ] Math_test overflowerror on sparc64 linux Message-ID: Bugs item #459464, was opened at 2001-09-07 02:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 Category: Extension Modules >Group: 3rd Party >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: Math_test overflowerror on sparc64 linux Initial Comment: Traceback(most recent call last): testit('asin(-1)',math.asin(-1),-math.pi/2) OverflowError: math range error ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-17 12:45 Message: Logged In: YES user_id=31435 Closed for lack of followup; presumed to be a platform libm bug. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-13 20:20 Message: Logged In: YES user_id=31435 If there isn't any followup on this by the weekend, I'm going to close it. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-10 08:43 Message: Logged In: YES user_id=21627 Also, what compiler did you use? gcc on sparc64 (all versions) has known floating point bugs, so that it is not capable of building reliable 64-bit binaries, see gcc.gnu.org for details. The test works fine for me on Solaris 8, with the Sun WS6U1 compiler. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-07 02:58 Message: Logged In: YES user_id=31435 Needs more info. Which version of Python? If you try asin(-1) in a C program on this box, does the math library set errno? If so, it's a platform C bug, and you should report it to your C vendor (Python doesn't do anything with asin except call the platform asin, and if that sets errno to ERANGE, Python raises OverflowError; asin (-1) should not set errno to ERANGE, but if it does there's nothing Python can do about that). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459464&group_id=5470 From noreply@sourceforge.net Tue Sep 18 05:53:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 17 Sep 2001 21:53:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-462461 ] Some install scripts ignore ENV VARS Message-ID: Bugs item #462461, was opened at 2001-09-17 21:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 Category: Installation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Some install scripts ignore ENV VARS Initial Comment: I am trying to make a python 2.1.1 RPM for my linux distro. I am running into a problem during the python install. It seems that pydoc is trying to get installed into my systems /usr/bin (good thing I build rpms as a unprivledged user). From what I can tell, whatever installs pydoc seems to ignore $BINDIR and $prefix as I set them in my "make install" command. copying build/lib.linux-i686-2.1/zlib.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload copying build/lib.linux-i686-2.1/linuxaudiodev.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload running install_scripts copying build/scripts/pydoc -> /usr/bin error: /usr/bin/pydoc: Permission denied make: *** [sharedinstall] Error 1 error: Bad exit status from /home/miah/rpm_build/tmp/rpm-tmp.23763 (%install) My install command is make prefix=$RPM_BUILD_ROOT/usr \ BINDIR=$RPM_BUILD_ROOT/usr/bin \ install ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 From noreply@sourceforge.net Tue Sep 18 15:34:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 07:34:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open >Resolution: Fixed Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 07:34 Message: Logged In: YES user_id=6380 I've checked in the patch now. Still waiting for Martijn's feedback before I close the report. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Tue Sep 18 16:09:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 08:09:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 08:09 Message: Logged In: YES user_id=116747 Your patch looks sound, apart from the fact it'll only remove a LF. The Spec says the CRLF is part of the boundary, and, to account for broken implementations, it should probably remove and of 'CRLF', 'LF', or 'CR' at the end. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 07:34 Message: Logged In: YES user_id=6380 I've checked in the patch now. Still waiting for Martijn's feedback before I close the report. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Tue Sep 18 16:40:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 08:40:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 08:40 Message: Logged In: YES user_id=6380 I think that CRLF support in this case isn't worth it. It's not done elsewhere in this module -- it assumes that line endings have already been converted to Unix style. Lone CR is definitely not supported -- none of the code would work. ---------------------------------------------------------------------- Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 08:09 Message: Logged In: YES user_id=116747 Your patch looks sound, apart from the fact it'll only remove a LF. The Spec says the CRLF is part of the boundary, and, to account for broken implementations, it should probably remove and of 'CRLF', 'LF', or 'CR' at the end. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 07:34 Message: Logged In: YES user_id=6380 I've checked in the patch now. Still waiting for Martijn's feedback before I close the report. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Tue Sep 18 17:16:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 09:16:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- >Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 09:16 Message: Logged In: YES user_id=116747 Okay, if all the code depends on line-endings being Unix-style, the patch has my blessings. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 08:40 Message: Logged In: YES user_id=6380 I think that CRLF support in this case isn't worth it. It's not done elsewhere in this module -- it assumes that line endings have already been converted to Unix style. Lone CR is definitely not supported -- none of the code would work. ---------------------------------------------------------------------- Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 08:09 Message: Logged In: YES user_id=116747 Your patch looks sound, apart from the fact it'll only remove a LF. The Spec says the CRLF is part of the boundary, and, to account for broken implementations, it should probably remove and of 'CRLF', 'LF', or 'CR' at the end. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 07:34 Message: Logged In: YES user_id=6380 I've checked in the patch now. Still waiting for Martijn's feedback before I close the report. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Tue Sep 18 17:27:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 09:27:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-417176 ] MultiFile.read() includes CRLF boundary Message-ID: Bugs item #417176, was opened at 2001-04-18 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 Category: Python Library Group: None >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Martijn Pieters (mjpieters) Assigned to: Guido van Rossum (gvanrossum) Summary: MultiFile.read() includes CRLF boundary Initial Comment: multifile.MultiFile.readlines()and .read() will return a body of a multipart message including the line delimiter that is to be regarded part of the boundary. In a partial multipart message like: --BoundaryHere Content-Type: text/plain 1 2 3 4 --BoundaryHere the message within the delimiters does not include the final line delimiter (CRLF or LF or whatnot) after the line reading '4'; it is considered part of the boundary. MultiFile however, returns it as part of the body. See RFC2046 section 5.1.1. In the usual text formatting of the RFC, you'll find the definition and explanation in the first two paragraphs of page 19. ---------------------------------------------------------------------- Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 09:16 Message: Logged In: YES user_id=116747 Okay, if all the code depends on line-endings being Unix-style, the patch has my blessings. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 08:40 Message: Logged In: YES user_id=6380 I think that CRLF support in this case isn't worth it. It's not done elsewhere in this module -- it assumes that line endings have already been converted to Unix style. Lone CR is definitely not supported -- none of the code would work. ---------------------------------------------------------------------- Comment By: Martijn Pieters (mjpieters) Date: 2001-09-18 08:09 Message: Logged In: YES user_id=116747 Your patch looks sound, apart from the fact it'll only remove a LF. The Spec says the CRLF is part of the boundary, and, to account for broken implementations, it should probably remove and of 'CRLF', 'LF', or 'CR' at the end. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 07:34 Message: Logged In: YES user_id=6380 I've checked in the patch now. Still waiting for Martijn's feedback before I close the report. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-13 12:59 Message: Logged In: YES user_id=6380 Martijn, here's a fix. Can you test this? The fix works (how else) by reading ahead one line and stripping the final newline if the next line is empty. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:54 Message: Logged In: YES user_id=6380 I wrote that code and I'm probably culpable. It's also always bothered me. Unassigning it from Barry (it has nothing to do with Barry). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417176&group_id=5470 From noreply@sourceforge.net Tue Sep 18 18:53:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 10:53:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-461980 ] __contains__() underdocumented Message-ID: Bugs item #461980, was opened at 2001-09-16 00:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461980&group_id=5470 Category: Documentation Group: Python 2.2 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: __contains__() underdocumented Initial Comment: In http://python.sourceforge.net/devel-docs/ref/sequence-types.html#l2h-126 __contains__() is mentioned, and it's recommended that mappings and sequences implement them, but it's signature and semantics are not described. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-18 10:53 Message: Logged In: YES user_id=3066 __contains__() is described in the next section, "Additional methods for emulation of sequence types." Both references are included in the index. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461980&group_id=5470 From noreply@sourceforge.net Tue Sep 18 19:35:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 11:35:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-462270 ] sub-tle difference between pre and sre Message-ID: Bugs item #462270, was opened at 2001-09-17 09:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462270&group_id=5470 Category: Regular Expressions Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: sub-tle difference between pre and sre Initial Comment: as reported by Carlos Gaston Alvarez on comp.lang.python (verified in 2.1.1 and 2.2a3): >>> import pre >>> p = pre.compile("x*") >>> p.sub("-", "abxd") '-a-b-d-' >>> import sre >>> p = sre.compile("x*") >>> p.sub("-", "abxd") '-a-b--d-' ---------------------------------------------------------------------- >Comment By: Fredrik Lundh (effbot) Date: 2001-09-18 11:35 Message: Logged In: YES user_id=38376 unlike PRE, SRE didn't ignore empty matches at the last position. you can never have too many test cases... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462270&group_id=5470 From noreply@sourceforge.net Tue Sep 18 19:52:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 11:52:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-454843 ] Python2.x sre and threaded import lockin Message-ID: Bugs item #454843, was opened at 2001-08-23 20:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454843&group_id=5470 Category: Threads Group: None Status: Open Resolution: None >Priority: 1 Submitted By: Joe Kelly (jpkelly) Assigned to: Fredrik Lundh (effbot) Summary: Python2.x sre and threaded import lockin Initial Comment: There appears to be a bug in the way Python2.x does import locking on sre. This is illustrated by the following code fragments. $ cat retest #!/usr/local/bin/python __import__("ret") $ cat ret.py #!/usr/local/bin/python import time, thread, string #import time, thread import re #import pre #re=pre def mythread(): time.sleep(2) url = "hello there" url = re.sub(" ", '', url) print "hello from threadland", url thread.start_new_thread(mythread, ()) url = "hello main there" url = re.sub(" ", '', url) print "main", url time.sleep(5) print "goodbye", url If you run retest as shown above you get: $ retest main hellomainthere goodbye hellomainthere It never runs the code in the thread. If you run python on ret.pyc directly you get the correct/expected result: $ python ret.pyc main hellomainthere hello from threadland hellothere goodbye hellomainthere If you replace sre with pre by commenting out line 5 and uncommenting out line 6 and 7 it works correctly/as expected: $ retest main hellomainthere hello from threadland hellothere goodbye hellomainthere I've also noticed some strange interaction with other imports, i.e. if you go back to the original ret.py and comment out line 3 and uncomment line 4 (just don't import the string module) you get the following: $ retest main hellomainthere goodbye hellomainthere hello from threadland hellothere That is the thread gets executed at the end or sometimes not at all: $ retest main hellomainthere goodbye hellomainthere Again, calling ret directly seems to work. $ python ret.pyc main hellomainthere hello from threadland hellothere goodbye hellomainthere This has been tested on Solaris 8 running on Intel: $ uname -a SunOS machine 5.8 Generic_108529-07 i86pc i386 i86pc It also exhibits the same behavior under Linux: $ uname -a Linux machine 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown The above output was generated by python 2.0 compiled with threading on: $ python Python 2.0 (#1, May 13 2001, 00:55:08) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. >>> It exhibits the same behavior under python 2.1.1: $ python Python 2.1.1 (#22, Aug 20 2001, 17:12:35) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. ---------------------------------------------------------------------- >Comment By: Fredrik Lundh (effbot) Date: 2001-09-18 11:52 Message: Logged In: YES user_id=38376 Reduced priority (to match "hopeless" status) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-23 21:20 Message: Logged In: YES user_id=31435 Assigned to Fredrik, but as I said on c.l.py, never write a module that spawns threads as a side effect of merely being imported. Everything you're chasing is an accident, and while /F may or may not bother worming around this one, you're going to get in trouble over and over again. I've reduced the priority accordingly. /F, the immediate cause for this one is the import sre_parse in the body of sre_compile.compile(), which is reached in the spawned thread via calling re.sub(). Since the module "ret" is itself imported, the main thread doing the import of "ret" holds the import lock for the duration. This causes the spawned thread (created by merely importing "ret", and there's no proper synchronization in the test case either, so accidents compound) to block on any import attempt. In particular, the spawned thread blocks on the line shown above. Worm around that, and it blocks somewhere else later; etc. In *general* it's hopeless. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454843&group_id=5470 From noreply@sourceforge.net Tue Sep 18 20:16:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 12:16:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-462639 ] HTTP/1.1 support undocumented Message-ID: Bugs item #462639, was opened at 2001-09-18 12:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462639&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: A.M. Kuchling (akuchling) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: HTTP/1.1 support undocumented Initial Comment: The docs for httplib.py don't cover the HTTP/1.1 support, or new classes such as HTTPResponse or HTTPConnection. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462639&group_id=5470 From noreply@sourceforge.net Tue Sep 18 20:30:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 12:30:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-462639 ] HTTP/1.1 support undocumented Message-ID: Bugs item #462639, was opened at 2001-09-18 12:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462639&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: A.M. Kuchling (akuchling) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: HTTP/1.1 support undocumented Initial Comment: The docs for httplib.py don't cover the HTTP/1.1 support, or new classes such as HTTPResponse or HTTPConnection. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-18 12:30 Message: Logged In: YES user_id=3066 Duplicate of bug #458447. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462639&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:03:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:03:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-454843 ] Python2.x sre and threaded import lockin Message-ID: Bugs item #454843, was opened at 2001-08-23 20:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454843&group_id=5470 Category: Threads Group: None >Status: Closed >Resolution: Wont Fix Priority: 1 Submitted By: Joe Kelly (jpkelly) >Assigned to: Tim Peters (tim_one) Summary: Python2.x sre and threaded import lockin Initial Comment: There appears to be a bug in the way Python2.x does import locking on sre. This is illustrated by the following code fragments. $ cat retest #!/usr/local/bin/python __import__("ret") $ cat ret.py #!/usr/local/bin/python import time, thread, string #import time, thread import re #import pre #re=pre def mythread(): time.sleep(2) url = "hello there" url = re.sub(" ", '', url) print "hello from threadland", url thread.start_new_thread(mythread, ()) url = "hello main there" url = re.sub(" ", '', url) print "main", url time.sleep(5) print "goodbye", url If you run retest as shown above you get: $ retest main hellomainthere goodbye hellomainthere It never runs the code in the thread. If you run python on ret.pyc directly you get the correct/expected result: $ python ret.pyc main hellomainthere hello from threadland hellothere goodbye hellomainthere If you replace sre with pre by commenting out line 5 and uncommenting out line 6 and 7 it works correctly/as expected: $ retest main hellomainthere hello from threadland hellothere goodbye hellomainthere I've also noticed some strange interaction with other imports, i.e. if you go back to the original ret.py and comment out line 3 and uncomment line 4 (just don't import the string module) you get the following: $ retest main hellomainthere goodbye hellomainthere hello from threadland hellothere That is the thread gets executed at the end or sometimes not at all: $ retest main hellomainthere goodbye hellomainthere Again, calling ret directly seems to work. $ python ret.pyc main hellomainthere hello from threadland hellothere goodbye hellomainthere This has been tested on Solaris 8 running on Intel: $ uname -a SunOS machine 5.8 Generic_108529-07 i86pc i386 i86pc It also exhibits the same behavior under Linux: $ uname -a Linux machine 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown The above output was generated by python 2.0 compiled with threading on: $ python Python 2.0 (#1, May 13 2001, 00:55:08) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. >>> It exhibits the same behavior under python 2.1.1: $ python Python 2.1.1 (#22, Aug 20 2001, 17:12:35) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-18 13:03 Message: Logged In: YES user_id=31435 Reassigned to me and closed as WontFix. I confirmed with Guido that we have no bright ideas pending for worming around cases like this, and the import lock remains essential to prevent worse problems. "Never write a module that spawns threads as a side effect of merely being imported" remains the only reliable workaround (e.g., spawn the threads from a module function called after the module import completes). BTW, 2.2 will contain (& CVS Python already does) a new imp.lock_held() function, so you can determine whether the import lock is currently held. ---------------------------------------------------------------------- Comment By: Fredrik Lundh (effbot) Date: 2001-09-18 11:52 Message: Logged In: YES user_id=38376 Reduced priority (to match "hopeless" status) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-23 21:20 Message: Logged In: YES user_id=31435 Assigned to Fredrik, but as I said on c.l.py, never write a module that spawns threads as a side effect of merely being imported. Everything you're chasing is an accident, and while /F may or may not bother worming around this one, you're going to get in trouble over and over again. I've reduced the priority accordingly. /F, the immediate cause for this one is the import sre_parse in the body of sre_compile.compile(), which is reached in the spawned thread via calling re.sub(). Since the module "ret" is itself imported, the main thread doing the import of "ret" holds the import lock for the duration. This causes the spawned thread (created by merely importing "ret", and there's no proper synchronization in the test case either, so accidents compound) to block on any import attempt. In particular, the spawned thread blocks on the line shown above. Worm around that, and it blocks somewhere else later; etc. In *general* it's hopeless. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454843&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:05:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:05:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-462461 ] Some install scripts ignore ENV VARS Message-ID: Bugs item #462461, was opened at 2001-09-17 21:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 Category: Installation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Some install scripts ignore ENV VARS Initial Comment: I am trying to make a python 2.1.1 RPM for my linux distro. I am running into a problem during the python install. It seems that pydoc is trying to get installed into my systems /usr/bin (good thing I build rpms as a unprivledged user). From what I can tell, whatever installs pydoc seems to ignore $BINDIR and $prefix as I set them in my "make install" command. copying build/lib.linux-i686-2.1/zlib.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload copying build/lib.linux-i686-2.1/linuxaudiodev.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload running install_scripts copying build/scripts/pydoc -> /usr/bin error: /usr/bin/pydoc: Permission denied make: *** [sharedinstall] Error 1 error: Bad exit status from /home/miah/rpm_build/tmp/rpm-tmp.23763 (%install) My install command is make prefix=$RPM_BUILD_ROOT/usr \ BINDIR=$RPM_BUILD_ROOT/usr/bin \ install ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-18 13:05 Message: Logged In: YES user_id=21627 It appears that passing --prefix to setup.py might solve this problem. Would you like to verify this theory, and produce a patch if it solves your problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:06:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:06:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-461754 ] CDATA should not undergo entity subst. Message-ID: Bugs item #461754, was opened at 2001-09-14 20:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 Category: XML Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) >Assigned to: Martin v. Löwis (loewis) Summary: CDATA should not undergo entity subst. Initial Comment: CDATASection data should not undergo entity substitution when output. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:07:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:07:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-461753 ] Opaque context not handled when NULL Message-ID: Bugs item #461753, was opened at 2001-09-14 20:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 Category: XML Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) >Assigned to: Martin v. Löwis (loewis) Summary: Opaque context not handled when NULL Initial Comment: The opaque context string pointer passed to ExternalEntityRefHandler may be NULL in which case None is supplied as an argument. However, ExternalEntityParserCreate demands a non-NULL string and so may fail. Argument passing in Modules/pyexpat.c:ExternalEntityParserCreate should probably use a z rather than an s in ParseTuple. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:12:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:12:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-459334 ] urllib2 __getitem__ problem Message-ID: Bugs item #459334, was opened at 2001-09-06 15:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 Category: Extension Modules Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: urllib2 __getitem__ problem Initial Comment: urllib2's file-like object has a bug in its __getitem__ method. Try getting item 5 or item [], both valid queries as far as dict-like objects go, however it naively tries to execute .lower() on the supplied name. If the item does not exist in self.dict then it would seem that a KeyError should be raised - not AttributeError. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-18 13:12 Message: Logged In: YES user_id=21627 rfc822.Message has an __getitem__ method that matches the reported problem. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 18:46 Message: Logged In: YES user_id=6380 Ehh??? I don't see a file-like object in urllib2, and I don't see a __getitem__ method anywhere in the file, and I don't see a call to .lower() that could be suspect. Which file are you really talking about? Or can you show a sample session or program exhibiting the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:19:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:19:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-459334 ] urllib2 __getitem__ problem Message-ID: Bugs item #459334, was opened at 2001-09-06 15:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 Category: Extension Modules Group: Python 2.1.1 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: urllib2 __getitem__ problem Initial Comment: urllib2's file-like object has a bug in its __getitem__ method. Try getting item 5 or item [], both valid queries as far as dict-like objects go, however it naively tries to execute .lower() on the supplied name. If the item does not exist in self.dict then it would seem that a KeyError should be raised - not AttributeError. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 13:19 Message: Logged In: YES user_id=6380 In that case I won't fix it. You are only supposed to index that dict-like object with strings, and if you pass it anything else you deserve a TypeError, but an AttributeError will do just fine. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-18 13:12 Message: Logged In: YES user_id=21627 rfc822.Message has an __getitem__ method that matches the reported problem. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 18:46 Message: Logged In: YES user_id=6380 Ehh??? I don't see a file-like object in urllib2, and I don't see a __getitem__ method anywhere in the file, and I don't see a call to .lower() that could be suspect. Which file are you really talking about? Or can you show a sample session or program exhibiting the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459334&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:26:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:26:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-462658 ] PyLong_{As,From}VoidPtr not documented Message-ID: Bugs item #462658, was opened at 2001-09-18 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462658&group_id=5470 Category: Documentation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: PyLong_{As,From}VoidPtr not documented Initial Comment: I stumbled upon PyLong_FromVoidPtr and PyLong_AsVoidPtr a week or so ago. I just noticed that they don't seem to be documented in any of the TeX sources. If they are not deprecated, they should probably be in the API ref. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462658&group_id=5470 From noreply@sourceforge.net Tue Sep 18 21:47:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 13:47:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-449964 ] sre.sub() fails Message-ID: Bugs item #449964, was opened at 2001-08-10 17:06 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449964&group_id=5470 Category: Regular Expressions Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Atsuo Ishimoto (atsuoi) Assigned to: Fredrik Lundh (effbot) Summary: sre.sub() fails Initial Comment: sre.sub() raises exception if template contains "\g" . Traceback (most recent call last): File "", line 1, in ? File "c:\tools\python21\lib\sre.py", line 71, in subn return _compile(pattern, 0).subn(repl, string, count) File "c:\tools\python21\lib\sre.py", line 171, in _subn template = _compile_repl(template, pattern) File "c:\tools\python21\lib\sre.py", line 149, in _compile_repl p = sre_parse.parse_template(repl, pattern) File "c:\tools\python21\lib\sre_parse.py", line 701, in parse_template this = char(ESCAPES[this][1]) TypeError: object is not callable: '>' --------------------------------------------------- This patch fix problem. $ diff -u sre_parse.py.orig sre_parse.py --- sre_parse.py.orig Sat Aug 11 08:44:11 2001 +++ sre_parse.py Sat Aug 11 08:51:43 2001 @@ -658,12 +658,12 @@ name = "" if s.match("<"): while 1: - char = s.get() - if char is None: + c = s.get() + if c is None: raise error, "unterminated group name" - if char == ">": + if c == ">": break - name = name + char + name = name + c if not name: raise error, "bad group name" try: ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449964&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:14:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:14:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-433031 ] SRE: x++ isn't supported Message-ID: Bugs item #433031, was opened at 2001-06-14 01:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433031&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: x++ isn't supported Initial Comment: from jeffrey friedl: [perl has] added some interesting things that you might want to consider. In particular, posessive quantifiers X++ (which acts exactly like (?>X+), but is much easier to grok). Very nice. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433031&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:15:23 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:15:23 -0700 Subject: [Python-bugs-list] [ python-Bugs-433027 ] SRE: (?-flag) is not supported. Message-ID: Bugs item #433027, was opened at 2001-06-14 01:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433027&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: (?-flag) is not supported. Initial Comment: from the jeffrey friedl report: (?-i) is not supported. It'd be nice to have ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433027&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:15:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:15:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-433029 ] SRE: posix classes aren't supported Message-ID: Bugs item #433029, was opened at 2001-06-14 01:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433029&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: posix classes aren't supported Initial Comment: from the jeffrey friedl report: Posix class stuff aren't supported. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433029&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:16:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:16:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-433030 ] SRE: (?>...) is not supported Message-ID: Bugs item #433030, was opened at 2001-06-14 01:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433030&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: (?>...) is not supported Initial Comment: from the jeffrey friedl report: (?>...) is not supported [this is a "stand-alone pattern". the engine has code for this, but the parser doesn't recognize this yet. shouldn't be too hard to fix; I just need a couple of good test cases before I start /F] ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433030&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:16:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:16:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-433024 ] SRE: (?flag) isn't properly scoped Message-ID: Bugs item #433024, was opened at 2001-06-14 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433024&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: (?flag) isn't properly scoped Initial Comment: from the jeffrey friedl report: The way (?i) works now is that if it appears anywhere in the regex, it turns on case-insensative matching for the entire regex. This is different (and less useful) than how Perl or Sun's Java package does it [I'm pretty sure SRE does it this way to exactly match the version of PCRE used in 1.5.2, but maybe it's time to move forward... /F] ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433024&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:16:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:16:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-433028 ] SRE: (?flag:...) is not supported Message-ID: Bugs item #433028, was opened at 2001-06-14 01:28 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433028&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: SRE: (?flag:...) is not supported Initial Comment: from the jeffrey friedl report: (?flag:...) and (?-flag:...) are not supported. They'd be nice. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=433028&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:17:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:17:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-420011 ] \u escapes don't work inside ranges Message-ID: Bugs item #420011, was opened at 2001-04-29 14:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420011&group_id=5470 Category: Regular Expressions Group: Feature Request Status: Open Resolution: None >Priority: 3 Submitted By: Fredrik Lundh (effbot) Assigned to: Fredrik Lundh (effbot) Summary: \u escapes don't work inside ranges Initial Comment: the pattern "[\u0000-\uffff]" should match any unicode character. for some reason, it doesn't seem to do that... ---------------------------------------------------------------------- Comment By: Fredrik Lundh (effbot) Date: 2001-04-29 14:18 Message: Logged In: YES user_id=38376 I meant r"[\u0000-\uffff]" and on second thought, I'm not sure it's a bug: SRE doesn't seem to support \u and \U escapes at all. and the pattern u"[\u0000-\uffff]" works as expected. I'll change this to a feature request. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420011&group_id=5470 From noreply@sourceforge.net Tue Sep 18 22:27:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 14:27:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-462461 ] Some install scripts ignore ENV VARS Message-ID: Bugs item #462461, was opened at 2001-09-17 21:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 Category: Installation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Some install scripts ignore ENV VARS Initial Comment: I am trying to make a python 2.1.1 RPM for my linux distro. I am running into a problem during the python install. It seems that pydoc is trying to get installed into my systems /usr/bin (good thing I build rpms as a unprivledged user). From what I can tell, whatever installs pydoc seems to ignore $BINDIR and $prefix as I set them in my "make install" command. copying build/lib.linux-i686-2.1/zlib.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload copying build/lib.linux-i686-2.1/linuxaudiodev.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload running install_scripts copying build/scripts/pydoc -> /usr/bin error: /usr/bin/pydoc: Permission denied make: *** [sharedinstall] Error 1 error: Bad exit status from /home/miah/rpm_build/tmp/rpm-tmp.23763 (%install) My install command is make prefix=$RPM_BUILD_ROOT/usr \ BINDIR=$RPM_BUILD_ROOT/usr/bin \ install ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-18 14:27 Message: Logged In: NO The reason I cannot use --prefix with configure is that programs will get that path embedded into them as they are compiled and expect for libs/modules/whatever to be in that path. The way I get all RPMS to build proper (redhat, and everybody else pretty much does this) is to build it with normal parameters (ie, configure --prefix=/usr --whatever) and then when you do your make install you simply pass a different path to the Makefile. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-18 13:05 Message: Logged In: YES user_id=21627 It appears that passing --prefix to setup.py might solve this problem. Would you like to verify this theory, and produce a patch if it solves your problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 From noreply@sourceforge.net Tue Sep 18 23:52:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 15:52:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-462461 ] Some install scripts ignore ENV VARS Message-ID: Bugs item #462461, was opened at 2001-09-17 21:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 Category: Installation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Some install scripts ignore ENV VARS Initial Comment: I am trying to make a python 2.1.1 RPM for my linux distro. I am running into a problem during the python install. It seems that pydoc is trying to get installed into my systems /usr/bin (good thing I build rpms as a unprivledged user). From what I can tell, whatever installs pydoc seems to ignore $BINDIR and $prefix as I set them in my "make install" command. copying build/lib.linux-i686-2.1/zlib.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload copying build/lib.linux-i686-2.1/linuxaudiodev.so -> /home/miah/rpm_build/tmp/python- root/usr/lib/python2.1/lib-dynload running install_scripts copying build/scripts/pydoc -> /usr/bin error: /usr/bin/pydoc: Permission denied make: *** [sharedinstall] Error 1 error: Bad exit status from /home/miah/rpm_build/tmp/rpm-tmp.23763 (%install) My install command is make prefix=$RPM_BUILD_ROOT/usr \ BINDIR=$RPM_BUILD_ROOT/usr/bin \ install ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-18 15:52 Message: Logged In: YES user_id=6380 That's a reasonable request. Since you know your needs, we might make more progress if you figured out a patch (I imagine changes to setup.py or to the Makefile are needed) and uploaded it, so we know exactly what you'd like to see changed. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-18 14:27 Message: Logged In: NO The reason I cannot use --prefix with configure is that programs will get that path embedded into them as they are compiled and expect for libs/modules/whatever to be in that path. The way I get all RPMS to build proper (redhat, and everybody else pretty much does this) is to build it with normal parameters (ie, configure --prefix=/usr --whatever) and then when you do your make install you simply pass a different path to the Makefile. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-18 13:05 Message: Logged In: YES user_id=21627 It appears that passing --prefix to setup.py might solve this problem. Would you like to verify this theory, and produce a patch if it solves your problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462461&group_id=5470 From noreply@sourceforge.net Wed Sep 19 00:56:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 16:56:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-462710 ] Python 2.2a3/XML leaks memory Message-ID: Bugs item #462710, was opened at 2001-09-18 16:56 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 Category: XML Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Jeffrey Chang (jchang) Assigned to: Nobody/Anonymous (nobody) Summary: Python 2.2a3/XML leaks memory Initial Comment: I'm running Python 2.2a3 on solaris 2.6 with expat 1.2. The following bit of code leaks a ton of memory. Within 5 seconds, it's used up 50Mb of memory. -------- from xml import sax from xml.sax import handler print sax.make_parser().__doc__ while 1: parser = sax.make_parser() parser.setContentHandler(handler.ContentHandler()) parser.feed("hello!") -------- Python 2.1 in the same environment seems to leak little or no memory. I tried compiling Python 2.2a3 with an older version of pyexpat, 1.45 (the one that comes with Python 2.1) and using Python 2.1's xml package, but it still leaks. The problem may be somewhere outside the XML package. I looked through the release notes for 2.2, but could find nothing obvious. This seems to be different from bug #416288 "infrequent memory leak in pyexpat", in that it leaks memory quite severely and not on an exceptional error condition. Thanks, Jeff ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 From noreply@sourceforge.net Wed Sep 19 03:52:09 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 19:52:09 -0700 Subject: [Python-bugs-list] [ python-Bugs-462737 ] unicodeobject.h uses quoted includes Message-ID: Bugs item #462737, was opened at 2001-09-18 19:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462737&group_id=5470 Category: Unicode Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: M.-A. Lemburg (lemburg) Summary: unicodeobject.h uses quoted includes Initial Comment: There are 3 #include statements in include/unicodeobject.h which use quoted includes instead of angled includes #include "ctype.h" #include "wchar.h" #include "wctype.h" The one other #include in the file of time.h is angled - it is just these three that are not. [Python 2.1 ActiveState distribution, on both RH Linux 7.1., and Windows 2000] ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462737&group_id=5470 From noreply@sourceforge.net Wed Sep 19 04:30:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 20:30:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-454086 ] distutils/mingw32 links to dbg libs Message-ID: Bugs item #454086, was opened at 2001-08-21 21:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 7 Submitted By: Gerhard Häring (ghaering) Assigned to: A.M. Kuchling (akuchling) Summary: distutils/mingw32 links to dbg libs Initial Comment: When compiling extension modules on Windows with debugging enabled for the native mode of the GNU compilers ("--compiler=mingw32 --debug"), distutils tries to link with the debugging version of the libraries (python21_d.dll, ...). This may be useful for Microsoft Visual C++, but for the GNU compilers, it isn't. GNU tools have a different debugging symbol format than MS tools, so there's no point in doing this. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2001-09-18 20:30 Message: Logged In: YES user_id=163326 OK, see patch #462754. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-09-04 12:56 Message: Logged In: YES user_id=11375 Hmm... I can't see any code in cygwinccompiler.py that adds the _d prefix in the current CVS. Can you please track down the code that adds it, and submit a patch to fix the problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=454086&group_id=5470 From noreply@sourceforge.net Wed Sep 19 04:36:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Sep 2001 20:36:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-443042 ] 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Message-ID: Bugs item #443042, was opened at 2001-07-20 04:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 Category: Extension Modules Group: Python 2.2 >Status: Open Resolution: Fixed Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: Thomas Wouters (twouters) Summary: 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Initial Comment: gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 160.490u 10.370s 3:09.17 90.3% 0+0k 0+0io 70442pf+0w yetix@/usr/home/ajung/new/Python-2.2a1(318)% make gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 Env: gcc 2.95.3, Linux 2.4.5 i386 ---------------------------------------------------------------------- >Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-18 20:36 Message: Logged In: YES user_id=12800 I'm reopening this since I'm now seeing it with a fresh cvs checkout of Python 2.2a3+. Thomas, feel free to assign it to me. ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:26 Message: Logged In: YES user_id=34209 Closing. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-05 11:45 Message: Logged In: YES user_id=11084 Works now in 2.2a2. Andreas ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:22 Message: Logged In: YES user_id=6380 Andreas, is this still a problem in 2.2a2? ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 16:38 Message: Logged In: YES user_id=11084 Compilation works fine after removing HAVE_BROKEN_NICE from config.h - seems to be broken :-) Andreas ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 10:08 Message: Logged In: YES user_id=11084 My system uses glibc 2.1.2. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-07-20 07:33 Message: Logged In: YES user_id=11375 The version of glibc is probably also relevant. Reassigning to Thomas Wouters, as this looks related to the recent nice/getpriority changes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 From noreply@sourceforge.net Wed Sep 19 08:31:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 00:31:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-462783 ] mmap bus error on linux Message-ID: Bugs item #462783, was opened at 2001-09-19 00:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462783&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Nobody/Anonymous (nobody) Summary: mmap bus error on linux Initial Comment: Not using the mmap module correctly can cause a bus error under Linux. This is a DEC, err, Compaq, err, HP Alpha. Here's a reproducible. The problem appears to be trying to mmap past the end of the file, since putting in a "seek(0)" at the indicated spot fixes things. [dalke@pw600a src]$ ./python Python 2.2a3+ (#6, Sep 17 2001, 05:05:24) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> file = open("test.dat", "w+") >>> file.write("12345") >>> import mmap >>> # Forgot to do "file.seek(0)" here >>> s = mmap.mmap(file.fileno(), 5) >>> s[:5] Bus error [dalke@pw600a src]$ gdb ./python core GNU gdb 19991004 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-redhat-linux"... warning: "/home/dalke/cvses/python/dist/src/core": ambiguous core format, 2 handle rs match warning: core file may not match specified executable file. Core was generated by `perl'. Program terminated with signal 8, Floating point exception. #0 0x12004d7b8 in com_assert_stmt (c=0x0, n=0x0) at Python/compile.c:717 717 PyString_AsString(c->c_code)[c- >c_nexti++] = byte; (gdb) where #0 0x12004d7b8 in com_assert_stmt (c=0x0, n=0x0) at Python/compile.c:717 (gdb) Andrew dalke@dalkescientific.com ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462783&group_id=5470 From noreply@sourceforge.net Wed Sep 19 10:09:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 02:09:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-461754 ] CDATA should not undergo entity subst. Message-ID: Bugs item #461754, was opened at 2001-09-14 20:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 Category: XML Group: Python 2.1.1 >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) Assigned to: Martin v. Löwis (loewis) Summary: CDATA should not undergo entity subst. Initial Comment: CDATASection data should not undergo entity substitution when output. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 02:09 Message: Logged In: YES user_id=21627 Thanks for the patch. I've applied it as minidom.py 1.35 (1.27 in PyXML). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461754&group_id=5470 From noreply@sourceforge.net Wed Sep 19 10:57:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 02:57:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-461753 ] Opaque context not handled when NULL Message-ID: Bugs item #461753, was opened at 2001-09-14 20:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 Category: XML Group: Python 2.1.1 >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: James Matthew Farrow (jmfarrow) Assigned to: Martin v. Löwis (loewis) Summary: Opaque context not handled when NULL Initial Comment: The opaque context string pointer passed to ExternalEntityRefHandler may be NULL in which case None is supplied as an argument. However, ExternalEntityParserCreate demands a non-NULL string and so may fail. Argument passing in Modules/pyexpat.c:ExternalEntityParserCreate should probably use a z rather than an s in ParseTuple. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 02:57 Message: Logged In: YES user_id=21627 Thanks for the patch. I've applied it as pyexpat.c 2.49 (1.39 in PyXML). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461753&group_id=5470 From noreply@sourceforge.net Wed Sep 19 12:22:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 04:22:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-462737 ] unicodeobject.h uses quoted includes Message-ID: Bugs item #462737, was opened at 2001-09-18 19:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462737&group_id=5470 Category: Unicode Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: M.-A. Lemburg (lemburg) Summary: unicodeobject.h uses quoted includes Initial Comment: There are 3 #include statements in include/unicodeobject.h which use quoted includes instead of angled includes #include "ctype.h" #include "wchar.h" #include "wctype.h" The one other #include in the file of time.h is angled - it is just these three that are not. [Python 2.1 ActiveState distribution, on both RH Linux 7.1., and Windows 2000] ---------------------------------------------------------------------- >Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-19 04:22 Message: Logged In: YES user_id=38388 Fixed in CVS... unicodeobject.h rev. 2.34 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462737&group_id=5470 From noreply@sourceforge.net Wed Sep 19 13:16:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 05:16:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Wed Sep 19 14:25:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 06:25:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Wed Sep 19 14:40:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 06:40:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 06:40 Message: Logged In: YES user_id=21627 That doesn't help. The value of n, in int n = ((PyVarObject *)obj)->ob_size; is zero, so the code doing the alignment is skipped. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Wed Sep 19 18:23:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 10:23:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-210637 ] ihooks on windows and pythoncom (PR#294) Message-ID: Bugs item #210637, was opened at 2000-07-31 14:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=210637&group_id=5470 Category: Windows Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: ihooks on windows and pythoncom (PR#294) Initial Comment: Jitterbug-Id: 294 Submitted-By: mak@mikroplan.com.pl Date: Thu, 13 Apr 2000 04:09:35 -0400 (EDT) Version: cvs OS: windows Hi, Python module ihooks is not so compatible with builtin imp while importing modules whose name is stored in registry eg. pythoncom/pywintypes. import ihooks ihooks.install() import pythoncom This code will fail inside pythonwin ide too ! ==================================================================== Audit trail: Tue Jul 11 08:29:17 2000 guido moved from incoming to open ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-19 10:23 Message: Logged In: NO ruoy retupmoc si daed ---------------------------------------------------------------------- Comment By: Grzegorz Makarewicz (mpmak) Date: 2001-03-02 04:27 Message: Logged In: YES user_id=141704 BasicModuleLoader.find_module_in_dir is searching for main modules only in frozen and builtin. The imp searches the registry, too. ModuleLoader.find_module_in_dir should call the functions from the inherited object. so this patch should help: --- V:\py21\Lib\ihooks.py Mon Feb 12 08:55:46 2001 +++ ihooks.py Sun Feb 18 04:39:39 2001 @@ -122,8 +122,13 @@ def find_module_in_dir(self, name, dir): if dir is None: - return self.find_builtin_module(name) - else: + result = self.find_builtin_module(name) + if result is not None: + return result + try: + return imp.find_module(name, None) + except: + return None try: return imp.find_module(name, [dir]) except ImportError: @@ -237,7 +242,7 @@ def find_module_in_dir(self, name, dir, allow_packages=1): if dir is None: - return self.find_builtin_module(name) + return BasicModuleLoader.find_module_in_dir (self,name,dir) if allow_packages: fullname = self.hooks.path_join(dir, name) if self.hooks.path_isdir(fullname): ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2000-08-30 23:23 Message: Leaving open, but moving down the priority and resolution lists. A patch would help bump it back up :-) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2000-08-13 23:42 Message: This needs a resolution. The "registered module" code in the code also needs to support HKEY_CURRENT_USER along with the HKEY_LOCAL_MACHINE it does now. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=210637&group_id=5470 From noreply@sourceforge.net Wed Sep 19 18:35:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 10:35:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 10:35 Message: Logged In: YES user_id=6380 Ouch, you're right. I'll remove all the silly tests to avoid a tiny bit of work under unusual circumstances. Right now I'm not at a place where I can prepare a patch for upload, sorry. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 06:40 Message: Logged In: YES user_id=21627 That doesn't help. The value of n, in int n = ((PyVarObject *)obj)->ob_size; is zero, so the code doing the alignment is skipped. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Wed Sep 19 18:46:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 10:46:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Amit Patel (amitp) Assigned to: Nobody/Anonymous (nobody) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Wed Sep 19 18:50:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 10:50:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Amit Patel (amitp) Assigned to: Nobody/Anonymous (nobody) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- >Comment By: Amit Patel (amitp) Date: 2001-09-19 10:50 Message: Logged In: YES user_id=327765 Bah, it destroyed my formatting. I'll upload a separate file. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Wed Sep 19 21:18:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 13:18:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Amit Patel (amitp) Assigned to: Nobody/Anonymous (nobody) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- >Comment By: Amit Patel (amitp) Date: 2001-09-19 13:18 Message: Logged In: YES user_id=327765 I'm attaching a variant of the program which runs and then causes "SystemError: unknown opcode". ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 10:50 Message: Logged In: YES user_id=327765 Bah, it destroyed my formatting. I'll upload a separate file. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Wed Sep 19 22:10:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 14:10:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-462710 ] Python 2.2a3/XML leaks memory Message-ID: Bugs item #462710, was opened at 2001-09-18 16:56 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 Category: XML Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Jeffrey Chang (jchang) >Assigned to: Martin v. Löwis (loewis) Summary: Python 2.2a3/XML leaks memory Initial Comment: I'm running Python 2.2a3 on solaris 2.6 with expat 1.2. The following bit of code leaks a ton of memory. Within 5 seconds, it's used up 50Mb of memory. -------- from xml import sax from xml.sax import handler print sax.make_parser().__doc__ while 1: parser = sax.make_parser() parser.setContentHandler(handler.ContentHandler()) parser.feed("hello!") -------- Python 2.1 in the same environment seems to leak little or no memory. I tried compiling Python 2.2a3 with an older version of pyexpat, 1.45 (the one that comes with Python 2.1) and using Python 2.1's xml package, but it still leaks. The problem may be somewhere outside the XML package. I looked through the release notes for 2.2, but could find nothing obvious. This seems to be different from bug #416288 "infrequent memory leak in pyexpat", in that it leaks memory quite severely and not on an exceptional error condition. Thanks, Jeff ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 From noreply@sourceforge.net Thu Sep 20 03:42:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 19:42:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Amit Patel (amitp) Assigned to: Nobody/Anonymous (nobody) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-19 19:42 Message: Logged In: YES user_id=163326 FYI: Python 1.5.2 and 2.0.1 say: gerhard@lilith:/tmp > /opt/python20/bin/python python-continue-bug-2.py SyntaxError: 'continue' not supported inside 'try' clause (python-continue-bug-2.py, line 10) This problem seems to have started with the 2.1 branch. ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 13:18 Message: Logged In: YES user_id=327765 I'm attaching a variant of the program which runs and then causes "SystemError: unknown opcode". ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 10:50 Message: Logged In: YES user_id=327765 Bah, it destroyed my formatting. I'll upload a separate file. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Thu Sep 20 04:33:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 20:33:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 20:33 Message: Logged In: YES user_id=6380 Try this. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 10:35 Message: Logged In: YES user_id=6380 Ouch, you're right. I'll remove all the silly tests to avoid a tiny bit of work under unusual circumstances. Right now I'm not at a place where I can prepare a patch for upload, sorry. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 06:40 Message: Logged In: YES user_id=21627 That doesn't help. The value of n, in int n = ((PyVarObject *)obj)->ob_size; is zero, so the code doing the alignment is skipped. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Thu Sep 20 05:50:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 21:50:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core >Group: None Status: Open Resolution: None Priority: 5 Submitted By: Amit Patel (amitp) >Assigned to: Thomas Wouters (twouters) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 21:50 Message: Logged In: YES user_id=6380 I can reproduce this in 2.2 too. Thomas, can you look at this? I believe you wrote the continue-in-try code... ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-19 19:42 Message: Logged In: YES user_id=163326 FYI: Python 1.5.2 and 2.0.1 say: gerhard@lilith:/tmp > /opt/python20/bin/python python-continue-bug-2.py SyntaxError: 'continue' not supported inside 'try' clause (python-continue-bug-2.py, line 10) This problem seems to have started with the 2.1 branch. ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 13:18 Message: Logged In: YES user_id=327765 I'm attaching a variant of the program which runs and then causes "SystemError: unknown opcode". ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 10:50 Message: Logged In: YES user_id=327765 Bah, it destroyed my formatting. I'll upload a separate file. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Thu Sep 20 06:25:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 22:25:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-463093 ] File methods need doc strings Message-ID: Bugs item #463093, was opened at 2001-09-19 22:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Nobody/Anonymous (nobody) Summary: File methods need doc strings Initial Comment: None of the file methods have docstrings. It's a disgrace! Any volunteers? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 From noreply@sourceforge.net Thu Sep 20 06:27:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 22:27:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-443042 ] 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Message-ID: Bugs item #443042, was opened at 2001-07-20 04:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 Category: Extension Modules Group: Python 2.2 >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: Thomas Wouters (twouters) Summary: 2.2a1: unable to build posixmodule (PRIO_PROCESS undeclard Initial Comment: gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 160.490u 10.370s 3:09.17 90.3% 0+0k 0+0io 70442pf+0w yetix@/usr/home/ajung/new/Python-2.2a1(318)% make gcc -g -O3 -Wall -Wstrict-prototypes -Dss_family=__ss_family -Dss_len=__ss_len -I. -I./Include -DHAVE_CONFIG_H -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function `posix_nice': ./Modules/posixmodule.c:1145: warning: implicit declaration of function `getpriority' ./Modules/posixmodule.c:1145: `PRIO_PROCESS' undeclared (first use in this function) ./Modules/posixmodule.c:1145: (Each undeclared identifier is reported only once ./Modules/posixmodule.c:1145: for each function it appears in.) make: *** [Modules/posixmodule.o] Fehler 1 Env: gcc 2.95.3, Linux 2.4.5 i386 ---------------------------------------------------------------------- >Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-19 22:27 Message: Logged In: YES user_id=12800 I'm reclosing this ;/ Pilot error. I must have screwed up building a new kernel and that wasted some of my header files, which screwed up Python's autoconf detection. Sigh sigh sigh. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-18 20:36 Message: Logged In: YES user_id=12800 I'm reopening this since I'm now seeing it with a fresh cvs checkout of Python 2.2a3+. Thomas, feel free to assign it to me. ---------------------------------------------------------------------- Comment By: Thomas Wouters (twouters) Date: 2001-09-06 05:26 Message: Logged In: YES user_id=34209 Closing. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-05 11:45 Message: Logged In: YES user_id=11084 Works now in 2.2a2. Andreas ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:22 Message: Logged In: YES user_id=6380 Andreas, is this still a problem in 2.2a2? ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 16:38 Message: Logged In: YES user_id=11084 Compilation works fine after removing HAVE_BROKEN_NICE from config.h - seems to be broken :-) Andreas ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-07-20 10:08 Message: Logged In: YES user_id=11084 My system uses glibc 2.1.2. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2001-07-20 07:33 Message: Logged In: YES user_id=11375 The version of glibc is probably also relevant. Reassigning to Thomas Wouters, as this looks related to the recent nice/getpriority changes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443042&group_id=5470 From noreply@sourceforge.net Thu Sep 20 07:54:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 23:54:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-461001 ] inspect & pydoc vs new-style classes Message-ID: Bugs item #461001, was opened at 2001-09-12 13:15 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461001&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: inspect & pydoc vs new-style classes Initial Comment: I've heard that inspect & pydoc don't work well with new-style classe. This needs attention if so. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-19 23:54 Message: Logged In: YES user_id=31435 Closed. A sequence of patches taught inspect.py how to recognize 2.2's method descriptors, and pydoc.py what to do with them. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=461001&group_id=5470 From noreply@sourceforge.net Thu Sep 20 07:55:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Sep 2001 23:55:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-463093 ] File methods need doc strings Message-ID: Bugs item #463093, was opened at 2001-09-19 22:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Tim Peters (tim_one) Summary: File methods need doc strings Initial Comment: None of the file methods have docstrings. It's a disgrace! Any volunteers? ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-19 23:55 Message: Logged In: YES user_id=31435 Assigned to me and in progress. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 From noreply@sourceforge.net Thu Sep 20 08:37:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 00:37:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-20 00:37 Message: Logged In: YES user_id=21627 Works fine, thanks. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 20:33 Message: Logged In: YES user_id=6380 Try this. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 10:35 Message: Logged In: YES user_id=6380 Ouch, you're right. I'll remove all the silly tests to avoid a tiny bit of work under unusual circumstances. Right now I'm not at a place where I can prepare a patch for upload, sorry. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 06:40 Message: Logged In: YES user_id=21627 That doesn't help. The value of n, in int n = ((PyVarObject *)obj)->ob_size; is zero, so the code doing the alignment is skipped. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Thu Sep 20 08:55:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 00:55:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-463093 ] File methods need doc strings Message-ID: Bugs item #463093, was opened at 2001-09-19 22:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Tim Peters (tim_one) Summary: File methods need doc strings Initial Comment: None of the file methods have docstrings. It's a disgrace! Any volunteers? ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-20 00:55 Message: Logged In: YES user_id=31435 Redeemed from disgrace, in Objects/fileobject.c, new revision: 2.128 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-19 23:55 Message: Logged In: YES user_id=31435 Assigned to me and in progress. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463093&group_id=5470 From noreply@sourceforge.net Thu Sep 20 13:58:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 05:58:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-463177 ] ftplib broken passive mode Message-ID: Bugs item #463177, was opened at 2001-09-20 05:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463177&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib broken passive mode Initial Comment: (This only applies when using passive FTP) ftplib.py assumes that the 227 response will contain an address and port specification in the form of (h1,h2,h3,h4,p1,p2) -- note the parentheses. In fact, RFC 959 does not explicitly specify the parentheses, and gives an example conversation that includes a 227 response with no parentheses. ftplib.py throws an exception when talking to an FTP server that does not format the 227 response with parentheses (not uncommon, apparently). The parse227 function should be updated to do something such as the following: _parse227_re = re.compile('\d+,\d+,\d+,\d+,\d+,\d+') def parse227(resp): '''Parse the '227' response for a PASV request. Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '227': raise error_reply, resp m = _parse227_re.search(resp) if m is None: raise error_proto, resp numbers = string.split(m.group(), ',') if len(numbers) <> 6: raise error_proto, resp host = string.join(numbers[:4], '.') port = (string.atoi(numbers[4]) << 8) + string.atoi(numbers[5]) return host, port ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463177&group_id=5470 From noreply@sourceforge.net Thu Sep 20 14:38:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 06:38:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access Message-ID: Bugs item #462848, was opened at 2001-09-19 05:16 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 Category: Type/class unification Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: test_descr causes unaligned access Initial Comment: On SPARC Solaris 2.8, test_descr causes a crash with an unaligned access. The specific line of the crash is in subtype_dealloc PyObject *dict = *dictptr; Here, the type is "L", tp_basicsize is 18, and tp_dictoffset is -4. In turn, tries to fetch a pointer at offset 14 relative to self, which is an unaligned access. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-20 06:38 Message: Logged In: YES user_id=6380 Fixed in object.c:2.151. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-20 00:37 Message: Logged In: YES user_id=21627 Works fine, thanks. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 20:33 Message: Logged In: YES user_id=6380 Try this. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 10:35 Message: Logged In: YES user_id=6380 Ouch, you're right. I'll remove all the silly tests to avoid a tiny bit of work under unusual circumstances. Right now I'm not at a place where I can prepare a patch for upload, sorry. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-19 06:40 Message: Logged In: YES user_id=21627 That doesn't help. The value of n, in int n = ((PyVarObject *)obj)->ob_size; is zero, so the code doing the alignment is skipped. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 06:25 Message: Logged In: YES user_id=6380 Ouch. There was code to align the dictptr but it didn't count on the basicsize being unaligned. Try this patch. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470 From noreply@sourceforge.net Thu Sep 20 14:57:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 06:57:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-463177 ] ftplib broken passive mode Message-ID: Bugs item #463177, was opened at 2001-09-20 05:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463177&group_id=5470 Category: Python Library Group: Python 2.1.1 >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: ftplib broken passive mode Initial Comment: (This only applies when using passive FTP) ftplib.py assumes that the 227 response will contain an address and port specification in the form of (h1,h2,h3,h4,p1,p2) -- note the parentheses. In fact, RFC 959 does not explicitly specify the parentheses, and gives an example conversation that includes a 227 response with no parentheses. ftplib.py throws an exception when talking to an FTP server that does not format the 227 response with parentheses (not uncommon, apparently). The parse227 function should be updated to do something such as the following: _parse227_re = re.compile('\d+,\d+,\d+,\d+,\d+,\d+') def parse227(resp): '''Parse the '227' response for a PASV request. Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '227': raise error_reply, resp m = _parse227_re.search(resp) if m is None: raise error_proto, resp numbers = string.split(m.group(), ',') if len(numbers) <> 6: raise error_proto, resp host = string.join(numbers[:4], '.') port = (string.atoi(numbers[4]) << 8) + string.atoi(numbers[5]) return host, port ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-20 06:57 Message: Logged In: YES user_id=6380 Duplicate of #441712. Already fixed in CVS for 2.2. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463177&group_id=5470 From noreply@sourceforge.net Thu Sep 20 19:02:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 11:02:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-463286 ] Problem in urllib. No strip attribute Message-ID: Bugs item #463286, was opened at 2001-09-20 11:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463286&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Francesc Alted (falted) Assigned to: Nobody/Anonymous (nobody) Summary: Problem in urllib. No strip attribute Initial Comment: If one make use of the urllib.urlopen method to open an object which is not an URL (for exemple a filehandler), in place of throwing a IOError exception, the next error appears: File "/usr/local/lib/python2.1/urllib.py", line 904, in unwrap url = url.strip() AttributeError: strip I'm using Python 2.1.1. It seems like Guido wanted to strip out the use of string methods in urllib, but the unwrap method was not tested enough. I'm attaching a small source file which expose the flaw easily. Cheers, Francesc Alted ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463286&group_id=5470 From noreply@sourceforge.net Thu Sep 20 19:41:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 11:41:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-220993 ] Installation flaky with multiple installers, old versions Message-ID: Bugs item #220993, was opened at 2000-11-01 05:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=220993&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None >Priority: 7 Submitted By: Greg Ward (gward) Assigned to: A.M. Kuchling (akuchling) Summary: Installation flaky with multiple installers, old versions Initial Comment: Installation tends to have problems when there are old installations present, especially when a different user is doing the new installation. In particular, it appears that the chmod() done in 'copy_file()' (as a result of the "install" command attempting to preserve the mode of files from the build tree) fails, because you can't chmod() a file owned by somebody else. Paul Dubois suggests that simply unlinking the target file before doing the copy should work. I think he's right, but need to think about it and test it a bit first. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2001-09-20 11:41 Message: Logged In: YES user_id=11375 I think unlinking first is the right thing to do, having just run into another problem that seems to be caused by this. Installing *.so files to an NFS partition messed up other people, I think because they had the *.so file loaded into memory and the kernel's VM got confused. (That's the theory, anyway.) Bumping up the priority as a reminder to myself... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=220993&group_id=5470 From noreply@sourceforge.net Thu Sep 20 19:42:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 11:42:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-463286 ] Problem in urllib. No strip attribute Message-ID: Bugs item #463286, was opened at 2001-09-20 11:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463286&group_id=5470 Category: Python Library >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Francesc Alted (falted) >Assigned to: Guido van Rossum (gvanrossum) Summary: Problem in urllib. No strip attribute Initial Comment: If one make use of the urllib.urlopen method to open an object which is not an URL (for exemple a filehandler), in place of throwing a IOError exception, the next error appears: File "/usr/local/lib/python2.1/urllib.py", line 904, in unwrap url = url.strip() AttributeError: strip I'm using Python 2.1.1. It seems like Guido wanted to strip out the use of string methods in urllib, but the unwrap method was not tested enough. I'm attaching a small source file which expose the flaw easily. Cheers, Francesc Alted ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-20 11:42 Message: Logged In: YES user_id=6380 > file = urllib.urlopen(file_handler) This line is broken. urlopen() takes a string argument, but file_handler (poorly chosen name) is an open file object, not a string. Rejecting this as a pilot error. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463286&group_id=5470 From noreply@sourceforge.net Thu Sep 20 20:19:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 12:19:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-462658 ] PyLong_{As,From}VoidPtr not documented Message-ID: Bugs item #462658, was opened at 2001-09-18 13:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462658&group_id=5470 Category: Documentation Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: PyLong_{As,From}VoidPtr not documented Initial Comment: I stumbled upon PyLong_FromVoidPtr and PyLong_AsVoidPtr a week or so ago. I just noticed that they don't seem to be documented in any of the TeX sources. If they are not deprecated, they should probably be in the API ref. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-20 12:19 Message: Logged In: YES user_id=3066 Added documentation for these and many more PyLong_*() functions in Doc/api/api.tex revision 1.148. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462658&group_id=5470 From noreply@sourceforge.net Thu Sep 20 21:36:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 13:36:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Jack Jansen (jackjansen) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:11:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:11:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-463359 ] Interpreter generates infinite loop Message-ID: Bugs item #463359, was opened at 2001-09-20 15:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Ken Lalonde (kenlalonde) Assigned to: Nobody/Anonymous (nobody) Summary: Interpreter generates infinite loop Initial Comment: The simple attached script loops forever when run from the command line with no arguments. It's as if the "break" statement transfers control back to the start of the script. Am I losing my mind, or is the interpreter? My platform is sun/solaris 2.7/sparc, Python 2.1.1 (#1, Aug 9 2001, 17:14:49) [GCC 2.95.2 19991024 (release)] on sunos5 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:16:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:16:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-463359 ] Interpreter generates infinite loop Message-ID: Bugs item #463359, was opened at 2001-09-20 15:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 Category: Python Interpreter Core >Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ken Lalonde (kenlalonde) >Assigned to: Thomas Wouters (twouters) Summary: Interpreter generates infinite loop Initial Comment: The simple attached script loops forever when run from the command line with no arguments. It's as if the "break" statement transfers control back to the start of the script. Am I losing my mind, or is the interpreter? My platform is sun/solaris 2.7/sparc, Python 2.1.1 (#1, Aug 9 2001, 17:14:49) [GCC 2.95.2 19991024 (release)] on sunos5 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-20 15:16 Message: Logged In: YES user_id=6380 Another "continue-in-try" bug, or the same one? Given to Thomas for review. Broken in 2.2 as well. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:23:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:23:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-463378 ] pydoc vs staticmethod & classmethod Message-ID: Bugs item #463378, was opened at 2001-09-20 15:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463378&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs staticmethod & classmethod Initial Comment: pydoc isn't displaying the new static methods and class methods, in part because it doesn't know they're methods. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463378&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:26:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:26:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-463381 ] pydoc should identify bases Message-ID: Bugs item #463381, was opened at 2001-09-20 15:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463381&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc should identify bases Initial Comment: When displaying class info, pydoc should annotate methods with the class from which they came. Complications: The new __objclass__ may or may not be present; ditto the new __mro__; the method resolution order differs between new and classic classes; and I suppose a user-defined metaclass could introduce yet another, and unknowable (by pydoc), MRO. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463381&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:27:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:27:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-463383 ] pydoc vs class data attributes Message-ID: Bugs item #463383, was opened at 2001-09-20 15:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463383&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs class data attributes Initial Comment: pydoc doesn't display class data attributes. It should. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463383&group_id=5470 From noreply@sourceforge.net Thu Sep 20 23:29:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Sep 2001 15:29:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-463384 ] pydoc vs data docstrings Message-ID: Bugs item #463384, was opened at 2001-09-20 15:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463384&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs data docstrings Initial Comment: As of today, *some* kinds of descr-based data attributes can (and do) have docstrings (like complex.imag, although not 6j.imag). Of course pydoc doesn't know that's possible, so they never get displayed now. They should. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463384&group_id=5470 From noreply@sourceforge.net Fri Sep 21 11:05:38 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 03:05:38 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Fri Sep 21 11:08:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 03:08:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Fri Sep 21 11:18:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 03:18:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Fri Sep 21 13:00:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 05:00:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Tim Peters (tim_one) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Fri Sep 21 15:43:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 07:43:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-463572 ] Misleading documentation for gettext Message-ID: Bugs item #463572, was opened at 2001-09-21 07:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463572&group_id=5470 Category: Documentation Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Misleading documentation for gettext Initial Comment: in location: http://www.python.org/doc/2.1.1/lib/node187.html there are docs for translation(), but there is no indication or link to mappings between the supplied language and the subdirectory actually searched. A link to the relevant information would help people considerably, or rather an NB mentioning that the 'languages' in the translation() docs is not the plural of the 'language' in the find() docs. Once I'd renamed my French resource directores fr -> fr_FR it all worked, of course, but I only discovered this from debugging gettext :( kind regards, -Simon Harrison. On a side note, I have an alternative pygettext.py that inserts the English as the translated text when the "-t" option is supplied (test). This has been fairly useful since it allows me to run the code, and test for correct operation prior to real translation. I can supply the new version if useful. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463572&group_id=5470 From noreply@sourceforge.net Fri Sep 21 15:51:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 07:51:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-463576 ] socketmodule doesn't build on libc5 linu Message-ID: Bugs item #463576, was opened at 2001-09-21 07:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463576&group_id=5470 Category: Build Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: socketmodule doesn't build on libc5 linu Initial Comment: I've tried to build Python 2.1.1 on libc5 linux (Slackware 4). After configure I had to edit Modules/Setup to tell it to make the socket module, or "import socket" wouldn't work. But, compiling the socket module seems to demand glibc2.*. This is the error: ./Modules/socketmodule.c:178: netpacket/packet.h: No such file or directory The FAQ says (3.8): "Once you've built Python, use it to run the regen.py script in the Lib/linux1 directory". There is no regen.py or such directory. And the FAQ says that it's for Linux 1.*... (I'm running 2.2.19). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463576&group_id=5470 From noreply@sourceforge.net Fri Sep 21 16:01:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 08:01:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-463576 ] socketmodule doesn't build on libc5 linu Message-ID: Bugs item #463576, was opened at 2001-09-21 07:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463576&group_id=5470 Category: Build Group: Python 2.1.1 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: socketmodule doesn't build on libc5 linu Initial Comment: I've tried to build Python 2.1.1 on libc5 linux (Slackware 4). After configure I had to edit Modules/Setup to tell it to make the socket module, or "import socket" wouldn't work. But, compiling the socket module seems to demand glibc2.*. This is the error: ./Modules/socketmodule.c:178: netpacket/packet.h: No such file or directory The FAQ says (3.8): "Once you've built Python, use it to run the regen.py script in the Lib/linux1 directory". There is no regen.py or such directory. And the FAQ says that it's for Linux 1.*... (I'm running 2.2.19). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 08:01 Message: Logged In: YES user_id=6380 Sorry, we don't have the resources to support libc5. If you develop a patch to make socketmodule.c compile with libc5, please submit it to the SF patch manager. The FAQ is out of date; since you're on Linux 2.x, you should look at the linux2 directory, but normally you shouldn't have to recompile. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463576&group_id=5470 From noreply@sourceforge.net Fri Sep 21 16:06:19 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 08:06:19 -0700 Subject: [Python-bugs-list] [ python-Bugs-463572 ] Misleading documentation for gettext Message-ID: Bugs item #463572, was opened at 2001-09-21 07:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463572&group_id=5470 Category: Documentation Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Barry Warsaw (bwarsaw) Summary: Misleading documentation for gettext Initial Comment: in location: http://www.python.org/doc/2.1.1/lib/node187.html there are docs for translation(), but there is no indication or link to mappings between the supplied language and the subdirectory actually searched. A link to the relevant information would help people considerably, or rather an NB mentioning that the 'languages' in the translation() docs is not the plural of the 'language' in the find() docs. Once I'd renamed my French resource directores fr -> fr_FR it all worked, of course, but I only discovered this from debugging gettext :( kind regards, -Simon Harrison. On a side note, I have an alternative pygettext.py that inserts the English as the translated text when the "-t" option is supplied (test). This has been fairly useful since it allows me to run the code, and test for correct operation prior to real translation. I can supply the new version if useful. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-21 08:06 Message: Logged In: YES user_id=3066 Assigned to Barry. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463572&group_id=5470 From noreply@sourceforge.net Fri Sep 21 17:06:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 09:06:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Jack Jansen (jackjansen) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Fri Sep 21 19:26:49 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 11:26:49 -0700 Subject: [Python-bugs-list] [ python-Bugs-463640 ] weird namespace phenomenon Message-ID: Bugs item #463640, was opened at 2001-09-21 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463640&group_id=5470 Category: Python Interpreter Core Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: weird namespace phenomenon Initial Comment: # == module f.py y = 10 def g(): if y: y = 100 return y # == module h.py import f print f.g() # == plop these two modules into the same directory and 'cd' to that directory. When you run 'python h.py' at the command line, line 6 of f.py (if y:) creates a problem due to f being supposedly undefined. The error is registered as NameError or UnboundLocalError depending on what version of the python core you're running. Python 2.1.x says y is being referenced before assignment, yet if you change the _next_ line to read "z = 100" rather than "y = 100", the whole thing runs fine, printing 10 (the value of f.y) at the end as expected. This is at the very least an extreme logic quirk in how python namespaces work, and at worst a bug badly in need of correction (since vsn 1.5.2 or before). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463640&group_id=5470 From noreply@sourceforge.net Fri Sep 21 21:15:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 13:15:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-463640 ] weird namespace phenomenon Message-ID: Bugs item #463640, was opened at 2001-09-21 11:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463640&group_id=5470 Category: Python Interpreter Core >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Tim Peters (tim_one) Summary: weird namespace phenomenon Initial Comment: # == module f.py y = 10 def g(): if y: y = 100 return y # == module h.py import f print f.g() # == plop these two modules into the same directory and 'cd' to that directory. When you run 'python h.py' at the command line, line 6 of f.py (if y:) creates a problem due to f being supposedly undefined. The error is registered as NameError or UnboundLocalError depending on what version of the python core you're running. Python 2.1.x says y is being referenced before assignment, yet if you change the _next_ line to read "z = 100" rather than "y = 100", the whole thing runs fine, printing 10 (the value of f.y) at the end as expected. This is at the very least an extreme logic quirk in how python namespaces work, and at worst a bug badly in need of correction (since vsn 1.5.2 or before). ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-21 13:15 Message: Logged In: YES user_id=31435 Whether a given name is local or global in a given scope is a property determined at compile-time, not at runtime. See the Reference Manual for details. In brief, if a name is bound ("assigned to") *anywhere* in the body of a function, that name is local throughout the entire function. You assign to y in the body of g(), therefore y is a local variable everywhere in g(), and you reference y's value in g () before giving it a value (hence it's an unbound local at the time you first reference it, hence UnboundLocalError in recent Pythons). The y in the body of g() has nothing to do with the module-level vrbl y. If you intended to reference the module-level vrbl y, then you need to put global y as the first statement in g(). But it's impossible for me to guess what you intended -- and it's also impossible for Python. If you're familiar with C, it's exactly the same as int y = 10; int g() {int y; if (y) y = 100; return y;} except that in C you'd get random crap out of that function (due to referencing an uninitialized auto) instead of a reliable exception. The difference is that Python doesn't have explict declarations for local variables, but the fact that you assigned to y within the body of g makes y a local just as much as y is function-local in the C example above. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463640&group_id=5470 From noreply@sourceforge.net Fri Sep 21 22:20:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 14:20:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-443559 ] creating exceptions is underdocumented Message-ID: Bugs item #443559, was opened at 2001-07-22 10:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443559&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: creating exceptions is underdocumented Initial Comment: It's not documented very well (maybe not at all?) how to create your own exceptions, what methods are available for overriding / extending, etc. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-21 14:19 Message: Logged In: YES user_id=3066 Extended the discussion of user-defined exception in the tutorial (Doc/tut/tut.tex revision 1.150) and added a reference from the library manual's discussion of the standard exceptions (Doc/lib/libexcs.tex revision 1.40). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=443559&group_id=5470 From noreply@sourceforge.net Fri Sep 21 22:47:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 14:47:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Sat Sep 22 01:01:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 17:01:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-21 17:01 Message: Logged In: YES user_id=14198 The complaint is that when the environment is set via the win32 API, os.environ appears to not pick up the new setting. I have no idea why this is, but it is not Python's fault. Python uses the C runtime library, and there i snot much we can do about that. I don't have time to try and locate the CRTL source code and figure out why either. Marking as "Wont Fix" ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Sat Sep 22 01:29:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 17:29:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-21 17:29 Message: Logged In: YES user_id=31435 Ah! Good call. WRT VC's putenv, the MS docs say: """ _putenv and _wputenv affect only the environment that is local to the current process; you cannot use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment “segment” created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by _spawn, _exec, or system, and these new processes get any new items added by _putenv and _wputenv. """ Sounds like the msvcrt-level env functions work with a copy of the process env block captured at process creation time. As usual, a Bad Idea to try to use envars on Windows ... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-21 17:01 Message: Logged In: YES user_id=14198 The complaint is that when the environment is set via the win32 API, os.environ appears to not pick up the new setting. I have no idea why this is, but it is not Python's fault. Python uses the C runtime library, and there i snot much we can do about that. I don't have time to try and locate the CRTL source code and figure out why either. Marking as "Wont Fix" ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Sat Sep 22 04:38:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 20:38:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Jack Jansen (jackjansen) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Sat Sep 22 05:21:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 21:21:48 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Guido van Rossum (gvanrossum) Summary: types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Sat Sep 22 05:25:42 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 21:25:42 -0700 Subject: [Python-bugs-list] [ python-Bugs-463738 ] file object iterators Message-ID: Bugs item #463738, was opened at 2001-09-21 21:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463738&group_id=5470 Category: Documentation Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: file object iterators Initial Comment: The documentation for file objects does not describe that they can be iterated over using the iterator protocol. It should say that iterating over a file object returns each line, including the trailing newline. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463738&group_id=5470 From noreply@sourceforge.net Sat Sep 22 05:31:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 21:31:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-463739 ] test_sundry bogosity Message-ID: Bugs item #463739, was opened at 2001-09-21 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463739&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Guido van Rossum (gvanrossum) Summary: test_sundry bogosity Initial Comment: test_sundry is a bit bogus. If one of the modules can't be imported, none of the succeeding modules are even minimally tested. Should it be rewritten so that a failed import of one module doesn't shortcircuit the rest of the imports? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463739&group_id=5470 From noreply@sourceforge.net Sat Sep 22 05:35:26 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 21 Sep 2001 21:35:26 -0700 Subject: [Python-bugs-list] [ python-Bugs-463738 ] file object iterators Message-ID: Bugs item #463738, was opened at 2001-09-21 21:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463738&group_id=5470 Category: Documentation Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: file object iterators Initial Comment: The documentation for file objects does not describe that they can be iterated over using the iterator protocol. It should say that iterating over a file object returns each line, including the trailing newline. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-21 21:35 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libstdtypes.tex revision 1.69. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463738&group_id=5470 From noreply@sourceforge.net Sat Sep 22 17:23:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 09:23:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-463840 ] Missing initialization code in weakref Message-ID: Bugs item #463840, was opened at 2001-09-22 09:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463840&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Brian Quinlan (bquinlan) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Missing initialization code in weakref Initial Comment: The weak reference example given on: http://www.python.org/doc/current/lib/weakref- extension.html Should point of that the weak reference list should be initialized to NULL during object construction. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463840&group_id=5470 From noreply@sourceforge.net Sat Sep 22 17:58:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 09:58:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-463739 ] test_sundry bogosity Message-ID: Bugs item #463739, was opened at 2001-09-21 21:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463739&group_id=5470 Category: Python Library Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Guido van Rossum (gvanrossum) Summary: test_sundry bogosity Initial Comment: test_sundry is a bit bogus. If one of the modules can't be imported, none of the succeeding modules are even minimally tested. Should it be rewritten so that a failed import of one module doesn't shortcircuit the rest of the imports? ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:58 Message: Logged In: YES user_id=6380 No, if one of the modules can't be imported the test fails, and that's all we need to know. Lots of tests stop at the first error. I don't think there's a need to fix this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463739&group_id=5470 From noreply@sourceforge.net Sat Sep 22 18:33:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 10:33:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:33 Message: Logged In: YES user_id=6380 The reason is trivial. reload(os) doesn't magically cause reload(nt), and it's the nt module (whose source is posixmodule.c) that computes the 'environ' dictionary. I betcha a dollar that if you reload(nt) and then reload(os), the environment is fixed. But why would you want to do that? Changing os.environ should automatically call _putenv(); if it doesn't, submit a separate bug report. The MS docs are trying to explain that the environment semantics are the same as in Unix (you can't change your shell's environment, but child processes do inherit yours). In my experience envars work fine in Windows. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 17:29 Message: Logged In: YES user_id=31435 Ah! Good call. WRT VC's putenv, the MS docs say: """ _putenv and _wputenv affect only the environment that is local to the current process; you cannot use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment “segment” created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by _spawn, _exec, or system, and these new processes get any new items added by _putenv and _wputenv. """ Sounds like the msvcrt-level env functions work with a copy of the process env block captured at process creation time. As usual, a Bad Idea to try to use envars on Windows ... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-21 17:01 Message: Logged In: YES user_id=14198 The complaint is that when the environment is set via the win32 API, os.environ appears to not pick up the new setting. I have no idea why this is, but it is not Python's fault. Python uses the C runtime library, and there i snot much we can do about that. I don't have time to try and locate the CRTL source code and figure out why either. Marking as "Wont Fix" ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Sat Sep 22 18:46:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 10:46:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:46 Message: Logged In: YES user_id=6380 Whether or not it's documented for base64, changing that will also break existing code. It's a documentation issue (unfortunately). ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Sat Sep 22 18:46:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 10:46:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Jack Jansen (jackjansen) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:46 Message: Logged In: YES user_id=6380 Whether or not it's documented for base64, changing that will also break existing code. It's a documentation issue (unfortunately). ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Sun Sep 23 03:34:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 19:34:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-463996 ] quopri RFC 2047 and hex 20 encodings Message-ID: Bugs item #463996, was opened at 2001-09-22 19:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: quopri RFC 2047 and hex 20 encodings Initial Comment: In RFC 2047, the quoted-printable (i.e. "Q") encoding allows for _ to encode hex 20. See section 4.2 of that RFC. However, quopri was written against RFC 1521 which doesn't describe hex20/underscore encoding. quopri should be updated to allow for decoding of underscore to hex 20, perhaps as a flag on the decode() and decodestring() functions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 From noreply@sourceforge.net Sun Sep 23 08:00:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 00:00:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-23 00:00 Message: Logged In: YES user_id=14198 *sigh* - OK - the SDK docs appear wrong, but the main point is still valid. _putenv() does indeed modify the process environment, as the test program I wrote demonstrated. However, SetEnvironmentVariable() does *not* get reflected in the CRTL environment. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-22 21:45 Message: Logged In: YES user_id=14198 I think the SDK description Tim posted was clear that setenv does not modify the process environment. To prove this, I wrote the test code at the end (and output past it). It shows that using "::SetEnvironmentVariable()" will not have the value reflected in the CRTL (ie, getenv() will not see the new value) However, using putenv() *does* reflect the value back to the Win32 API - so GetEnvironmentVariable *does* see the value set by putenv. So I think Python is using the correct API, and can't fix the behaviour. int main() { static char buffer[128]; char * val = getenv("FOO"); printf("When starting, FOO=%s\n", val); SetEnvironmentVariable("FOO", "SetEnvironmentVariable"); GetEnvironmentVariable("FOO", buffer, sizeof (buffer)/sizeof(buffer[0])); val = buffer; printf("After set, GetEnvironmentVariable reports FOO=% s\n", val); val = getenv("FOO"); printf("After set, getenv reports FOO=%s\n", val); putenv("FOO=_putenv"); GetEnvironmentVariable("FOO", buffer, sizeof (buffer)/sizeof(buffer[0])); val = buffer; printf("After _putenv set, GetEnvironmentVariable reports FOO=%s\n", val); val = getenv("FOO"); printf("After _putenv set, getenv reports FOO=%s\n", val); return 0; } Output: When starting, FOO=(null) After set, GetEnvironmentVariable reports FOO=SetEnvironmentVariable After set, getenv reports FOO=(null) After _putenv set, GetEnvironmentVariable reports FOO=_putenv After _putenv set, getenv reports FOO=_putenv ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:33 Message: Logged In: YES user_id=6380 The reason is trivial. reload(os) doesn't magically cause reload(nt), and it's the nt module (whose source is posixmodule.c) that computes the 'environ' dictionary. I betcha a dollar that if you reload(nt) and then reload(os), the environment is fixed. But why would you want to do that? Changing os.environ should automatically call _putenv(); if it doesn't, submit a separate bug report. The MS docs are trying to explain that the environment semantics are the same as in Unix (you can't change your shell's environment, but child processes do inherit yours). In my experience envars work fine in Windows. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 17:29 Message: Logged In: YES user_id=31435 Ah! Good call. WRT VC's putenv, the MS docs say: """ _putenv and _wputenv affect only the environment that is local to the current process; you cannot use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment “segment” created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by _spawn, _exec, or system, and these new processes get any new items added by _putenv and _wputenv. """ Sounds like the msvcrt-level env functions work with a copy of the process env block captured at process creation time. As usual, a Bad Idea to try to use envars on Windows ... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-21 17:01 Message: Logged In: YES user_id=14198 The complaint is that when the environment is set via the win32 API, os.environ appears to not pick up the new setting. I have no idea why this is, but it is not Python's fault. Python uses the C runtime library, and there i snot much we can do about that. I don't have time to try and locate the CRTL source code and figure out why either. Marking as "Wont Fix" ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Sun Sep 23 15:04:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 07:04:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-463996 ] quopri RFC 2047 and hex 20 encodings Message-ID: Bugs item #463996, was opened at 2001-09-22 19:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: quopri RFC 2047 and hex 20 encodings Initial Comment: In RFC 2047, the quoted-printable (i.e. "Q") encoding allows for _ to encode hex 20. See section 4.2 of that RFC. However, quopri was written against RFC 1521 which doesn't describe hex20/underscore encoding. quopri should be updated to allow for decoding of underscore to hex 20, perhaps as a flag on the decode() and decodestring() functions. ---------------------------------------------------------------------- Comment By: Kent Engström (kente) Date: 2001-09-23 07:04 Message: Logged In: YES user_id=178855 See patch 464070 for a minimal decode enhancement. ---------------------------------------------------------------------- Comment By: Kent Engström (kente) Date: 2001-09-23 04:24 Message: Logged In: YES user_id=178855 We should not directly compare RFC 2047 and RFC 1521. RFC 1521 = Old standard, "QP for bodies" RFC 1522 = Old standard, "QP for headers" RFC 2045 = New standard, "QP for bodies" RFC 2027 = New standard, "QP for headers" The "underscore coding" is present already in RFC 1522, and absent in RFC 2045. A flag sent to the relevant functions may be the right way, but we want it to be something like "header_style", not "new_style". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 From noreply@sourceforge.net Mon Sep 24 20:35:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 12:35:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-462937 ] continue inside try confuses while loop Message-ID: Bugs item #462937, was opened at 2001-09-19 10:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Amit Patel (amitp) Assigned to: Thomas Wouters (twouters) Summary: continue inside try confuses while loop Initial Comment: If there's a continue inside a try inside a while with a break inside a function, well, things go wacky. I'll post code and give a description: #!/usr/bin/env python2 def bug(n): print 'Top' x = 0 while 1: print 'x = %d' % x x = x + 1 if x > n: break try: y = float(42) if y > 10: continue except ValueError: print 'Error' print 'Bottom' bug(4) # no loop bug(3) # loops When you run bug(4), it does what you expect -- prints Top, prints x= for various values of x, then prints Bottom, and returns. When you run bug(3), it prints Top, various values of x, and then instead of 'break' getting out of the loop, it jumps to the top of the function and prints Top again !! This seems really weird to me. Odd values of n behave differently than even values of n ! ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-24 12:35 Message: Logged In: YES user_id=34209 Gah. found it. How embarrassing (as I suspected.) My only solace is that Jeremy accepted the patch . The ugly hack of re-creating the just-popped frame-block in the case of a continue swapped the 'handler' and 'stacklevel' arguments to PyBlock_BlockSetup! And any subsequent break or exception would use the wrong handler and the wrong stack level to pop to. Don't ask me *how* I found it; I'm afraid something will go wrong with the fabric of space if I admit I found such an obscure bug with such little effort :) Fixed in revision 2.277 of Python/ceval.c. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-19 21:50 Message: Logged In: YES user_id=6380 I can reproduce this in 2.2 too. Thomas, can you look at this? I believe you wrote the continue-in-try code... ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2001-09-19 19:42 Message: Logged In: YES user_id=163326 FYI: Python 1.5.2 and 2.0.1 say: gerhard@lilith:/tmp > /opt/python20/bin/python python-continue-bug-2.py SyntaxError: 'continue' not supported inside 'try' clause (python-continue-bug-2.py, line 10) This problem seems to have started with the 2.1 branch. ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 13:18 Message: Logged In: YES user_id=327765 I'm attaching a variant of the program which runs and then causes "SystemError: unknown opcode". ---------------------------------------------------------------------- Comment By: Amit Patel (amitp) Date: 2001-09-19 10:50 Message: Logged In: YES user_id=327765 Bah, it destroyed my formatting. I'll upload a separate file. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462937&group_id=5470 From noreply@sourceforge.net Mon Sep 24 20:40:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 12:40:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-463359 ] Interpreter generates infinite loop Message-ID: Bugs item #463359, was opened at 2001-09-20 15:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Ken Lalonde (kenlalonde) Assigned to: Thomas Wouters (twouters) Summary: Interpreter generates infinite loop Initial Comment: The simple attached script loops forever when run from the command line with no arguments. It's as if the "break" statement transfers control back to the start of the script. Am I losing my mind, or is the interpreter? My platform is sun/solaris 2.7/sparc, Python 2.1.1 (#1, Aug 9 2001, 17:14:49) [GCC 2.95.2 19991024 (release)] on sunos5 ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2001-09-24 12:40 Message: Logged In: YES user_id=34209 Gah. found it. How embarrassing (as I suspected.) My only solace is that Jeremy accepted the patch . The ugly hack of re-creating the just-popped frame-block in the case of a continue swapped the 'handler' and 'stacklevel' arguments to PyBlock_BlockSetup! And any subsequent break or exception would use the wrong handler and the wrong stack level to pop to. Don't ask me *how* I found it; I'm afraid something will go wrong with the fabric of space if I admit I found such an obscure bug with such little effort :) Fixed in revision 2.277 of Python/ceval.c. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-20 15:16 Message: Logged In: YES user_id=6380 Another "continue-in-try" bug, or the same one? Given to Thomas for review. Broken in 2.2 as well. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463359&group_id=5470 From noreply@sourceforge.net Mon Sep 24 21:17:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 13:17:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-448482 ] python 2.1.1: sgmllib, decl. subset Message-ID: Bugs item #448482, was opened at 2001-08-06 11:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448482&group_id=5470 Category: Python Library Group: Python 2.1.1 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: python 2.1.1: sgmllib, decl. subset Initial Comment: sgmllib.SGMLParser is unable to parse a document type declaration subset and reports a false error. The attached patch fixes this. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-24 13:17 Message: Logged In: YES user_id=3066 This particular patch is sensitive to the contents of the internal subset. Fixed with a different patch an some refactoring of the sgmllib and HTMLParser modules in Lib/sgmllib.py revision 1.38. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448482&group_id=5470 From noreply@sourceforge.net Mon Sep 24 21:26:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 13:26:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-453706 ] sgmllib exception behaviour: policy? Message-ID: Bugs item #453706, was opened at 2001-08-21 05:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453706&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 6 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: sgmllib exception behaviour: policy? Initial Comment: the standard python htmlparser produces an exception from sgmllib while parsing this contruction: in the body of an html file. I´m not sure if this is a regular HTML Tag, but when netscape renders the page, it seems to ignore it. The problem is now, that sgmllib produces an uncaught exception, and i don´t know how to handle this exception really intelligent by my program. I like to have a HTLMParser that never crashes, even if he sometimes produces not exactly output. What does the developer team think for that? is this unimportant for the rest of the world or have i found a bug that should be fixed? if not, can you give me some suggestions how to work around this bug in my special case. thanks Michael ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-24 13:26 Message: Logged In: YES user_id=3066 Starting with Lib/sgmllib.py revision 1.38: There is a new method, unknown_decl(), which is called with the text of unknown declarations found outside the document type declaration. It gets the content of the declaration (the thing) and can do as it pleases. The default does nothing, so the original behavior is restored. Regression tests have been added to ensure this doesn't break without our knowledge in the future. (Restarting after an exception would not make sense for this. This approach is similar to the way certain other constructs are handled.) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-08-29 03:21 Message: Logged In: NO I use Python 2.1.1 as you expected and I didn´t try it with any earlier version, I began to use it only 2 months ago. By the way, the coolest programming language I´ve ever seen. Good work, guys! When the desired behaviour for sgmllib is to throw an exception when parsing such an unknown tag, what is the preferred way to catch it? I liked to use sgmllib as a kind of black box, and I´m sure this is possible in some way. Is there such a way and I don´t see it or isn´t it existing? In the current implementation of my program, I had to overwrite the function parse_declaration. This is what I would call in internal function of sgmllib, and maybe with the next version of sgmllib, the internal structure changes a bit and my programm won´t run anymore. And all the advantages of OO Programming are just blown away. a kind of this would be cool: data = "blafoo bla..." while true: try: myParser.feed(data) break except SGMLCatcheableParseError: exc_value = sys.exc_info()[1] data = data[exc_value:] continue you know what I mean? The code snippet is not very nice, but it should explain the problem.. When sgmllib throws an exception on ParseErrors there should be a way to instruct the Parser Object to ommit the tag an go further. Michael ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-28 10:44 Message: Logged In: YES user_id=3066 Python 2.1 and 2.1.1 both raised an exception in this case, while Python 2.0.1 did not (it skipped over the markup). I wish this had been caught before 2.1 was released! The fact that it has only now come up indicates that this is a very unusual input (which I'd expect for HTML, but not so much for SGML). ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-28 08:51 Message: Logged In: YES user_id=3066 This is not legal HTML or SGML (or XHTML, or any other acronym-of-the-week). The element that would have looked like that, but without the "!". I suspect someone had played with that and tried to comment it out, which they botched.) The "right thing" is to raise an exception due to illegal syntax. The problem is that you weren't seeing the exception before (what was the latest released version you were using where you did not get the exception?). I'll look into this a bit and think about it. The sgmllib/htmllib parsers have traditionally been way too lenient, so we may need to restore the old behavior. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=453706&group_id=5470 From noreply@sourceforge.net Tue Sep 25 07:19:40 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 23:19:40 -0700 Subject: [Python-bugs-list] [ python-Bugs-452220 ] __class__ assignment Message-ID: Bugs item #452220, was opened at 2001-08-17 14:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452220&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 2 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Guido van Rossum (gvanrossum) Summary: __class__ assignment Initial Comment: When safe assignment to x.__class__ should be supported. It's safe when the struct layout of the old and new class is compatinle. A sufficient safety condition is that the struct sizes are the same and there's a shared ancestor that also has the same size. (varitems, GC support and dict/weakref slots may complicate matters). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-24 23:19 Message: Logged In: YES user_id=6380 In CVS. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452220&group_id=5470 From noreply@sourceforge.net Tue Sep 25 08:02:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 00:02:41 -0700 Subject: [Python-bugs-list] [ python-Bugs-463378 ] pydoc vs staticmethod & classmethod Message-ID: Bugs item #463378, was opened at 2001-09-20 15:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463378&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs staticmethod & classmethod Initial Comment: pydoc isn't displaying the new static methods and class methods, in part because it doesn't know they're methods. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-25 00:02 Message: Logged In: YES user_id=31435 pydoc now segregates class attributes according to whether they're plain methods, class methods, static methods, properties, or non-method data or functions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463378&group_id=5470 From noreply@sourceforge.net Tue Sep 25 08:04:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 00:04:17 -0700 Subject: [Python-bugs-list] [ python-Bugs-463381 ] pydoc should identify bases Message-ID: Bugs item #463381, was opened at 2001-09-20 15:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463381&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc should identify bases Initial Comment: When displaying class info, pydoc should annotate methods with the class from which they came. Complications: The new __objclass__ may or may not be present; ditto the new __mro__; the method resolution order differs between new and classic classes; and I suppose a user-defined metaclass could introduce yet another, and unknowable (by pydoc), MRO. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-25 00:04 Message: Logged In: YES user_id=31435 pydoc now groups class attrs by the class in which they're defined, current class's attrs first, then by alphabetic order of defining class name. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463381&group_id=5470 From noreply@sourceforge.net Tue Sep 25 08:04:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 00:04:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-463383 ] pydoc vs class data attributes Message-ID: Bugs item #463383, was opened at 2001-09-20 15:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463383&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs class data attributes Initial Comment: pydoc doesn't display class data attributes. It should. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-25 00:04 Message: Logged In: YES user_id=31435 pydoc now displays class data attributes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463383&group_id=5470 From noreply@sourceforge.net Tue Sep 25 08:06:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 00:06:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-463384 ] pydoc vs data docstrings Message-ID: Bugs item #463384, was opened at 2001-09-20 15:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463384&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Tim Peters (tim_one) Summary: pydoc vs data docstrings Initial Comment: As of today, *some* kinds of descr-based data attributes can (and do) have docstrings (like complex.imag, although not 6j.imag). Of course pydoc doesn't know that's possible, so they never get displayed now. They should. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-25 00:06 Message: Logged In: YES user_id=31435 pydoc now displays data docstrings when it can. The implementation of property() was also changed so that a docstring can be given to a property (this wasn't possible before); pydoc was also changed to display the new property docstrings (when non-None). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463384&group_id=5470 From noreply@sourceforge.net Tue Sep 25 14:41:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 06:41:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-459235 ] tuple __getitem__ limited Message-ID: Bugs item #459235, was opened at 2001-09-06 10:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None >Priority: 2 Submitted By: Martin v. Löwis (loewis) Assigned to: Guido van Rossum (gvanrossum) Summary: tuple __getitem__ limited Initial Comment: The __getitem__ of a tuple does not support the extended slicing. That makes it difficult to delegate from an object's __getitem__ to a builtin container, which ought to work through delegating __getitem__
class GI:
    def __getitem__(self,a):
        print a

a = GI()
a[1:2]
(1,2,3,4).__getitem__(slice(1,2,None))
gives slice(1, 2, None) Traceback (most recent call last): File "bar.py", line 7, in ? (1,2,3,4).__getitem__(slice(1,2,None)) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-06 11:08 Message: Logged In: YES user_id=6380 This is not just the __getitem__ -- t[...] also has this problem. As a workaround, you can define __getslice__ or parse the slice() object yourself. I'll eventually get around to fixing this, but it's a bit messy. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459235&group_id=5470 From noreply@sourceforge.net Tue Sep 25 14:43:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 06:43:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Guido van Rossum (gvanrossum) Summary: types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-25 06:43 Message: Logged In: YES user_id=6380 Assigned to Tim -- another set of brains might help here. :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:56 Message: Logged In: YES user_id=6380 None of the new stuff is documented. I have a TO DO item for that myself. If you're doing type tests on callable-iterator instances something's wrong anyway; I suggest to remove the FunctionIterType. (Not all the new types have been added to types, and I'm not sure that they should be.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Tue Sep 25 14:43:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 06:43:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) >Assigned to: Tim Peters (tim_one) Summary: types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-25 06:43 Message: Logged In: YES user_id=6380 Assigned to Tim -- another set of brains might help here. :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:56 Message: Logged In: YES user_id=6380 None of the new stuff is documented. I have a TO DO item for that myself. If you're doing type tests on callable-iterator instances something's wrong anyway; I suggest to remove the FunctionIterType. (Not all the new types have been added to types, and I'm not sure that they should be.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Tue Sep 25 17:36:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 09:36:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-464872 ] PyDict_Check() fails if object not dict Message-ID: Bugs item #464872, was opened at 2001-09-25 09:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: PyDict_Check() fails if object not dict Initial Comment: Calling PyDict_Check() on the keywords object passed to an built-in extension module callback, when no keyword arguments were given results in Python raising an exception, rather than return 0 as it should. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470 From noreply@sourceforge.net Tue Sep 25 18:31:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 10:31:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-464872 ] PyDict_Check() fails if object not dict Message-ID: Bugs item #464872, was opened at 2001-09-25 09:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470 Category: Python Interpreter Core >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: PyDict_Check() fails if object not dict Initial Comment: Calling PyDict_Check() on the keywords object passed to an built-in extension module callback, when no keyword arguments were given results in Python raising an exception, rather than return 0 as it should. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-25 10:31 Message: Logged In: YES user_id=6380 I haven't seen your code, but I believe you may be seeing this because the keywords argument can be NULL. PyDict_Check() should not be applied to a NULL pointer, so the proper way to do this is to check for NULL before calling PyDict_Check(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470 From noreply@sourceforge.net Tue Sep 25 19:35:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 11:35:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-464900 ] Include TKInter Docs Message-ID: Bugs item #464900, was opened at 2001-09-25 11:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464900&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Include TKInter Docs Initial Comment: The standard Python distributions include the TKinter library but no docs for it. Arggh! I hope this can be remedied. The docs I've seen aren't so great, but they're enough to get started. Please consider tossing them into the Python distribution even if there's nobody available to edit them further. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464900&group_id=5470 From noreply@sourceforge.net Tue Sep 25 20:00:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 12:00:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-448918 ] docs for mmap module unclear/typo Message-ID: Bugs item #448918, was opened at 2001-08-07 14:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448918&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: docs for mmap module unclear/typo Initial Comment: For the mmap module docs: Under both the Windows and Unix constructors is the sentence: "If you wish to map an existing Python file object, use its fileno() method to obtain the correct value for the fileno parameter" OK, but what id I want to map an unopened file???? The working implies that I don't have to use an existing file object, but doesn't say how to do otherwise. under the Windows constructor: """ mmap(fileno, length[, tagname]) (Windows version) Maps length bytes from the file specified by the file handle fileno, and returns a mmap object. If length is 0, the maximum length of the map will be the current size of the file when mmap() is called. """ This is pretty clear, but under the Unix section: """ mmap(fileno, size[, flags, prot]) (Unix version) Maps length bytes from the file specified by the file handle fileno, and returns a mmap object. """ In the prototype, there is a required parameter called "size" and in the next sentence, the variable "length" is used. Are these supposed to be the same? can I use a 0 to indicate the whole file, as I can on Windows? Note that none of this seems to have changed in the development version of the docs. -Chris ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-25 12:00 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libmmap.tex revision 1.5. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448918&group_id=5470 From noreply@sourceforge.net Tue Sep 25 23:02:55 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 15:02:55 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] Add types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Tim Peters (tim_one) >Summary: Add types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-25 15:02 Message: Logged In: YES user_id=31435 Fixed, but by removing the partial set of xxxIterType vrbls from types.py, and adding a comment urging using of hasattr instead (because iterators in 2.2 aren't "a type", they're a protocol). Lib/types.py; new revision: 1.22 ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-25 07:42 Message: Logged In: YES user_id=12800 I was doing the type checking in the unittest for [c]StringIO. Only that and introspection modules will probably ever need to do such type checking. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-25 06:43 Message: Logged In: YES user_id=6380 Assigned to Tim -- another set of brains might help here. :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:56 Message: Logged In: YES user_id=6380 None of the new stuff is documented. I have a TO DO item for that myself. If you're doing type tests on callable-iterator instances something's wrong anyway; I suggest to remove the FunctionIterType. (Not all the new types have been added to types, and I'm not sure that they should be.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Wed Sep 26 02:42:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 18:42:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-465045 ] base n integer to string conversion Message-ID: Bugs item #465045, was opened at 2001-09-25 18:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: base n integer to string conversion Initial Comment: I see that the C files for int and long arithmetic already contain format() functions to format the numbers in arbitrary bases. The Python-exported decimal and hex conversion routines simply call the format function. I have three suggestions/requests, in increasing order of controversy: 1) How about exporting the format routine to Python, so there's a builtin function for converting an integer object to an arbitrary base 2<=b<=36. The code is already there--may as well let people use it. Something like format(n,base) would be a simple interface. 2) Right now there's no simple way to convert an integer to a raw byte string. I end up doing something like a = binascii.unhexlify("%x"%n) which is a kludge. I'd like to propose that as a special case, format(n,256) give the raw bytes. 3) Finally, if it's not too weird, format(n,128) could possibly return the BER (base 128) encoded representation of n, similar to pack("w",n) in perl. Bit 8 (the high bit) is set in each byte except the last. That means you can read BER integers byte by byte and know where they end. They're used in various security objects like X509 certificates. If not here, then sooner or later this function should appear in some library module. Thanks Paul ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 From noreply@sourceforge.net Wed Sep 26 02:45:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 18:45:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-465045 ] base n integer to string conversion Message-ID: Bugs item #465045, was opened at 2001-09-25 18:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: base n integer to string conversion Initial Comment: I see that the C files for int and long arithmetic already contain format() functions to format the numbers in arbitrary bases. The Python-exported decimal and hex conversion routines simply call the format function. I have three suggestions/requests, in increasing order of controversy: 1) How about exporting the format routine to Python, so there's a builtin function for converting an integer object to an arbitrary base 2<=b<=36. The code is already there--may as well let people use it. Something like format(n,base) would be a simple interface. 2) Right now there's no simple way to convert an integer to a raw byte string. I end up doing something like a = binascii.unhexlify("%x"%n) which is a kludge. I'd like to propose that as a special case, format(n,256) give the raw bytes. 3) Finally, if it's not too weird, format(n,128) could possibly return the BER (base 128) encoded representation of n, similar to pack("w",n) in perl. Bit 8 (the high bit) is set in each byte except the last. That means you can read BER integers byte by byte and know where they end. They're used in various security objects like X509 certificates. If not here, then sooner or later this function should appear in some library module. Thanks Paul ---------------------------------------------------------------------- >Comment By: paul rubin (phr) Date: 2001-09-25 18:45 Message: Logged In: YES user_id=72053 One minor comment: besides representing longs, BER encoded integers are also good for small integers. Numbers < 128 are represented in one byte. If short strings were marshalled with a BER-encoded length instead of a 4-byte length, that could save some space in .pyc files and pickled objects. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 From noreply@sourceforge.net Wed Sep 26 14:38:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 06:38:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-465045 ] base n integer to string conversion Message-ID: Bugs item #465045, was opened at 2001-09-25 18:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: base n integer to string conversion Initial Comment: I see that the C files for int and long arithmetic already contain format() functions to format the numbers in arbitrary bases. The Python-exported decimal and hex conversion routines simply call the format function. I have three suggestions/requests, in increasing order of controversy: 1) How about exporting the format routine to Python, so there's a builtin function for converting an integer object to an arbitrary base 2<=b<=36. The code is already there--may as well let people use it. Something like format(n,base) would be a simple interface. 2) Right now there's no simple way to convert an integer to a raw byte string. I end up doing something like a = binascii.unhexlify("%x"%n) which is a kludge. I'd like to propose that as a special case, format(n,256) give the raw bytes. 3) Finally, if it's not too weird, format(n,128) could possibly return the BER (base 128) encoded representation of n, similar to pack("w",n) in perl. Bit 8 (the high bit) is set in each byte except the last. That means you can read BER integers byte by byte and know where they end. They're used in various security objects like X509 certificates. If not here, then sooner or later this function should appear in some library module. Thanks Paul ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-26 06:38 Message: Logged In: YES user_id=6380 1) Which bases besides 8, 10 and 16 do you plan to use? The C code strikes me as more general than needed. 2) You can do this with the struct module. No need for kludges. 3) BER seems pretty esoteric. The binascii module seems the right place. Feel free to submit a patch! ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-25 18:45 Message: Logged In: YES user_id=72053 One minor comment: besides representing longs, BER encoded integers are also good for small integers. Numbers < 128 are represented in one byte. If short strings were marshalled with a BER-encoded length instead of a 4-byte length, that could save some space in .pyc files and pickled objects. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 From noreply@sourceforge.net Wed Sep 26 17:58:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 09:58:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Wed Sep 26 20:31:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 12:31:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-465342 ] PyUnicode_GetSize/PyUnicode_GET_SIZE Message-ID: Bugs item #465342, was opened at 2001-09-26 12:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465342&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: PyUnicode_GetSize/PyUnicode_GET_SIZE Initial Comment: While rewriting Zopes splitter to understand I run into the following problem: PyUnicode_GetSize() returns -1 for Py_Unicode object. PyUnicode_GET_SIZE() returns 7536745 for the same object. PyUnicode *doc; PyArg_ParseTuple(args,"u", &doc); printf("%ld\n", PyUnicode_GetSize(doc)); printf("%ld\n", PyUnicode_GET_SIZE(doc)); Env: Linux i386, gcc-2.96, Python-2.1.1 Andreas ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465342&group_id=5470 From noreply@sourceforge.net Thu Sep 27 01:13:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 17:13:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths Message-ID: Bugs item #465447, was opened at 2001-09-26 17:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 Category: Windows Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Andrew Bennetts (spiv) Assigned to: Tim Peters (tim_one) Summary: os.makedirs can fail with UNC paths Initial Comment: Calling os.makedirs('//remote/path/that/does/not/exist/yet') can cause an "OSError: [Errno 22] Invalid argument: '//remote'" If I map an equivalent network drive, it works fine (e.g. os.makedirs('N:/that/does/not/exist/yet')) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 From noreply@sourceforge.net Thu Sep 27 02:45:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 18:45:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-465467 ] os.unsetenv not implemented Message-ID: Bugs item #465467, was opened at 2001-09-26 18:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465467&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Naris Siamwalla (naris) Assigned to: Nobody/Anonymous (nobody) Summary: os.unsetenv not implemented Initial Comment: if os.putenv is implemented, os.unsetenv should be, too. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465467&group_id=5470 From noreply@sourceforge.net Thu Sep 27 04:07:18 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 20:07:18 -0700 Subject: [Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths Message-ID: Bugs item #465447, was opened at 2001-09-26 17:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 >Category: Documentation Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Andrew Bennetts (spiv) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: os.makedirs can fail with UNC paths Initial Comment: Calling os.makedirs('//remote/path/that/does/not/exist/yet') can cause an "OSError: [Errno 22] Invalid argument: '//remote'" If I map an equivalent network drive, it works fine (e.g. os.makedirs('N:/that/does/not/exist/yet')) ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-26 20:07 Message: Logged In: YES user_id=31435 It's hard to know whether to call this a doc bug or a feature request -- it's something of both. Calling it a doc bug for now and reassigning to Fred. Lots of things don't work with UNC paths, starting with ntpath.split() (the immediate cause of the failure reported here). The only functions we have that understand UNC paths are path.splitunc(), and the only one that calls it, path.ismount() (which isn't called by anything else). Until someone contributes code and test cases to make everything else UNC-aware, we should document that sundry os. and os.path functions don't work with UNC paths correctly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 From noreply@sourceforge.net Thu Sep 27 15:36:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 07:36:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-465673 ] pthreads need signal protection Message-ID: Bugs item #465673, was opened at 2001-09-27 07:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 Category: Threads Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: pthreads need signal protection Initial Comment: I've been playing around with Python and threads, and I've noticed some odd and often unstable behavior. In particular, on my Solaris 8 box I can get Python 1.5.2, 1.6, 2.0, or 2.1 to core dump every time with the following sequence. I've also seen this happen on Solaris 6 (all UltraSPARC based): 1. Enter the following code into the interactive interpreter: -- import threading def loopingfunc(): while 1: pass threading.Thread(target=loopingfunc).start() -- 2. Send a SIGINT signal (usually Ctrl-C, your terminal settings may vary). "Keyboard Interrupt" is displayed and so far everything looks fine. 3. Now simply press the key to enter a blank line in the interpreter. For my Solaris 8 box with the GNU readline 2.2 module present, this always ends up in a core dump. It may take a while, since at this point the readline signal handler is being re-entered recursively until the stack overflows. I've described this problem in the past on Usenet, but didn't get much response. For a more complete discussion of the problem and a possible solution, see http://groups.google.com/groups?hl=en&threadm=98osml%24sul%241%40newshost.mot.com&rnum=1&prev=/groups%3Fas_ugroup%3Dcomp.lang.python%26as_uauthors%3DJason%2520Lowe (If the URL doesn't work, search groups.google.com for posts by "Jason Lowe" in comp.lang.python and view the entire thread of the result.) Upon investigation of the problem, it looks like the problem is caused by an interaction with pthreads and signals. The SIGINT signal is delivered to the thread that is performing the spin loop, NOT the thread that is in the readline() module. Because the readline module uses setjmp()/longjmp() for its signal handling, the longjmp() ends up being executed by the wrong thread with dire results. Pthreads and signals don't mix very well, so one has to be very careful to make sure everything works properly. A typical solution is to ensure signals are only delivered to one thread by masking all signals in all other threads. I believe this will be the same root cause of bug #219772 (Interactive InterPreter+ Thread -> core dump at exit). I was able to solve the problem by modifying Python/thread_pthread.h's PyThread_start_new_thread() to block all signals with pthread_sigmask() after the new thread was started. This causes all threads created by Python except the initial thread to have all signals masked. This forces signals to be delivered to the main thread. I don't believe anyone is depending on the current behavior that signals will be delivered to an indeterminate thread, so this change seems safe. However I haven't run many other Python applications that deal with threads and signals. I propose that on platforms that implement Python threads with pthreads, the code masks all signals in all threads except the initial, main thread. This will resolve the problem of signals being delivered to threads indeterminately. I think I can dig up my initial code deltas if desired, or I can always recreate them. It's just a few lines to mask signals in the thread before thread creation, then restore them afterwards. (This causes only the main thread to have signals preserved.) A side question from this is whether the thread module (or posix module?) should expose the pthread_sigmask() functionality to Python threads on a platform that uses pthreads. This would allow developers to manipulate the signal masks of the Python threads so that a particular signal can be routed to a particular thread. (They would mask this signal in all other threads except the desired thread.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 From noreply@sourceforge.net Thu Sep 27 15:40:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 07:40:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-465673 ] pthreads need signal protection Message-ID: Bugs item #465673, was opened at 2001-09-27 07:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 Category: Threads Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: pthreads need signal protection Initial Comment: I've been playing around with Python and threads, and I've noticed some odd and often unstable behavior. In particular, on my Solaris 8 box I can get Python 1.5.2, 1.6, 2.0, or 2.1 to core dump every time with the following sequence. I've also seen this happen on Solaris 6 (all UltraSPARC based): 1. Enter the following code into the interactive interpreter: -- import threading def loopingfunc(): while 1: pass threading.Thread(target=loopingfunc).start() -- 2. Send a SIGINT signal (usually Ctrl-C, your terminal settings may vary). "Keyboard Interrupt" is displayed and so far everything looks fine. 3. Now simply press the key to enter a blank line in the interpreter. For my Solaris 8 box with the GNU readline 2.2 module present, this always ends up in a core dump. It may take a while, since at this point the readline signal handler is being re-entered recursively until the stack overflows. I've described this problem in the past on Usenet, but didn't get much response. For a more complete discussion of the problem and a possible solution, see http://groups.google.com/groups?hl=en&threadm=98osml%24sul%241%40newshost.mot.com&rnum=1&prev=/groups%3Fas_ugroup%3Dcomp.lang.python%26as_uauthors%3DJason%2520Lowe (If the URL doesn't work, search groups.google.com for posts by "Jason Lowe" in comp.lang.python and view the entire thread of the result.) Upon investigation of the problem, it looks like the problem is caused by an interaction with pthreads and signals. The SIGINT signal is delivered to the thread that is performing the spin loop, NOT the thread that is in the readline() module. Because the readline module uses setjmp()/longjmp() for its signal handling, the longjmp() ends up being executed by the wrong thread with dire results. Pthreads and signals don't mix very well, so one has to be very careful to make sure everything works properly. A typical solution is to ensure signals are only delivered to one thread by masking all signals in all other threads. I believe this will be the same root cause of bug #219772 (Interactive InterPreter+ Thread -> core dump at exit). I was able to solve the problem by modifying Python/thread_pthread.h's PyThread_start_new_thread() to block all signals with pthread_sigmask() after the new thread was started. This causes all threads created by Python except the initial thread to have all signals masked. This forces signals to be delivered to the main thread. I don't believe anyone is depending on the current behavior that signals will be delivered to an indeterminate thread, so this change seems safe. However I haven't run many other Python applications that deal with threads and signals. I propose that on platforms that implement Python threads with pthreads, the code masks all signals in all threads except the initial, main thread. This will resolve the problem of signals being delivered to threads indeterminately. I think I can dig up my initial code deltas if desired, or I can always recreate them. It's just a few lines to mask signals in the thread before thread creation, then restore them afterwards. (This causes only the main thread to have signals preserved.) A side question from this is whether the thread module (or posix module?) should expose the pthread_sigmask() functionality to Python threads on a platform that uses pthreads. This would allow developers to manipulate the signal masks of the Python threads so that a particular signal can be routed to a particular thread. (They would mask this signal in all other threads except the desired thread.) ---------------------------------------------------------------------- Comment By: Jason Lowe (jasonlowe) Date: 2001-09-27 07:40 Message: Logged In: YES user_id=56897 Ack. SourceForge wants to log me out every few minutes, so I wasn't logged in when I submitted this. Sorry 'bout that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 From noreply@sourceforge.net Thu Sep 27 16:59:13 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 08:59:13 -0700 Subject: [Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths Message-ID: Bugs item #465447, was opened at 2001-09-26 17:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 Category: Documentation Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Andrew Bennetts (spiv) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: os.makedirs can fail with UNC paths Initial Comment: Calling os.makedirs('//remote/path/that/does/not/exist/yet') can cause an "OSError: [Errno 22] Invalid argument: '//remote'" If I map an equivalent network drive, it works fine (e.g. os.makedirs('N:/that/does/not/exist/yet')) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 08:59 Message: Logged In: YES user_id=6380 I find that an unsettling conclusion. Maybe we've built too much knowledge about DOS paths into our path manipulation code? It's definitely a feature request, although in the short run it's OK to update the docs. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-26 20:07 Message: Logged In: YES user_id=31435 It's hard to know whether to call this a doc bug or a feature request -- it's something of both. Calling it a doc bug for now and reassigning to Fred. Lots of things don't work with UNC paths, starting with ntpath.split() (the immediate cause of the failure reported here). The only functions we have that understand UNC paths are path.splitunc(), and the only one that calls it, path.ismount() (which isn't called by anything else). Until someone contributes code and test cases to make everything else UNC-aware, we should document that sundry os. and os.path functions don't work with UNC paths correctly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 From noreply@sourceforge.net Thu Sep 27 17:00:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 09:00:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Martin v. Löwis (loewis) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- >Comment By: Mihai Ibanescu (misa) Date: 2001-09-27 09:00 Message: Logged In: YES user_id=205865 Am I missing something? I see a lot of uses for escape in dump_string, dump_xml and such, and no import beforehand. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:45 Message: Logged In: YES user_id=21627 Why is that a bug? Every use of escape imports it before using it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Thu Sep 27 17:19:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 09:19:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths Message-ID: Bugs item #465447, was opened at 2001-09-26 17:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 Category: Documentation Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Andrew Bennetts (spiv) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: os.makedirs can fail with UNC paths Initial Comment: Calling os.makedirs('//remote/path/that/does/not/exist/yet') can cause an "OSError: [Errno 22] Invalid argument: '//remote'" If I map an equivalent network drive, it works fine (e.g. os.makedirs('N:/that/does/not/exist/yet')) ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-27 09:19 Message: Logged In: YES user_id=31435 I agree. Most of these date back to DOS days, before UNC paths existed. The newer ones (like os.makedirs) appear to have been written with (only) Unix in mind. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 08:59 Message: Logged In: YES user_id=6380 I find that an unsettling conclusion. Maybe we've built too much knowledge about DOS paths into our path manipulation code? It's definitely a feature request, although in the short run it's OK to update the docs. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-26 20:07 Message: Logged In: YES user_id=31435 It's hard to know whether to call this a doc bug or a feature request -- it's something of both. Calling it a doc bug for now and reassigning to Fred. Lots of things don't work with UNC paths, starting with ntpath.split() (the immediate cause of the failure reported here). The only functions we have that understand UNC paths are path.splitunc(), and the only one that calls it, path.ismount() (which isn't called by anything else). Until someone contributes code and test cases to make everything else UNC-aware, we should document that sundry os. and os.path functions don't work with UNC paths correctly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 From noreply@sourceforge.net Thu Sep 27 18:02:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 10:02:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Martin v. Löwis (loewis) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- >Comment By: Mihai Ibanescu (misa) Date: 2001-09-27 10:02 Message: Logged In: YES user_id=205865 I'm a dumbass. I am sorry, I was working on a file that was not what I downloaded from the CVS tree. Definitely NOTABUG and my mistake. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 09:15 Message: Logged In: YES user_id=6380 Mihai, what you are missing is that in each case there is a line "from cgi import escape" which makes the function available to the local scope. I conclude this is not a bug, unless you can show is some sample code that crashes because of this. ---------------------------------------------------------------------- Comment By: Mihai Ibanescu (misa) Date: 2001-09-27 09:00 Message: Logged In: YES user_id=205865 Am I missing something? I see a lot of uses for escape in dump_string, dump_xml and such, and no import beforehand. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:45 Message: Logged In: YES user_id=21627 Why is that a bug? Every use of escape imports it before using it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Sun Sep 23 23:00:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 15:00:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-463840 ] Missing initialization code in weakref Message-ID: Bugs item #463840, was opened at 2001-09-22 09:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463840&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Brian Quinlan (bquinlan) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Missing initialization code in weakref Initial Comment: The weak reference example given on: http://www.python.org/doc/current/lib/weakref- extension.html Should point of that the weak reference list should be initialized to NULL during object construction. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-23 15:00 Message: Logged In: YES user_id=3066 This is clearly stated in the first sentence of the second paragraph of the section "Weak References in Extension Types." ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463840&group_id=5470 From noreply@sourceforge.net Wed Sep 26 18:47:37 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 10:47:37 -0700 Subject: [Python-bugs-list] [ python-Bugs-464423 ] _socket problem on solaris Message-ID: Bugs item #464423, was opened at 2001-09-24 07:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 Category: Build Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Bent Nagstrup Terp (bentterp) >Assigned to: Martin v. Löwis (loewis) Summary: _socket problem on solaris Initial Comment: I can't get the _socket module to build on solaris 8 with gcc 2.95.3 The compilation doesn't produce any errors, only lots of "warning: function declaration isn't a prototype", mainly from openssl header files, but also some from socketmodule.c itself: /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_socket': /root/Python-2.1.1/Modules/socketmodule.c:1921: warning: function declaration isn't a prototype /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_fromfd': /root/Python-2.1.1/Modules/socketmodule.c:1959: warning: function declaration isn't a prototype But as they are only warnings and not errors, compilation succeeds: building '_socket' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_SSL=1 -I/usr/local/ssl/include -I. -I/root/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /root/Python-2.1.1/Modules/socketmodule.c -o build/temp.solaris-2.8-sun4u-2.1/socketmodule.o gcc -shared build/temp.solaris-2.8-sun4u-2.1/socketmodule.o -L/usr/local/ssl/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.solaris-2.8-sun4u-2.1/_socket.so The socket library is being referenced in the toplevel Makefile: LIBS= -lpthread -lsocket -lnsl -ldl -lthread The errors only start to show up during 'make test': test_asynchat Exception in thread Thread-1: Traceback (most recent call last): File "/root/Python-2.1.1/Lib/threading.py", line 378, in __bootstrap self.run() File "./Lib/test/test_asynchat.py", line 12, in run sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) AttributeError: 'socket' module has no attribute 'socket' test test_asynchat crashed -- exceptions.AttributeError: 'socket' module has no attribute 'AF_INET' test test_socket crashed -- exceptions.AttributeError: 'socket' module has no attribute 'error' Is there any other information that I could provide to help? with kind regards, Bent Nagstrup Terp Systemadministrator Center for Genomics and Bioinformatics Karolinska Instituttet von Eulers Väg 8 171 77 Stockholm, Sweden ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 10:44 Message: Logged In: YES user_id=21627 Try 'import _socket' and report what that does. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 From noreply@sourceforge.net Wed Sep 26 17:00:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 09:00:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-465045 ] base n integer to string conversion Message-ID: Bugs item #465045, was opened at 2001-09-25 18:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: base n integer to string conversion Initial Comment: I see that the C files for int and long arithmetic already contain format() functions to format the numbers in arbitrary bases. The Python-exported decimal and hex conversion routines simply call the format function. I have three suggestions/requests, in increasing order of controversy: 1) How about exporting the format routine to Python, so there's a builtin function for converting an integer object to an arbitrary base 2<=b<=36. The code is already there--may as well let people use it. Something like format(n,base) would be a simple interface. 2) Right now there's no simple way to convert an integer to a raw byte string. I end up doing something like a = binascii.unhexlify("%x"%n) which is a kludge. I'd like to propose that as a special case, format(n,256) give the raw bytes. 3) Finally, if it's not too weird, format(n,128) could possibly return the BER (base 128) encoded representation of n, similar to pack("w",n) in perl. Bit 8 (the high bit) is set in each byte except the last. That means you can read BER integers byte by byte and know where they end. They're used in various security objects like X509 certificates. If not here, then sooner or later this function should appear in some library module. Thanks Paul ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-26 09:00 Message: Logged In: YES user_id=31435 1) Base 2 is semi-frequently requested. Note that Greg Wilson has open patch 455076 to add %b format and bin() function. No non-binary base has any fans. 2) I expect Paul means unbounded ints (based on previous requests). 3) Yup. Jeremy's Pisces may already deal w/ this (found via Google search). 3') Pickle already represents ints < 256 in one byte, and less than 2**16 in 2 (plus a 1-byte type code, of course). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-26 06:38 Message: Logged In: YES user_id=6380 1) Which bases besides 8, 10 and 16 do you plan to use? The C code strikes me as more general than needed. 2) You can do this with the struct module. No need for kludges. 3) BER seems pretty esoteric. The binascii module seems the right place. Feel free to submit a patch! ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2001-09-25 18:45 Message: Logged In: YES user_id=72053 One minor comment: besides representing longs, BER encoded integers are also good for small integers. Numbers < 128 are represented in one byte. If short strings were marshalled with a BER-encoded length instead of a 4-byte length, that could save some space in .pyc files and pickled objects. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465045&group_id=5470 From noreply@sourceforge.net Tue Sep 25 00:20:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 16:20:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-226766 ] popen('python -c"...."') tends to hang Message-ID: Bugs item #226766, was opened at 2000-12-24 08:08 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=226766&group_id=5470 Category: Windows Group: None Status: Open Resolution: None Priority: 5 Submitted By: michal wallace (sabren) Assigned to: Mark Hammond (mhammond) Summary: popen('python -c"...."') tends to hang Initial Comment: eg: import os os.popen('python -c"x=1;print x"').readlines() .. On my machine, using popen to call a second instance of python almost always causes python to freeze. No window pops up, but if I press alt-tab, there's an icon for w9xpopen.exe oddly: >>> os.popen('python -c"print"').readlines() and >> os.popen('python -c""').readlines() both work fine. ... This bug is different from #114780 in that it is repeatable and consistent. It happens on open, so is different from #125891. Eg: >>> proc = os.popen('python -c"x=1; print x"') will cause the crash. ---------------------------------------------------------------------- Comment By: Robert Amesz (rcamesz) Date: 2001-09-24 16:20 Message: Logged In: YES user_id=313190 Ah, well, it would seem that this is in fact the same bug I reported much later as #457466: "popenx() argument mangling hangs python". For some reason I overlooked it when posting my report, otherwise I'd have added my comments here. Sorry to add to the confusion. If you need to work around this bug (it's basically a bug in the commandline parsing), my report has information on that, as wel as a possible way of fixing it. My patched version of popen9x.exe does not hang on Win98, but 'reports' the error (reformatted to fit the margins): Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> import os >>> os.popen('python -c"x=1;print x"').read() "ARGUMENT PARSE ERROR\nThe way double quotes and spaces were used\ncaused popenx () to split the commandline.\n\nArgument count = 3\nArgument 0 = 'C:\PYTHON21\w9xpopen.exe'\nArgument 1 = 'C:\COMMAND.COM /c python -cx=1;print'\nArgument 2 = 'x'\n" >>> ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2000-12-29 03:29 Message: um..... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2000-12-28 15:34 Message: I have done lots of playing with this over the last month or so. The problem appears to be something to do with "python.exe" used as the target of such a popen command. (Ironically, we tried to use popen to capture remote Python invocations for Komodo - as I guess you are for IDLE) I have experimented with 3 "different" popen implementations: Python's, one written in Python using the win32 API directly, and one using the Netscape NSPR libraries. They all, however, end up doing the same basic thing with the same basic Windows API functions. They all behace the same WRT reading input. Python.exe (and one or 2 other exes) appear to hang when they are in an "interactive loop", and the spawning process is trying to read the input pipe. My experiements at breaking into the debugger shows Windows blocked inside the ReadFile() function. Note that Perl.exe does _not_ appear to provoke this (but Perl doesnt have a builtin interactive loop, so is harder to prove). Also note that "cmd.exe" also does _not_ provoke this - ie, both Perl.exe and cmd.exe both work fine, correctly reading and writing either pipe when the process is "interactive" So - after all this, my best guess was that there is something weird in the stdio Python uses to read stdin, and that Perl and cmd.exe both avoid this. Random, 100% speculative guess is that the "/MD" stdio is broken, but others wont be. This is as far as I got - I was going to experiment with /MD, other input techniques etc, but never got to it. It should be simple to reproduce with a simple test .exe, but alas never got to that either. I should have more time over the next few weeks. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2000-12-28 07:47 Message: Any chance you have Norton AntiVirus 2000 running? See http://sourceforge.net/bugs/?group_id=5470&func=detailbug&bug_id=114598 I've basically given up on popen for windows. :-( os.spawn*() works great though -- if you don't need to read the output. :-) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-12-24 09:40 Message: Mark, any idea? The first example also appears to hang for me consistently (W98SE). In a debug build under the debugger, breaking during the hang yields a gibberish disassembly window (i.e., it's not showing code!), so I didn't get anywhere after 5 minutes of thrashing. ---------------------------------------------------------------------- Comment By: michal wallace (sabren) Date: 2000-12-24 08:11 Message: .. er.. whoops.. It hangs/freezes, not crashes. And in fact, it occasionally returns control to python after several minutes. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=226766&group_id=5470 From noreply@sourceforge.net Sun Sep 23 05:45:08 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 21:45:08 -0700 Subject: [Python-bugs-list] [ python-Bugs-463506 ] reload(os) fails for os.environ Message-ID: Bugs item #463506, was opened at 2001-09-21 03:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 Category: Windows Group: Python 2.1.1 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mark Hammond (mhammond) Summary: reload(os) fails for os.environ Initial Comment: I used function KERNEL32::SetEnvironmentVariableA via Dynawrap.dll from http://cwashington.netreach.net/main_site/ downloads/default.asp?topic=a-m to add an new entry. Then I tested the result with a scripting host component and the new entry was shown. But not working was this: reload(os) os.environ PythonWin 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> from win32com.client import Dispatch >>> dw = Dispatch("DynamicWrapper") >>> dw.Register ("KERNEL32.DLL", "SetEnvironmentVariableA", "i=ss", "f= s", "r=l") 1 >>> dw.SetEnvironmentVariableA ("MyNewEntry", "MyNewValue") 1 >>> reload(os) >>> os.environ {'SNDSCAPE': 'C:\WINDOWS', 'CMDLINE': 'WIN', 'PATH': ' C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND', 'TEMP': 'C:\WIND OWS\TEMP', 'COMSPEC': 'C:\WINDOWS\COMMAND.COM', 'PRO MPT': '$p$g', 'WINBOOTDIR': 'C:\WINDOWS', 'WINDIR': 'C :\WINDOWS', 'TMP': 'C:\WINDOWS\TEMP'} >>> >>> sh = Dispatch("WScript.Shell") >>> for string in sh.Environment._NewEnum(): ... print string ... TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS COMSPEC=C:\WINDOWS\COMMAND.COM PATH=C:\PROGRAMME\PYTHON21 \;C:\WINDOWS;C:\WINDOWS\COMMAND CMDLINE=WIN windir=C:\WINDOWS SNDSCAPE=C:\WINDOWS MYNEWENTRY=MyNewValue >>> ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2001-09-22 21:45 Message: Logged In: YES user_id=14198 I think the SDK description Tim posted was clear that setenv does not modify the process environment. To prove this, I wrote the test code at the end (and output past it). It shows that using "::SetEnvironmentVariable()" will not have the value reflected in the CRTL (ie, getenv() will not see the new value) However, using putenv() *does* reflect the value back to the Win32 API - so GetEnvironmentVariable *does* see the value set by putenv. So I think Python is using the correct API, and can't fix the behaviour. int main() { static char buffer[128]; char * val = getenv("FOO"); printf("When starting, FOO=%s\n", val); SetEnvironmentVariable("FOO", "SetEnvironmentVariable"); GetEnvironmentVariable("FOO", buffer, sizeof (buffer)/sizeof(buffer[0])); val = buffer; printf("After set, GetEnvironmentVariable reports FOO=% s\n", val); val = getenv("FOO"); printf("After set, getenv reports FOO=%s\n", val); putenv("FOO=_putenv"); GetEnvironmentVariable("FOO", buffer, sizeof (buffer)/sizeof(buffer[0])); val = buffer; printf("After _putenv set, GetEnvironmentVariable reports FOO=%s\n", val); val = getenv("FOO"); printf("After _putenv set, getenv reports FOO=%s\n", val); return 0; } Output: When starting, FOO=(null) After set, GetEnvironmentVariable reports FOO=SetEnvironmentVariable After set, getenv reports FOO=(null) After _putenv set, GetEnvironmentVariable reports FOO=_putenv After _putenv set, getenv reports FOO=_putenv ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:33 Message: Logged In: YES user_id=6380 The reason is trivial. reload(os) doesn't magically cause reload(nt), and it's the nt module (whose source is posixmodule.c) that computes the 'environ' dictionary. I betcha a dollar that if you reload(nt) and then reload(os), the environment is fixed. But why would you want to do that? Changing os.environ should automatically call _putenv(); if it doesn't, submit a separate bug report. The MS docs are trying to explain that the environment semantics are the same as in Unix (you can't change your shell's environment, but child processes do inherit yours). In my experience envars work fine in Windows. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 17:29 Message: Logged In: YES user_id=31435 Ah! Good call. WRT VC's putenv, the MS docs say: """ _putenv and _wputenv affect only the environment that is local to the current process; you cannot use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment “segment” created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by _spawn, _exec, or system, and these new processes get any new items added by _putenv and _wputenv. """ Sounds like the msvcrt-level env functions work with a copy of the process env block captured at process creation time. As usual, a Bad Idea to try to use envars on Windows ... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-09-21 17:01 Message: Logged In: YES user_id=14198 The complaint is that when the environment is set via the win32 API, os.environ appears to not pick up the new setting. I have no idea why this is, but it is not Python's fault. Python uses the C runtime library, and there i snot much we can do about that. I don't have time to try and locate the CRTL source code and figure out why either. Marking as "Wont Fix" ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-21 14:47 Message: Logged In: YES user_id=31435 Reassigned to MarkH. I haven't figured out what the complaint is, but it looks like it has to do with the Win32 extensions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 05:00 Message: Logged In: NO This is an altenative way to change the environment: from win32com.client import Dispatch sh = Dispatch("WScript.Shell") sh.Environment['MYNEWENTRY'] = "bla-bla" print sh.Environment['MYNEWENTRY'] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:18 Message: Logged In: NO Markus_Daniel@gmx.de ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-21 03:08 Message: Logged In: NO This Bug was submitted by Markus Daniel (Spacy73) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463506&group_id=5470 From noreply@sourceforge.net Wed Sep 26 20:51:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 12:51:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-464405 ] freeze doesn't like DOS files on Linux Message-ID: Bugs item #464405, was opened at 2001-09-24 06:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 Category: Demos and Tools Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: freeze doesn't like DOS files on Linux Initial Comment: I've got a perfectly running Python program on Linux, importing some modules that were apparently written on Windows, since the files are in DOS format (carriage return + line feed at the end of lines). When I try to freeze this program, the module finder crashes on every module in DOS format claiming that there's a syntx error at the end of each line. This is not really serious, but quite annoying... Thanks. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:51 Message: Logged In: YES user_id=21627 What Python version? Could you please submit an example of one of the files it is complaining about? Since you cannot attach it to this report, it would be good if you could open a new report. When doing so, please identify yourself. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 From noreply@sourceforge.net Thu Sep 27 07:54:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 23:54:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Nobody/Anonymous (nobody) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Wed Sep 26 20:45:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 12:45:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Martin v. Löwis (loewis) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:45 Message: Logged In: YES user_id=21627 Why is that a bug? Every use of escape imports it before using it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Mon Sep 24 22:06:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 14:06:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-451217 ] Missing big chunk of extend/embed manual Message-ID: Bugs item #451217, was opened at 2001-08-15 08:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451217&group_id=5470 Category: Documentation Group: Feature Request >Status: Closed Resolution: None Priority: 6 Submitted By: Skip Montanaro (montanaro) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Missing big chunk of extend/embed manual Initial Comment: I was looking for some information on the tp_setattro slot and checked the Extending and Embedding manual. Unfortunately, the section on Type Methods seems to be truncated (both online and in the ext.tex source). It indicates that each slot in the type object will be discussed, but the section ends abruptly after saying it will discuss the basic type methods. Check here for the online example: http://www.python.org/doc/ext/dnt-type-methods.html Also, it appears that some of the slot names have changed since this text was written. I can update those bits, but need the help of someone better versed in the Python core to add explanations of the various fields. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-24 14:06 Message: Logged In: YES user_id=3066 Closing; this just tells me it's incomplete, which we've always said is the case. (Yes, we'll still work on it! I'm just getting the bug report out of the way.) ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-08-15 12:15 Message: Logged In: YES user_id=3066 Nothing has been dropped, it just hasn't been completed. I've just checked in a contribution which helps fill in the discussion of many commonly used slots, but it's still far from complete. (Doc/ext/ext.tex revision 1.103) I'm marking this as a feature request and dropping the priority since the documentation is not providing incorrect information, just not enough information. You can also look for related information in the last chapter of the Python/C API reference. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-08-15 09:05 Message: Logged In: YES user_id=44345 I retract my supposition that some slot names have changed. There are some new ones, but none of the existing ones changed names. My apologies... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451217&group_id=5470 From noreply@sourceforge.net Mon Sep 24 15:37:54 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 07:37:54 -0700 Subject: [Python-bugs-list] [ python-Bugs-464423 ] _socket problem on solaris Message-ID: Bugs item #464423, was opened at 2001-09-24 07:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 Category: Build Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Bent Nagstrup Terp (bentterp) Assigned to: Nobody/Anonymous (nobody) Summary: _socket problem on solaris Initial Comment: I can't get the _socket module to build on solaris 8 with gcc 2.95.3 The compilation doesn't produce any errors, only lots of "warning: function declaration isn't a prototype", mainly from openssl header files, but also some from socketmodule.c itself: /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_socket': /root/Python-2.1.1/Modules/socketmodule.c:1921: warning: function declaration isn't a prototype /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_fromfd': /root/Python-2.1.1/Modules/socketmodule.c:1959: warning: function declaration isn't a prototype But as they are only warnings and not errors, compilation succeeds: building '_socket' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_SSL=1 -I/usr/local/ssl/include -I. -I/root/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /root/Python-2.1.1/Modules/socketmodule.c -o build/temp.solaris-2.8-sun4u-2.1/socketmodule.o gcc -shared build/temp.solaris-2.8-sun4u-2.1/socketmodule.o -L/usr/local/ssl/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.solaris-2.8-sun4u-2.1/_socket.so The socket library is being referenced in the toplevel Makefile: LIBS= -lpthread -lsocket -lnsl -ldl -lthread The errors only start to show up during 'make test': test_asynchat Exception in thread Thread-1: Traceback (most recent call last): File "/root/Python-2.1.1/Lib/threading.py", line 378, in __bootstrap self.run() File "./Lib/test/test_asynchat.py", line 12, in run sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) AttributeError: 'socket' module has no attribute 'socket' test test_asynchat crashed -- exceptions.AttributeError: 'socket' module has no attribute 'AF_INET' test test_socket crashed -- exceptions.AttributeError: 'socket' module has no attribute 'error' Is there any other information that I could provide to help? with kind regards, Bent Nagstrup Terp Systemadministrator Center for Genomics and Bioinformatics Karolinska Instituttet von Eulers Väg 8 171 77 Stockholm, Sweden ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 From noreply@sourceforge.net Tue Sep 25 15:42:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 07:42:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Tim Peters (tim_one) Summary: types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- >Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-25 07:42 Message: Logged In: YES user_id=12800 I was doing the type checking in the unittest for [c]StringIO. Only that and introspection modules will probably ever need to do such type checking. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-25 06:43 Message: Logged In: YES user_id=6380 Assigned to Tim -- another set of brains might help here. :-) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:56 Message: Logged In: YES user_id=6380 None of the new stuff is documented. I have a TO DO item for that myself. If you're doing type tests on callable-iterator instances something's wrong anyway; I suggest to remove the FunctionIterType. (Not all the new types have been added to types, and I'm not sure that they should be.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Sun Sep 23 11:26:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 03:26:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-462710 ] Python 2.2a3/XML leaks memory Message-ID: Bugs item #462710, was opened at 2001-09-18 16:56 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 Category: XML Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jeffrey Chang (jchang) Assigned to: Martin v. Löwis (loewis) Summary: Python 2.2a3/XML leaks memory Initial Comment: I'm running Python 2.2a3 on solaris 2.6 with expat 1.2. The following bit of code leaks a ton of memory. Within 5 seconds, it's used up 50Mb of memory. -------- from xml import sax from xml.sax import handler print sax.make_parser().__doc__ while 1: parser = sax.make_parser() parser.setContentHandler(handler.ContentHandler()) parser.feed("hello!") -------- Python 2.1 in the same environment seems to leak little or no memory. I tried compiling Python 2.2a3 with an older version of pyexpat, 1.45 (the one that comes with Python 2.1) and using Python 2.1's xml package, but it still leaks. The problem may be somewhere outside the XML package. I looked through the release notes for 2.2, but could find nothing obvious. This seems to be different from bug #416288 "infrequent memory leak in pyexpat", in that it leaks memory quite severely and not on an exceptional error condition. Thanks, Jeff ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-23 03:26 Message: Logged In: YES user_id=21627 This is fixed in pyexpat.c 2.51. The problem was that the garbage collection APIs in Python have changed, so that expat parsers were no longer collected. Please note that it is better to invoke the parser's close method, to avoid relying on garbage collection. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462710&group_id=5470 From noreply@sourceforge.net Wed Sep 26 18:47:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 10:47:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Mihai Ibanescu (misa) >Assigned to: Martin v. Löwis (loewis) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Mon Sep 24 14:41:59 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 24 Sep 2001 06:41:59 -0700 Subject: [Python-bugs-list] [ python-Bugs-464405 ] freeze doesn't like DOS files on Linux Message-ID: Bugs item #464405, was opened at 2001-09-24 06:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 Category: Demos and Tools Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: freeze doesn't like DOS files on Linux Initial Comment: I've got a perfectly running Python program on Linux, importing some modules that were apparently written on Windows, since the files are in DOS format (carriage return + line feed at the end of lines). When I try to freeze this program, the module finder crashes on every module in DOS format claiming that there's a syntx error at the end of each line. This is not really serious, but quite annoying... Thanks. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 From noreply@sourceforge.net Thu Sep 27 04:58:58 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 20:58:58 -0700 Subject: [Python-bugs-list] [ python-Bugs-465502 ] urllib2: urlopen unicode problem Message-ID: Bugs item #465502, was opened at 2001-09-26 20:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: John Quigley (jmquigs) Assigned to: Nobody/Anonymous (nobody) Summary: urllib2: urlopen unicode problem Initial Comment: It seems like urlopen doesn't like unicode strings for urls: Python 2.1.1 (#1, Jul 23 2001, 22:08:25) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import urllib2 >>> url = u"http://www.yahoo.com" >>> urllib2.urlopen(url) Traceback (most recent call last): File "", line 1, in ? File "/home/john/python-install/lib/python2.1/urllib2.py", line 135, in urlopen return _opener.open(url, data) File "/home/john/python-install/lib/python2.1/urllib2.py", line 310, in open assert isinstance(req, Request) # really only care about interface AssertionError One fix which seems to work is to add: or type(fullurl) == types.UnicodeType to the if on line 303 (Matrix!!!) of urllib2.py. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 From noreply@sourceforge.net Wed Sep 26 18:20:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 10:20:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Thu Sep 27 17:15:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 09:15:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Martin v. Löwis (loewis) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 09:15 Message: Logged In: YES user_id=6380 Mihai, what you are missing is that in each case there is a line "from cgi import escape" which makes the function available to the local scope. I conclude this is not a bug, unless you can show is some sample code that crashes because of this. ---------------------------------------------------------------------- Comment By: Mihai Ibanescu (misa) Date: 2001-09-27 09:00 Message: Logged In: YES user_id=205865 Am I missing something? I see a lot of uses for escape in dump_string, dump_xml and such, and no import beforehand. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:45 Message: Logged In: YES user_id=21627 Why is that a bug? Every use of escape imports it before using it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Tue Sep 25 14:45:12 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 06:45:12 -0700 Subject: [Python-bugs-list] [ python-Bugs-422686 ] sys.path initialization in embedded Pyth Message-ID: Bugs item #422686, was opened at 2001-05-09 09:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Frederic Giacometti (giacometti) Assigned to: Guido van Rossum (gvanrossum) Summary: sys.path initialization in embedded Pyth Initial Comment: Context: ====== Python 2.1 final release, working with build from source (c:\program files\python does not exist), and PYTHONHOME is set to point to the root source directory (c:\local\src\Python-2.1). Problem shows up on Windows (other platforms?) Problem: ====== The directory of the executable (which is not python.exe) shows up in second position in sys.path. Ex: == When the process executable (__argv value) is c:\jdk1.3.0_02\bin\java.exe, I get: sys.path = ['c:\local\src\jpe', 'c:\local\src\python-2.1\dlls', 'c:\local\src\python-2.1\lib', 'c:\local\src\python-2.1\lib\plat-win', 'c:\local\src\python-2.1\lib\lib-tk', 'c:\jdk1.3.0_02\bin', 'c:\local\src\python-2.1'] Note: === If PYTHONHOME is not set in the environment, I get a 'site module not found' message upon Python initialization, and then a corrupted import behavior, with corrupted values in sys.modules. Maybe the Python VM should exit right away when the site module cannot be imported, instead of going on and working with a corrupted sys.modules list. I did not have this problem on Python 1.5.2. I looked at the sys.path initialization C code (getpath() function, windows-specific code...); the code seems quite complex, and I could not trace easily where the executable's directory was picked up. By default of finding the source of the problem, an external fix could be a rule of the kind: Do not add the executable directory to sys.path when the executable basename not in (python, python.exe). Frederic Giacometti ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 09:40 Message: Logged In: YES user_id=93657 I'll try to trace the problem on Windows - but I only have Unix boxes on the client site where I work this month; I have to do it at home, and my wife now gets mad at me any time she sees an xemacs window on my laptop :((. I completely agree with the 'python -i' thing :)) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-17 08:32 Message: Logged In: YES user_id=6380 Strange. I cannot reproduce this on Unix. Can you run your test program under the debugger on Windows to see where sys.path is modfied? Let's forget about -i; if Java is doing some low-level messing with stdin, you can't really blame Python if it goes wrong! ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-17 08:20 Message: Logged In: YES user_id=93657 I'm attaching a simple test program and its Makefile, for build with VC++. Running 'nmake' after sourcing the VC++ environment (vcvars.bat) will do the build and print the test output. Whatever be the configuration (PYTHONPATH set, not set, current working directory...), the directory containing the executable (main.exe) will always be listed in sys.path. This is a potential problem, to the extent that one cannot make assumption on the *.py files and directories contained in the executable directory. I'm pasting below a sample run, where 'c:\local\src\testpath' shows up in sys.path (not normal), in addition ot the current working directory (c:\local\src - normal): C:\local\src\testpath>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl c:\local\src\Python\PCbuild\python21.lib main.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. main.c Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:main.exe c:\local\src\Python\PCbuild\python21.lib main.obj cd .. && testpath\main.exe ['c:\program files\python21\lib\plat-win', 'c:\program files\python21\lib ', 'c:\program files\python21\dlls', 'c:\program files\python21\lib\lib-t k', 'c:\local\src', 'c:\local\src\testpath'] PYTHONPATH=None cwd=C:\local\src C:\local\src\testpath> ----------------------------- As for 'python -i', I was giving an exemple of probelm that occurs when modifying global process ressources [here, the -i option operates a setvbuf() call on stdin; the Java VM also seems to do some operation there (modifying stdin low-level file descriptor flags), that ends up in Python syntax errors on interactive carriage return, after the Java VM is started, but only with 'python -i'...]. I was giving this as an exemple in the same vein as modifying argv[]: one cannot help that there is an unlikely, but nevertheless existing possibility that there be sometimes another library that uses the variable in the same time; and that modifying it could mess up something somewhere... Some would also quote 'Murphy's law' :)) Frederic Giacometti ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:19 Message: Logged In: YES user_id=6380 Reassigning this to me, I don't think Tim can help. Frederic, your explanations are inscrutable. "Py_Main() isn't called, but it is called." "python -i and python -i" does *what*? Who are "the guys"? Sorry, I just don't see the bug report in there. Can you provide a small test program that exhibits the problem? ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 19:16 Message: Logged In: YES user_id=93657 In this context, only the Py_Initialize (and the infamously versatile Py_ThreadInit at some point too) functions are called. Py_Main() is not called there. Py_Main() is called only in the python.PyRun.main() Java function, so that 'java python.PyRun' emulates the python command (provided as a turn around only because some Unix platform had problems finding and opening dynamically the Java shared library). But, when python is called from a regular Java program, only the standard embedded procedures are used (Py_Initialize, Py_InitThreads...). Sorry... But, who knows, maybe Java also messes up some process global data ;-\ For curiosity, in this order of things: 'python -i', and 'python -i' only yields a syntax error on the interactive carriage return right after the JVM is initialized... It sounds to me like some conflict on the stdin file descriptor flags setup (which seems only to occur with python -i).. I advised the guys to use the cmd package instead of calling python -i in their applications. I did not raise a bug report on this one... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 18:32 Message: Logged In: YES user_id=6380 PySys_SetArgv() is also called from Py_Main(). Don't you call that? (I recall we had an argument about it. :-) ---------------------------------------------------------------------- Comment By: Frederic Giacometti (giacometti) Date: 2001-09-04 17:47 Message: Logged In: YES user_id=93657 I don't call PySys_SetArgv(), so this is the default behavior. But it's true that calling PySys_SetArgv() could be a solution. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-04 11:19 Message: Logged In: YES user_id=6380 The code that inserts the directory is not in getpath() but in Python/sysmodule.c, in PySys_SetArgv(). (Most of this function is devoted to this action, in fact.) I propose that if you don't want the executable's directory in sys.argv, you don't pass it to PySys_SetArgv(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422686&group_id=5470 From noreply@sourceforge.net Sun Sep 23 22:57:10 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 14:57:10 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None >Status: Pending Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-23 14:57 Message: Logged In: YES user_id=3066 What in the base64 module needs to have documentation corrected? It sounds like the encode() and encodestring() functions should be documented as generating a trailing newline; is this correct? Set status to pending. Barry, when you respond to this request for information the issue will be re-opened and assigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:46 Message: Logged In: YES user_id=6380 Whether or not it's documented for base64, changing that will also break existing code. It's a documentation issue (unfortunately). ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Wed Sep 26 18:13:29 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 10:13:29 -0700 Subject: [Python-bugs-list] [ python-Bugs-465299 ] xmlrpclib broken Message-ID: Bugs item #465299, was opened at 2001-09-26 10:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Nobody/Anonymous (nobody) Summary: xmlrpclib broken Initial Comment: Between version 1.5 and 1.6 of Lib/xmlrpclib.py, an import from cgi import escape was removed, and now escape is no longer in the namespace. Fix is easy, put the line back. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465299&group_id=5470 From noreply@sourceforge.net Tue Sep 25 16:49:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 25 Sep 2001 08:49:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-215026 ] SSL features undocumented Message-ID: Bugs item #215026, was opened at 2000-09-21 15:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=215026&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 4 Submitted By: Martin v. Löwis (loewis) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: SSL features undocumented Initial Comment: The socket.ssl function, and the SSL objects, are not documented. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-25 08:49 Message: Logged In: YES user_id=3066 Commited patch #461337, which added the requested documentation. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2001-04-21 20:45 Message: Logged In: YES user_id=14198 Sorry, but I don't use SSL at all, so back to Fred. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-19 15:01 Message: Logged In: YES user_id=31435 Assigned to MarkH on the off chance he runs SSL on Windows. Mark, if you don't either, then nobody who runs on Windows cares about this enough to bother, so just reassign it to Fred for the doc-issue part of it. ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-04-09 07:00 Message: Logged In: YES user_id=11645 Test case is trivial: >>> a = urllib2.urlopen('https://sourceforge.net') >>> a.read(10) And see that something comes out. I can't help any more with that, I haven't seen a windows machine for longer then Tim hasn't seen a socket... Assigning back to tim -- if you can't solve it, someone more qualified them me will have to solve it. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-03-18 10:56 Message: Logged In: YES user_id=31435 Sorry, Fred, I not only know nothing about SSL, I've never even used a socket! I don't have a clue. Maybe after the docs are written, I'll know how to test it . Assigning back to Moshe, in the hope that he can at least attach a teensy test case I can run to let me know whether or not his suggestion works on Windows. But someone will also have to tell me how to *compile* with SSL support on Windows -- e.g., I sure don't have any of the #include files it's looking for when USE_SSL is #define'd. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-03-18 08:28 Message: Logged In: YES user_id=3066 Tim: Can you look at Moshe's suggestion for the SSL on Windows? Please assign back to me for the documentation issue afterwards. Thanks! ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2001-03-18 02:34 Message: Logged In: YES user_id=11645 Fred, if any of the guys in PythonLabs has some spare times and a windows machine, then inside the RAND_status() line, you should put right after the USE_EGD #endif something like #ifdef RAND_screen() #endif I don't want to make this a formal patch submission because I don't have any windows machine to test it on... (And if we make an ssl module, it should just have a RAND_* functions wrapped up and have all the smarts in socket.py/ssl.py/. I don't have cycles to work on this, but this seemed like a good place to braindump ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2000-10-12 19:41 Message: I should note that the SSL support in the socket module was discussed briefly at a PythonLabs meeting a few weeks ago in the context of a bug report complaining that the SSL code here wasn't portable to Windows. We decided that SSL support probably belonged in a separate module in the first place, so all this might change in some future release. Especially if anyone would like to fund some work on getting SSL support working across platforms. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2000-09-21 20:46 Message: Low priority for 2.0, but reasonable patches will be considered. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=215026&group_id=5470 From noreply@sourceforge.net Wed Sep 26 18:44:35 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 26 Sep 2001 10:44:35 -0700 Subject: [Python-bugs-list] [ python-Bugs-464423 ] _socket problem on solaris Message-ID: Bugs item #464423, was opened at 2001-09-24 07:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 Category: Build Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Bent Nagstrup Terp (bentterp) Assigned to: Nobody/Anonymous (nobody) Summary: _socket problem on solaris Initial Comment: I can't get the _socket module to build on solaris 8 with gcc 2.95.3 The compilation doesn't produce any errors, only lots of "warning: function declaration isn't a prototype", mainly from openssl header files, but also some from socketmodule.c itself: /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_socket': /root/Python-2.1.1/Modules/socketmodule.c:1921: warning: function declaration isn't a prototype /root/Python-2.1.1/Modules/socketmodule.c: In function `PySocket_fromfd': /root/Python-2.1.1/Modules/socketmodule.c:1959: warning: function declaration isn't a prototype But as they are only warnings and not errors, compilation succeeds: building '_socket' extension gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_SSL=1 -I/usr/local/ssl/include -I. -I/root/Python-2.1.1/./Include -I/usr/local/include -IInclude/ -c /root/Python-2.1.1/Modules/socketmodule.c -o build/temp.solaris-2.8-sun4u-2.1/socketmodule.o gcc -shared build/temp.solaris-2.8-sun4u-2.1/socketmodule.o -L/usr/local/ssl/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.solaris-2.8-sun4u-2.1/_socket.so The socket library is being referenced in the toplevel Makefile: LIBS= -lpthread -lsocket -lnsl -ldl -lthread The errors only start to show up during 'make test': test_asynchat Exception in thread Thread-1: Traceback (most recent call last): File "/root/Python-2.1.1/Lib/threading.py", line 378, in __bootstrap self.run() File "./Lib/test/test_asynchat.py", line 12, in run sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) AttributeError: 'socket' module has no attribute 'socket' test test_asynchat crashed -- exceptions.AttributeError: 'socket' module has no attribute 'AF_INET' test test_socket crashed -- exceptions.AttributeError: 'socket' module has no attribute 'error' Is there any other information that I could provide to help? with kind regards, Bent Nagstrup Terp Systemadministrator Center for Genomics and Bioinformatics Karolinska Instituttet von Eulers Väg 8 171 77 Stockholm, Sweden ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 10:44 Message: Logged In: YES user_id=21627 Try 'import _socket' and report what that does. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464423&group_id=5470 From noreply@sourceforge.net Sat Sep 22 17:56:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 22 Sep 2001 09:56:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-463737 ] types.CallableIterType Message-ID: Bugs item #463737, was opened at 2001-09-21 21:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 Category: Python Library Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Guido van Rossum (gvanrossum) Summary: types.CallableIterType Initial Comment: The types module defines a FunctionIterType, however iterators of this type have a repr that describes them as . Instances of this type return true for isinstance(it, FunctionIterType). I think types.FunctionIterType should be changed to CallableIterType since 1) this more accurately describes the type of iterator they are; 2) more closely matches what you see in the object's repr. Since this is related: None of the *IterType in the types module are documented. My recommendation is to address the point above first, then reassign to Fred for documentation. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 09:56 Message: Logged In: YES user_id=6380 None of the new stuff is documented. I have a TO DO item for that myself. If you're doing type tests on callable-iterator instances something's wrong anyway; I suggest to remove the FunctionIterType. (Not all the new types have been added to types, and I'm not sure that they should be.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463737&group_id=5470 From noreply@sourceforge.net Sun Sep 23 12:24:30 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 04:24:30 -0700 Subject: [Python-bugs-list] [ python-Bugs-463996 ] quopri RFC 2047 and hex 20 encodings Message-ID: Bugs item #463996, was opened at 2001-09-22 19:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: quopri RFC 2047 and hex 20 encodings Initial Comment: In RFC 2047, the quoted-printable (i.e. "Q") encoding allows for _ to encode hex 20. See section 4.2 of that RFC. However, quopri was written against RFC 1521 which doesn't describe hex20/underscore encoding. quopri should be updated to allow for decoding of underscore to hex 20, perhaps as a flag on the decode() and decodestring() functions. ---------------------------------------------------------------------- Comment By: Kent Engström (kente) Date: 2001-09-23 04:24 Message: Logged In: YES user_id=178855 We should not directly compare RFC 2047 and RFC 1521. RFC 1521 = Old standard, "QP for bodies" RFC 1522 = Old standard, "QP for headers" RFC 2045 = New standard, "QP for bodies" RFC 2027 = New standard, "QP for headers" The "underscore coding" is present already in RFC 1522, and absent in RFC 2045. A flag sent to the relevant functions may be the right way, but we want it to be something like "header_style", not "new_style". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 From noreply@sourceforge.net Thu Sep 27 15:09:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 07:09:21 -0700 Subject: [Python-bugs-list] [ python-Bugs-465342 ] PyUnicode_GetSize/PyUnicode_GET_SIZE Message-ID: Bugs item #465342, was opened at 2001-09-26 12:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465342&group_id=5470 Category: Unicode Group: Python 2.1.1 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: PyUnicode_GetSize/PyUnicode_GET_SIZE Initial Comment: While rewriting Zopes splitter to understand I run into the following problem: PyUnicode_GetSize() returns -1 for Py_Unicode object. PyUnicode_GET_SIZE() returns 7536745 for the same object. PyUnicode *doc; PyArg_ParseTuple(args,"u", &doc); printf("%ld\n", PyUnicode_GetSize(doc)); printf("%ld\n", PyUnicode_GET_SIZE(doc)); Env: Linux i386, gcc-2.96, Python-2.1.1 Andreas ---------------------------------------------------------------------- >Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-27 07:09 Message: Logged In: YES user_id=38388 Guido van Rossum wrote: > > (SourceForge is down.) > > > While rewriting Zopes splitter to understand > > I run into the following problem: > > PyUnicode_GetSize() returns -1 for Py_Unicode > > object. PyUnicode_GET_SIZE() returns 7536745 > > for the same object. > > > > PyUnicode *doc; > > PyArg_ParseTuple(args,"u", &doc); > > > > printf("%ld\n", PyUnicode_GetSize(doc)); > > printf("%ld\n", PyUnicode_GET_SIZE(doc)); > > > > Env: Linux i386, gcc-2.96, Python-2.1.1 > > You misunderstand the 'u' format code. It returns a pointer to a raw > array of Py_UNICODE characters, not a Python object. But > PyUnicode_GetSize() and PyUnicode_GET_SIZE() expect a Python (Unicode) > object (which has an object header etc.). Right. > You can use "u#" in the format to get the size in a second (int) argument. ... or the "U" parser marker to actually get at the PyUnicodeObject and then your code should work. > BTW I can't find a typedef for PyUnicode. Are you sure you ran this > code? ... closing the bug report. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465342&group_id=5470 From noreply@sourceforge.net Sun Sep 23 11:30:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 23 Sep 2001 03:30:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-460838 ] compilation warning from missing cast Message-ID: Bugs item #460838, was opened at 2001-09-12 01:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 Category: Extension Modules Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Dalke (dalke) Assigned to: Martin v. Löwis (loewis) Summary: compilation warning from missing cast Initial Comment: When compiling _localemodule.c under IRIX I get the warning "/usr2/people/dalke/cvses/python/dist/src/Modules/_loca lemodule.c", line 218: warning(1164): argument of type "const char *" is incompatible with parameter of type "void *" free (Py_FileSystemDefaultEncoding); There should be a cast throwing constness away to get rid of that warning. Here's a patch that doesn't have the warning Index: Modules/_localemodule.c ======================================================= ============ RCS file: /cvsroot/python/python/dist/src/Modules/_localemo dule.c,v retrieving revision 2.23 diff -c -r2.23 _localemodule.c *** Modules/_localemodule.c 2001/09/05 17:09:48 2.23 --- Modules/_localemodule.c 2001/09/12 08:04:25 *************** *** 215,221 **** if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free (Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else --- 215,221 ---- if (*codeset && (enc = PyCodec_Encoder (codeset))) { /* Release previous file encoding */ if (Py_FileSystemDefaultEncoding) ! free ((char *) Py_FileSystemDefaultEncoding); Py_FileSystemDefaultEncoding = strdup (codeset); Py_DECREF(enc); } else Andrew ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-23 03:30 Message: Logged In: YES user_id=21627 This is fixed in 2.24 of _localemodule.c. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470 From noreply@sourceforge.net Thu Sep 27 18:58:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 10:58:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Edward Kandrot (arcanelord) >Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Thu Sep 27 19:02:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 11:02:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-464405 ] freeze doesn't like DOS files on Linux Message-ID: Bugs item #464405, was opened at 2001-09-24 06:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 Category: Demos and Tools Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: freeze doesn't like DOS files on Linux Initial Comment: I've got a perfectly running Python program on Linux, importing some modules that were apparently written on Windows, since the files are in DOS format (carriage return + line feed at the end of lines). When I try to freeze this program, the module finder crashes on every module in DOS format claiming that there's a syntx error at the end of each line. This is not really serious, but quite annoying... Thanks. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 11:02 Message: Logged In: YES user_id=6380 I can reproduce this with Python 2.2 quite easily: on Linux, in the Tools/freeze directory, use the ../scripts/lfcr.py script to give hello.py CRLF line endings. Then try to freeze it. The cause is the code in the tokenizer that parses from strings, which doesn't like the \r\n line endings and doesn't throw the \r out like the code that parses from a file does. I'm tempted to request a feature that the tokenizer should be smarter when it finds a \r (e.g. just ignore it). ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-26 12:51 Message: Logged In: YES user_id=21627 What Python version? Could you please submit an example of one of the files it is complaining about? Since you cannot attach it to this report, it would be good if you could open a new report. When doing so, please identify yourself. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464405&group_id=5470 From noreply@sourceforge.net Thu Sep 27 19:08:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 11:08:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Thu Sep 27 19:08:45 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 11:08:45 -0700 Subject: [Python-bugs-list] [ python-Bugs-465502 ] urllib2: urlopen unicode problem Message-ID: Bugs item #465502, was opened at 2001-09-26 20:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: John Quigley (jmquigs) >Assigned to: Jeremy Hylton (jhylton) Summary: urllib2: urlopen unicode problem Initial Comment: It seems like urlopen doesn't like unicode strings for urls: Python 2.1.1 (#1, Jul 23 2001, 22:08:25) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import urllib2 >>> url = u"http://www.yahoo.com" >>> urllib2.urlopen(url) Traceback (most recent call last): File "", line 1, in ? File "/home/john/python-install/lib/python2.1/urllib2.py", line 135, in urlopen return _opener.open(url, data) File "/home/john/python-install/lib/python2.1/urllib2.py", line 310, in open assert isinstance(req, Request) # really only care about interface AssertionError One fix which seems to work is to add: or type(fullurl) == types.UnicodeType to the if on line 303 (Matrix!!!) of urllib2.py. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 11:08 Message: Logged In: YES user_id=6380 He's right. Assigned to Jeremy. (This is trivial, but I'd like you to look it over.) (Note to Jeremy: I'm not quite comfortable with all the isinstance() checks in your code. I'm afraid that some of these are already broken in 2.2, e.g. is_callable(). It would be better to test for specific attributes to make the distinctions or tests you need to make.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 From noreply@sourceforge.net Thu Sep 27 19:53:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 11:53:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Thu Sep 27 21:29:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 13:29:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Thu Sep 27 21:43:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 13:43:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None >Priority: 1 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Thu Sep 27 21:48:56 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 13:48:56 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library >Group: Not a Bug >Status: Closed >Resolution: Invalid >Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 00:42:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 16:42:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 04:31:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 20:31:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-27 20:31 Message: Logged In: YES user_id=31435 I don't dispute that the function can be useful. That's not enough, though, and sqrt(2L) =- 1.414... is surely more useful to more people more often than sqrt(2L) == 1L. You should investigate the crypto work already done in Python, for example http://www.amk.ca/python/code/crypto.html There are also at least 2 Python wrappers for GMP, one hosted at SourceForge and another from Marc-Andre Lemburg. If you're doing serious crypto work, you certainly want GMP. If you're just putzing around, inventing long int algorithms on your own is seriously educational <0.9 wink>. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 05:48:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 27 Sep 2001 21:48:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None >Status: Open Resolution: None Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-27 21:48 Message: Logged In: YES user_id=12800 Correct. base64.encode() and base64.encodestring() should be documented as adding a trailing newline, but only if the source string doesn't already end in a newline (i.e: base64.encodestring('hello') == base64.encodestring('hello\n') ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-23 14:57 Message: Logged In: YES user_id=3066 What in the base64 module needs to have documentation corrected? It sounds like the encode() and encodestring() functions should be documented as generating a trailing newline; is this correct? Set status to pending. Barry, when you respond to this request for information the issue will be re-opened and assigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:46 Message: Logged In: YES user_id=6380 Whether or not it's documented for base64, changing that will also break existing code. It's a documentation issue (unfortunately). ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Fri Sep 28 08:17:00 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 00:17:00 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 08:28:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 00:28:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-465502 ] urllib2: urlopen unicode problem Message-ID: Bugs item #465502, was opened at 2001-09-26 20:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: John Quigley (jmquigs) Assigned to: Jeremy Hylton (jhylton) Summary: urllib2: urlopen unicode problem Initial Comment: It seems like urlopen doesn't like unicode strings for urls: Python 2.1.1 (#1, Jul 23 2001, 22:08:25) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import urllib2 >>> url = u"http://www.yahoo.com" >>> urllib2.urlopen(url) Traceback (most recent call last): File "", line 1, in ? File "/home/john/python-install/lib/python2.1/urllib2.py", line 135, in urlopen return _opener.open(url, data) File "/home/john/python-install/lib/python2.1/urllib2.py", line 310, in open assert isinstance(req, Request) # really only care about interface AssertionError One fix which seems to work is to add: or type(fullurl) == types.UnicodeType to the if on line 303 (Matrix!!!) of urllib2.py. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:28 Message: Logged In: YES user_id=21627 For cases like this, I'd propose to use types.StringTypes until there is a common base type for both. This allows the code to continue to work even if Unicode is configured out of the compiler; the idiom then is type(fullurl) in types.StringTypes ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 11:08 Message: Logged In: YES user_id=6380 He's right. Assigned to Jeremy. (This is trivial, but I'd like you to look it over.) (Note to Jeremy: I'm not quite comfortable with all the isinstance() checks in your code. I'm afraid that some of these are already broken in 2.2, e.g. is_callable(). It would be better to test for specific attributes to make the distinctions or tests you need to make.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465502&group_id=5470 From noreply@sourceforge.net Fri Sep 28 11:56:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 03:56:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-417796 ] illegal version 1.0.2pre Message-ID: Bugs item #417796, was opened at 2001-04-20 21:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 Category: Distutils Group: None Status: Open Resolution: Fixed Priority: 5 Submitted By: Garth T Kidd (gtk) Assigned to: Thomas Heller (theller) Summary: illegal version 1.0.2pre Initial Comment: Description: The version in distutils/__init__ doesn't conform to the strict versioning guidelines in distutils/version, resulting in failure when trying to use distutils to install 4Suite (and perhaps other modules). Workaround: Hand-edit distutils/__init__.py to remove "pre". Pointers to vital stuff in code: Lib/distutils/__init__.py: __version__ = "1.0.2pre" Lib/distutils/version.py: A version number consists of two or three dot- separated numeric components, with an optional "pre- release" tag on the end. The pre-release tag consists of the letter 'a' or 'b' followed by a number. Demonstration of problem: Python 2.1 (#1, Apr 18 2001, 10:49:25) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. >>> import distutils >>> import distutils.version >>> v = distutils.version.StrictVersion (distutils.__version__) Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.1/distutils/version.py", line 42, in __init__ self.parse(vstring) File "/usr/local/lib/python2.1/distutils/version.py", line 109, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '1.0.2pre' >>> ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2001-09-28 03:56 Message: Logged In: YES user_id=11105 Seems better to close this bug, since it is fixed. Iff a python version 2.1.2 is released, someone will have to remember this one... ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2001-09-05 12:00 Message: Logged In: YES user_id=11105 I didn't close it because it should have been fixed in Python 2.1.1, just in case there will be a 2.1.2 release, where it should be fixed. Shall I close it? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 11:14 Message: Logged In: YES user_id=6380 Why is this not closed? ---------------------------------------------------------------------- Comment By: Garth T Kidd (gtk) Date: 2001-07-29 23:15 Message: Logged In: YES user_id=59803 Fixed in distutils 1.20 tagged for release with Python 2.2, meaning 4Suite et al won't install cleanly with any out-of- the-box Python 2.1. :/ If there's ever a 2.1.2, anyone want to tag this for it? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=417796&group_id=5470 From noreply@sourceforge.net Fri Sep 28 13:40:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 05:40:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 13:40:43 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 05:40:43 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 13:43:06 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 05:43:06 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:43 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 14:33:25 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 06:33:25 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-28 06:33 Message: Logged In: YES user_id=38388 I still don't see an archive on SF. Could this be caused by the same problem you reported a few days ago ? (using "u" instead of "U" in the argument parser ?). ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:43 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 14:37:28 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 06:37:28 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: Andreas Jung (ajung) Date: 2001-09-28 06:37 Message: Logged In: YES user_id=11084 *sigh* just trying to re-upload the file. The problem seems to occur somewhere in the cleanup code when die module gets deleted or unloaded. The other unicode problem is solved. ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-28 06:33 Message: Logged In: YES user_id=38388 I still don't see an archive on SF. Could this be caused by the same problem you reported a few days ago ? (using "u" instead of "U" in the argument parser ?). ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:43 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 14:45:24 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 06:45:24 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 06:45 Message: Logged In: YES user_id=6380 Also, is the algorithm more than this? while abs(n-x*x) > 2*x+1: x = (x + n/x) / 2 I see no advantage to coding that in C, since all the time goes (presumably) into the arithmetic, which is already all in C. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 20:31 Message: Logged In: YES user_id=31435 I don't dispute that the function can be useful. That's not enough, though, and sqrt(2L) =- 1.414... is surely more useful to more people more often than sqrt(2L) == 1L. You should investigate the crypto work already done in Python, for example http://www.amk.ca/python/code/crypto.html There are also at least 2 Python wrappers for GMP, one hosted at SourceForge and another from Marc-Andre Lemburg. If you're doing serious crypto work, you certainly want GMP. If you're just putzing around, inventing long int algorithms on your own is seriously educational <0.9 wink>. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 15:18:33 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 07:18:33 -0700 Subject: [Python-bugs-list] [ python-Bugs-465759 ] segmentation fault Message-ID: Bugs item #465759, was opened at 2001-09-27 11:53 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 Category: Unicode Group: Python 2.1.1 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Andreas Jung (ajung) Assigned to: M.-A. Lemburg (lemburg) Summary: segmentation fault Initial Comment: The attached tar.gz contains the source of a modified Zope splitter that accepts unicode strings. The included test.py file crashes with Python2.1.1 with a segfault. Traceback see below. It maybe a reference counting problem but I could not find any errors. I reduced the original sources of the Splitter to a small reproducable testcase. I also checked the problem against gcc-3.0.1 and gcc-2.9.6 - same behaviour. Any ideas? Andreas (gdb) bt #0 0x400e4eaa in chunk_free (ar_ptr=0x4018df00, p=0x80f8de8) at malloc.c:3152 #1 0x400e4d59 in __libc_free (mem=0x80f8df0) at malloc.c:3054 #2 0x0808acb0 in func_dealloc (op=0x80fb584) at Objects/funcobject.c:259 #3 0x08091bed in insertdict (mp=0x80f21dc, key=0x80f1980, hash=399376304, value=0x80c4cac) at Objects/dictobject.c:377 #4 0x08091e97 in PyDict_SetItem (op=0x80f21dc, key=0x80f1980, value=0x80c4cac) at Objects/dictobject.c:510 #5 0x08093eeb in _PyModule_Clear (m=0x80f1b44) at Objects/moduleobject.c:118 #6 0x08067fdb in PyImport_Cleanup () at Python/import.c:323 #7 0x0806e5bd in Py_Finalize () at Python/pythonrun.c:211 #8 0x08051e38 in Py_Main (argc=3, argv=0xbffff594) at Modules/main.c:331 #9 0x40081177 in __libc_start_main (main=0x8051a30
, argc=3, ubp_av=0xbffff594, init=0x8050e78 <_init>, fini=0x80a9810 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff58c) at ../sysdeps/generic/libc-start.c:129 ---------------------------------------------------------------------- >Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-28 07:18 Message: Logged In: YES user_id=38388 The bug is in the _index() slot: PyList_GetItem() does not increment the item's refcount for you, so you have to apply a Py_XINCREF() yourself. This is not related to the PyUnicode_Split() call in any way. Closing the report. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 06:37 Message: Logged In: YES user_id=11084 *sigh* just trying to re-upload the file. The problem seems to occur somewhere in the cleanup code when die module gets deleted or unloaded. The other unicode problem is solved. ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2001-09-28 06:33 Message: Logged In: YES user_id=38388 I still don't see an archive on SF. Could this be caused by the same problem you reported a few days ago ? (using "u" instead of "U" in the argument parser ?). ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:43 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 The archive should be available now. In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Andreas Jung (ajung) Date: 2001-09-28 05:40 Message: Logged In: YES user_id=11084 archive should be available now :-) In Sourceforge We Trust. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-28 00:17 Message: Logged In: YES user_id=21627 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465759&group_id=5470 From noreply@sourceforge.net Fri Sep 28 16:35:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 08:35:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-28 08:35 Message: Logged In: NO nevermind. i figured it out. muchas gracias. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:00:07 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:00:07 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:00 Message: Logged In: YES user_id=6380 Closing. I applied the patch from "tww-china" in the CVS. (China, what's your real/full name, so we can add it to Misc/ACKS?) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-28 08:35 Message: Logged In: NO nevermind. i figured it out. muchas gracias. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:02:04 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:02:04 -0700 Subject: [Python-bugs-list] [ python-Bugs-463330 ] binascii.b2a_base64() trailing newline Message-ID: Bugs item #463330, was opened at 2001-09-20 13:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 Category: Extension Modules Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: binascii.b2a_base64() trailing newline Initial Comment: binascii.b2a_base64() should not append a "courtesy newline". See attached patch (but the test suite should be updated too). ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-28 09:02 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/libbase64.tex revision 1.19. ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-27 21:48 Message: Logged In: YES user_id=12800 Correct. base64.encode() and base64.encodestring() should be documented as adding a trailing newline, but only if the source string doesn't already end in a newline (i.e: base64.encodestring('hello') == base64.encodestring('hello\n') ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-23 14:57 Message: Logged In: YES user_id=3066 What in the base64 module needs to have documentation corrected? It sounds like the encode() and encodestring() functions should be documented as generating a trailing newline; is this correct? Set status to pending. Barry, when you respond to this request for information the issue will be re-opened and assigned to me. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-22 10:46 Message: Logged In: YES user_id=6380 Whether or not it's documented for base64, changing that will also break existing code. It's a documentation issue (unfortunately). ---------------------------------------------------------------------- Comment By: Barry Warsaw (bwarsaw) Date: 2001-09-21 20:38 Message: Logged In: YES user_id=12800 You're right, the newline is documented in b2a_base64(). I actually hit this problem through the base64 module, which uses binascii underneath. The extra newline is implied in the example, but not really documented. I think it may also be a bit misleading to quote RFC 1521 where that RFC does not (I think) require the newline. Two options: - reassign to Fred for updating the base64 documentation about the extra newline. - get rid of the extra newline in base64 only, not in binascii. This can be accomplished by looking at the source string: if it has a trailing newline, leave one in, if it doesn't strip the extra newline from the result string. That's the solution I'll use in the email package if we don't change base64. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-21 09:06 Message: Logged In: YES user_id=6380 But won't this break working code? I believe the courtesy newline is documented. If people program around this naively, their code will break. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463330&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:04:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:04:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-28 09:04 Message: Logged In: YES user_id=119770 Albert Chin-A-Young ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:00 Message: Logged In: YES user_id=6380 Closing. I applied the patch from "tww-china" in the CVS. (China, what's your real/full name, so we can add it to Misc/ACKS?) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-28 08:35 Message: Logged In: NO nevermind. i figured it out. muchas gracias. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (china) (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:08:20 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:08:20 -0700 Subject: [Python-bugs-list] [ python-Bugs-465673 ] pthreads need signal protection Message-ID: Bugs item #465673, was opened at 2001-09-27 07:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 Category: Threads Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Guido van Rossum (gvanrossum) Summary: pthreads need signal protection Initial Comment: I've been playing around with Python and threads, and I've noticed some odd and often unstable behavior. In particular, on my Solaris 8 box I can get Python 1.5.2, 1.6, 2.0, or 2.1 to core dump every time with the following sequence. I've also seen this happen on Solaris 6 (all UltraSPARC based): 1. Enter the following code into the interactive interpreter: -- import threading def loopingfunc(): while 1: pass threading.Thread(target=loopingfunc).start() -- 2. Send a SIGINT signal (usually Ctrl-C, your terminal settings may vary). "Keyboard Interrupt" is displayed and so far everything looks fine. 3. Now simply press the key to enter a blank line in the interpreter. For my Solaris 8 box with the GNU readline 2.2 module present, this always ends up in a core dump. It may take a while, since at this point the readline signal handler is being re-entered recursively until the stack overflows. I've described this problem in the past on Usenet, but didn't get much response. For a more complete discussion of the problem and a possible solution, see http://groups.google.com/groups?hl=en&threadm=98osml%24sul%241%40newshost.mot.com&rnum=1&prev=/groups%3Fas_ugroup%3Dcomp.lang.python%26as_uauthors%3DJason%2520Lowe (If the URL doesn't work, search groups.google.com for posts by "Jason Lowe" in comp.lang.python and view the entire thread of the result.) Upon investigation of the problem, it looks like the problem is caused by an interaction with pthreads and signals. The SIGINT signal is delivered to the thread that is performing the spin loop, NOT the thread that is in the readline() module. Because the readline module uses setjmp()/longjmp() for its signal handling, the longjmp() ends up being executed by the wrong thread with dire results. Pthreads and signals don't mix very well, so one has to be very careful to make sure everything works properly. A typical solution is to ensure signals are only delivered to one thread by masking all signals in all other threads. I believe this will be the same root cause of bug #219772 (Interactive InterPreter+ Thread -> core dump at exit). I was able to solve the problem by modifying Python/thread_pthread.h's PyThread_start_new_thread() to block all signals with pthread_sigmask() after the new thread was started. This causes all threads created by Python except the initial thread to have all signals masked. This forces signals to be delivered to the main thread. I don't believe anyone is depending on the current behavior that signals will be delivered to an indeterminate thread, so this change seems safe. However I haven't run many other Python applications that deal with threads and signals. I propose that on platforms that implement Python threads with pthreads, the code masks all signals in all threads except the initial, main thread. This will resolve the problem of signals being delivered to threads indeterminately. I think I can dig up my initial code deltas if desired, or I can always recreate them. It's just a few lines to mask signals in the thread before thread creation, then restore them afterwards. (This causes only the main thread to have signals preserved.) A side question from this is whether the thread module (or posix module?) should expose the pthread_sigmask() functionality to Python threads on a platform that uses pthreads. This would allow developers to manipulate the signal masks of the Python threads so that a particular signal can be routed to a particular thread. (They would mask this signal in all other threads except the desired thread.) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:08 Message: Logged In: YES user_id=6380 I don't have Solaris access, and I can't get this to break on Linux. But I agree with your suggestion that posix threads should block signals. Are you capable of coming up with a patch that does that, in a way that is independent of the specific platform (as long as it has PTHREADS)? You may have to open a new issue in the patch manager, since SF doesn't allow after-the-fact attachments to anonymous entries. (Maybe SF logs you out whenever you quit your browser? That's what it does for me. :-) ---------------------------------------------------------------------- Comment By: Jason Lowe (jasonlowe) Date: 2001-09-27 07:40 Message: Logged In: YES user_id=56897 Ack. SourceForge wants to log me out every few minutes, so I wasn't logged in when I submitted this. Sorry 'bout that. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465673&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:10:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:10:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:10 Message: Logged In: YES user_id=6380 Ah! You're already in our ACKS file. Thanks! (Any other patches of yours that you'd like us to have a look at?) ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-09-28 09:04 Message: Logged In: YES user_id=119770 Albert Chin-A-Young ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:00 Message: Logged In: YES user_id=6380 Closing. I applied the patch from "tww-china" in the CVS. (China, what's your real/full name, so we can add it to Misc/ACKS?) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-28 08:35 Message: Logged In: NO nevermind. i figured it out. muchas gracias. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:14:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:14:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-419062 ] python 2.1 : building pbs on AIX 4.3.2 Message-ID: Bugs item #419062, was opened at 2001-04-25 23:59 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 Category: Build Group: Platform-specific Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: python 2.1 : building pbs on AIX 4.3.2 Initial Comment: I met what could be called "regression"? problems : the "make all" process stopped at the beginning of the building of the shared modules under AIX 4.3.2. 1. it is looking for a "ld_so_aix" under the destination directory (${prefix}/lib/python2.1}) ... which, for an obvious reason is not there during the compiling phase 2. if you try to force the process by creating the directory and putting the "so needed" program in it, a new stop occurs : it is unable to find the "Python.exp" or whatever other *.exp file needed by the linking process Those problems didn't occur during the build of python 2.0 wich has been compiled fine under AIX 4.3.2 ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-09-28 09:14 Message: Logged In: YES user_id=119770 Not yet. I'll send a patch for #210665 tomorrow night. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:10 Message: Logged In: YES user_id=6380 Ah! You're already in our ACKS file. Thanks! (Any other patches of yours that you'd like us to have a look at?) ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-09-28 09:04 Message: Logged In: YES user_id=119770 Albert Chin-A-Young ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:00 Message: Logged In: YES user_id=6380 Closing. I applied the patch from "tww-china" in the CVS. (China, what's your real/full name, so we can add it to Misc/ACKS?) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-28 08:35 Message: Logged In: NO nevermind. i figured it out. muchas gracias. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-27 11:08 Message: Logged In: NO Sorry for my ignorance, but can someone tell me how to apply a python patch (or point me to the doc that explains how)? ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-09-26 10:20 Message: Logged In: YES user_id=119770 Oops. We accidentally deleted it. It's back now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-26 09:58 Message: Logged In: NO Does anyone know where else this patch can be found? ---------------------------------------------------------------------- Comment By: The Written Word (Albert Chin-A- (tww-china) Date: 2001-06-14 03:47 Message: Logged In: YES user_id=119770 Try the patch at ftp://ftp.thewrittenword.com/outgoing/pub/python-2.1-419062.patch ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419062&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:15:34 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:15:34 -0700 Subject: [Python-bugs-list] [ python-Bugs-452747 ] New-style class instances can't be copied Message-ID: Bugs item #452747, was opened at 2001-08-18 17:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 Category: Type/class unification Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Allan Crooks (amc1) Assigned to: Guido van Rossum (gvanrossum) >Summary: New-style class instances can't be copied Initial Comment: Any class which extends either the dictionary or list types in Python 2.2a1 is both unpickable by both the pickle module and cPickle, and is uncopyable by the copy module. Oh, and I'll use this opportunity to thank Guido and everyone who's ever worked on Python for making a programming language which is absolutely wonderful to program in. :) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:15 Message: Logged In: YES user_id=6380 This is mostly fixed in CVS and 2.2a4 (out today): you can pickle new-style classes now as long as they derive from picklable classes or from, and as long as they don't use __slots__. Issues: - copy module doesn't use copy_reg, so still can't copy these - object() can't be pickled; should it? - __slots__ not supported ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-18 23:35 Message: Logged In: YES user_id=6380 Thanks :-) Regarding your bug, it's more general than what you describe even: any class derived from object except certain built-in classes are unpicklable. I have to think about this -- part of my brain says that this is how it should be, and that you can register your constructor with copy_reg to make your type picklable, and another part of my brain says that it should be supported one way or another. Changed the subject to reflect the problem better. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:16:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:16:02 -0700 Subject: [Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths Message-ID: Bugs item #465447, was opened at 2001-09-26 17:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 Category: Documentation Group: Platform-specific >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andrew Bennetts (spiv) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: os.makedirs can fail with UNC paths Initial Comment: Calling os.makedirs('//remote/path/that/does/not/exist/yet') can cause an "OSError: [Errno 22] Invalid argument: '//remote'" If I map an equivalent network drive, it works fine (e.g. os.makedirs('N:/that/does/not/exist/yet')) ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-09-28 09:16 Message: Logged In: YES user_id=3066 Added comments about UNC path non-support for os.makedirs() and the os.path module in Doc/lib/libos.tex revision 1.65 and Doc/lib/libposixpath.tex revision 1.20. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 09:19 Message: Logged In: YES user_id=31435 I agree. Most of these date back to DOS days, before UNC paths existed. The newer ones (like os.makedirs) appear to have been written with (only) Unix in mind. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 08:59 Message: Logged In: YES user_id=6380 I find that an unsettling conclusion. Maybe we've built too much knowledge about DOS paths into our path manipulation code? It's definitely a feature request, although in the short run it's OK to update the docs. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-26 20:07 Message: Logged In: YES user_id=31435 It's hard to know whether to call this a doc bug or a feature request -- it's something of both. Calling it a doc bug for now and reassigning to Fred. Lots of things don't work with UNC paths, starting with ntpath.split() (the immediate cause of the failure reported here). The only functions we have that understand UNC paths are path.splitunc(), and the only one that calls it, path.ismount() (which isn't called by anything else). Until someone contributes code and test cases to make everything else UNC-aware, we should document that sundry os. and os.path functions don't work with UNC paths correctly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470 From noreply@sourceforge.net Fri Sep 28 17:45:15 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 09:45:15 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: Nobody/Anonymous (nobody) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Fri Sep 28 18:05:32 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 10:05:32 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Tom Epperly (tepperly) >Assigned to: Tim Peters (tim_one) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 10:05 Message: Logged In: YES user_id=6380 Makes sense to me. Tim, what do you think? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Fri Sep 28 19:59:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 11:59:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-452747 ] New-style class instances can't be copied Message-ID: Bugs item #452747, was opened at 2001-08-18 17:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Allan Crooks (amc1) Assigned to: Guido van Rossum (gvanrossum) Summary: New-style class instances can't be copied Initial Comment: Any class which extends either the dictionary or list types in Python 2.2a1 is both unpickable by both the pickle module and cPickle, and is uncopyable by the copy module. Oh, and I'll use this opportunity to thank Guido and everyone who's ever worked on Python for making a programming language which is absolutely wonderful to program in. :) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 11:59 Message: Logged In: YES user_id=6380 The first two of the remaining issues are fixed in CVS (but not in 2.2a4). I don't think it's worth supporting __slots__; classes with __slots__ should write their own __reduce__ method. Therefore, I'm closing this as "fixed". ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 09:15 Message: Logged In: YES user_id=6380 This is mostly fixed in CVS and 2.2a4 (out today): you can pickle new-style classes now as long as they derive from picklable classes or from, and as long as they don't use __slots__. Issues: - copy module doesn't use copy_reg, so still can't copy these - object() can't be pickled; should it? - __slots__ not supported ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-08-18 23:35 Message: Logged In: YES user_id=6380 Thanks :-) Regarding your bug, it's more general than what you describe even: any class derived from object except certain built-in classes are unpicklable. I have to think about this -- part of my brain says that this is how it should be, and that you can register your constructor with copy_reg to make your type picklable, and another part of my brain says that it should be supported one way or another. Changed the subject to reflect the problem better. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452747&group_id=5470 From noreply@sourceforge.net Fri Sep 28 20:00:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 12:00:47 -0700 Subject: [Python-bugs-list] [ python-Bugs-442734 ] 2.2a1: New style classes and pydoc Message-ID: Bugs item #442734, was opened at 2001-07-19 05:57 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442734&group_id=5470 Category: Type/class unification Group: Python 2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Guido van Rossum (gvanrossum) Summary: 2.2a1: New style classes and pydoc Initial Comment: pydoc (and the new builtin function help) don't find new style classes in modules: File test.py: ---- class foo: pass class bar(object): pass ---- Interactive session: >>> import test >>> help(test) Help on module test: NAME test FILE /data/home/walter/test.py CLASSES foo class foo DATA __file__ = 'test.py' __name__ = 'test' ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 12:00 Message: Logged In: YES user_id=6380 This was taken care of by Tim. In 2.2a4, pydoc and inspect do a great job on new-style classes. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-07-19 06:06 Message: Logged In: YES user_id=6380 Yup, inspect needs to be taught a lesson. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442734&group_id=5470 From noreply@sourceforge.net Fri Sep 28 20:47:50 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 12:47:50 -0700 Subject: [Python-bugs-list] [ python-Bugs-466173 ] unpack TypeError unclear Message-ID: Bugs item #466173, was opened at 2001-09-28 12:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Tim Peters (tim_one) Summary: unpack TypeError unclear Initial Comment: I liked the error message in Python 2.1 better than the 2.2 error message for cases like this one: a, b = 1 It uses to say unpack non-sequence. Not is says iter() of non-sequence. Since the iter() call is hidden, I'd prefer to see it's specific error message hidden, too. To the user, it's just an error unpacking a sequeunce. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 From noreply@sourceforge.net Fri Sep 28 20:52:36 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 12:52:36 -0700 Subject: [Python-bugs-list] [ python-Bugs-466175 ] cPickle core dump Message-ID: Bugs item #466175, was opened at 2001-09-28 12:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 6 Submitted By: Jeremy Hylton (jhylton) Assigned to: Jeremy Hylton (jhylton) Summary: cPickle core dump Initial Comment: A cPickler Pickler() operating in fast mode, i.e. when Pickler().fast =1, dumps core on recursive objects. a = [] a.append(a) p = cPickle.Pickler() p.fast = 1 p.dump(a) [segfault] The fast flag indicates that pickle shouldn't keep track of object it has seen before, so it gets caught in an infinite loop if it hits a recursive object. Jim worries that fixing the segfault will slow down the fast mode, which is a big performance improvement. I think it can be solved using the same trick that we use for comparing and printing recursive objects like [[...]]. The approach is to use a simple counter to track recursive calls. Only track objects previously seen after the counter exceeds some threshhold. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 From noreply@sourceforge.net Fri Sep 28 21:00:53 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 13:00:53 -0700 Subject: [Python-bugs-list] [ python-Bugs-424002 ] sys.executable not reliable Message-ID: Bugs item #424002, was opened at 2001-05-14 11:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=424002&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Evan Simpson (evansimpson) Assigned to: Guido van Rossum (gvanrossum) Summary: sys.executable not reliable Initial Comment: I created a file test.py containing: #!/usr/local/bin/python2.1 import sys print sys.executable When I run it using the command line "/usr/local/bin/python2.1 test.py", it prints the full path to the executable. When I run it from "/usr/local", using "bin/python2.1 test.py", then I get "bin/python2.1". When I run it using "./test.py", I get a blank string. Under version 1.5.2, all of these yielded the full path to the executable. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 13:00 Message: Logged In: YES user_id=6380 I think I've fixed this in CVS now (post-2.2a4). Can you test this with the new CVS? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 12:06 Message: Logged In: YES user_id=6380 Curious. I'll look into this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=424002&group_id=5470 From noreply@sourceforge.net Fri Sep 28 21:03:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 13:03:39 -0700 Subject: [Python-bugs-list] [ python-Bugs-466173 ] unpack TypeError unclear Message-ID: Bugs item #466173, was opened at 2001-09-28 12:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Tim Peters (tim_one) Summary: unpack TypeError unclear Initial Comment: I liked the error message in Python 2.1 better than the 2.2 error message for cases like this one: a, b = 1 It uses to say unpack non-sequence. Not is says iter() of non-sequence. Since the iter() call is hidden, I'd prefer to see it's specific error message hidden, too. To the user, it's just an error unpacking a sequeunce. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 13:03 Message: Logged In: YES user_id=6380 This has been discussed before. The iter() call doesn't know that it's called from a sequence unpack, so it's hard to get the old message back. As a compromise, I suggest to change the message not to refer to iter(), but to the more abstract concept of iteration, e.g. "iteration over non-sequence". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 From noreply@sourceforge.net Fri Sep 28 21:04:57 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 13:04:57 -0700 Subject: [Python-bugs-list] [ python-Bugs-466175 ] cPickle core dump Message-ID: Bugs item #466175, was opened at 2001-09-28 12:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 6 Submitted By: Jeremy Hylton (jhylton) Assigned to: Jeremy Hylton (jhylton) Summary: cPickle core dump Initial Comment: A cPickler Pickler() operating in fast mode, i.e. when Pickler().fast =1, dumps core on recursive objects. a = [] a.append(a) p = cPickle.Pickler() p.fast = 1 p.dump(a) [segfault] The fast flag indicates that pickle shouldn't keep track of object it has seen before, so it gets caught in an infinite loop if it hits a recursive object. Jim worries that fixing the segfault will slow down the fast mode, which is a big performance improvement. I think it can be solved using the same trick that we use for comparing and printing recursive objects like [[...]]. The approach is to use a simple counter to track recursive calls. Only track objects previously seen after the counter exceeds some threshhold. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 13:04 Message: Logged In: YES user_id=6380 Go for it. I take it this relates to a customer project? Else why the priority 6? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 From noreply@sourceforge.net Fri Sep 28 22:05:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 14:05:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-466200 ] ability to specify a 'verify' script Message-ID: Bugs item #466200, was opened at 2001-09-28 14:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466200&group_id=5470 Category: Distutils Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Jon Nelson (jnelson) Assigned to: A.M. Kuchling (akuchling) Summary: ability to specify a 'verify' script Initial Comment: The following patch adds the ability to specify a 'verify' script (as used by the %verify). Treatment is exactly the same as with post_install, etc... --- bdist_rpm.py Wed Sep 12 11:42:17 2001 +++ /home/agamemnon/jnelson/bdist_rpm.py Fri Sep 28 16:09:18 2001 @@ -131,6 +131,7 @@ self.post_install = None self.pre_uninstall = None self.post_uninstall = None + self.verifyscript = None self.prep = None self.provides = None self.requires = None @@ -210,6 +211,7 @@ self.ensure_filename('post_install') self.ensure_filename('pre_uninstall') self.ensure_filename('post_uninstall') + self.ensure_filename('verifyscript') # XXX don't forget we punted on summaries and descriptions -- they # should be handled here eventually! @@ -423,6 +425,7 @@ ('post', 'post_install', None), ('preun', 'pre_uninstall', None), ('postun', 'post_uninstall', None), + ('verify', 'verifyscript', None), ] for (rpm_opt, attr, default) in script_options: ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466200&group_id=5470 From noreply@sourceforge.net Fri Sep 28 22:21:22 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 14:21:22 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-28 14:21 Message: Logged In: YES user_id=31435 Well, a correct algorithm is more than a little subtle (floating division can't work here due to overflows, and if by "/" you're thinking "//" the algorithm is incorrect), and an *efficient* correct algorithm much more so. My own long-int integral-root code is both correct and quick, and is about 500(!) lines of Python (more than half in comment blocks sketching a correctness proof). Part of that was due to the inability to compute logs of longs quickly in 2.1, in order to get a good starting guess. I fixed that in 2.2, though, by generalizing math.log(long) and math.log10(long) to generate good log approximations for longs of any magnitude. The rest is that Newton steps approximately double the number of good bits on each iteration, and in the early iterations, when you've only got a few dozen good bits, computing the Newton steps with full long precision is a monstrous waste of time (when you've only got 12 good bits, (say) hundred-thousand bit arithmetic is factors of millions slower than necessary). So an efficient algorithm scales each step to use no more precision than is justified during that step. All of which is indeed an argument not to write it in C, though: the complex logic is much easier expressed in Python. The vast bulk of the runtime is consumed by division, and that's already in C (although GMP does long division much quickker than Python does it -- and probably always will). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 06:45 Message: Logged In: YES user_id=6380 Also, is the algorithm more than this? while abs(n-x*x) > 2*x+1: x = (x + n/x) / 2 I see no advantage to coding that in C, since all the time goes (presumably) into the arithmetic, which is already all in C. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 20:31 Message: Logged In: YES user_id=31435 I don't dispute that the function can be useful. That's not enough, though, and sqrt(2L) =- 1.414... is surely more useful to more people more often than sqrt(2L) == 1L. You should investigate the crypto work already done in Python, for example http://www.amk.ca/python/code/crypto.html There are also at least 2 Python wrappers for GMP, one hosted at SourceForge and another from Marc-Andre Lemburg. If you're doing serious crypto work, you certainly want GMP. If you're just putzing around, inventing long int algorithms on your own is seriously educational <0.9 wink>. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 22:50:52 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 14:50:52 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Edward Kandrot (arcanelord) Date: 2001-09-28 14:50 Message: Logged In: YES user_id=102159 The algorithm I have was based off of a method I use to calc sqrts on paper, though I modified it to do 32 bits at a time (or the limit of floats) instead of one base10 digit. So, a 512 bit sqrt took 16 steps, with a few operations per step (I think the total code was 20-30 lines). I would be interested in the algorithm that you have, since I am always interested in performance. Could you please post it or email it to me? Thanks. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-28 14:21 Message: Logged In: YES user_id=31435 Well, a correct algorithm is more than a little subtle (floating division can't work here due to overflows, and if by "/" you're thinking "//" the algorithm is incorrect), and an *efficient* correct algorithm much more so. My own long-int integral-root code is both correct and quick, and is about 500(!) lines of Python (more than half in comment blocks sketching a correctness proof). Part of that was due to the inability to compute logs of longs quickly in 2.1, in order to get a good starting guess. I fixed that in 2.2, though, by generalizing math.log(long) and math.log10(long) to generate good log approximations for longs of any magnitude. The rest is that Newton steps approximately double the number of good bits on each iteration, and in the early iterations, when you've only got a few dozen good bits, computing the Newton steps with full long precision is a monstrous waste of time (when you've only got 12 good bits, (say) hundred-thousand bit arithmetic is factors of millions slower than necessary). So an efficient algorithm scales each step to use no more precision than is justified during that step. All of which is indeed an argument not to write it in C, though: the complex logic is much easier expressed in Python. The vast bulk of the runtime is consumed by division, and that's already in C (although GMP does long division much quickker than Python does it -- and probably always will). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 06:45 Message: Logged In: YES user_id=6380 Also, is the algorithm more than this? while abs(n-x*x) > 2*x+1: x = (x + n/x) / 2 I see no advantage to coding that in C, since all the time goes (presumably) into the arithmetic, which is already all in C. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 20:31 Message: Logged In: YES user_id=31435 I don't dispute that the function can be useful. That's not enough, though, and sqrt(2L) =- 1.414... is surely more useful to more people more often than sqrt(2L) == 1L. You should investigate the crypto work already done in Python, for example http://www.amk.ca/python/code/crypto.html There are also at least 2 Python wrappers for GMP, one hosted at SourceForge and another from Marc-Andre Lemburg. If you're doing serious crypto work, you certainly want GMP. If you're just putzing around, inventing long int algorithms on your own is seriously educational <0.9 wink>. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Fri Sep 28 23:07:51 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 15:07:51 -0700 Subject: [Python-bugs-list] [ python-Bugs-466175 ] cPickle core dump Message-ID: Bugs item #466175, was opened at 2001-09-28 12:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 6 Submitted By: Jeremy Hylton (jhylton) Assigned to: Jeremy Hylton (jhylton) Summary: cPickle core dump Initial Comment: A cPickler Pickler() operating in fast mode, i.e. when Pickler().fast =1, dumps core on recursive objects. a = [] a.append(a) p = cPickle.Pickler() p.fast = 1 p.dump(a) [segfault] The fast flag indicates that pickle shouldn't keep track of object it has seen before, so it gets caught in an infinite loop if it hits a recursive object. Jim worries that fixing the segfault will slow down the fast mode, which is a big performance improvement. I think it can be solved using the same trick that we use for comparing and printing recursive objects like [[...]]. The approach is to use a simple counter to track recursive calls. Only track objects previously seen after the counter exceeds some threshhold. ---------------------------------------------------------------------- >Comment By: Jeremy Hylton (jhylton) Date: 2001-09-28 15:07 Message: Logged In: YES user_id=31392 No customer project. It's higher than 5 because it's a core dump rather than merely incorrect behavior. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 13:04 Message: Logged In: YES user_id=6380 Go for it. I take it this relates to a customer project? Else why the priority 6? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466175&group_id=5470 From noreply@sourceforge.net Sat Sep 29 01:28:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 28 Sep 2001 17:28:05 -0700 Subject: [Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul Message-ID: Bugs item #465527, was opened at 2001-09-26 23:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 Category: Python Library Group: Not a Bug Status: Closed Resolution: Invalid Priority: 5 Submitted By: Edward Kandrot (arcanelord) Assigned to: Tim Peters (tim_one) Summary: sqrt on a long int returns invalid resul Initial Comment: n = 1881988129206079638386972394616504398071635633794173827 0076335642298885971523466548531906060650474304531738801 1303396716199692321205734031879550656996221305168759307 650257059L x = long(math.sqrt(n)) the result of this is that x is off by many orders of magnitude. There should be a sqrt function that returns a long integer result so that large integer math will work as expected. I have written this function in python, one that would set x to be the integer part of a sqrt, but the hd it was on is currently damaged. If this is determined to be an actual problem that needs to be fixed, I will submit the code in this bug (unless someone beats me to it). ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-28 17:28 Message: Logged In: YES user_id=31435 Sorry, I can't afford to get sucked into a detailed discussion of this, and sharing the code anywhere would just lead to more time drain. The heart of it is this, a correct version of Guido's stab: def longroot(n, r, g): . """Return floor(n**(1./r)), as if it infinite precision. . g must be a starting guess such that g**r > n. . """ . assert n > 0 . assert r > 1 . assert g**r > n . while 1: . delta = (n/g**(r-1) - g) / r . if delta < 0: . g += delta . else: . break . assert g**r <= n < (g+1)**r . return g Proving correctness, generating a good starting guess, optimizing to use fewer bits in early iterations, performance analysis, and specializing to r=2 are all left as exercises (some difficult). Again, if you're serious about crypto research, get one of the Python GMP wrappers. GMP has hyper-optimized bigint root extraction functions, faster than anything you're going to come up with on your own, and faster than Python will ever have (not that it has any ). ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-28 14:50 Message: Logged In: YES user_id=102159 The algorithm I have was based off of a method I use to calc sqrts on paper, though I modified it to do 32 bits at a time (or the limit of floats) instead of one base10 digit. So, a 512 bit sqrt took 16 steps, with a few operations per step (I think the total code was 20-30 lines). I would be interested in the algorithm that you have, since I am always interested in performance. Could you please post it or email it to me? Thanks. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-28 14:21 Message: Logged In: YES user_id=31435 Well, a correct algorithm is more than a little subtle (floating division can't work here due to overflows, and if by "/" you're thinking "//" the algorithm is incorrect), and an *efficient* correct algorithm much more so. My own long-int integral-root code is both correct and quick, and is about 500(!) lines of Python (more than half in comment blocks sketching a correctness proof). Part of that was due to the inability to compute logs of longs quickly in 2.1, in order to get a good starting guess. I fixed that in 2.2, though, by generalizing math.log(long) and math.log10(long) to generate good log approximations for longs of any magnitude. The rest is that Newton steps approximately double the number of good bits on each iteration, and in the early iterations, when you've only got a few dozen good bits, computing the Newton steps with full long precision is a monstrous waste of time (when you've only got 12 good bits, (say) hundred-thousand bit arithmetic is factors of millions slower than necessary). So an efficient algorithm scales each step to use no more precision than is justified during that step. All of which is indeed an argument not to write it in C, though: the complex logic is much easier expressed in Python. The vast bulk of the runtime is consumed by division, and that's already in C (although GMP does long division much quickker than Python does it -- and probably always will). ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 06:45 Message: Logged In: YES user_id=6380 Also, is the algorithm more than this? while abs(n-x*x) > 2*x+1: x = (x + n/x) / 2 I see no advantage to coding that in C, since all the time goes (presumably) into the arithmetic, which is already all in C. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 20:31 Message: Logged In: YES user_id=31435 I don't dispute that the function can be useful. That's not enough, though, and sqrt(2L) =- 1.414... is surely more useful to more people more often than sqrt(2L) == 1L. You should investigate the crypto work already done in Python, for example http://www.amk.ca/python/code/crypto.html There are also at least 2 Python wrappers for GMP, one hosted at SourceForge and another from Marc-Andre Lemburg. If you're doing serious crypto work, you certainly want GMP. If you're just putzing around, inventing long int algorithms on your own is seriously educational <0.9 wink>. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 16:42 Message: Logged In: YES user_id=102159 Actually, this is a very useful function, since it is used in crytpography and other factoring-large-number projects. Without this function, I can not see how people would use python for this work, unless they did like I did, found out where the problem was, and write my own library for it. Everyone working on crypto using python will have to write their own sqrt, as it currently stands. I would recommend adding this to some library, maybe a large integer library could be made. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-27 13:48 Message: Logged In: YES user_id=31435 Closing as a Not-A-Bug, because it's functioning as designed. The math functions convert their arguments to C doubles, so you're never going to get more than 53 bits of precision of out them. >>> >>> sqrt(n) 4.338188710978442e+86 >>> To 53 signficant bits, that's an excellent approximation, and that's all the math.* functions can hope to deliver. Wholly accurate unbounded-int sqrt, pow etc are things Python doesn't have, and it's unclear whether it should (lots of code for a tiny audience). If that's wanted, I suggest that writing a PEP is in order first. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 13:43 Message: Logged In: YES user_id=6380 The math module does all its work in double precision floating point. I believe that the precision you are asking is unobtainable using floating point: x is much larger than the number of bits retained in the mantissa of a double precision number (53 I believe). So the best error bound on n-x*x that you can get is of the order of n/2**53. The value you get for n-x*x is significantly smaller than that, so I think the math module has done the best it can. ---------------------------------------------------------------------- Comment By: Edward Kandrot (arcanelord) Date: 2001-09-27 13:29 Message: Logged In: YES user_id=102159 I am using 2.1. I saw the problem on Linux previously, but I am on a Win2k box now with these results: >>> x 433818871097844195711080363479661366933416624844037360445918 708654950711556266965073920L >>> n-x*x 579455590187726959148083548468770884154260745498744050023793 649517960092688750631137087163290051389345006612268597554742 3732078994891141758379026196586090659L Since I do not have the program to give the correct answer, I can not tell you what it is right now (until I fix my Linux HD). I can tell you it is wrong by how much larger the remainder is from the sqrt. n-x*x should be less than 2*x+1, wereas the results from above is 133570858437146139501587560404236730965976658068588390668591 16036188472L*x+151281127770264061379550826654612638192882839 13990470767939415731499169681374054240419L (ie many magnitudes of order greater than expected). I will shortly recover the algorithm that calcs sqrt correctly and post it here, so at least we can see what I was expecting as a result. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-27 10:58 Message: Logged In: YES user_id=6380 Which Python version? On which platform? In 2.1 and 2.2 I get a decent result. Assigning to Tim who usually answers these questions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470 From noreply@sourceforge.net Sun Sep 30 05:20:01 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 29 Sep 2001 21:20:01 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: Tim Peters (tim_one) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:20 Message: Logged In: YES user_id=31435 Hmm. The patch is against some older version of Python that doesn't bear much textual resemblance to current longobject.c (i.e., patch can't make head or tail of this). I believe Guido already changed PyLong_AsLong(), about 2 weeks ago, to back off to PyInt_AsLong if an int object is passed in. PyLong_AsLongLong() does not, though, and I agree it's a good idea. So I'll do that. Tom, I hope you didn't intend your "It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1)" to have more actual content than "It would be nice if people never died before they were ready to go" <0.9 wink>. But if so, we obviously can't change the behavior of code that's already been released. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 10:05 Message: Logged In: YES user_id=6380 Makes sense to me. Tim, what do you think? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Sun Sep 30 05:36:16 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 29 Sep 2001 21:36:16 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: Tim Peters (tim_one) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:36 Message: Logged In: YES user_id=31435 Oops! What Guido did in PyLong_AsLong is back off to PyInt_AsLong but only if PyInt_Check is true. What the suggested patch does is call PyInt_AsLong in *any* non-NULL case where PyLong_Check is false, and that includes dubious things like converting floats to ints. I don't think we want that, and it isn't needed for your stated goal ("'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long"). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:20 Message: Logged In: YES user_id=31435 Hmm. The patch is against some older version of Python that doesn't bear much textual resemblance to current longobject.c (i.e., patch can't make head or tail of this). I believe Guido already changed PyLong_AsLong(), about 2 weeks ago, to back off to PyInt_AsLong if an int object is passed in. PyLong_AsLongLong() does not, though, and I agree it's a good idea. So I'll do that. Tom, I hope you didn't intend your "It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1)" to have more actual content than "It would be nice if people never died before they were ready to go" <0.9 wink>. But if so, we obviously can't change the behavior of code that's already been released. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 10:05 Message: Logged In: YES user_id=6380 Makes sense to me. Tim, what do you think? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Sun Sep 30 06:12:03 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 29 Sep 2001 22:12:03 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: Tim Peters (tim_one) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-29 22:12 Message: Logged In: YES user_id=31435 PyLong_AsLongLong (and so also PyArg_ParseTuple 'L') now accepts longs and ints (but not types other than those and subclasses of those), for 2.2: Doc/ext/extending.tex; new revision: 1.3 Misc/ACKS; new revision: 1.113 Misc/NEWS; new revision: 1.260 Modules/_testcapimodule.c; new revision: 1.12 Objects/longobject.c; new revision: 1.110 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:36 Message: Logged In: YES user_id=31435 Oops! What Guido did in PyLong_AsLong is back off to PyInt_AsLong but only if PyInt_Check is true. What the suggested patch does is call PyInt_AsLong in *any* non-NULL case where PyLong_Check is false, and that includes dubious things like converting floats to ints. I don't think we want that, and it isn't needed for your stated goal ("'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long"). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:20 Message: Logged In: YES user_id=31435 Hmm. The patch is against some older version of Python that doesn't bear much textual resemblance to current longobject.c (i.e., patch can't make head or tail of this). I believe Guido already changed PyLong_AsLong(), about 2 weeks ago, to back off to PyInt_AsLong if an int object is passed in. PyLong_AsLongLong() does not, though, and I agree it's a good idea. So I'll do that. Tom, I hope you didn't intend your "It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1)" to have more actual content than "It would be nice if people never died before they were ready to go" <0.9 wink>. But if so, we obviously can't change the behavior of code that's already been released. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 10:05 Message: Logged In: YES user_id=6380 Makes sense to me. Tim, what do you think? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Sun Sep 30 06:59:44 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sat, 29 Sep 2001 22:59:44 -0700 Subject: [Python-bugs-list] [ python-Bugs-466173 ] unpack TypeError unclear Message-ID: Bugs item #466173, was opened at 2001-09-28 12:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jeremy Hylton (jhylton) Assigned to: Tim Peters (tim_one) Summary: unpack TypeError unclear Initial Comment: I liked the error message in Python 2.1 better than the 2.2 error message for cases like this one: a, b = 1 It uses to say unpack non-sequence. Not is says iter() of non-sequence. Since the iter() call is hidden, I'd prefer to see it's specific error message hidden, too. To the user, it's just an error unpacking a sequeunce. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2001-09-29 22:59 Message: Logged In: YES user_id=31435 I did both: replaced the 3 generic msgs as Guido suggested, and restored the specific msg Jeremy suggested. Objects/abstract.c; new revision: 2.82 Objects/classobject.c; new revision: 2.151 Objects/typeobject.c; new revision: 2.78 Python/ceval.c; new revision: 2.279 ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 13:03 Message: Logged In: YES user_id=6380 This has been discussed before. The iter() call doesn't know that it's called from a sequence unpack, so it's hard to get the old message back. As a compromise, I suggest to change the message not to refer to iter(), but to the more abstract concept of iteration, e.g. "iteration over non-sequence". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466173&group_id=5470 From noreply@sourceforge.net Sun Sep 30 19:28:31 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 30 Sep 2001 11:28:31 -0700 Subject: [Python-bugs-list] [ python-Bugs-466125 ] PyLong_AsLongLong works for any integer Message-ID: Bugs item #466125, was opened at 2001-09-28 09:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Closed Resolution: Fixed Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: Tim Peters (tim_one) Summary: PyLong_AsLongLong works for any integer Initial Comment: It would be nice if PyLong_AsLongLong worked more like PyInt_AsLong. When the value can be coerced into an integer, it should be. The current behavior is that PyLong_AsLongLong only works (without raising an exception) on instances of a PyLongObject. I would be far better for my application, http://www.llnl.gov/casc/components/, if PyLong_AsLongLong called PyInt_AsLong in cases where the argument is not a PyLongObject. The return value of PyInt_AsLong can safely be promoted to a long long. The end result that I would like is that an 'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long. PyArg_ParseTuple ultimately uses PyLong_AsLongLong to handle the L format code. It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1). Here is an example of how one might do this. This patch also changes the behavior of PyLong_AsLong to fall back on PyInt_AsLong. $ diff -c longobject.c~ longobject.c *** longobject.c~ Wed Jan 17 07:33:18 2001 --- longobject.c Fri Sep 28 09:42:45 2001 *************** *** 144,153 **** unsigned long x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; --- 144,156 ---- unsigned long x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); + } v = (PyLongObject *)vv; i = v->ob_size; sign = 1; *************** *** 387,395 **** LONG_LONG x, prev; int i, sign; ! if (vv == NULL || !PyLong_Check(vv)) { PyErr_BadInternalCall(); return -1; } v = (PyLongObject *)vv; --- 390,401 ---- LONG_LONG x, prev; int i, sign; ! if (vv == NULL) { PyErr_BadInternalCall(); return -1; + } + if (!PyLong_Check(vv)) { + return PyInt_AsLong(vv); } v = (PyLongObject *)vv; ---------------------------------------------------------------------- >Comment By: Tom Epperly (tepperly) Date: 2001-09-30 11:28 Message: Logged In: YES user_id=94539 Thanks to all for making the change. It will make my Python language bindings easier and better. When I spoke of changing it in past version, I did not mean to suggest time travel or some method of altering everyone's installations of previously released version. I was wondering if it could be included in future bug fix releases to previously released versions. However, this appears to be against your policy for bug fixes that I've gleaned from your WWW pages. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 22:12 Message: Logged In: YES user_id=31435 PyLong_AsLongLong (and so also PyArg_ParseTuple 'L') now accepts longs and ints (but not types other than those and subclasses of those), for 2.2: Doc/ext/extending.tex; new revision: 1.3 Misc/ACKS; new revision: 1.113 Misc/NEWS; new revision: 1.260 Modules/_testcapimodule.c; new revision: 1.12 Objects/longobject.c; new revision: 1.110 ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:36 Message: Logged In: YES user_id=31435 Oops! What Guido did in PyLong_AsLong is back off to PyInt_AsLong but only if PyInt_Check is true. What the suggested patch does is call PyInt_AsLong in *any* non-NULL case where PyLong_Check is false, and that includes dubious things like converting floats to ints. I don't think we want that, and it isn't needed for your stated goal ("'L' in a PyArg_ParseTuple call return any integer value (int or long) as a C long long"). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-29 21:20 Message: Logged In: YES user_id=31435 Hmm. The patch is against some older version of Python that doesn't bear much textual resemblance to current longobject.c (i.e., patch can't make head or tail of this). I believe Guido already changed PyLong_AsLong(), about 2 weeks ago, to back off to PyInt_AsLong if an int object is passed in. PyLong_AsLongLong() does not, though, and I agree it's a good idea. So I'll do that. Tom, I hope you didn't intend your "It would be nice to have this behavior in past versions too (i.e. 1.5.2, 2.0 and 2.1)" to have more actual content than "It would be nice if people never died before they were ready to go" <0.9 wink>. But if so, we obviously can't change the behavior of code that's already been released. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-28 10:05 Message: Logged In: YES user_id=6380 Makes sense to me. Tim, what do you think? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=466125&group_id=5470 From noreply@sourceforge.net Sun Sep 30 21:35:46 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 30 Sep 2001 13:35:46 -0700 Subject: [Python-bugs-list] [ python-Bugs-463996 ] quopri RFC 2047 and hex 20 encodings Message-ID: Bugs item #463996, was opened at 2001-09-22 19:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Barry Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: quopri RFC 2047 and hex 20 encodings Initial Comment: In RFC 2047, the quoted-printable (i.e. "Q") encoding allows for _ to encode hex 20. See section 4.2 of that RFC. However, quopri was written against RFC 1521 which doesn't describe hex20/underscore encoding. quopri should be updated to allow for decoding of underscore to hex 20, perhaps as a flag on the decode() and decodestring() functions. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-30 13:35 Message: Logged In: YES user_id=21627 I believe this bug has been fixed with patch #462190, which has been committed. If there are still open issues left, please indicate what they are, and we'll re-open the report. ---------------------------------------------------------------------- Comment By: Kent Engström (kente) Date: 2001-09-23 07:04 Message: Logged In: YES user_id=178855 See patch 464070 for a minimal decode enhancement. ---------------------------------------------------------------------- Comment By: Kent Engström (kente) Date: 2001-09-23 04:24 Message: Logged In: YES user_id=178855 We should not directly compare RFC 2047 and RFC 1521. RFC 1521 = Old standard, "QP for bodies" RFC 1522 = Old standard, "QP for headers" RFC 2045 = New standard, "QP for bodies" RFC 2027 = New standard, "QP for headers" The "underscore coding" is present already in RFC 1522, and absent in RFC 2045. A flag sent to the relevant functions may be the right way, but we want it to be something like "header_style", not "new_style". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=463996&group_id=5470 From noreply@sourceforge.net Sun Sep 30 22:43:11 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 30 Sep 2001 14:43:11 -0700 Subject: [Python-bugs-list] [ python-Bugs-465467 ] os.unsetenv not implemented Message-ID: Bugs item #465467, was opened at 2001-09-26 18:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465467&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Naris Siamwalla (naris) Assigned to: Nobody/Anonymous (nobody) Summary: os.unsetenv not implemented Initial Comment: if os.putenv is implemented, os.unsetenv should be, too. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2001-09-30 14:43 Message: Logged In: YES user_id=21627 A patch for this bug is under development in http://sourceforge.net/tracker/?group_id=5470&atid=305470&func=detail&aid=460805 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465467&group_id=5470