From noreply at sourceforge.net Mon Mar 1 01:12:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 01:13:01 2004 Subject: [ python-Bugs-774188 ] XP manifest files should be installed Message-ID: Bugs item #774188, was opened at 2003-07-19 15:49 Message generated for change (Comment added) made by limi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774188&group_id=5470 Category: Windows Group: Python 2.3 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Henk Punt (h_punt) Assigned to: Mark Hammond (mhammond) Summary: XP manifest files should be installed Initial Comment: In order for python based windows programs to use the right widget (e.g. common control) versions on XP, a manifest file must be present for both executables (python.exe and pythonw.exe). I believe Python2.2 installs these per default. If these are not present, weird graphical artifacts may show up on windows XP in tree and list controls when high-color icons are used. A sample of a manifest file ('pythonw.exe.manifest'): Python Interpreter ---------------------------------------------------------------------- Comment By: Alexander Limi (limi) Date: 2004-03-01 07:12 Message: Logged In: YES user_id=403979 I can confirm that this works fine with the cross-platform Python controller we are shipping with Plone 2.0, if that is of any use. We use Python 2.3.3 and wxPython 2.4.2.4. Stumbled over this issue when I was searching for information on Python and Manifest-files, and thought I'd add my 0.02 euros. Screenshots on http://download.limi.net/xcontroller/ if you're curious about how it looks. :) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-07-21 00:38 Message: Logged In: YES user_id=31435 I'm closing this, for lack of a sane way to proceed at this time. The http://www.python.org/cgi-bin/moinmoin/PythonQuestions link has a claim that adding a manifest file caused Tkinter to crash ... until it's clear what to do, I'm not touching this. ---------------------------------------------------------------------- Comment By: Henk Punt (h_punt) Date: 2003-07-20 10:36 Message: Logged In: YES user_id=729698 I've googled around a bit more, http://www.python.org/cgi-bin/moinmoin/PythonQuestions section '4 Windows XP look-and-feel' advises against it, apparently somebody ran into problems with this. Mark is right, we don't know what the right control library is for any program run with the python.exe interpreter. sigh, I guess for microsoft a program is only a program when it is an .exe :-(. As far as I am concerned this is also not very critical. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2003-07-20 06:40 Message: Logged In: YES user_id=14198 Welcome to .NET . I can believe this would help some GUI programs, but am hard pressed to call it critical enough to bang in 2.3 at this late stage. A concern is that how do we know the assertion about what control library we want to use is true for *all* programs hosted by our executables? ---------------------------------------------------------------------- Comment By: Henk Punt (h_punt) Date: 2003-07-20 00:25 Message: Logged In: YES user_id=729698 I may have put them there myself, It is a known problem though, lookup section '2.4.2.1 Windows XP and Python 2.2.2' of the wxpython Wiki at: http://wiki.wxpython.org/index.cgi/Frequently_20Asked_20Que stions It would not hurt to have these installed by default for the Windows platform ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-07-19 22:15 Message: Logged In: YES user_id=31435 Mark, does this mean anything to you? We've (PLabs) certainly never installed anything like this before. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774188&group_id=5470 From noreply at sourceforge.net Mon Mar 1 06:00:52 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 06:00:59 2004 Subject: [ python-Bugs-907457 ] Docs for os, popen2 omit list argument to popen2() et al Message-ID: Bugs item #907457, was opened at 2004-03-01 11:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907457&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Hoffman (hoffmanm) Assigned to: Nobody/Anonymous (nobody) Summary: Docs for os, popen2 omit list argument to popen2() et al Initial Comment: http://www.python.org/doc/current/lib/os-newstreams.html and http://www.python.org/doc/current/lib/module-popen2.html do not give any indication that you can use a list for cmd instead of a string and os.execvp() will be used instead of setting up a subshell. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907457&group_id=5470 From noreply at sourceforge.net Mon Mar 1 06:12:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 06:12:44 2004 Subject: [ python-Bugs-789262 ] __getattr__ and metaclasses Message-ID: Bugs item #789262, was opened at 2003-08-15 15:18 Message generated for change (Comment added) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789262&group_id=5470 Category: Type/class unification Group: None Status: Open Resolution: None Priority: 5 Submitted By: Gon?alo Rodrigues (grodr) Assigned to: Nobody/Anonymous (nobody) Summary: __getattr__ and metaclasses Initial Comment: This came out from a thread in comp.lang.python: Here?s the reference: http://groups.google.pt/groups?hl=pt-PT&lr=&ie=UTF- 8&threadm=md94jvccu02b9dv5890k34629rkot79roj% 404ax.com&rnum=6&prev=/groups%3Fq%3Dgon%25C3% 25A7alo%2Brodrigues%2Bgroup:comp.lang.python.*% 26hl%3Dpt-PT%26lr%3D%26ie%3DUTF-8%26group% 3Dcomp.lang.python.*%26selm% 3Dmd94jvccu02b9dv5890k34629rkot79roj% 25404ax.com%26rnum%3D6 Consider the following example (provided by M. Simionato) >>> class M(type): ... def __getattr__(self, name): ... if name == '__iter__': ... return lambda self: iter([]) ... >>> class C(object): ... __metaclass__ = M ... >>> C.__iter__ at 0x0110E8F0> >>> c = C() >>> iter(c) Traceback (most recent call last): File "", line 1, in ? TypeError: iteration over non-sequence >>> This means that the iterator machinery does not check __getattr__ (or __getattribute__ for that matter ? I have made the test). The Language Reference says: ?A class can implement certain operations that are invoked by special syntax (such as arithmetic operations or subscripting and slicing) by defining methods with special names.? Which does not throw much light on the matter at hand. So there are two ways we can view the above: (A) It?s a bug. This is the one I favour ;-). Arguing by contradiction, not being considered a bug means that there is a very special distinction being made when it comes to attribute lookup of special names. I tend to follow the Gang of Four?s main injunction ?Prefer composition to inheritance?. Composition is great in Python precisely because of the __getattr__ hook. Not being able to use __getattr__ in metaclasses to trap special names surely hampers that role somewhat. (B) It?s not a bug. Then at least I think that the documentation should be worded more accurately. Quoting A. Martelli on the same thread ?__getattr__ is not a BINDING of the special method, though it may be considered a DEFINITION of it, which is why the current phrase in the Language Reference is not 100% correct and complete -- only 99.44%, and I agree that the remaining 0.56% _is_ a delicate defect in the documentation.? With my best regards, G. Rodrigues ---------------------------------------------------------------------- >Comment By: Michael Hudson (mwh) Date: 2004-03-01 11:12 Message: Logged In: YES user_id=6656 > Metaclasses are not guilty here! It's more complicated than that. iter(o) does (roughly) o->ob_type->tp_iter(o) At class definition time, if the class defines __iter__, a wrapper for it is stuffed into the type's tp_iter slot. If it doesn't, NULL is placed there instead. What *could* be done is, if the *meta*class defines __getattr__ or __getattribute__, all the tp_ slots could be filled with a special wrapper that calls the generic attribute getter. But that would be quite a coding effort, and these classes would have pretty atrocious performance. And making this work when you assign to __getattribute__ on the metaclass would be a truly crazy piece of code. Or the docs could note this limitation. ---------------------------------------------------------------------- Comment By: Michele Simionato (michele_s) Date: 2003-08-21 11:16 Message: Logged In: YES user_id=583457 Two comments: 1. The credit for discovering this "issue" goes to Bjorn Pettersen, not to me. 2. The issue is NOT with metaclasses, the title should be "special methods and __getattr__" The metaclass works perfectly fine and X.__iter__(x) works. The problem is with the "iter" builtin, since iter(x) DOES NOT call X.__iter__(x). Same with str, len, etc. Metaclasses are not guilty here! Michele ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789262&group_id=5470 From noreply at sourceforge.net Mon Mar 1 07:10:18 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 07:10:24 2004 Subject: [ python-Bugs-835353 ] logging.StreamHandler encodes log message in UTF-8 Message-ID: Bugs item #835353, was opened at 2003-11-03 22:45 Message generated for change (Comment added) made by vsajip You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Vaclav Dvorak (vdvo) >Assigned to: Vinay Sajip (vsajip) Summary: logging.StreamHandler encodes log message in UTF-8 Initial Comment: For some reason that I do not see, logging.StreamHandler in Python 2.3 insists on writing plain non-Unicode strings to the stream, and the encoding is hard-coded as UTF-8: if not hasattr(types, "UnicodeType"): #if no unicode support... self.stream.write("%s\n" % msg) else: try: self.stream.write("%s\n" % msg) except UnicodeError: self.stream.write("%s\n" % msg.encode("UTF-8")) This behaviour is neither documented nor reasonable. Files can be perfectly able to write Unicode strings (e.g., through the use of codecs.EncodedFile or with a default encoding of sys.stdout), and even if they are not, UTF-8 is hardly the only choice for an encoding. I propose to simply replace the above code with: self.stream.write(msg) self.stream.write("\n") ---------------------------------------------------------------------- >Comment By: Vinay Sajip (vsajip) Date: 2004-03-01 12:10 Message: Logged In: YES user_id=308438 Notice that UTF-8 is only used if a UnicodeError is detected. By default, "%s\n" % msg is written to the stream using the stream's write(). If the stream can handle this without raising a UnicodeError, then UTF-8 will not be used. Is there a specific use case/test script which demonstrates a problem? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-11-05 20:30 Message: Logged In: YES user_id=21627 That would be an incompatible change, of course, as you then may get encoding errors where you currently get none. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 From noreply at sourceforge.net Mon Mar 1 08:48:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 08:48:51 2004 Subject: [ python-Bugs-899109 ] 1==float('nan') Message-ID: Bugs item #899109, was opened at 2004-02-17 21:47 Message generated for change (Comment added) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=899109&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: Fixed Priority: 3 Submitted By: Arman Bostani (arman0) Assigned to: Michael Hudson (mwh) Summary: 1==float('nan') Initial Comment: In python 2.3.1 on Linux/x86, X==float('nan') evaluates to True given any number value for X. I admit to not knowing much about IEEE arithmetic. But, is this Kosher? -arman ---------------------------------------------------------------------- >Comment By: Michael Hudson (mwh) Date: 2004-03-01 13:48 Message: Logged In: YES user_id=6656 If I'm reading the pybench tea leaves correctly, you don't have anything to worry about here. CompareFloatsIntegers is significantly faster (~30%), everything else is in the noise. Removing float_compare speeds up CompareFloatsIntegers even more (~40%, now) and has little impact on anything else. I don't believe PyObject_Compare() is a performance hotspot when the types involved implement rich comparisons. ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2004-02-26 13:09 Message: Logged In: YES user_id=38388 Michael, please be more careful about these changes: we certainly do not want to lose a significant number of cycles just to remedy this rather uncommon error situation. The cleanest solution seems to be to just raise an exception in the compare logic (which is perfectly OK). Removing the tp_compare slot will result in PyObject_Compare() to take a different path and is likely going to cause a performance hit. Whatever you chose to do about this, please make sure that we don't lose performance in float compares. pybench has a special test for float comparisons which you could use as basis for this. Thanks. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-26 12:51 Message: Logged In: YES user_id=6656 Hmm. I agree the situation wrt. float_compare as in CVS is a problem. Not sure I have the courage to have float_compare starting to set exceptions, though. Just removing float_compare seems to be a conservative change (yes, it can give silly answers, but this is nothing new). I certainly don't have the courage to change PyObject_Compare unless someone like Tim or Guido says I should :-) ---------------------------------------------------------------------- Comment By: Paul Eggert (eggert) Date: 2004-02-20 21:10 Message: Logged In: YES user_id=17848 Sorry, I didn't intend a rant, and I apologize if any offense was given. I'll try to use a milder tone henceforth. To answer Michael's question: yes, now that your patch is installed, float_compare is incompatible with rich comparison; for example cmp(NaN,1.0) returns 0 even though NaN==1.0 returns False. Another problem: cmp() initially uses pointer comparison to compare objects, so if x is a NaN then cmp(x,x) returns 0. I don't think that removing float_compare will fix the problem, as it would simply cause cmp to return an incorrect value when given a NaN. If you prefer IEEE semantics to sorting NaNs before numbers, another possibility is for cmp to raise an exception when given a NaN, since in that case cmp can't return any value that is compatible with IEEE floating point. Here's a patch to implement this proposal. It does not rely on isnan or a substitute, so I hope this answers Tim's objection. Note that PyObject_Compare needs a minor change, too; since user-defined types may have the same problem that Float does, it's simplest just to omit the optimization there. =================================================================== RCS file: Objects/floatobject.c,v retrieving revision 2.3.3.2 retrieving revision 2.3.3.3 diff -pu -r2.3.3.2 -r2.3.3.3 --- Objects/floatobject.c 2004/02/20 19:45:01 2.3.3.2 +++ Objects/floatobject.c 2004/02/20 21:04:20 2.3.3.3 @@ -367,7 +367,15 @@ float_compare(PyFloatObject *v, PyFloatO { double i = v->ob_fval; double j = w->ob_fval; - return (i < j) ? -1 : (i > j) ? 1 : 0; + if (i < j) + return -1; + if (i > j) + return 1; + if (i == j) + return 0; + PyErr_SetString(PyExc_FloatingPointError, + "cannot compare NaNs using cmp"); + return -2; } static PyObject* =================================================================== RCS file: Objects/object.c,v retrieving revision 2.3.3.0 retrieving revision 2.3.3.1 diff -pu -r2.3.3.0 -r2.3.3.1 --- Objects/object.c 2003/04/18 00:45:58 2.3.3.0 +++ Objects/object.c 2004/02/20 21:04:20 2.3.3.1 @@ -877,8 +877,6 @@ PyObject_Compare(PyObject *v, PyObject * PyErr_BadInternalCall(); return -1; } - if (v == w) - return 0; vtp = v->ob_type; compare_nesting++; if (compare_nesting > NESTING_LIMIT && ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-20 11:09 Message: Logged In: YES user_id=6656 Paul, I appreciate your attention to detail, but your last comment is essentially a rant that puts words into Tim's and my mouth. My patch (which is what got checked in) *is* attached to this report, or you can see it on the python-checkins list. There was some ancillary discussion on python-dev (under the admittedly inscrutable title of "Weekly Python Bug/Patch Summary") about this, where it was uncovered that MSVC 7.1 (which is what Python 2.4 will be compiled with) adheres to the C99 rules for comparisons involving NaNs. So with my patch, on all major platforms, float comparisons are likely to follow C99 rules in Python 2.4. We're still not going to promise anything, though. I admit to not doing much research on whether I should/could remove float_compare. It seems that perhaps I should. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-02-19 20:22 Message: Logged In: YES user_id=31435 I specifically said C89. Python doesn't require C99 support, and can't yet, because the majority of compilers used to compile Python aren't yet C99 compilers. Even in C99, that x! =x is 1 for NaN is optional behavior, depending on whether the implementation chooses to define __STDC_IEC_559__. The point of my example was solely the result of x==x. It doesn't matter how a NaN got put into x, MSVC 6 generates code that returns true regardless. It wasn't constructed to confuse anything -- to the contrary, it shows about the most straightforward way to *get* a NaN under MSVC 6, short of playing tricks with bit representation. Michael's patch is a more efficient approach regardless. If Python is to grow an isnan macro (which his patch doesn't need), then it shoiuld grow an isnan() macro that works on all platforms with 754 HW (else it appears to promise thing it can't deliver). Going on to call NaN "less than" everything else goes beyond anything C99 says, and is a debate of its own. No, he didn't remove float_compare(). He could, but only cmp () will invoke it now. ---------------------------------------------------------------------- Comment By: Paul Eggert (eggert) Date: 2004-02-19 19:55 Message: Logged In: YES user_id=17848 C99 does say what happens when NaNs are compared. See, for example, section 7.12.14, which says that NaNs are unordered with respect to other floating point values, and section 7.12.14.1, which says that x>y is equivalent to isgreater(x,y) and therefore returns false if either x or y is a NaN (unless the "invalid" floating-point exception occurs, which isn't happening here and even if it did happen the original code would be broken anyway). Your argument is that any code that uses NaNs returns garbage and so we should give up. But then you have no logical reason to either favor or oppose this patch, as it doesn't alter Python's behavior on non-NaN arguments. It's clear the the patch does fix the comparison problem on most existing platforms. It actually works on Solaris sparc, and I'm sure that it will work on a wide variety of other important platforms. The fact that you've found an incompatibility between MSVC 6 and C99 on one example does not mean that the proposed patch won't work: it merely means that MSVC 6 won't work on your example (which is deliberately constructed to confuse pre-C99 compilers). The proposed patch doesn't contain confusing code like that, so it should work even on pre-C99 compilers. I'm not speaking just from theory here. Similar code has been in GNU sort since 1999, and it works fine in practice. Since the patch fixes the bug on many (perhaps all) real platforms, and it can't introduce a bug on any platform, the patch is a win. Michael Hudson said "Consider the attached." but nothing was attached. I gather from his comments that he added rich comparisons for floats. This will work if the code never invokes the 2.3.3 float_compare -- so can I take it that he removed float_compare? ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-19 19:39 Message: Logged In: YES user_id=6656 Tim said yes. Objects/floatobject.c revision 2.127 Misc/NEWS revision 1.936 ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-19 19:01 Message: Logged In: YES user_id=6656 Consider the attached. It implements rich comparisons for floats, which makes the behaviour on linux at least very much less silly. All tests except for the considered-hopeless-on-this box audio tests and the new test_tcl pass. Even test_bsddb passed! Twice! (I'm not sure I can claim credit for this :-) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-02-19 17:34 Message: Logged In: YES user_id=31435 Sorry, the patch can't work: C89 says nothing about what happens when NaNs are compared, and it's in fact not the case across platforms that "x != x" returns 1 when x is a NaN. The most important counter-example for Python is that the following prints 1.#INF -1.#IND 1 under MSVC 6. #include void main() { double x = 1e300 * 1e300; printf("%g\n", x); x -= x; printf("%g\n", x); printf("%d\n", x == x); } ---------------------------------------------------------------------- Comment By: Paul Eggert (eggert) Date: 2004-02-19 06:39 Message: Logged In: YES user_id=17848 There's an easy fix. Python has long mishandled IEEE special values (see bugs 445484 and 737648, and see PEP 42 "Non-accidental IEEE-754 support" as well as PEP 754), and solving the problem in general will be some work. However, solving the NaN-comparison problem is easy: simply sort NaNs consistently before all numbers. This is the same algorithm that GNU "sort -g" has used for quite some time. =================================================================== RCS file: Include/pyport.h,v retrieving revision 2.3.3.0 diff -pu -r2.3.3.0 Include/pyport.h --- Include/pyport.h 2003/09/30 14:56:50 2.3.3.0 +++ Include/pyport.h 2004/02/19 06:06:10 @@ -221,6 +221,13 @@ extern "C" { #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE) #endif +/* Py_IS_NAN(X) + * Return 1 if float or double arg is not a number (NaN), else 0. + * Caution: + * X is evaluated more than once. + */ +#define Py_IS_NAN(X) ((X) != (X)) + /* Py_IS_INFINITY(X) * Return 1 if float or double arg is an infinity, else 0. * Caution: =================================================================== RCS file: Objects/floatobject.c,v retrieving revision 2.3.3.0 diff -pu -r2.3.3.0 Objects/floatobject.c --- Objects/floatobject.c 2003/06/28 20:04:24 2.3.3.0 +++ Objects/floatobject.c 2004/02/19 06:03:37 @@ -367,7 +367,21 @@ float_compare(PyFloatObject *v, PyFloatO { double i = v->ob_fval; double j = w->ob_fval; - return (i < j) ? -1 : (i > j) ? 1 : 0; + int c; + /* Because of NaNs IEEE arithmetic is not a total order. + * Python works better with total orders, so use the same + * total order that GNU sort does: NaNs sort before numbers, + * and NaNs are sorted by internal bit-pattern. + */ + return ((i < j) ? -1 + : (i > j) ? 1 + : (i == j) ? 0 + : !Py_IS_NAN(j) ? -1 /* i is NaN, j is not */ + : !Py_IS_NAN(i) ? 1 /* j is NAN, i is not */ + : /* i and j are both NaNs; compare them bitwise */ + ((c = memcmp(&v->ob_fval, &w->ob_fval, sizeof(v->ob_fval))) + < 0) ? -1 + : (c > 0)); } static long ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-18 17:46 Message: Logged In: YES user_id=6656 Man, that's strange (I see the same behaviour on my redhat 9 box with 2.3.3). I don't have time to dig right now, but if you want to, playing with equivalent C programs would be a very good start. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=899109&group_id=5470 From noreply at sourceforge.net Mon Mar 1 09:22:53 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 09:22:56 2004 Subject: [ python-Bugs-907575 ] "\textttNone" in Index Message-ID: Bugs item #907575, was opened at 2004-03-01 14:22 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Heiko Selber (drhok) Assigned to: Nobody/Anonymous (nobody) Summary: "\textttNone" in Index Initial Comment: In the index of the Python 2.3.3 documentation (as started from IDLE on Windows XP), the references to None None object NotImplemented NotImplemented object are shown as \textttNone \textttNone object \textttNotImplemented \textttNotImplemented object and are therefore at the wrong place. This is probably due to a typo. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 From noreply at sourceforge.net Mon Mar 1 23:49:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 23:49:21 2004 Subject: [ python-Bugs-897625 ] time.strftime crashes python Message-ID: Bugs item #897625, was opened at 2004-02-15 13:33 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897625&group_id=5470 Category: Python Library >Group: Python 2.4 >Status: Closed >Resolution: Fixed Priority: 7 Submitted By: Tom Lynn (tlynn) Assigned to: Brett Cannon (bcannon) Summary: time.strftime crashes python Initial Comment: On Win2k: Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.strftime("%a",(1900,1,1, 13,0,0, -3,0,-1)) Python dumps core. Is that (ever) expected behaviour? ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-01 20:49 Message: Logged In: YES user_id=357491 OK, fixed in Python 2.4 with rev. #2.140 for Modules/timemodule.c (along with changes to Doc/lib/libtime.tex as rev. 1.63, datetimemodule.c as rev. 1.70, Lib/test/test_time.py as rev. 1.16, and Lib/test/test_strftime.py as rev. 1.28). This will break some code that does not use 1 or higher for fields in the time tuple that are supposed to be set to that (month, day, and day of year), but it was felt it was better to do a complete check on all values then on only certain values so as to make it consistent. Since it breaks code it will not be backported. And yes, ashtong, more data points are always helpful. ---------------------------------------------------------------------- Comment By: Graham Ashton (ashtong) Date: 2004-02-28 08:57 Message: Logged In: YES user_id=263764 Not sure if it's helpful, but here's another data point. I get the buggy behaviour on 2.3.3 on Gentoo Linux: ratchet% python Python 2.3.3 (#1, Jan 6 2004, 09:44:50) [GCC 3.3.2 20031022 (Gentoo Linux 3.3.2-r2, propolice)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.strftime("%a",(1900,1,1, 13,0,0, -3,0,-1)) Segmentation fault ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-21 12:01 Message: Logged In: YES user_id=357491 OK, have a solution coded up, just waiting to hear from Tim on whether a change to datetime is okay with him. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-17 13:59 Message: Logged In: YES user_id=357491 Should be able to deal with this cleanly by modifying gettmarg() to do some sanity checks on the values before returning and letting time_strftime() at the struct tm that gettmarg() created. First have to check the ISO C standard, though, to make sure I don't overstep my bounds on the sanity checks (or I could just follow our own specs, but that would be too easy =). ---------------------------------------------------------------------- Comment By: Matthew Sherborne (matiu) Date: 2004-02-16 12:36 Message: Logged In: YES user_id=304464 On WinXP Home does: >>> import time >>> time.strftime("%a",(1900,1,1, 13,0,0, -3,0,-1)) '\xfcI\xc1w\xf8I\xc1w\xf4I\xc1w\xf0I\xc1w\xecI\xc1w\xe8I\xc1w\xe4I\xc1w\xdcI\xc1w\xd4I\xc1w\xccI\xc1w\xc0I\xc1w\xb4I\xc1w\xacI\xc1w\xa0I\xc1w\x9cI\xc1w\x98I\xc1w\x94I\xc1w\x90I\xc1w\x8cI\xc1w\x88I\xc1w\x84I\xc1w\x80I\xc1w|I\xc1wxI\xc1wtI\xc1wpI\xc1whI\xc1w\I\xc1wTI\xc1wLI\xc1w\x8cI\xc1wDI\xc1w>> import time >>> time.strftime("%a",(1900,1,1, 13,0,0, -3,0,-1)) '\x0e' Python 2.3.3c1 (#2, Dec 6 2003, 16:44:56) [GCC 3.3.3 20031203 (prerelease) (Debian)] on linux2 ---------------------------------------------------------------------- Comment By: Matthew Sherborne (matiu) Date: 2004-02-16 12:32 Message: Logged In: YES user_id=304464 Also, please have a look at: https://sourceforge.net/tracker/index.php?func=detail&aid=898253&group_id=5470&atid=105470 at the same time. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-02-15 17:23 Message: Logged In: YES user_id=31435 I assume this is specific to Python on Windows using Microsoft's C, since this workalike plain C program also dies with a memory error while in the bowels of MS's strftime(): #include #include void main() { struct tm t; char buf[256]; size_t i; t.tm_year = 1900 - 1900; t.tm_mon = 1 - 1; t.tm_mday = 1; t.tm_hour = 13; t.tm_min = 0; t.tm_sec = 0; t.tm_wday = -3; t.tm_yday = 0; t.tm_isdst = -1; printf("calling strftime\n"); i = strftime(buf, sizeof(buf), "%a", &t); printf("i: %d\n", i); } The problem is the negative value for tm_wday. MS strftime isn't defensive, and uses the negative tm_wday to index into nonsense memory. Ironically, if C had defined the % operator in the sane way (meaning Python's way ), a negative tm_wday wouldn't have survived for the C library function to see. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-02-15 15:41 Message: Logged In: YES user_id=80475 It is expected. Well, now that I've confirmed it on Py2.3.3 and Py2.4, yes ;-) Is it desirable? Heck no. Brett, can you take a look at this? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897625&group_id=5470 From noreply at sourceforge.net Mon Mar 1 23:54:59 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 23:55:11 2004 Subject: [ python-Bugs-873652 ] Platform module not documented Message-ID: Bugs item #873652, was opened at 2004-01-09 01:40 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=873652&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Simon Brunning (brunns) Assigned to: Brett Cannon (bcannon) Summary: Platform module not documented Initial Comment: The platform module isn't mentioned in the standard ducumentation, so far as I can see, though the doc-strings look pretty good. ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-01 20:54 Message: Logged In: YES user_id=357491 OK, added as rev #1.2.2.1 . ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-01-09 22:10 Message: Logged In: YES user_id=357491 The LaTeX docs are in 2.4 . They have not been backported to 2.3 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=873652&group_id=5470 From noreply at sourceforge.net Mon Mar 1 23:57:05 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 1 23:57:10 2004 Subject: [ python-Bugs-883604 ] locale specific problem in test_strftime.py Message-ID: Bugs item #883604, was opened at 2004-01-24 05:21 Message generated for change (Settings changed) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=883604&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: George Yoshida (quiver) >Assigned to: Brett Cannon (bcannon) Summary: locale specific problem in test_strftime.py Initial Comment: test/test_strftime.py compares an expectation and a result by regular expressions, but the pattern isn't escaped. So if the expectation includes a metacharacter, expectation == result and re.match(expectation, result) do not always return the same value. In my case on Japanese Windows, time.tzname returns ('\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)', '\x93 \x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)') The output contains parentheses. This resuls in a message: Conflict for nonstandard '%Z' format (time zone name): Expected ???? (?W????), but got ???? (?W????) re.match(foo, bar) != (foo == bar) One workaround I can think of is changing re.match(e [1], result) back to result == e[1]. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-01-29 18:23 Message: Logged In: YES user_id=357491 That's not what I meant by the comment; sorry for not being clearer. I meant is whether test_strftime's existence is because of Jython. ---------------------------------------------------------------------- Comment By: George Yoshida (quiver) Date: 2004-01-29 03:54 Message: Logged In: YES user_id=671362 > Is this for Jython or something? No, it's Python 2.3.3 on Windows 2000. time zone is classified as non standard(unpredictable) so it might be difficult to make test_stftime.py to support all locales. There are so many issues. FYI, I checked time.tzname on other platforms. # Jython Jython 2.1 on java1.4.2 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import time >>> time.tzname ('JST', 'JST') # Japanese Standard Time # Linux On RHL 9.0(Python 2.2/2.3), time.tzname returns ('JST', 'JST'). They pass the test. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-01-27 00:28 Message: Logged In: YES user_id=357491 Does anyone know why we even have test_strftime? It isn't like we have our own implementation and there are basic tests in test_time to make sure the wrapper around the C function works. I know the test module says it is for sanity checks, but if it fails legitimately on a platform there is not much we can do about it. Is this for Jython or something? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=883604&group_id=5470 From noreply at sourceforge.net Tue Mar 2 04:22:43 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 04:22:55 2004 Subject: [ python-Bugs-835353 ] logging.StreamHandler encodes log message in UTF-8 Message-ID: Bugs item #835353, was opened at 2003-11-03 23:45 Message generated for change (Comment added) made by vdvo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Vaclav Dvorak (vdvo) Assigned to: Vinay Sajip (vsajip) Summary: logging.StreamHandler encodes log message in UTF-8 Initial Comment: For some reason that I do not see, logging.StreamHandler in Python 2.3 insists on writing plain non-Unicode strings to the stream, and the encoding is hard-coded as UTF-8: if not hasattr(types, "UnicodeType"): #if no unicode support... self.stream.write("%s\n" % msg) else: try: self.stream.write("%s\n" % msg) except UnicodeError: self.stream.write("%s\n" % msg.encode("UTF-8")) This behaviour is neither documented nor reasonable. Files can be perfectly able to write Unicode strings (e.g., through the use of codecs.EncodedFile or with a default encoding of sys.stdout), and even if they are not, UTF-8 is hardly the only choice for an encoding. I propose to simply replace the above code with: self.stream.write(msg) self.stream.write("\n") ---------------------------------------------------------------------- >Comment By: Vaclav Dvorak (vdvo) Date: 2004-03-02 10:22 Message: Logged In: YES user_id=545628 Hmmm... I can't remember what the exact problem was, but now that I look at it again, I see that it must have been my error. What a poor bug report this is. :-( Sorry. Still, I'd like the encoding to be configurable: UTF-8 can stay as the default, but it would be nice to have an option to use, say, "iso-8859-2" or "windows-1250". ---------------------------------------------------------------------- Comment By: Vinay Sajip (vsajip) Date: 2004-03-01 13:10 Message: Logged In: YES user_id=308438 Notice that UTF-8 is only used if a UnicodeError is detected. By default, "%s\n" % msg is written to the stream using the stream's write(). If the stream can handle this without raising a UnicodeError, then UTF-8 will not be used. Is there a specific use case/test script which demonstrates a problem? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-11-05 21:30 Message: Logged In: YES user_id=21627 That would be an incompatible change, of course, as you then may get encoding errors where you currently get none. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 From noreply at sourceforge.net Tue Mar 2 08:32:31 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 08:32:39 2004 Subject: [ python-Bugs-835353 ] logging.StreamHandler encodes log message in UTF-8 Message-ID: Bugs item #835353, was opened at 2003-11-03 22:45 Message generated for change (Comment added) made by vsajip You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 Category: Python Library Group: Python 2.3 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Vaclav Dvorak (vdvo) Assigned to: Vinay Sajip (vsajip) Summary: logging.StreamHandler encodes log message in UTF-8 Initial Comment: For some reason that I do not see, logging.StreamHandler in Python 2.3 insists on writing plain non-Unicode strings to the stream, and the encoding is hard-coded as UTF-8: if not hasattr(types, "UnicodeType"): #if no unicode support... self.stream.write("%s\n" % msg) else: try: self.stream.write("%s\n" % msg) except UnicodeError: self.stream.write("%s\n" % msg.encode("UTF-8")) This behaviour is neither documented nor reasonable. Files can be perfectly able to write Unicode strings (e.g., through the use of codecs.EncodedFile or with a default encoding of sys.stdout), and even if they are not, UTF-8 is hardly the only choice for an encoding. I propose to simply replace the above code with: self.stream.write(msg) self.stream.write("\n") ---------------------------------------------------------------------- >Comment By: Vinay Sajip (vsajip) Date: 2004-03-02 13:32 Message: Logged In: YES user_id=308438 If you want to use some other encoding, why not use a stream created using codecs.open(), and if necessary use a Formatter which is Unicode-aware to convert from msg + args to the formatted message? Then the exception handler should never be invoked. Or, do you mean, for the exception handler? I think UTF-8 is OK as the default, since it is the most commonly used. I may consider making this configurable for a future release, if there is enough demand; for now you can patch it yourself. I'll close this bug report now, I assume that's OK with you? ---------------------------------------------------------------------- Comment By: Vaclav Dvorak (vdvo) Date: 2004-03-02 09:22 Message: Logged In: YES user_id=545628 Hmmm... I can't remember what the exact problem was, but now that I look at it again, I see that it must have been my error. What a poor bug report this is. :-( Sorry. Still, I'd like the encoding to be configurable: UTF-8 can stay as the default, but it would be nice to have an option to use, say, "iso-8859-2" or "windows-1250". ---------------------------------------------------------------------- Comment By: Vinay Sajip (vsajip) Date: 2004-03-01 12:10 Message: Logged In: YES user_id=308438 Notice that UTF-8 is only used if a UnicodeError is detected. By default, "%s\n" % msg is written to the stream using the stream's write(). If the stream can handle this without raising a UnicodeError, then UTF-8 will not be used. Is there a specific use case/test script which demonstrates a problem? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-11-05 20:30 Message: Logged In: YES user_id=21627 That would be an incompatible change, of course, as you then may get encoding errors where you currently get none. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=835353&group_id=5470 From noreply at sourceforge.net Tue Mar 2 09:20:28 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 09:20:31 2004 Subject: [ python-Bugs-908316 ] pdb should hash stdout Message-ID: Bugs item #908316, was opened at 2004-03-02 16:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908316&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Miki Tebeka (tebeka) Assigned to: Nobody/Anonymous (nobody) Summary: pdb should hash stdout Initial Comment: pdb should store a local copy of stdout and use it. The problem: I've used pdb with a script that uses fileinput.input with inplace=1 stdout is redirected and I can't see the pdb prompt (which is directory to the output file). Miki ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908316&group_id=5470 From noreply at sourceforge.net Tue Mar 2 12:41:13 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 12:41:17 2004 Subject: [ python-Bugs-908441 ] default index for __getslice__ is not sys.maxint Message-ID: Bugs item #908441, was opened at 2004-03-02 17:41 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908441&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Matthias Drochner (drochner) Assigned to: Nobody/Anonymous (nobody) Summary: default index for __getslice__ is not sys.maxint Initial Comment: (This applies also to __setslice__ and possibly more.) (This was already present in Python-2.2.) If the upper slice index is omitted, a default is passed to the __getslice__ method. Documentation claims this is sys.maxint. This is wrong if INT_MAX and LONG_MAX differ; what is passed is INT_MAX while sys.maxint is LONG_MAX. I'm not sure whether to call it a code bug or a documentation bug; at least there is code out there which compares to sys.maxint. The whole code path from ceval.c:_PyEval_SliceIndex() to operator.c:op_getslice() to abstract.c:PySequence_GetSlice() to classobject.c:instance_slice() has just room for an "int", so a code fix is pretty invasive... A small test program to check this: ========== import sys class sl(object): def __getslice__(self, a, b): return (a, b) print "sys.maxint = %ld" % sys.maxint bounds = sl()[:] print "default bounds = [%ld, %ld]" % bounds ========== gives on NetBSD/amd64: sys.maxint = 9223372036854775807 default bounds = [0, 2147483647] ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908441&group_id=5470 From noreply at sourceforge.net Tue Mar 2 12:42:16 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 12:42:22 2004 Subject: [ python-Bugs-902037 ] relative on-disk SYSTEM id handling is incorrect Message-ID: Bugs item #902037, was opened at 2004-02-22 02:13 Message generated for change (Comment added) made by crhode You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=902037&group_id=5470 Category: XML Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Bob Ippolito (etrepum) Assigned to: Nobody/Anonymous (nobody) Summary: relative on-disk SYSTEM id handling is incorrect Initial Comment: XML.sax.saxutils.prepare_input_source checks os.path.isfile on a relative path without first combining it with the base path. Attached patch is against CVS HEAD (which is also broken, in the exact same way, so I imagine the patch should apply cleanly to 2.3). ---------------------------------------------------------------------- Comment By: Chuck Rhode (crhode) Date: 2004-03-02 11:42 Message: Logged In: YES user_id=988879 See also Bugs 788931 and 616431. -ccr- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=902037&group_id=5470 From noreply at sourceforge.net Tue Mar 2 12:44:14 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 12:44:18 2004 Subject: [ python-Bugs-788931 ] resolving relative paths for external entities with xml.sax Message-ID: Bugs item #788931, was opened at 2003-08-14 15:31 Message generated for change (Comment added) made by crhode You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788931&group_id=5470 Category: XML Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Bart Vanhaute (bartvh) Assigned to: Nobody/Anonymous (nobody) Summary: resolving relative paths for external entities with xml.sax Initial Comment: [This is a copy of a message posted on comp.lang.python for which I did not see any response. After some reflection, I began to see it as a bug in python, so here is the bug report.] I have a set of XML documents that use external entity definitions for which I am having problems parsing them using python and xml.sax. The problem is with the resolution of relative paths in these. An example: dir1/test.xml: &ent; dir2/test.dtd: dir2/test.inc: external entity test >From what I understand of XML specs, relative paths in external entities are relative to the location of the document *in which they are defined*. However, using xml.sax (which calls expat, I presume), the paths are resolved relative to the current working directory. So the parser can not find the test.inc when the current working directory is e.g. dir1. I do not see how creating an EntityResolver would help here: how do I know against what base path I have to resolve the entity? (the same thing can be read without problems with other xml parser, for instance in Java). Bart. ---------------------------------------------------------------------- Comment By: Chuck Rhode (crhode) Date: 2004-03-02 11:44 Message: Logged In: YES user_id=988879 See also Bugs 902037 and 616431. -ccr- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788931&group_id=5470 From noreply at sourceforge.net Tue Mar 2 14:06:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 14:06:59 2004 Subject: [ python-Bugs-900580 ] IDLE docs broken on OSX Message-ID: Bugs item #900580, was opened at 2004-02-19 14:59 Message generated for change (Comment added) made by jbrandmeyer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900580&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jonathan Brandmeyer (jbrandmeyer) Assigned to: Nobody/Anonymous (nobody) Summary: IDLE docs broken on OSX Initial Comment: Under Apple's OSX operating system, the variable sys.platform is named'darwin'. In at least one place, idle makes a test to see if thecurrent platform is MS Windows by checking for the substring 'win' insys.platform, which leads to incorrect behavior on the Mac. In particular, in lib/python2.3/idlelib/EditorWindow.py, member function EditorWindow.python_docs() behaves incorrectly on OS X. I believe that if the test for MS Windows is completely removed that you will get correct behavior on all platforms, based on my reading of the webbrowser module source. Please change that function to the following (near line 313): >>> def python_docs(self, event=None): >>> webbrowser.open(self.help_url) >>> return "break" ---------------------------------------------------------------------- >Comment By: Jonathan Brandmeyer (jbrandmeyer) Date: 2004-03-02 14:06 Message: Logged In: YES user_id=676765 There are a series of changes related to the one I mentioned before. In addition, Safari requires the full URI to local files when started via the webbrowser module (or via several other methods) even though it automatically prepends that string when entered in the address bar. So, I have an additional patch that makes appropriate modifications for file:/// prefixed paths. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900580&group_id=5470 From noreply at sourceforge.net Tue Mar 2 19:34:57 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 19:35:06 2004 Subject: [ python-Bugs-907575 ] "\textttNone" in Index Message-ID: Bugs item #907575, was opened at 2004-03-01 23:22 Message generated for change (Comment added) made by quiver You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Heiko Selber (drhok) Assigned to: Nobody/Anonymous (nobody) Summary: "\textttNone" in Index Initial Comment: In the index of the Python 2.3.3 documentation (as started from IDLE on Windows XP), the references to None None object NotImplemented NotImplemented object are shown as \textttNone \textttNone object \textttNotImplemented \textttNotImplemented object and are therefore at the wrong place. This is probably due to a typo. ---------------------------------------------------------------------- Comment By: George Yoshida (quiver) Date: 2004-03-03 09:34 Message: Logged In: YES user_id=671362 This is a duplicate of bug #820344 and has been fixed. See : http://www.python.org/sf/820344 commit log: http://mail.python.org/pipermail/python-checkins/2004- January/039399.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 From noreply at sourceforge.net Tue Mar 2 23:29:05 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 2 23:29:15 2004 Subject: [ python-Bugs-754449 ] Exceptions when a thread exits Message-ID: Bugs item #754449, was opened at 2003-06-14 03:32 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 Category: Threads Group: Python 2.3 Status: Open Resolution: None Priority: 3 Submitted By: Matthias Klose (doko) Assigned to: Brett Cannon (bcannon) Summary: Exceptions when a thread exits Initial Comment: [forwarded from http://bugs.debian.org/195812] The application mentioned is offlineimap, available from ftp://ftp.debian.org/dists/unstable/main/source/. This behavior is new to Python 2.3. When my application exits, I get a lot of these messages: Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable jgoerzen@christoph:~/tree/offlineimap-3.99.18$ ./offlineimap.py -l log -d maildir -a Personal,Excel Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-02 20:29 Message: Logged In: YES user_id=357491 To force this error I inserted code to set all attributes of the threading module to None and then throw and exception. After commenting out the two calls to currentThread in _Condition the thrown exception to trigger the problem propogated to the top correctly. I did have the clean-up function give out since I set *everything* to None, but it doesn't look like a normal issue as shown in the exception traceback in the OP. I don't think it is an issue. So it seems commenting the two calls to currentThread in _Condition solves the problem. But since this is threading code and the comment explicitly states it is for the side-effect I am going to try to get a second opinion. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-16 20:59 Message: Logged In: YES user_id=357491 Does anyone know how to cause this error in isolation? I have tried a bunch of different ways but cannot cause an exception to be raised at the correct point in Threading.__bootstrap() to lead to self.__stop() to be called while the interpreter is tearing itself down. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-09 17:18 Message: Logged In: YES user_id=357491 After staring at the code, I am not even sure if the calls for its side- effect are needed. If you call currentThread(), it either returns a value from _active which is a dict of running Thread instances indexed by thread idents, or a new _DummyThread instance that inserts itself into _active. Now the two calls in the _Condition class are purely for this possible side-effect. And yet at no point is anything from _active, through currentThread or direct access, even touched by a _Condition method. The only chance this might be an issue is if a _Condition instance uses an RLock instance for its locking, which is the default behavior. But this still makes the side-effect need useless. RLocks will call currentThread on their own and since this is all in the same thread the result won't change. And in this specific case of this bug, the _Condition instance is created with a Lock instance since that is what the Thread instance uses for constructing the _Condition instance it use, which is just thread.allocate_lock() which is obviously not an RLock. In other words I can't find the point to the side-effect in _Condition. I will try to come up with some testing code that reproduces the error and then see if just removing the calls in _Condition remove the error and still pass the regression tests. ---------------------------------------------------------------------- Comment By: John Goerzen (jgoerzen) Date: 2003-06-16 06:26 Message: Logged In: YES user_id=491567 I can confirm that this behavior is not present in Python 2.2 in the same version that I am using to test against Python 2.3. I will be on vacation for most of this and next week. I'll try to get to the logging script before I leave, but I might not get to it until I return. FYI, you can also obtain OfflineIMAP at http://quux.org/devel/offlineimap. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:58 Message: Logged In: YES user_id=357491 OK, following Tim's advice I checked and it seems that Thread calls a method while shutting itself down that calls Condition.notifyAll which calls currentThread which is a global. It would appear that offlineimap is leaving its threads running, the program gets shut down, the threads raise an error while shutting down (probably because things are being torn down), this triggers the stopping method in Thread, and this raises its own exception because of the teardown which is what we are seeing as the TypeError. So the question is whether Condition should store a local reference to currentThread or not. It is not the most pure solution since this shutdown issue is not Condition's, but the only other solution I can think of is to have Thread keep a reference to currentThread, inject it into the current frame's global namespace, call Condition.notifyAll, and then remove the reference from the frame again. I vote for the cleaner, less pure solution. =) Am I insane on this or does it at least sound like this is the problem and proper solution? ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:19 Message: Logged In: YES user_id=357491 Nuts. For some reason I thought the OP had said when threads were exiting. I will ask on python-dev for a good explanation of what happens when Python is shutting down. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-06-15 18:05 Message: Logged In: YES user_id=31435 Note that the OP said "when my application exits". When Python is tearing down the universe, it systematically sets module-global bindings to None. currentThread() is a module global. I can't make more time for this now, so for more info talk about it on Python-Dev. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 16:44 Message: Logged In: YES user_id=357491 Well, I'm stumped. I checked the diff from when 2.2 was initially released until now and the only change that seems to be related to any of this is that what is returned by currentThread is not saved in a variable. But since the error is the calling of currentThread itself and not saving the return value I don't see how that would affect anything. I also went through offlineimap but I didn't see anything there that seemed to be setting currentThread to None. Although since several files do ``import *`` so there still is a possibility of overwriting currentThread locally. So, for my owning learning and to help solve this, I have written a tracing function that writes to stderr using the logging package when it detects that either currentThread or threading.currentThread has been set to None, locally or globally (I assume the code is not injecting into builtins so I didn't bother checking there). The file is named tracer.py and I have attached it to this bug report. If you can execute ``sys.settrace(tracer.trace_currentThread)`` before offlinemap starts executing and immediately within each thread (it has to be called in *every* thread since tracing functions are no inherited from the main thread) it should print out a message when currentThread becomes None. If you *really* want to make this robust you can also have it check sys.modules['threading'] every time as well, but I figure there is not going to be much renaming and masking of currentThread. ---------------------------------------------------------------------- Comment By: Matthias Klose (doko) Date: 2003-06-15 01:44 Message: Logged In: YES user_id=60903 Please see http://packages.debian.org/unstable/mail/offlineimap.html or for the tarball: http://ftp.debian.org/debian/pool/main/o/offlineimap/offlineimap_3.99.18.tar.gz ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 01:19 Message: Logged In: YES user_id=357491 I went to the FTP site and all I found was some huge, compressed files (after changing the path to ftp://ftp.debian.org/ debian/dists/sid/main/source); no specific program called offlinemap. If it is in one of those files can you just add the file to the bug report? As for the reported bug, it looks like currentThread is being redefined, although how that is happening is beyond me. I checked the 'threading' module and no where is currentThread redefined which could lead to None. Has the app being run been changed at all since Python 2.2 was released? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 From noreply at sourceforge.net Wed Mar 3 04:40:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 04:41:05 2004 Subject: [ python-Bugs-215126 ] Over restricted type checking on eval() function Message-ID: Bugs item #215126, was opened at 2000-09-22 21:36 Message generated for change (Comment added) made by pfremy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=215126&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: Later Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Raymond Hettinger (rhettinger) Summary: Over restricted type checking on eval() function Initial Comment: The built-in function eval() takes a string argument and a dictionary. The second argument should allow any instance which defines __getitem__ as opposed to just dictionaries. The following example creates a type error: eval, argument 2: expected dictionary, instance found class SpreadSheet: _cells = {} def __setitem__( self, key, formula ): self._cells[key] = formula def __getitem__( self, key ): return eval( self._cells[key], self ) ss = SpreadSheet() ss['a1'] = '5' ss['a2'] = 'a1*5' ss['a2'] ---------------------------------------------------------------------- Comment By: Philippe Fremy (pfremy) Date: 2004-03-03 10:40 Message: Logged In: YES user_id=233844 I have exactly the same need as the original poster. The only difference in my case is that I inhreted a dictionnary. I want to use the eval() function as a simple expression evaluator. I have the follwing dictionnary: d['a']='1' d['b']='2' d['c']='a+b' I want the following results: d[a] -> 1 d[b] -> 2 d[c] -> 3 To do that, I was planning to use the eval() function and overloading the __getitem__ of the global or local dictionnary: class MyDict( dict ) : def __getitem__( self, key ): print "__getitem__", key val = dict.__getitem__( self, key ) print "val = '%s'" % val return eval( val , self ) But it does not work: d[a]: __getitem__ a val = '1' -> 1 d[b]: __getitem__ b val = '2' -> 2 d[c]: __getitem__ c val = 'e+1' ERROR Traceback (most recent call last): File "test_parse_jaycos_config.py", line 83, in testMyDict self.assertEquals( d['c'], 2 ) File "parse_config_file.py", line 10, in __getitem__ return eval( val , self ) File "", line 0, in ? TypeError: cannot concatenate 'str' and 'int' objects d['c'] did fetch the 'a+1' value, which was passed to eval. However, eval() tried to evaluate the expression using the content of the dictionnary instead of using __getitem__. So it fetched the string '1' for 'a' instead of the value 1, so the result is not suitable for the addition. ---------------------------------------------------------------------- Comment By: Michael Chermside (mcherm) Date: 2004-01-12 23:01 Message: Logged In: YES user_id=99874 Hmm... I like this! Of course, I am wary of adding *yet another* special double- underscore function to satisfy a single special purpose, but this would satisfy all of *my* needs, and without any performance impact for lookups that are FOUND. Lookups that are NOT found would have a slight performance degrade (I know better than to speculate about the size of the effect without measuring it). I'm not really sure what percentage of dict lookups succeed. At any rate, what are these "other contexts" you mention in which a __keyerror__ would "also be useful"? Because if we can find other places where it is useful, that significantly improves the usefulness. OTOH, if the tests can be done ONLY for eval (I don't really think that's possible), then I'm certain no one cares about the performance of eval. ---------------------------------------------------------------------- Comment By: Gregory Smith (gregsmith) Date: 2004-01-12 20:38 Message: Logged In: YES user_id=292741 This may be a compromise solution, which could also be useful in other contexts: What if the object passed is derived from dict - presumably that doesn't help because the point is to do low-level calls to the actual dict's lookup functions. Now, suppose we modify the basic dict type, so that before throwing a KeyError, it checks to see if it is really a derived object with a method __keyerror__, and if so, calls that and returns its result (or lets it throw)? Now you can make objects that look like dicts, and act like them at the low level, but can automatically populate themselves when non-existent keys are requested. Of course, __keyerror__('x') does not have to make an 'x' entry in the dict; it could make no change, or add several entries, depending on the desired semantics regarding future lookups. It could be set up so that every lookup fails and is forwarded by __keyerror__ to the __getitem__ of another object, for instance. The cost of this to the 'normal' dict lookup is that the need to do PyDict_CheckExact() each time a lookup fails. ---------------------------------------------------------------------- Comment By: Michael Chermside (mcherm) Date: 2003-12-16 16:37 Message: Logged In: YES user_id=99874 I'll just add my voice as somebody who would find this to be "darn handy" if it could ever done without noticably impacting the speed of python code that DOESN'T use eval(). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-09-23 06:18 Message: Added to PEP 42. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2000-09-22 21:42 Message: Changed Group to Feature Request. Should be added to PEP 42 (I'll do that if nobody beats me to it). CPython requires a genuine dict now for speed. I believe JPython allows any mapping object. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=215126&group_id=5470 From noreply at sourceforge.net Wed Mar 3 04:58:57 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 04:59:02 2004 Subject: [ python-Bugs-908936 ] rexec.r_eval() does not work like eval() Message-ID: Bugs item #908936, was opened at 2004-03-03 10:58 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 Category: Python Library Group: Python 2.2.2 Status: Open Resolution: None Priority: 5 Submitted By: Philippe Fremy (pfremy) Assigned to: Nobody/Anonymous (nobody) Summary: rexec.r_eval() does not work like eval() Initial Comment: I want to use the eval() function of python as simple ultra-restricted expression evaluator. So, when executing r_eval(), I want to pass a dictionnary of the local and global variables, just like it is possible with eval(). However, r_eval() does not allow it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 From noreply at sourceforge.net Wed Mar 3 11:20:30 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 11:21:36 2004 Subject: [ python-Bugs-728330 ] Don't define _SGAPI on IRIX Message-ID: Bugs item #728330, was opened at 2003-04-27 05:21 Message generated for change (Comment added) made by billbaxter26 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=728330&group_id=5470 Category: Installation Group: Python 2.3 Status: Open Resolution: Later Priority: 5 Submitted By: Ralf W. Grosse-Kunstleve (rwgk) Assigned to: Neal Norwitz (nnorwitz) Summary: Don't define _SGAPI on IRIX Initial Comment: Python release: 2.3b1 Platform: IRIX 6.5 MIPSpro Compilers: Version 7.3.1.2m Commands used: ./configure --prefix=/usr/local_cci/Python-2.3b1t make The socket module fails to compile. The output from the compiler is attached. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2004-03-03 11:20 Message: Logged In: YES user_id=892601 Got it down to one error: % > ./python Lib/test/test_socket.py Traceback (most recent call last): File "Lib/test/test_socket.py", line 6, in ? import socket File "/usr/local/spider/lib/python2.3/socket.py", line 44, in ? import _socket ImportError: 210454:./python: rld: Fatal Error: unresolvable symbol in /usr/local/spider/lib/python2.3/lib-dynload/_socketmodule.so: _xpg5_accept xpg5_accept does appear in any library on our SGI's that are only 1-2 years old. It does appear in libc in very recent revisions of Irix (> 6.5.19?) Does anyone know how to get Python 2.3 to avoid the use of xpg5_accept? Thanks ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2004-01-12 13:59 Message: Logged In: YES user_id=892601 Has anyone encountered problems with different versions of IRIX 6.5? I finally got sockets to work in Python2.3.3, but only on the most up-to-date version of IRIX (uname -v = 01100304). On any other machine with a lower version (archetecture doesn't seem to matter), I get messages which all seem to be related to sockets: 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_vsnprintf 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_recv 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_connect 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_bind 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_getsockopt 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_sendto 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_setsockopt 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_accept 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_recvfrom 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_socket 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_getsockname Upgrading all of our SGIs is not something I have control over. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-12-22 13:52 Message: Logged In: YES user_id=768223 Sorry if there is something unclear. Redefine means: Set a value which is required to satisfy ifdef-statements in the header files. As you see in the definitions, given in the comment, the value for _NO_XOPEN4 is set as a result of some dependencies automatically defined. A redefinition of _SGIAPI in the socketmodule.c is not sufficient alone. Therefore to satisfy all requirements in the header files, you should set the values for _NO_XOPEN4 and _NO_XOPEN5 also manually. Howto do in socketmodule.c? ... #define _SGIAPI 1 #define _NO_XOPEN4 1 #define _NO_XOPEN5 1 ... If you are familiar with regular expressions, then you will know that _NO_XOPEN[45] is a shorthand for _NO_XOPEN4, _NO_XOPEN5. Sorry if there was something wrong in my comment. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-12-22 10:49 Message: Logged In: YES user_id=892601 Can someone please clarify mherta's comment from 2003-12-16? How should we "redefine _NO_XOPEN[45] in the socketmodule.c at the same position like the _SGIAPI redefinition"? Should those lines of code be added to socketmodule.c, or are they the source of the problem? Is _NO_XOPEN[45] shorthand for _NO_XOPEN[4] and _NO_XOPEN[5] or are they all different? Thanks. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-12-16 12:27 Message: Logged In: YES user_id=768223 I've tested the latest Python 2.3.3c1 to compile. The problem reported is still present. To avoid the error messages, about the incompatible types of several netdb-functions (like inet_pton), you should redefine _NO_XOPEN[45] in the socketmodule.c at the same position like the _SGIAPI redefinition. If there are error messages that types like u_short and u_char are not defined, please add -D_BSD_TYPES in the Makefile (BASECFLAGS is okay). If anybody don't need a executable compiled with MipsPro, gcc from the freeware.sgi.com could be a choice. The problem for this seems in /usr/include/standards.h: #define _NO_XOPEN4 (!defined(_XOPEN_SOURCE) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500))) #define _NO_XOPEN5 (!defined(_XOPEN_SOURCE) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 < 500))) As the first option is true (_XOPEN_SOURCE is set to 600 in pyconfig.h) the second option will be false. The constant #define NI_NUMERICHOST 0x00000002 /* return numeric form of hostname */ is enveloped in a clause #ifdef _NO_XOPEN4 && _NO_XOPEN5 (/usr/include/netdb.h) which is always false. In the manual pages there is a example which uses the constant NI_NUMERICHOST and compiles without error message. I'm not sure to cut off the file pyconfig.h from compiling the socketmodule.c? Any comments? ---------------------------------------------------------------------- Comment By: Hans Nowak (zephyrfalcon) Date: 2003-10-30 22:04 Message: Logged In: YES user_id=173607 My $0.02... Yesterday I successfully compiled Python 2.3.2, with socket module. I'm using an O2 running IRIX 6.5.11f. I didn't encounter any of the problems described before, and had no problems with _SGIAPI or anything. The reason it didn't compile was that u_long and u_char were not defined in some places; /usr/include/netinet/tcp.h to be precise, and a Python file (getaddrinfo.c). I'm using gcc 3.3 (the one downloaded from freeware.sgi.com). If anyone is interested, drop me a mail at hans at zephyrfalcon.org and I'll put the binary online somewhere. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-10-24 15:59 Message: Logged In: YES user_id=892601 Here's the output from 'gmake', using MIPSpro Compiler 7.30 on IRIX 6.5 Sorry, I don't know how to attach something using the "Add a Comment" box. Is there another way to post? The patch at www.python.org/2.3.2/patches/sgi-socketmodule.patch was edited into socketmodule.c : #include #endif /* GCC 3.2 on Irix 6.5 fails to define this variable at all. Based on the above code, I'd say that the SGI headers are just horked. */ #if defined(__sgi) && !defined(INET_ADDRSTRLEN) #define INET_ADDRSTRLEN 16 #endif /* Generic includes */ #include #include --------------------------------------------------------------------------- cc -OPT:Olimit=0 -DNDEBUG -n32 -O -I. -I./Include -DPy_BUILD_CORE -c ./Modules/socketmodule.c -o Modules/socketmodule.o cc-1047 cc: WARNING File = ./Modules/socketmodule.c, Line = 195 Macro "_SGIAPI" (declared at line 210 of "/usr/include/standards.h") has an incompatible redefinition. #define _SGIAPI 1 ^ cc-1020 cc: ERROR File = /usr/include/netdb.h, Line = 198 The identifier "socklen_t" is undefined. extern int iruserok_sa(const void *, socklen_t, int, const char *, ^ cc-1047 cc: WARNING File = ./Modules/addrinfo.h, Line = 145 Macro "_SS_ALIGNSIZE" (declared at line 246 of "/usr/include/sys/socket.h") has an incompatible redefinition. #define _SS_ALIGNSIZE (sizeof(PY_LONG_LONG)) ^ cc-1020 cc: ERROR File = ./Modules/socketmodule.c, Line = 822 The identifier "NI_NUMERICHOST" is undefined. NI_NUMERICHOST); ^ cc-1515 cc: ERROR File = ./Modules/socketmodule.c, Line = 3054 A value of type "int" cannot be assigned to an entity of type "const char *". retval = inet_ntop(af, packed, ip, sizeof(ip)); ^ 3 errors detected in the compilation of "./Modules/socketmodule.c". gmake: *** [Modules/socketmodule.o] Error 2 ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2003-10-23 06:25 Message: Logged In: YES user_id=6656 Just to be clear, please "attach" the build rather than pasting it inline. ---------------------------------------------------------------------- Comment By: Anthony Baxter (anthonybaxter) Date: 2003-10-22 22:19 Message: Logged In: YES user_id=29957 Did you try 2.3.2 with the patch from the 2.3.2 build bugs page? If it failed, please post the build log of the failing bit to this bug. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-10-22 14:26 Message: Logged In: YES user_id=892601 Has there been any progress since August on getting Python-2.3 to compile on IRIX 6.5? I really need to have sockets working to use python. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-08-14 07:37 Message: Logged In: YES user_id=768223 I have the same problem on IRIX 6.5.19m and MIPSpro 7.3.1.3m on a FUEL 600Mhz. The situation seems a little bit strange on this system. But I have luck and get it compiled. As the current implementation is not clean, my resolution also. Which should be changed to get it work. The manpage for gethostbyaddr_r says: #include #include #include #include So I included this in the __sgi-clause in socketmodule.c. Looking in the header-files shows, that some variables are defined if #define _NO_XOPEN4 1 #define _NO_XOPEN5 1 are set, before the includes. This defines some more variables, so that pyconfig.h should be changed. #define HAVE_ADDRINFO 1 #define HAVE_SOCKADDR_STORAGE 1 Sure there are warnings about the redefinition of the _(SGIAPI|NO_XOPEN4|NO_XOPEN5) but it compiles and the tests don't fail. Also my applications run without exception or coredump on FUEL, Octane, Octane 2. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-08-01 08:10 Message: Logged In: YES user_id=33168 Ralf, I will try to work on this, but it won't be for a week or two probably. Can you tell me which machines (by name) work and doesn't work. The only IRIX machine I seem to know about it rattler. ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-08-01 03:34 Message: Logged In: YES user_id=71407 For the records: The Python2.3 (final) socket module still does not compile under IRIX 6.5.20. It only compiles under 6.5.10. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 14:07 Message: Logged In: YES user_id=31392 I applied a slight variant of Neal's patch and that seemed to fix things. It still seems wrong that we define _SGIAPI, but that will have to wait for 2.3.1. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 09:54 Message: Logged In: YES user_id=31392 I learned a little about inet_ntop() in the last few minutes. It looks like the size_t argument is an older spelling, and the current POSIX says it should be socklen_t. Regardless, it looks like we're using the new definition when IRIX is actually providing the older definition. Neal attached a patch that looks like it should clean up the problem. Have you tried it? I think a better solution would be to teach configure how to find inet_ntop() via netdb.h, but that's probably too hard to get done in the new couple of hours. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 09:42 Message: Logged In: YES user_id=31392 There seem to be two causes of worry. The actual compiler error in your build log and the use of _SGIAPI that Casavanti warns again. It looks like the compiler problems is because our inet_ntop() prototype is wrong. That is Python says the last argument is a socklen_t, but IRIX and Linux man pages both say size_t. Perhaps size_t and socklen_t are different sizes on IRIX, but not on Linux. What happens if you change it to size_t? The problematic code would appear to be these lines from socketmodule.c: #if defined(__sgi)&&_COMPILER_VERSION>700 && !_SGIAPI /* make sure that the reentrant (gethostbyaddr_r etc) functions are declared correctly if compiling with MIPSPro 7.x in ANSI C mode (default) */ #define _SGIAPI 1 #include "netdb.h" #endif It's the only use the _SGIAPI symbol that Casavant says we shouldn't use. What happens if you remove the use _SGIAPI, i.e. just make it #if defined(__sgi) && _COMPILER_VERSION > 700 /* make sure that the reentrant (gethostbyaddr_r etc) functions are declared correctly if compiling with MIPSPro 7.x in ANSI C mode (default) */ #include "netdb.h" #endif ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-07-16 20:27 Message: Logged In: YES user_id=71407 We have confirmed that the socket module in Python 2.3b1 and 2.3b2 fails to compile under these versions of IRIX: 6.5.10, MIPSpro 7.3.1.2m 6.5.19, MIPSpro 7.3.1.3m 6.5.20, MIPSpro 7.3.1.3m (latest available, to my knowledge) If Python 2.3 goes out without a working socket module it will be useless for many people in science where IRIX is still found quite frequently. Maybe even worse, we will also no longer be able to advertise Python as a language that "runs everywhere." ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-07-15 18:37 Message: Logged In: YES user_id=71407 Date: Tue, 15 Jul 2003 15:06:25 -0500 From: "Brent Casavant" To: "Ralf W. Grosse-Kunstleve" Subject: Re: IRIX & Python Ralf, I read through the sourceforge report. I don't have a sourceforge account so I didn't add there, but feel free to distribute my ramblings. First, they should be very careful about what version of the operating system they are using. Real IPv6 support was only added a few releases ago (6.5.20 I believe, though my memory is hazy). Some of the functions/macros corresponding to IPv6 were introduced prior to that point, but implementation may not have been complete. If they have to play tricks with #define values to get a symbol recongnized it most likely means that SGI didn't intend for that symbol to be used yet. I suspect the problems they are seeing are because they are using some version of IRIX 6.5.x that includes inet_ntoa() definitions under _SGIAPI, but for which real support was not yet complete. The namespace of symbols that begin with a single underscore and a capital letter is reserved for the OS vendors, and the fact that someone is trying to manually insert a definition of _SGIAPI into the source should be a big red warning flag. That said, there is a correct method to deal with the new capabilities of IRIX 6.5.x over time. This comes in two parts. A better explanation is in /usr/include/optional_sym.h First, when a new symbol is added to IRIX, the corresponding header file will always have the following line in it: #pragma optional some_new_symbol The presence of this #pragma will cause the linker to not complain if the symbol is missing when the executable is linked. If SGI neglects to do so it is a bug that should be reported to us. The second part is that calls to these "optional" symbols should be protected by a run-time check to see if the symbol is actually present. Just like this: #include #include . . . if (_MIPS_SYMBOL_PRESENT(some_new_symbol)) { /* New function is present, use it */ qux = some_new_symbol(foo, bar, baz); } else { /* New function isn't present, do something else */ qux = builtin_some_new_symbol(foo, bar, baz); } This ensures that a single executable will be able to function properly (or at least degrade gracefully) on all version of IRIX 6.5.x. In other words you can compile on 6.5.20 and run on 6.5.8, or vice versa. In particular, this means that compile-time detection of features such as inet_ntoa() is incorrect for IRIX 6.5.x -- these decisions should be made at run-time instead. If the decision is made at compile time the executable may well not execute on an older version of IRIX 6.5.x. Unfortunately GNU configure is not equipped to utilize such advanced binary-compatability mechanisms, so there's no "easy" way to get GNU configure'd software to run across all IRIX 6.5.x releases, short of compiling only on the original non-upgraded version of IRIX 6.5. Hope that helps, Brent Casavant On Tue, 15 Jul 2003, Ralf W. Grosse-Kunstleve wrote: > We are developing a Python-based (www.python.org) application for > IRIX. Until now the Python IRIX port was fully supported, but the last > two beta releases of Python (2.3b1 and 2.3b2) make me increasingly > worried because the crucial socket module (TCP/IP sockets) fails to > build. A while ago I've filed a bug report, but the Python developers > appear to be stuck: > > https://sourceforge.net/tracker/? func=detail&aid=728330&group_id=5470&atid=105470 > > Is there a way to bring this to the attention of developers at SGI to > hopefully get some help? > > Thank you in advance! > Ralf > -- Brent Casavant Silicon Graphics, Inc. Where am I? And what am I IRIX O.S. Engineer http://www.sgi.com/ doing in this handbasket? bcasavan@sgi.com 44.8562N 93.1355W 860F -- Unknown ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-06-30 10:21 Message: Logged In: YES user_id=71407 The socket module still fails to compile with Python 2.3b2, in addition to two other extensions. The full make log is attached. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-05-22 02:47 Message: Logged In: YES user_id=21627 I think it would be best if detect presence of inet_aton/inet_pton. Is IPv6 support possible on this system? Then it would be best if that was detected, as well. If it is not possible to detect aton/pton/ipv6, what is the problem with not using them? I'd like to have a look at the relevant headers (in particular to understand the duplicate definition of _SGIAPI), indeed. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-05-21 19:35 Message: Logged In: YES user_id=33168 Argh!!! This is a nightmare. The attached hack ^h^h^h patch fixes the problem, but ... _SGIAPI needs to be defined (~192 in socketmodule.c) in order to get the prototypes for inet_aton, inet_pton. But _SGIAPI can't be defined in the standard header files because XOPEN_SOURCE is defined. Martin, do you have any other suggestions? I don't see how to do this right within configure. If you want I can send you the header file(s). ---------------------------------------------------------------------- Comment By: alexandre gillet (gillet) Date: 2003-05-12 13:41 Message: Logged In: YES user_id=150999 I had the same problem compiling socket on Irix. We did find that on our system ENABLE_IPV6 is not define and all the error are cause by that. System that do not enable IPV6 are not well supported with the socketmodule.c code. We were able to compile socket after making few change in the code: I am not sure if I did it right but it compile. I will post my patch but I do not see any place to attach my file example: See line 2794,2800 + #ifdef ENABLE_IPV6 char packed[MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; + #else + char packed[sizeof(struct in_addr)]; + #endif I am not sure how to post the patch or file. ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-05-05 14:44 Message: Logged In: YES user_id=71407 This is not in my area of expertise, but I've tried a couple of (probably stupid) things: #include in socketmodule.c instead of #define _SGIAPI. This resulted in even more errors. ./configure --disable-ipv6 Same errors as before. I am lost here. Sorry. But you still have ssh access to rattler.lbl.gov if that helps. Accounts for other Python developers are a possibility. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-05-04 08:39 Message: Logged In: YES user_id=21627 Can you analyse these compiler errors in more detail, please? What, in your opinion, is causing these problems, and how would you correct them? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=728330&group_id=5470 From noreply at sourceforge.net Wed Mar 3 14:53:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 14:54:10 2004 Subject: [ python-Bugs-909295 ] segmentation fault Message-ID: Bugs item #909295, was opened at 2004-03-03 14:53 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Chuck Mason (cemason) Assigned to: Nobody/Anonymous (nobody) Summary: segmentation fault Initial Comment: $ python Python 2.3.1 (#1, Sep 23 2003, 10:07:41) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def func(*a): print a ... >>> func((1, 2, 3) ... )Segmentation fault -------------------------- Not sure what other information you need, but I tested it on several machines with the same version and it seems to be hardware/other library independant. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 From noreply at sourceforge.net Wed Mar 3 13:07:57 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 15:18:16 2004 Subject: [ python-Bugs-909226 ] Can Not import a module with - (DASH) in filename Message-ID: Bugs item #909226, was opened at 2004-03-03 13:07 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909226&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Benjamin Schollnick (bscholln) Assigned to: Nobody/Anonymous (nobody) Summary: Can Not import a module with - (DASH) in filename Initial Comment: I am currently running, Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32. I have a file that I am attempting to import "report- manager.py", that refuses to be imported. C:\develope\versions>python Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import report-manager File "", line 1 import report-manager ^ SyntaxError: invalid syntax >>> import "report-manager" File "", line 1 import "report-manager" If this is not a bug, and is indeed expected behavior, is this documented in any manner? I have not found any references covering this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909226&group_id=5470 From noreply at sourceforge.net Wed Mar 3 15:24:22 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 15:24:50 2004 Subject: [ python-Bugs-909308 ] Embedded Python Interpreter in MFC apps leaks Message-ID: Bugs item #909308, was opened at 2004-03-03 21:24 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909308&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: David (yakumoklesk) Assigned to: Nobody/Anonymous (nobody) Summary: Embedded Python Interpreter in MFC apps leaks Initial Comment: I am embedding the python interpreter in my MFC multidocument application. In the mainframe class, at creation time, I do Py_Initialize(). When the program comes to an end, in the mainframe destructor, I do Py_Finalize(). No Pyobject is created, no PyRun_SimpleString is called, nothing but the Py_Initialize() and the Py_Finalize() only. But those simple calls make the program to report leaks, that when are breakpointed with _CrtSetBreakAlloc (using lib) the code "leaked" stops inside python code. I made a new project from scratch (multidocument also), without adding no line except Py_Initialize and Py_Finalize, an the leak already exists. I did a Dialog application and used the same calls, and the leak already exists. But when I make a non MFC application, the leak do not exists. Is this bug a real python bug, or its due an MFC bad implementation of memory allocation? Please, I need to know if there is a way to avoid this leaks, because I want to control what leaks are really mine (c++), what leaks are caused by c++ to python wrapped code, and what leaks are just python, to have a better control of the processes of my application. I am using Python 2.3.3 and VC++ 6.0 with service pack 5 on a Windows XP Professional with an Athlon XP. David. If any information is needed about the leaks and the lines that report to be leaked, just tell me and I'll made an inform. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909308&group_id=5470 From noreply at sourceforge.net Wed Mar 3 15:26:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 15:28:09 2004 Subject: [ python-Bugs-909226 ] Can Not import a module with - (DASH) in filename Message-ID: Bugs item #909226, was opened at 2004-03-03 12:07 Message generated for change (Settings changed) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909226&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Benjamin Schollnick (bscholln) Assigned to: Nobody/Anonymous (nobody) Summary: Can Not import a module with - (DASH) in filename Initial Comment: I am currently running, Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32. I have a file that I am attempting to import "report- manager.py", that refuses to be imported. C:\develope\versions>python Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import report-manager File "", line 1 import report-manager ^ SyntaxError: invalid syntax >>> import "report-manager" File "", line 1 import "report-manager" If this is not a bug, and is indeed expected behavior, is this documented in any manner? I have not found any references covering this. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-03-03 14:26 Message: Logged In: YES user_id=44345 Yes it is expected and documented behavior. Module names as mentioned in import statements must be valid Python identifiers. Hyphens are not allowed in identifiers. Try renaming the file to reportmanager.py or report_manager.py. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909226&group_id=5470 From noreply at sourceforge.net Wed Mar 3 13:13:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 3 16:03:39 2004 Subject: [ python-Bugs-909230 ] bug in idna-encoding-module Message-ID: Bugs item #909230, was opened at 2004-03-03 18:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909230&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Rumpeltux (rumpeltux) Assigned to: Nobody/Anonymous (nobody) Summary: bug in idna-encoding-module Initial Comment: in /usr/lib/python2.3/encodings/idna.py, line 175 it goes: lables = input.split('.') which causes the interpreter to stop executing the program, but by changing it to labels = dots.split(input) everything's fine ;) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909230&group_id=5470 From noreply at sourceforge.net Wed Mar 3 23:05:43 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:21:59 2004 Subject: [ python-Bugs-909295 ] segmentation fault Message-ID: Bugs item #909295, was opened at 2004-03-03 14:53 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Chuck Mason (cemason) Assigned to: Nobody/Anonymous (nobody) Summary: segmentation fault Initial Comment: $ python Python 2.3.1 (#1, Sep 23 2003, 10:07:41) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def func(*a): print a ... >>> func((1, 2, 3) ... )Segmentation fault -------------------------- Not sure what other information you need, but I tested it on several machines with the same version and it seems to be hardware/other library independant. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-03 23:05 Message: Logged In: YES user_id=80475 On WinMe, I cannot reproduce this on Py2.2.3, Py2.3.3, or Py2.4a0. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:22:26 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:25:15 2004 Subject: [ python-Bugs-889153 ] asyncore.dispactcher: incorrect connect Message-ID: Bugs item #889153, was opened at 2004-02-02 19:04 Message generated for change (Comment added) made by klimkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=889153&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sankov Dmitry Alexandrovich (sankov_da) Assigned to: Nobody/Anonymous (nobody) Summary: asyncore.dispactcher: incorrect connect Initial Comment: When i use non-blocking socket, connect() method of asyncore.dispatcher class looks like works incorrect. Example: if connection have not established then socket merely closed and handle_error not called and no exception throwed. One more example: if writable() and readble() methods returns zero than handle_connect() will never be called even if connection will be established. Thanks. ---------------------------------------------------------------------- Comment By: Alexey Klimkin (klimkin) Date: 2004-03-04 11:22 Message: Logged In: YES user_id=410460 Patch #909005 fixes the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=889153&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:23:19 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:25:17 2004 Subject: [ python-Bugs-887279 ] asyncore.py poll* missing urgent data Message-ID: Bugs item #887279, was opened at 2004-01-30 00:25 Message generated for change (Comment added) made by klimkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=887279&group_id=5470 Category: Python Library Group: Python 2.2.1 candidate Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: asyncore.py poll* missing urgent data Initial Comment: According to the select.poll documentation, polling flags include POLLIN (regular data) and POLLPRI (urgent data). asyncore poll2 and poll3 check readable objects for POLLIN, but do not check for POLLPRI. ---------------------------------------------------------------------- Comment By: Alexey Klimkin (klimkin) Date: 2004-03-04 11:23 Message: Logged In: YES user_id=410460 Patch #909005 fixes the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=887279&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:23:56 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:25:20 2004 Subject: [ python-Bugs-777588 ] asyncore is broken for windows if connection is refused Message-ID: Bugs item #777588, was opened at 2003-07-25 18:43 Message generated for change (Comment added) made by klimkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=777588&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Garth Bushell (garth42) Assigned to: Nobody/Anonymous (nobody) Summary: asyncore is broken for windows if connection is refused Initial Comment: asyncore.poll is broken on windows. If a connection is refused happens it will hang for ever and never raise an exception. The Select statment never checks the exfds. This is needed as this is where windows reports failed connections. The documentation in the microsoft platform SDK mentions this. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/select_2.asp The suggested fix is shown below althought this is untested. The correct error number is recived from getsockopt(SOL_SOCKET,SO_ERROR) def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) if sys.platform == 'win32': if not obj.connected: e.append(fd) if [] == r == w == e: time.sleep(timeout) else: try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] != EINTR: raise else: return if sys.platform == 'win32': for fd in e: obj = map.get(fd) if obj is None: continue errno = fs.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) raise socket.error,(errno,socketerrorTab[error]) for fd in r: obj = map.get(fd) if obj is None: continue read(obj) for fd in w: obj = map.get(fd) if obj is None: continue write(obj) ---------------------------------------------------------------------- Comment By: Alexey Klimkin (klimkin) Date: 2004-03-04 11:23 Message: Logged In: YES user_id=410460 Patch #909005 fixes the problem. ---------------------------------------------------------------------- Comment By: John J Smith (johnjsmith) Date: 2003-07-29 16:49 Message: Logged In: YES user_id=830565 I was bitten by the same problem. My workaround (in a Tkinter application) is given below. Would it make sense to modify poll() to simply add the union of r and w to e, and call handle_error() for any fd in e? Workaround: try: self.connect(send_addr) except socket.error: self.handle_error() if sys.platform == 'win32': # Win98 select() doesn't seem to report errors for a # non-blocking connect(). self.__connected = 0 self.__frame.after(2000, self.__win_connect_poll) ... if sys.platform == 'win32': def __win_connect_poll (self): if self.__connected: return e = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) if e in (0, errno.EINPROGRESS, errno.WSAEINPROGRESS): self.__frame.after(2000, self.__win_connect_poll) else: try: str = socket.errorTab[e] except KeyError: str = os.strerror(e) try: raise socket.error(e, str) except socket.error: self.handle_error() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=777588&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:24:16 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:25:21 2004 Subject: [ python-Bugs-658749 ] asyncore connect() and winsock errors Message-ID: Bugs item #658749, was opened at 2002-12-26 21:25 Message generated for change (Comment added) made by klimkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=658749&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Nobody/Anonymous (nobody) Summary: asyncore connect() and winsock errors Initial Comment: asyncore's connect() method should interpret the winsock errors; these are different from Unix (and different between the Win98 family and the Win2k family). ---------------------------------------------------------------------- Comment By: Alexey Klimkin (klimkin) Date: 2004-03-04 11:24 Message: Logged In: YES user_id=410460 Patch #909005 fixes the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=658749&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:24:31 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:25:23 2004 Subject: [ python-Bugs-654766 ] asyncore.py and "handle_expt" Message-ID: Bugs item #654766, was opened at 2002-12-16 21:42 Message generated for change (Comment added) made by klimkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=654766&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jes?s Cea Avi?n (jcea) Assigned to: Nobody/Anonymous (nobody) Summary: asyncore.py and "handle_expt" Initial Comment: Python 2.2.2 here. Asyncore.py doesn't invoke "handle_expt" ever ("handle_expt" is documented in docs). Managing OOB data is imprescindible to handle "connection refused" errors in Windows, for example. ---------------------------------------------------------------------- Comment By: Alexey Klimkin (klimkin) Date: 2004-03-04 11:24 Message: Logged In: YES user_id=410460 Patch #909005 fixes the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=654766&group_id=5470 From noreply at sourceforge.net Thu Mar 4 03:59:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 09:29:47 2004 Subject: [ python-Bugs-909295 ] segmentation fault Message-ID: Bugs item #909295, was opened at 2004-03-03 20:53 Message generated for change (Comment added) made by zgoda You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Chuck Mason (cemason) Assigned to: Nobody/Anonymous (nobody) Summary: segmentation fault Initial Comment: $ python Python 2.3.1 (#1, Sep 23 2003, 10:07:41) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def func(*a): print a ... >>> func((1, 2, 3) ... )Segmentation fault -------------------------- Not sure what other information you need, but I tested it on several machines with the same version and it seems to be hardware/other library independant. ---------------------------------------------------------------------- Comment By: Jarek Zgoda (zgoda) Date: 2004-03-04 09:59 Message: Logged In: YES user_id=92222 No such weirdness on W2KSp4 with Python 2.3.2 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-04 05:05 Message: Logged In: YES user_id=80475 On WinMe, I cannot reproduce this on Py2.2.3, Py2.3.3, or Py2.4a0. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 From noreply at sourceforge.net Thu Mar 4 09:59:55 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 4 10:00:02 2004 Subject: [ python-Bugs-909295 ] segmentation fault Message-ID: Bugs item #909295, was opened at 2004-03-03 14:53 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Chuck Mason (cemason) Assigned to: Nobody/Anonymous (nobody) Summary: segmentation fault Initial Comment: $ python Python 2.3.1 (#1, Sep 23 2003, 10:07:41) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def func(*a): print a ... >>> func((1, 2, 3) ... )Segmentation fault -------------------------- Not sure what other information you need, but I tested it on several machines with the same version and it seems to be hardware/other library independant. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-04 09:59 Message: Logged In: YES user_id=31435 Get into a debugger and show the top dozen functions on the call stack when the segfault occurs. Segfaults in an interactive shell unique to Unixish systems usually get pinned on GNU readline in the end. ---------------------------------------------------------------------- Comment By: Jarek Zgoda (zgoda) Date: 2004-03-04 03:59 Message: Logged In: YES user_id=92222 No such weirdness on W2KSp4 with Python 2.3.2 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-03 23:05 Message: Logged In: YES user_id=80475 On WinMe, I cannot reproduce this on Py2.2.3, Py2.3.3, or Py2.4a0. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909295&group_id=5470 From noreply at sourceforge.net Fri Mar 5 13:42:58 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Mar 5 13:43:10 2004 Subject: [ python-Bugs-907575 ] "\textttNone" in Index Message-ID: Bugs item #907575, was opened at 2004-03-01 09:22 Message generated for change (Comment added) made by akuchling You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed Resolution: None Priority: 5 Submitted By: Heiko Selber (drhok) Assigned to: Nobody/Anonymous (nobody) Summary: "\textttNone" in Index Initial Comment: In the index of the Python 2.3.3 documentation (as started from IDLE on Windows XP), the references to None None object NotImplemented NotImplemented object are shown as \textttNone \textttNone object \textttNotImplemented \textttNotImplemented object and are therefore at the wrong place. This is probably due to a typo. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2004-03-05 13:42 Message: Logged In: YES user_id=11375 Marking as closed. ---------------------------------------------------------------------- Comment By: George Yoshida (quiver) Date: 2004-03-02 19:34 Message: Logged In: YES user_id=671362 This is a duplicate of bug #820344 and has been fixed. See : http://www.python.org/sf/820344 commit log: http://mail.python.org/pipermail/python-checkins/2004- January/039399.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 From noreply at sourceforge.net Fri Mar 5 13:43:09 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Mar 5 13:43:41 2004 Subject: [ python-Bugs-907575 ] "\textttNone" in Index Message-ID: Bugs item #907575, was opened at 2004-03-01 09:22 Message generated for change (Comment added) made by akuchling You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 Category: Documentation Group: Python 2.3 Status: Closed Resolution: None Priority: 5 Submitted By: Heiko Selber (drhok) Assigned to: Nobody/Anonymous (nobody) Summary: "\textttNone" in Index Initial Comment: In the index of the Python 2.3.3 documentation (as started from IDLE on Windows XP), the references to None None object NotImplemented NotImplemented object are shown as \textttNone \textttNone object \textttNotImplemented \textttNotImplemented object and are therefore at the wrong place. This is probably due to a typo. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2004-03-05 13:43 Message: Logged In: YES user_id=11375 Marking as closed. ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2004-03-05 13:42 Message: Logged In: YES user_id=11375 Marking as closed. ---------------------------------------------------------------------- Comment By: George Yoshida (quiver) Date: 2004-03-02 19:34 Message: Logged In: YES user_id=671362 This is a duplicate of bug #820344 and has been fixed. See : http://www.python.org/sf/820344 commit log: http://mail.python.org/pipermail/python-checkins/2004- January/039399.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=907575&group_id=5470 From noreply at sourceforge.net Fri Mar 5 14:52:11 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Mar 5 14:52:18 2004 Subject: [ python-Bugs-909230 ] bug in idna-encoding-module Message-ID: Bugs item #909230, was opened at 2004-03-03 13:13 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909230&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Rumpeltux (rumpeltux) >Assigned to: Martin v. L?wis (loewis) Summary: bug in idna-encoding-module Initial Comment: in /usr/lib/python2.3/encodings/idna.py, line 175 it goes: lables = input.split('.') which causes the interpreter to stop executing the program, but by changing it to labels = dots.split(input) everything's fine ;) ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-05 14:52 Message: Logged In: YES user_id=33168 Martin, it looks like line 174: unicode(input, "ascii") should be input = unicode(input, "ascii"). I'm not sure what's supposed to happenning here, but it looks like the if/else code block may be able to be rewritten as: if not isinstance(input, unicode): input = unicode(input, "ascii") labels = dots.split(input) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909230&group_id=5470 From noreply at sourceforge.net Sat Mar 6 07:35:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Mar 6 07:35:19 2004 Subject: [ python-Bugs-743267 ] super passes bad arguments to __get__ when used w/class Message-ID: Bugs item #743267, was opened at 2003-05-25 18:00 Message generated for change (Comment added) made by pje You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=743267&group_id=5470 Category: Type/class unification Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Phillip J. Eby (pje) Assigned to: Guido van Rossum (gvanrossum) Summary: super passes bad arguments to __get__ when used w/class Initial Comment: Run the following code to demonstrate the issue: ==== class Getter(object): def __get__(self, ob, typ=None): print "called with", (ob, typ) class Base(object): foo = Getter() class Subclass(Base): pass print print Base().foo Subclass().foo super(Subclass,Subclass()).foo Base.foo Subclass.foo super(Subclass,Subclass).foo ==== Notice that super(Subclass,Subclass).foo is calling the descriptor with the *class* object, not 'None' as is done for the analagous cases that don't use super(). The only reason this ever "works" is because 'classmethod' ignores the 'ob' parameter to '__get__'. However, this breaks when using 'super' to access property descriptors in 2.3, and it will also break any user-defined descriptors that are accessed via super(). The behavior is the same in 2.2, and is arguably broken there as well. For example, 'super(someclass,someclass).X' (where 'X' is a normal instance method) results in X being a *bound* method, bound to the class, rather than an *unbound* method, ready for use with an explicit instance. Personally, I would be happy if super() grew an extra argument to disambiguate whether you are doing a (class,instance) or (class,class) call, anyway. When using super() with metaclasses, I've encountered situations where super() guessed wrong, because I was using a type that was both an instance of, and a subclass of, the same type. Being able to explicitly request that this "class method" form of super is being used, would eliminate this confusion as well. In the face of ambiguity... ;) ---------------------------------------------------------------------- >Comment By: Phillip J. Eby (pje) Date: 2004-03-06 12:35 Message: Logged In: YES user_id=56214 Here's a patch against the CVS head to add a test for the problem, and fix it. Please backport to the 2.3 branch as well. Thanks! ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-02-25 19:09 Message: Logged In: YES user_id=6656 I don't think you'll find any difference between the trunk and release23-maint in this area, so it doesn't make much difference. ---------------------------------------------------------------------- Comment By: Phillip J. Eby (pje) Date: 2004-02-25 19:06 Message: Logged In: YES user_id=56214 super().descriptor example: class Base(object): aProp = property(lambda self: "foo") class Sub(Base): def test(klass): print super(Sub,klass).aProp test = classmethod(test) Sub.test() This prints "foo", when it should print "" instead. To be precise, the issue is that accessing any descriptor that behaves differently when retrieved on the class vs. the instance, will behave incorrectly when accessed via super() from a classmethod in a subclass. Classmethods themselves work correctly because they behave the same way no matter how you retrieve them. At present I think the patch should simply change the descr_get call in super_getattro so that it checks whether su->obj==su->obj_type, and if so, pass in NULL instead of su->obj as the second argument to descr_get. Should I create this patch against the 2.3 maintenance branch, or against the head? I'd like to make sure it gets into the next 2.3.x bugfix release. (I didn't realize this bug was still open until I stumbled across it the other day, and I'm not expecting to upgrade to 2.3 production use for a few months yet. I've been using a pure-Python reimplementation of super() as a workaround.) ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2004-02-25 15:57 Message: Logged In: YES user_id=6380 > However, this breaks when using 'super' to access > property descriptors in 2.3, and it will also break any > user-defined descriptors that are accessed via super(). Can you give an example of this use case? I don't have a strong opinion on this; methinks you should go ahead and prepa patch... ---------------------------------------------------------------------- Comment By: Phillip J. Eby (pje) Date: 2004-02-25 07:06 Message: Logged In: YES user_id=56214 Assigning to Guido to request pronouncement on the correct way to fix this before I attempt to create patch(es). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=743267&group_id=5470 From noreply at sourceforge.net Sat Mar 6 11:03:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Mar 6 11:03:11 2004 Subject: [ python-Bugs-910986 ] copy.copy fails for array.array Message-ID: Bugs item #910986, was opened at 2004-03-06 11:03 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=910986&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Glenn Parker (redandgray) Assigned to: Nobody/Anonymous (nobody) Summary: copy.copy fails for array.array Initial Comment: Python version 2.3.3 under WindowsXP Home Edition The standard library "copy" does not work with the standard library "array". import copy import array x = array.array('c', 'abcdef') y = copy.copy(x) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/copy.py", line 95, in copy return _reconstruct(x, rv, 0) File "/usr/lib/python2.3/copy.py", line 338, in _reconstruct y = callable(*args) File "/usr/lib/python2.3/copy_reg.py", line 92, in __newobj__ return cls.__new__(cls, *args) TypeError: array() takes at least 1 argument (0 given) The same thing happens for copy.deepcopy. Judging from the TypeError details, it appears that copy.copy assumes a new object of the same type as its input argument can be created with no arguments, but array.array requires at least one argument (describing the type of items in the array). array.array should have a custom method added to make it work smoothly with copy.copy. Documentation for copy.copy should be clearer about the requirements on the type of its input argument. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=910986&group_id=5470 From noreply at sourceforge.net Sat Mar 6 15:41:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Mar 6 15:41:58 2004 Subject: [ python-Bugs-911080 ] string str.split() behaviour inconsistency Message-ID: Bugs item #911080, was opened at 2004-03-06 20:41 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Pete Shinners (peteshinners) Assigned to: Nobody/Anonymous (nobody) Summary: string str.split() behaviour inconsistency Initial Comment: The str.split() method behaves differently depending on if it uses the default (no arguments) separator, or if you provide your own. There is no way to reproduce the functionality of the default separator if you supply your own. >>> s = "a b c" >>> s.split() ['a', 'b', 'c'] >>> s.split(" ") ['a', 'b', '', 'c'] The default split uses a different algorithm, where it combines multiple separators into a single separator. Providing a custom separator makes split separate each individual separator. Obviously there are good reasons for forcing a separate entry between each separator. With simple comma or colon separated records, you want to know if an entry is blank. The problem is there is not a way to reproduce the functionality of the default behavior. This alternate behavior is also not documented, so it becomes confusing why split behaves different once you want your own separators. Fixing could be a problem. Changing the actual split() method would break many programs. But adding an different split is a potentially nice solution. The other option would be to "re-use" the current splitfields() function and have it work like the current split. And change the split() to behave like it does with no default. This would unfortunately still "break stuff". The easiest fix may just be documentation and letting people know of this difference. I've been helping some newbies through Python. When this came up I was a little surprised and we were forced to learn it was just a little "magic and scary". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 From noreply at sourceforge.net Sun Mar 7 02:09:39 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 7 02:09:44 2004 Subject: [ python-Bugs-910986 ] copy.copy fails for array.array Message-ID: Bugs item #910986, was opened at 2004-03-06 11:03 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=910986&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Glenn Parker (redandgray) >Assigned to: Raymond Hettinger (rhettinger) Summary: copy.copy fails for array.array Initial Comment: Python version 2.3.3 under WindowsXP Home Edition The standard library "copy" does not work with the standard library "array". import copy import array x = array.array('c', 'abcdef') y = copy.copy(x) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/copy.py", line 95, in copy return _reconstruct(x, rv, 0) File "/usr/lib/python2.3/copy.py", line 338, in _reconstruct y = callable(*args) File "/usr/lib/python2.3/copy_reg.py", line 92, in __newobj__ return cls.__new__(cls, *args) TypeError: array() takes at least 1 argument (0 given) The same thing happens for copy.deepcopy. Judging from the TypeError details, it appears that copy.copy assumes a new object of the same type as its input argument can be created with no arguments, but array.array requires at least one argument (describing the type of items in the array). array.array should have a custom method added to make it work smoothly with copy.copy. Documentation for copy.copy should be clearer about the requirements on the type of its input argument. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=910986&group_id=5470 From noreply at sourceforge.net Sun Mar 7 02:23:39 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 7 02:23:45 2004 Subject: [ python-Bugs-911080 ] string str.split() behaviour inconsistency Message-ID: Bugs item #911080, was opened at 2004-03-06 15:41 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 Category: Python Interpreter Core Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Pete Shinners (peteshinners) >Assigned to: Raymond Hettinger (rhettinger) Summary: string str.split() behaviour inconsistency Initial Comment: The str.split() method behaves differently depending on if it uses the default (no arguments) separator, or if you provide your own. There is no way to reproduce the functionality of the default separator if you supply your own. >>> s = "a b c" >>> s.split() ['a', 'b', 'c'] >>> s.split(" ") ['a', 'b', '', 'c'] The default split uses a different algorithm, where it combines multiple separators into a single separator. Providing a custom separator makes split separate each individual separator. Obviously there are good reasons for forcing a separate entry between each separator. With simple comma or colon separated records, you want to know if an entry is blank. The problem is there is not a way to reproduce the functionality of the default behavior. This alternate behavior is also not documented, so it becomes confusing why split behaves different once you want your own separators. Fixing could be a problem. Changing the actual split() method would break many programs. But adding an different split is a potentially nice solution. The other option would be to "re-use" the current splitfields() function and have it work like the current split. And change the split() to behave like it does with no default. This would unfortunately still "break stuff". The easiest fix may just be documentation and letting people know of this difference. I've been helping some newbies through Python. When this came up I was a little surprised and we were forced to learn it was just a little "magic and scary". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 From noreply at sourceforge.net Sun Mar 7 06:00:03 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 7 06:00:12 2004 Subject: [ python-Bugs-911080 ] string str.split() behaviour inconsistency Message-ID: Bugs item #911080, was opened at 2004-03-06 21:41 Message generated for change (Comment added) made by sjoerd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 Category: Python Interpreter Core >Group: Not a Bug >Status: Closed Resolution: None Priority: 5 Submitted By: Pete Shinners (peteshinners) Assigned to: Raymond Hettinger (rhettinger) Summary: string str.split() behaviour inconsistency Initial Comment: The str.split() method behaves differently depending on if it uses the default (no arguments) separator, or if you provide your own. There is no way to reproduce the functionality of the default separator if you supply your own. >>> s = "a b c" >>> s.split() ['a', 'b', 'c'] >>> s.split(" ") ['a', 'b', '', 'c'] The default split uses a different algorithm, where it combines multiple separators into a single separator. Providing a custom separator makes split separate each individual separator. Obviously there are good reasons for forcing a separate entry between each separator. With simple comma or colon separated records, you want to know if an entry is blank. The problem is there is not a way to reproduce the functionality of the default behavior. This alternate behavior is also not documented, so it becomes confusing why split behaves different once you want your own separators. Fixing could be a problem. Changing the actual split() method would break many programs. But adding an different split is a potentially nice solution. The other option would be to "re-use" the current splitfields() function and have it work like the current split. And change the split() to behave like it does with no default. This would unfortunately still "break stuff". The easiest fix may just be documentation and letting people know of this difference. I've been helping some newbies through Python. When this came up I was a little surprised and we were forced to learn it was just a little "magic and scary". ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2004-03-07 12:00 Message: Logged In: YES user_id=43607 Use s.split(None) to get the same behavior as without arguments. This is documented behavior, as far as I know. If the documentation isn't good enough, submit a bug report specifically for that. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=911080&group_id=5470 From noreply at sourceforge.net Sun Mar 7 18:26:57 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 7 18:27:04 2004 Subject: [ python-Bugs-897817 ] test_strptime failures on FC2-test Message-ID: Bugs item #897817, was opened at 2004-02-15 21:52 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897817&group_id=5470 Category: Python Library Group: Python 2.4 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Anthony Baxter (anthonybaxter) Assigned to: Anthony Baxter (anthonybaxter) Summary: test_strptime failures on FC2-test Initial Comment: I'm seeing test_strptime failures on this box, running a version of Fedora Core that's between 1 and the new test release. test test_strptime failed -- Traceback (most recent call last): File "Lib/test/test_strptime.py", line 258, in test_timezone self.failUnlessEqual(strp_output.tm_isdst, 0) AssertionError: -1 != 0 Note that the following line (which tests GMT) also fails with a -1. The underlying failure: >>> import _strptime >>> strp_output = _strptime.strptime("UTC", "%Z") >>> strp_output.tm_isdst -1 >>> strp_output = _strptime.strptime("GMT", "%Z") >>> strp_output.tm_isdst -1 ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-07 15:26 Message: Logged In: YES user_id=357491 Fixed in rev. 1.31 . Basically tweaked the test that checks if time.tzname[0] == time.tzname[1] (which is bad since then you can't tell when DST is in effect or not) to take into acct. if time.tzname[1] (the DST timezone) is set to UTC or GMT. Since there is no adjustment, then just set let be set to 0 through the normal algorithm. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-23 20:26 Message: Logged In: YES user_id=357491 A possible cause for this, Anthony, is having the timezone set to ("UTC", "GMT") and time.daylight to a 1. This would lead to not passing the test since there is an explicit test in the strptime code for when duplicate non-DST and DST timezones are the same and this would do it since UTC and GMT are injected into the non-DST timezone list for comparisons. The default is -1 since you can't tell the proper value if both non-DST and DST are the same. And UTC and GMT should not be considered DST timezones obviously. Anyway, I hope you don't find anything wrong and it was just a weird glitch in the date settings. ---------------------------------------------------------------------- Comment By: Anthony Baxter (anthonybaxter) Date: 2004-02-23 19:05 Message: Logged In: YES user_id=29957 Very very strange. I rebuilt python, and the problem has gone away. I will assign this to myself and try and reproduce it. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-17 13:39 Message: Logged In: YES user_id=357491 Anthony, can you let me know what the following commands spit out?:: import time; import _strptime time.tzname time.daylight _strptime.LocaleTime().timezone _strptime.TimeRE()['Z'] That should be enough info for me to debug this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897817&group_id=5470 From noreply at sourceforge.net Sun Mar 7 22:09:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 7 22:09:07 2004 Subject: [ python-Bugs-905737 ] BuildApplet needs to get more BuildApplication features Message-ID: Bugs item #905737, was opened at 2004-02-27 05:08 Message generated for change (Comment added) made by etrepum You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=905737&group_id=5470 Category: Macintosh Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Jack Jansen (jackjansen) Assigned to: Jack Jansen (jackjansen) Summary: BuildApplet needs to get more BuildApplication features Initial Comment: BuildApplet needs to become a more complete interface to bundlebuilder, thereby also getting the function of the old BuildApplication, and various intermediate steps. ---------------------------------------------------------------------- Comment By: Bob Ippolito (etrepum) Date: 2004-03-07 22:09 Message: Logged In: YES user_id=139309 Is there a summary of BuildApplication features anywhere? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=905737&group_id=5470 From noreply at sourceforge.net Mon Mar 8 11:53:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 8 11:53:43 2004 Subject: [ python-Bugs-728330 ] Don't define _SGAPI on IRIX Message-ID: Bugs item #728330, was opened at 2003-04-27 11:21 Message generated for change (Comment added) made by mhertha You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=728330&group_id=5470 Category: Installation Group: Python 2.3 Status: Open Resolution: Later Priority: 5 Submitted By: Ralf W. Grosse-Kunstleve (rwgk) Assigned to: Neal Norwitz (nnorwitz) Summary: Don't define _SGAPI on IRIX Initial Comment: Python release: 2.3b1 Platform: IRIX 6.5 MIPSpro Compilers: Version 7.3.1.2m Commands used: ./configure --prefix=/usr/local_cci/Python-2.3b1t make The socket module fails to compile. The output from the compiler is attached. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2004-03-08 17:53 Message: Logged In: YES user_id=768223 I got Python 2.3.3 compiled with MipsPro Compilers: Version 7.3.1.3m. The following changes were made to satisfy all needs. Line 206 in Modules/socketmodule.c #define _SGIAPI 1 NEW: #undef _XOPEN_SOURCE NEW: #define HAVE_GETADDRINFO 1 NEW: #define HAVE_GETNAMEINFO 1 #define HAVE_INET_PTON NEW: #include NEW: #include NEW: #include #include Line 269: /* #include "addrinfo.h" */ In addition to this I extend the CFLAGS with -D_BSD_TYPES to satisfy the u_short and friends definition. --maik./ ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2004-03-03 17:20 Message: Logged In: YES user_id=892601 Got it down to one error: % > ./python Lib/test/test_socket.py Traceback (most recent call last): File "Lib/test/test_socket.py", line 6, in ? import socket File "/usr/local/spider/lib/python2.3/socket.py", line 44, in ? import _socket ImportError: 210454:./python: rld: Fatal Error: unresolvable symbol in /usr/local/spider/lib/python2.3/lib-dynload/_socketmodule.so: _xpg5_accept xpg5_accept does appear in any library on our SGI's that are only 1-2 years old. It does appear in libc in very recent revisions of Irix (> 6.5.19?) Does anyone know how to get Python 2.3 to avoid the use of xpg5_accept? Thanks ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2004-01-12 19:59 Message: Logged In: YES user_id=892601 Has anyone encountered problems with different versions of IRIX 6.5? I finally got sockets to work in Python2.3.3, but only on the most up-to-date version of IRIX (uname -v = 01100304). On any other machine with a lower version (archetecture doesn't seem to matter), I get messages which all seem to be related to sockets: 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_vsnprintf 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_recv 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_connect 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_bind 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_getsockopt 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_sendto 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_setsockopt 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_accept 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_recvfrom 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_socket 152272:python2.3: rld: Error: unresolvable symbol in python2.3: _xpg5_getsockname Upgrading all of our SGIs is not something I have control over. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-12-22 19:52 Message: Logged In: YES user_id=768223 Sorry if there is something unclear. Redefine means: Set a value which is required to satisfy ifdef-statements in the header files. As you see in the definitions, given in the comment, the value for _NO_XOPEN4 is set as a result of some dependencies automatically defined. A redefinition of _SGIAPI in the socketmodule.c is not sufficient alone. Therefore to satisfy all requirements in the header files, you should set the values for _NO_XOPEN4 and _NO_XOPEN5 also manually. Howto do in socketmodule.c? ... #define _SGIAPI 1 #define _NO_XOPEN4 1 #define _NO_XOPEN5 1 ... If you are familiar with regular expressions, then you will know that _NO_XOPEN[45] is a shorthand for _NO_XOPEN4, _NO_XOPEN5. Sorry if there was something wrong in my comment. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-12-22 16:49 Message: Logged In: YES user_id=892601 Can someone please clarify mherta's comment from 2003-12-16? How should we "redefine _NO_XOPEN[45] in the socketmodule.c at the same position like the _SGIAPI redefinition"? Should those lines of code be added to socketmodule.c, or are they the source of the problem? Is _NO_XOPEN[45] shorthand for _NO_XOPEN[4] and _NO_XOPEN[5] or are they all different? Thanks. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-12-16 18:27 Message: Logged In: YES user_id=768223 I've tested the latest Python 2.3.3c1 to compile. The problem reported is still present. To avoid the error messages, about the incompatible types of several netdb-functions (like inet_pton), you should redefine _NO_XOPEN[45] in the socketmodule.c at the same position like the _SGIAPI redefinition. If there are error messages that types like u_short and u_char are not defined, please add -D_BSD_TYPES in the Makefile (BASECFLAGS is okay). If anybody don't need a executable compiled with MipsPro, gcc from the freeware.sgi.com could be a choice. The problem for this seems in /usr/include/standards.h: #define _NO_XOPEN4 (!defined(_XOPEN_SOURCE) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500))) #define _NO_XOPEN5 (!defined(_XOPEN_SOURCE) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 < 500))) As the first option is true (_XOPEN_SOURCE is set to 600 in pyconfig.h) the second option will be false. The constant #define NI_NUMERICHOST 0x00000002 /* return numeric form of hostname */ is enveloped in a clause #ifdef _NO_XOPEN4 && _NO_XOPEN5 (/usr/include/netdb.h) which is always false. In the manual pages there is a example which uses the constant NI_NUMERICHOST and compiles without error message. I'm not sure to cut off the file pyconfig.h from compiling the socketmodule.c? Any comments? ---------------------------------------------------------------------- Comment By: Hans Nowak (zephyrfalcon) Date: 2003-10-31 04:04 Message: Logged In: YES user_id=173607 My $0.02... Yesterday I successfully compiled Python 2.3.2, with socket module. I'm using an O2 running IRIX 6.5.11f. I didn't encounter any of the problems described before, and had no problems with _SGIAPI or anything. The reason it didn't compile was that u_long and u_char were not defined in some places; /usr/include/netinet/tcp.h to be precise, and a Python file (getaddrinfo.c). I'm using gcc 3.3 (the one downloaded from freeware.sgi.com). If anyone is interested, drop me a mail at hans at zephyrfalcon.org and I'll put the binary online somewhere. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-10-24 21:59 Message: Logged In: YES user_id=892601 Here's the output from 'gmake', using MIPSpro Compiler 7.30 on IRIX 6.5 Sorry, I don't know how to attach something using the "Add a Comment" box. Is there another way to post? The patch at www.python.org/2.3.2/patches/sgi-socketmodule.patch was edited into socketmodule.c : #include #endif /* GCC 3.2 on Irix 6.5 fails to define this variable at all. Based on the above code, I'd say that the SGI headers are just horked. */ #if defined(__sgi) && !defined(INET_ADDRSTRLEN) #define INET_ADDRSTRLEN 16 #endif /* Generic includes */ #include #include --------------------------------------------------------------------------- cc -OPT:Olimit=0 -DNDEBUG -n32 -O -I. -I./Include -DPy_BUILD_CORE -c ./Modules/socketmodule.c -o Modules/socketmodule.o cc-1047 cc: WARNING File = ./Modules/socketmodule.c, Line = 195 Macro "_SGIAPI" (declared at line 210 of "/usr/include/standards.h") has an incompatible redefinition. #define _SGIAPI 1 ^ cc-1020 cc: ERROR File = /usr/include/netdb.h, Line = 198 The identifier "socklen_t" is undefined. extern int iruserok_sa(const void *, socklen_t, int, const char *, ^ cc-1047 cc: WARNING File = ./Modules/addrinfo.h, Line = 145 Macro "_SS_ALIGNSIZE" (declared at line 246 of "/usr/include/sys/socket.h") has an incompatible redefinition. #define _SS_ALIGNSIZE (sizeof(PY_LONG_LONG)) ^ cc-1020 cc: ERROR File = ./Modules/socketmodule.c, Line = 822 The identifier "NI_NUMERICHOST" is undefined. NI_NUMERICHOST); ^ cc-1515 cc: ERROR File = ./Modules/socketmodule.c, Line = 3054 A value of type "int" cannot be assigned to an entity of type "const char *". retval = inet_ntop(af, packed, ip, sizeof(ip)); ^ 3 errors detected in the compilation of "./Modules/socketmodule.c". gmake: *** [Modules/socketmodule.o] Error 2 ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2003-10-23 12:25 Message: Logged In: YES user_id=6656 Just to be clear, please "attach" the build rather than pasting it inline. ---------------------------------------------------------------------- Comment By: Anthony Baxter (anthonybaxter) Date: 2003-10-23 04:19 Message: Logged In: YES user_id=29957 Did you try 2.3.2 with the patch from the 2.3.2 build bugs page? If it failed, please post the build log of the failing bit to this bug. ---------------------------------------------------------------------- Comment By: Bill Baxter (billbaxter26) Date: 2003-10-22 20:26 Message: Logged In: YES user_id=892601 Has there been any progress since August on getting Python-2.3 to compile on IRIX 6.5? I really need to have sockets working to use python. ---------------------------------------------------------------------- Comment By: Maik Hertha (mhertha) Date: 2003-08-14 13:37 Message: Logged In: YES user_id=768223 I have the same problem on IRIX 6.5.19m and MIPSpro 7.3.1.3m on a FUEL 600Mhz. The situation seems a little bit strange on this system. But I have luck and get it compiled. As the current implementation is not clean, my resolution also. Which should be changed to get it work. The manpage for gethostbyaddr_r says: #include #include #include #include So I included this in the __sgi-clause in socketmodule.c. Looking in the header-files shows, that some variables are defined if #define _NO_XOPEN4 1 #define _NO_XOPEN5 1 are set, before the includes. This defines some more variables, so that pyconfig.h should be changed. #define HAVE_ADDRINFO 1 #define HAVE_SOCKADDR_STORAGE 1 Sure there are warnings about the redefinition of the _(SGIAPI|NO_XOPEN4|NO_XOPEN5) but it compiles and the tests don't fail. Also my applications run without exception or coredump on FUEL, Octane, Octane 2. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-08-01 14:10 Message: Logged In: YES user_id=33168 Ralf, I will try to work on this, but it won't be for a week or two probably. Can you tell me which machines (by name) work and doesn't work. The only IRIX machine I seem to know about it rattler. ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-08-01 09:34 Message: Logged In: YES user_id=71407 For the records: The Python2.3 (final) socket module still does not compile under IRIX 6.5.20. It only compiles under 6.5.10. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 20:07 Message: Logged In: YES user_id=31392 I applied a slight variant of Neal's patch and that seemed to fix things. It still seems wrong that we define _SGIAPI, but that will have to wait for 2.3.1. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 15:54 Message: Logged In: YES user_id=31392 I learned a little about inet_ntop() in the last few minutes. It looks like the size_t argument is an older spelling, and the current POSIX says it should be socklen_t. Regardless, it looks like we're using the new definition when IRIX is actually providing the older definition. Neal attached a patch that looks like it should clean up the problem. Have you tried it? I think a better solution would be to teach configure how to find inet_ntop() via netdb.h, but that's probably too hard to get done in the new couple of hours. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2003-07-17 15:42 Message: Logged In: YES user_id=31392 There seem to be two causes of worry. The actual compiler error in your build log and the use of _SGIAPI that Casavanti warns again. It looks like the compiler problems is because our inet_ntop() prototype is wrong. That is Python says the last argument is a socklen_t, but IRIX and Linux man pages both say size_t. Perhaps size_t and socklen_t are different sizes on IRIX, but not on Linux. What happens if you change it to size_t? The problematic code would appear to be these lines from socketmodule.c: #if defined(__sgi)&&_COMPILER_VERSION>700 && !_SGIAPI /* make sure that the reentrant (gethostbyaddr_r etc) functions are declared correctly if compiling with MIPSPro 7.x in ANSI C mode (default) */ #define _SGIAPI 1 #include "netdb.h" #endif It's the only use the _SGIAPI symbol that Casavant says we shouldn't use. What happens if you remove the use _SGIAPI, i.e. just make it #if defined(__sgi) && _COMPILER_VERSION > 700 /* make sure that the reentrant (gethostbyaddr_r etc) functions are declared correctly if compiling with MIPSPro 7.x in ANSI C mode (default) */ #include "netdb.h" #endif ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-07-17 02:27 Message: Logged In: YES user_id=71407 We have confirmed that the socket module in Python 2.3b1 and 2.3b2 fails to compile under these versions of IRIX: 6.5.10, MIPSpro 7.3.1.2m 6.5.19, MIPSpro 7.3.1.3m 6.5.20, MIPSpro 7.3.1.3m (latest available, to my knowledge) If Python 2.3 goes out without a working socket module it will be useless for many people in science where IRIX is still found quite frequently. Maybe even worse, we will also no longer be able to advertise Python as a language that "runs everywhere." ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-07-16 00:37 Message: Logged In: YES user_id=71407 Date: Tue, 15 Jul 2003 15:06:25 -0500 From: "Brent Casavant" To: "Ralf W. Grosse-Kunstleve" Subject: Re: IRIX & Python Ralf, I read through the sourceforge report. I don't have a sourceforge account so I didn't add there, but feel free to distribute my ramblings. First, they should be very careful about what version of the operating system they are using. Real IPv6 support was only added a few releases ago (6.5.20 I believe, though my memory is hazy). Some of the functions/macros corresponding to IPv6 were introduced prior to that point, but implementation may not have been complete. If they have to play tricks with #define values to get a symbol recongnized it most likely means that SGI didn't intend for that symbol to be used yet. I suspect the problems they are seeing are because they are using some version of IRIX 6.5.x that includes inet_ntoa() definitions under _SGIAPI, but for which real support was not yet complete. The namespace of symbols that begin with a single underscore and a capital letter is reserved for the OS vendors, and the fact that someone is trying to manually insert a definition of _SGIAPI into the source should be a big red warning flag. That said, there is a correct method to deal with the new capabilities of IRIX 6.5.x over time. This comes in two parts. A better explanation is in /usr/include/optional_sym.h First, when a new symbol is added to IRIX, the corresponding header file will always have the following line in it: #pragma optional some_new_symbol The presence of this #pragma will cause the linker to not complain if the symbol is missing when the executable is linked. If SGI neglects to do so it is a bug that should be reported to us. The second part is that calls to these "optional" symbols should be protected by a run-time check to see if the symbol is actually present. Just like this: #include #include . . . if (_MIPS_SYMBOL_PRESENT(some_new_symbol)) { /* New function is present, use it */ qux = some_new_symbol(foo, bar, baz); } else { /* New function isn't present, do something else */ qux = builtin_some_new_symbol(foo, bar, baz); } This ensures that a single executable will be able to function properly (or at least degrade gracefully) on all version of IRIX 6.5.x. In other words you can compile on 6.5.20 and run on 6.5.8, or vice versa. In particular, this means that compile-time detection of features such as inet_ntoa() is incorrect for IRIX 6.5.x -- these decisions should be made at run-time instead. If the decision is made at compile time the executable may well not execute on an older version of IRIX 6.5.x. Unfortunately GNU configure is not equipped to utilize such advanced binary-compatability mechanisms, so there's no "easy" way to get GNU configure'd software to run across all IRIX 6.5.x releases, short of compiling only on the original non-upgraded version of IRIX 6.5. Hope that helps, Brent Casavant On Tue, 15 Jul 2003, Ralf W. Grosse-Kunstleve wrote: > We are developing a Python-based (www.python.org) application for > IRIX. Until now the Python IRIX port was fully supported, but the last > two beta releases of Python (2.3b1 and 2.3b2) make me increasingly > worried because the crucial socket module (TCP/IP sockets) fails to > build. A while ago I've filed a bug report, but the Python developers > appear to be stuck: > > https://sourceforge.net/tracker/? func=detail&aid=728330&group_id=5470&atid=105470 > > Is there a way to bring this to the attention of developers at SGI to > hopefully get some help? > > Thank you in advance! > Ralf > -- Brent Casavant Silicon Graphics, Inc. Where am I? And what am I IRIX O.S. Engineer http://www.sgi.com/ doing in this handbasket? bcasavan@sgi.com 44.8562N 93.1355W 860F -- Unknown ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-06-30 16:21 Message: Logged In: YES user_id=71407 The socket module still fails to compile with Python 2.3b2, in addition to two other extensions. The full make log is attached. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-05-22 08:47 Message: Logged In: YES user_id=21627 I think it would be best if detect presence of inet_aton/inet_pton. Is IPv6 support possible on this system? Then it would be best if that was detected, as well. If it is not possible to detect aton/pton/ipv6, what is the problem with not using them? I'd like to have a look at the relevant headers (in particular to understand the duplicate definition of _SGIAPI), indeed. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-05-22 01:35 Message: Logged In: YES user_id=33168 Argh!!! This is a nightmare. The attached hack ^h^h^h patch fixes the problem, but ... _SGIAPI needs to be defined (~192 in socketmodule.c) in order to get the prototypes for inet_aton, inet_pton. But _SGIAPI can't be defined in the standard header files because XOPEN_SOURCE is defined. Martin, do you have any other suggestions? I don't see how to do this right within configure. If you want I can send you the header file(s). ---------------------------------------------------------------------- Comment By: alexandre gillet (gillet) Date: 2003-05-12 19:41 Message: Logged In: YES user_id=150999 I had the same problem compiling socket on Irix. We did find that on our system ENABLE_IPV6 is not define and all the error are cause by that. System that do not enable IPV6 are not well supported with the socketmodule.c code. We were able to compile socket after making few change in the code: I am not sure if I did it right but it compile. I will post my patch but I do not see any place to attach my file example: See line 2794,2800 + #ifdef ENABLE_IPV6 char packed[MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; + #else + char packed[sizeof(struct in_addr)]; + #endif I am not sure how to post the patch or file. ---------------------------------------------------------------------- Comment By: Ralf W. Grosse-Kunstleve (rwgk) Date: 2003-05-05 20:44 Message: Logged In: YES user_id=71407 This is not in my area of expertise, but I've tried a couple of (probably stupid) things: #include in socketmodule.c instead of #define _SGIAPI. This resulted in even more errors. ./configure --disable-ipv6 Same errors as before. I am lost here. Sorry. But you still have ssh access to rattler.lbl.gov if that helps. Accounts for other Python developers are a possibility. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-05-04 14:39 Message: Logged In: YES user_id=21627 Can you analyse these compiler errors in more detail, please? What, in your opinion, is causing these problems, and how would you correct them? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=728330&group_id=5470 From noreply at sourceforge.net Mon Mar 8 15:52:11 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 8 15:52:23 2004 Subject: [ python-Bugs-897872 ] Unknown color name on HP-UX Message-ID: Bugs item #897872, was opened at 2004-02-16 03:37 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897872&group_id=5470 Category: IDLE Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Richard Townsend (rptownsend) >Assigned to: Kurt B. Kaiser (kbk) Summary: Unknown color name on HP-UX Initial Comment: When I click on a node in the class browser tree widget, I get: TclError: unknown color name "darkblue". This is coming from line 253 in TreeWidget.py where the background color is hard-coded as "darkblue". On HP-UX 11.11 there is no entry for "darkblue" in rgb.txt. ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2004-03-08 15:52 Message: Logged In: YES user_id=149084 Fixed by Nigel Rowe's Patch [ 805830 ] Highlight builtins ---------------------------------------------------------------------- Comment By: Richard Townsend (rptownsend) Date: 2004-02-21 11:30 Message: Logged In: YES user_id=200117 One of my collegues tried adding an entry to rgb.txt on HP-UX and running the rgb util, but he couldn't get X to recognise the new color. Looking at the rgb.txt files on HP-UX and Linux (SuSE 8.2) there are many differences, not just color names that are missing, but definitions which are different. I wrote a little script to compare the files. I have attached its output. However, the definition for 'darkblue' on Linux is identical to 'blue4' on both Linux and HP-UX (0, 0, 139). Perhaps the simplest thing would be for IDLE to use 'blue4' ? ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-02-18 19:48 Message: Logged In: YES user_id=593130 Given the apparent absence of problems on others systems, perhaps the absence of a 'darkblue' entry is a bug that should be reported to HP. Do you know anything of the specs for rgb.txt? And can you add such an entry to fix the problem? If you are sure the absence if legit, what color can be depended on if 'darkblue' does not work? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=897872&group_id=5470 From noreply at sourceforge.net Mon Mar 8 17:34:40 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 8 17:34:53 2004 Subject: [ python-Bugs-754449 ] Exceptions when a thread exits Message-ID: Bugs item #754449, was opened at 2003-06-14 03:32 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 Category: Threads Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 3 Submitted By: Matthias Klose (doko) Assigned to: Brett Cannon (bcannon) Summary: Exceptions when a thread exits Initial Comment: [forwarded from http://bugs.debian.org/195812] The application mentioned is offlineimap, available from ftp://ftp.debian.org/dists/unstable/main/source/. This behavior is new to Python 2.3. When my application exits, I get a lot of these messages: Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable jgoerzen@christoph:~/tree/offlineimap-3.99.18$ ./offlineimap.py -l log -d maildir -a Personal,Excel Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-08 14:32 Message: Logged In: YES user_id=357491 OK, this has been fixed in Python 2.4 (rev. 1.41 of Lib/threading.py; just removed the two calls to currentThread in the _Condition class that were commented to be for their side-effect). Just because I don't feel rock-solid on my fix to the point of it not changing some obscure semantics that I would be willing to put a gun to my head over it I am not going to backport this until I hear from someone who had this bug and reports that they have not had any issues for a long time. Otherwise I will just leave the fix in 2.4 only. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-03-02 20:29 Message: Logged In: YES user_id=357491 To force this error I inserted code to set all attributes of the threading module to None and then throw and exception. After commenting out the two calls to currentThread in _Condition the thrown exception to trigger the problem propogated to the top correctly. I did have the clean-up function give out since I set *everything* to None, but it doesn't look like a normal issue as shown in the exception traceback in the OP. I don't think it is an issue. So it seems commenting the two calls to currentThread in _Condition solves the problem. But since this is threading code and the comment explicitly states it is for the side-effect I am going to try to get a second opinion. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-16 20:59 Message: Logged In: YES user_id=357491 Does anyone know how to cause this error in isolation? I have tried a bunch of different ways but cannot cause an exception to be raised at the correct point in Threading.__bootstrap() to lead to self.__stop() to be called while the interpreter is tearing itself down. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-09 17:18 Message: Logged In: YES user_id=357491 After staring at the code, I am not even sure if the calls for its side- effect are needed. If you call currentThread(), it either returns a value from _active which is a dict of running Thread instances indexed by thread idents, or a new _DummyThread instance that inserts itself into _active. Now the two calls in the _Condition class are purely for this possible side-effect. And yet at no point is anything from _active, through currentThread or direct access, even touched by a _Condition method. The only chance this might be an issue is if a _Condition instance uses an RLock instance for its locking, which is the default behavior. But this still makes the side-effect need useless. RLocks will call currentThread on their own and since this is all in the same thread the result won't change. And in this specific case of this bug, the _Condition instance is created with a Lock instance since that is what the Thread instance uses for constructing the _Condition instance it use, which is just thread.allocate_lock() which is obviously not an RLock. In other words I can't find the point to the side-effect in _Condition. I will try to come up with some testing code that reproduces the error and then see if just removing the calls in _Condition remove the error and still pass the regression tests. ---------------------------------------------------------------------- Comment By: John Goerzen (jgoerzen) Date: 2003-06-16 06:26 Message: Logged In: YES user_id=491567 I can confirm that this behavior is not present in Python 2.2 in the same version that I am using to test against Python 2.3. I will be on vacation for most of this and next week. I'll try to get to the logging script before I leave, but I might not get to it until I return. FYI, you can also obtain OfflineIMAP at http://quux.org/devel/offlineimap. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:58 Message: Logged In: YES user_id=357491 OK, following Tim's advice I checked and it seems that Thread calls a method while shutting itself down that calls Condition.notifyAll which calls currentThread which is a global. It would appear that offlineimap is leaving its threads running, the program gets shut down, the threads raise an error while shutting down (probably because things are being torn down), this triggers the stopping method in Thread, and this raises its own exception because of the teardown which is what we are seeing as the TypeError. So the question is whether Condition should store a local reference to currentThread or not. It is not the most pure solution since this shutdown issue is not Condition's, but the only other solution I can think of is to have Thread keep a reference to currentThread, inject it into the current frame's global namespace, call Condition.notifyAll, and then remove the reference from the frame again. I vote for the cleaner, less pure solution. =) Am I insane on this or does it at least sound like this is the problem and proper solution? ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:19 Message: Logged In: YES user_id=357491 Nuts. For some reason I thought the OP had said when threads were exiting. I will ask on python-dev for a good explanation of what happens when Python is shutting down. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-06-15 18:05 Message: Logged In: YES user_id=31435 Note that the OP said "when my application exits". When Python is tearing down the universe, it systematically sets module-global bindings to None. currentThread() is a module global. I can't make more time for this now, so for more info talk about it on Python-Dev. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 16:44 Message: Logged In: YES user_id=357491 Well, I'm stumped. I checked the diff from when 2.2 was initially released until now and the only change that seems to be related to any of this is that what is returned by currentThread is not saved in a variable. But since the error is the calling of currentThread itself and not saving the return value I don't see how that would affect anything. I also went through offlineimap but I didn't see anything there that seemed to be setting currentThread to None. Although since several files do ``import *`` so there still is a possibility of overwriting currentThread locally. So, for my owning learning and to help solve this, I have written a tracing function that writes to stderr using the logging package when it detects that either currentThread or threading.currentThread has been set to None, locally or globally (I assume the code is not injecting into builtins so I didn't bother checking there). The file is named tracer.py and I have attached it to this bug report. If you can execute ``sys.settrace(tracer.trace_currentThread)`` before offlinemap starts executing and immediately within each thread (it has to be called in *every* thread since tracing functions are no inherited from the main thread) it should print out a message when currentThread becomes None. If you *really* want to make this robust you can also have it check sys.modules['threading'] every time as well, but I figure there is not going to be much renaming and masking of currentThread. ---------------------------------------------------------------------- Comment By: Matthias Klose (doko) Date: 2003-06-15 01:44 Message: Logged In: YES user_id=60903 Please see http://packages.debian.org/unstable/mail/offlineimap.html or for the tarball: http://ftp.debian.org/debian/pool/main/o/offlineimap/offlineimap_3.99.18.tar.gz ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 01:19 Message: Logged In: YES user_id=357491 I went to the FTP site and all I found was some huge, compressed files (after changing the path to ftp://ftp.debian.org/ debian/dists/sid/main/source); no specific program called offlinemap. If it is in one of those files can you just add the file to the bug report? As for the reported bug, it looks like currentThread is being redefined, although how that is happening is beyond me. I checked the 'threading' module and no where is currentThread redefined which could lead to None. Has the app being run been changed at all since Python 2.2 was released? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 From noreply at sourceforge.net Mon Mar 8 17:36:27 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 8 17:36:36 2004 Subject: [ python-Bugs-754449 ] Exceptions when a thread exits Message-ID: Bugs item #754449, was opened at 2003-06-14 03:32 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 Category: Threads Group: Python 2.3 Status: Closed Resolution: Fixed Priority: 3 Submitted By: Matthias Klose (doko) Assigned to: Brett Cannon (bcannon) Summary: Exceptions when a thread exits Initial Comment: [forwarded from http://bugs.debian.org/195812] The application mentioned is offlineimap, available from ftp://ftp.debian.org/dists/unstable/main/source/. This behavior is new to Python 2.3. When my application exits, I get a lot of these messages: Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable jgoerzen@christoph:~/tree/offlineimap-3.99.18$ ./offlineimap.py -l log -d maildir -a Personal,Excel Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable Unhandled exception in thread started by > Traceback (most recent call last): File "/usr/lib/python2.3/threading.py", line 426, in __bootstrap self.__stop() File "/usr/lib/python2.3/threading.py", line 435, in __stop self.__block.notifyAll() File "/usr/lib/python2.3/threading.py", line 239, in notifyAll self.notify(len(self.__waiters)) File "/usr/lib/python2.3/threading.py", line 221, in notify currentThread() # for side-effect TypeError: 'NoneType' object is not callable ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2004-03-08 14:36 Message: Logged In: YES user_id=357491 OK, this has been fixed in Python 2.4 (rev. 1.41 of Lib/threading.py; just removed the two calls to currentThread in the _Condition class that were commented to be for their side-effect). Just because I don't feel rock-solid on my fix to the point of it not changing some obscure semantics that I would be willing to put a gun to my head over it I am not going to backport this until I hear from someone who had this bug and reports that they have not had any issues for a long time. Otherwise I will just leave the fix in 2.4 only. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-03-08 14:32 Message: Logged In: YES user_id=357491 OK, this has been fixed in Python 2.4 (rev. 1.41 of Lib/threading.py; just removed the two calls to currentThread in the _Condition class that were commented to be for their side-effect). Just because I don't feel rock-solid on my fix to the point of it not changing some obscure semantics that I would be willing to put a gun to my head over it I am not going to backport this until I hear from someone who had this bug and reports that they have not had any issues for a long time. Otherwise I will just leave the fix in 2.4 only. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-03-02 20:29 Message: Logged In: YES user_id=357491 To force this error I inserted code to set all attributes of the threading module to None and then throw and exception. After commenting out the two calls to currentThread in _Condition the thrown exception to trigger the problem propogated to the top correctly. I did have the clean-up function give out since I set *everything* to None, but it doesn't look like a normal issue as shown in the exception traceback in the OP. I don't think it is an issue. So it seems commenting the two calls to currentThread in _Condition solves the problem. But since this is threading code and the comment explicitly states it is for the side-effect I am going to try to get a second opinion. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-16 20:59 Message: Logged In: YES user_id=357491 Does anyone know how to cause this error in isolation? I have tried a bunch of different ways but cannot cause an exception to be raised at the correct point in Threading.__bootstrap() to lead to self.__stop() to be called while the interpreter is tearing itself down. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-02-09 17:18 Message: Logged In: YES user_id=357491 After staring at the code, I am not even sure if the calls for its side- effect are needed. If you call currentThread(), it either returns a value from _active which is a dict of running Thread instances indexed by thread idents, or a new _DummyThread instance that inserts itself into _active. Now the two calls in the _Condition class are purely for this possible side-effect. And yet at no point is anything from _active, through currentThread or direct access, even touched by a _Condition method. The only chance this might be an issue is if a _Condition instance uses an RLock instance for its locking, which is the default behavior. But this still makes the side-effect need useless. RLocks will call currentThread on their own and since this is all in the same thread the result won't change. And in this specific case of this bug, the _Condition instance is created with a Lock instance since that is what the Thread instance uses for constructing the _Condition instance it use, which is just thread.allocate_lock() which is obviously not an RLock. In other words I can't find the point to the side-effect in _Condition. I will try to come up with some testing code that reproduces the error and then see if just removing the calls in _Condition remove the error and still pass the regression tests. ---------------------------------------------------------------------- Comment By: John Goerzen (jgoerzen) Date: 2003-06-16 06:26 Message: Logged In: YES user_id=491567 I can confirm that this behavior is not present in Python 2.2 in the same version that I am using to test against Python 2.3. I will be on vacation for most of this and next week. I'll try to get to the logging script before I leave, but I might not get to it until I return. FYI, you can also obtain OfflineIMAP at http://quux.org/devel/offlineimap. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:58 Message: Logged In: YES user_id=357491 OK, following Tim's advice I checked and it seems that Thread calls a method while shutting itself down that calls Condition.notifyAll which calls currentThread which is a global. It would appear that offlineimap is leaving its threads running, the program gets shut down, the threads raise an error while shutting down (probably because things are being torn down), this triggers the stopping method in Thread, and this raises its own exception because of the teardown which is what we are seeing as the TypeError. So the question is whether Condition should store a local reference to currentThread or not. It is not the most pure solution since this shutdown issue is not Condition's, but the only other solution I can think of is to have Thread keep a reference to currentThread, inject it into the current frame's global namespace, call Condition.notifyAll, and then remove the reference from the frame again. I vote for the cleaner, less pure solution. =) Am I insane on this or does it at least sound like this is the problem and proper solution? ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 23:19 Message: Logged In: YES user_id=357491 Nuts. For some reason I thought the OP had said when threads were exiting. I will ask on python-dev for a good explanation of what happens when Python is shutting down. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-06-15 18:05 Message: Logged In: YES user_id=31435 Note that the OP said "when my application exits". When Python is tearing down the universe, it systematically sets module-global bindings to None. currentThread() is a module global. I can't make more time for this now, so for more info talk about it on Python-Dev. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 16:44 Message: Logged In: YES user_id=357491 Well, I'm stumped. I checked the diff from when 2.2 was initially released until now and the only change that seems to be related to any of this is that what is returned by currentThread is not saved in a variable. But since the error is the calling of currentThread itself and not saving the return value I don't see how that would affect anything. I also went through offlineimap but I didn't see anything there that seemed to be setting currentThread to None. Although since several files do ``import *`` so there still is a possibility of overwriting currentThread locally. So, for my owning learning and to help solve this, I have written a tracing function that writes to stderr using the logging package when it detects that either currentThread or threading.currentThread has been set to None, locally or globally (I assume the code is not injecting into builtins so I didn't bother checking there). The file is named tracer.py and I have attached it to this bug report. If you can execute ``sys.settrace(tracer.trace_currentThread)`` before offlinemap starts executing and immediately within each thread (it has to be called in *every* thread since tracing functions are no inherited from the main thread) it should print out a message when currentThread becomes None. If you *really* want to make this robust you can also have it check sys.modules['threading'] every time as well, but I figure there is not going to be much renaming and masking of currentThread. ---------------------------------------------------------------------- Comment By: Matthias Klose (doko) Date: 2003-06-15 01:44 Message: Logged In: YES user_id=60903 Please see http://packages.debian.org/unstable/mail/offlineimap.html or for the tarball: http://ftp.debian.org/debian/pool/main/o/offlineimap/offlineimap_3.99.18.tar.gz ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-15 01:19 Message: Logged In: YES user_id=357491 I went to the FTP site and all I found was some huge, compressed files (after changing the path to ftp://ftp.debian.org/ debian/dists/sid/main/source); no specific program called offlinemap. If it is in one of those files can you just add the file to the bug report? As for the reported bug, it looks like currentThread is being redefined, although how that is happening is beyond me. I checked the 'threading' module and no where is currentThread redefined which could lead to None. Has the app being run been changed at all since Python 2.2 was released? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754449&group_id=5470 From noreply at sourceforge.net Tue Mar 9 07:20:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 07:21:00 2004 Subject: [ python-Bugs-789290 ] Minor FP bug in object.c Message-ID: Bugs item #789290, was opened at 2003-08-15 15:15 Message generated for change (Comment added) made by nmm1 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789290&group_id=5470 Category: Python Interpreter Core Group: Python 2.2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nick Maclaren (nmm1) Assigned to: Nobody/Anonymous (nobody) Summary: Minor FP bug in object.c Initial Comment: This is closely related to the one I have reported in floatobject.c (789159). VERY closely. It is shown up by the following test on a machine with 64-bit longs and floating-point trapping turned on (though it might show up as bogus results even with no trapping): print int( 9223372036854775200.0) print int( 9223372036854775800.0) print int(-9223372036854776800.0) print int(-9223372036854777000.0) 958,959c958,959 < double intpart, fractpart; < int expo; --- > double intpart, fractpart, z; > int expo, i, j; 978c978,989 < if (intpart > LONG_MAX || -intpart > LONG_MAX) { --- > /* Remember that (double)LONG_MAX can round either way. */ > if (intpart > LONG_MIN/2 && intpart < LONG_MAX/2) > z = 0.0; > else { > z = (intpart >= 0.0 ? intpart : -intpart); > for (i = (sizeof(long)*CHAR_BIT-1)/16; i >= 0; --i) { > x = LONG_MAX; > for (j = 0; j < i; ++j) x >>= 16; > z -= ldexp(x&0xffff,16*i); > } > } > if (z > 0.0) { ---------------------------------------------------------------------- >Comment By: Nick Maclaren (nmm1) Date: 2004-03-09 12:20 Message: Logged In: YES user_id=652073 The bug is overflow (i.e. undefined behaviour), and so the symptoms will vary according to the system. Under the conditions I was running, there was no output, because Python terminated with a SIGFPE. As I said, it could as easily show up as erroneous results. In THIS case, the failure occurs in the input processing, and the purpose of prefixing it by print and int() is if you try it on a system where it gives wrong answers. If you don't have access to a system where overflow can be turned on or one that uses unusual arithmetic, you will not be able to repeat it. That is why I created a fix. The reason that I didn't attach is is that attachment was broken; I don't know why, and have neither the time nor the inclination to debug a Web interface that I do not manage. I can trivially send such things by Email, which is far more reliable. There doesn't appear to be a mechanism to try again, so here is a context diff: *** object.c.org Wed Feb 19 03:21:21 2003 --- object.c Fri Aug 15 15:22:50 2003 *************** *** 955,962 **** long _Py_HashDouble(double v) { ! double intpart, fractpart; ! int expo; long hipart; long x; /* the final hash value */ /* This is designed so that Python numbers of different types --- 955,962 ---- long _Py_HashDouble(double v) { ! double intpart, fractpart, z; ! int expo, i, j; long hipart; long x; /* the final hash value */ /* This is designed so that Python numbers of different types *************** *** 975,981 **** #endif if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ ! if (intpart > LONG_MAX || -intpart > LONG_MAX) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) --- 975,992 ---- #endif if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ ! /* Remember that (double)LONG_MAX can round either way. */ ! if (intpart > LONG_MIN/2 && intpart < LONG_MAX/2) ! z = 0.0; ! else { ! z = (intpart >= 0.0 ? intpart : -intpart); ! for (i = (sizeof(long)*CHAR_BIT-1)/16; i >= 0; --i) { ! x = LONG_MAX; ! for (j = 0; j < i; ++j) x >>= 16; ! z -= ldexp(x&0xffff,16*i); ! } ! } ! if (z > 0.0) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-02-17 00:22 Message: Logged In: YES user_id=31435 Sorry, I can't make for this, so unassigned it. To help the next person, 1. Please say something about what "the bug" is. You show 4 lines printing int(big_integer), but don't show any output. In addition, the patch *appears* to be against _Py_HashDouble (), but that function isn't involved in int() or in printing. 2. Please generate a context diff for patches, and attach the patch to the bug report instead of pasting it into the text box. SourceForge destroys the intended line structure and indentation in text boxes, and this non-context diff patch is very hard to follow in this mangled form. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789290&group_id=5470 From noreply at sourceforge.net Tue Mar 9 09:33:55 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 10:29:04 2004 Subject: [ python-Bugs-912758 ] AskFolder (EasyDialogs) does not work? Message-ID: Bugs item #912758, was opened at 2004-03-09 09:33 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912758&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Benjamin Schollnick (bscholln) Assigned to: Jack Jansen (jackjansen) Summary: AskFolder (EasyDialogs) does not work? Initial Comment: I previously was using this code: #fss , ok = macfs.GetDirectory('Folder to search:') Which worked fine on Python v2.3 on MOSX v10.3. But, I am updating the code to use: test = EasyDialogs.AskFolder ( message="Please choose a folder to process", defaultLocation=".", wanted=string) Which results in: Traceback (most recent call last): File "Panther:Users:benjamin:Desktop:Python:finders:re-dup- file.py", line 59, in ? test = EasyDialogs.AskFolder ( message="Please choose a folder to process", defaultLocation=".", wanted=string) AttributeError: 'module' object has no attribute 'AskFolder' If I run the EasyDialogs.py self test, it dies (without a traceback), right after the following code: rv = AskFileForSave(wanted=Carbon.File.FSRef, savedFileName="%s.txt"%s) Message("rv.as_pathname: %s"%rv.as_pathname()) Which the AskFolder test is what appears to be crashing the EasyDialogs test... (Since the pathname test message is appearing during the self test). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912758&group_id=5470 From noreply at sourceforge.net Tue Mar 9 09:19:25 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 11:02:34 2004 Subject: [ python-Bugs-912747 ] Unable to overwrite file with findertools.move Message-ID: Bugs item #912747, was opened at 2004-03-09 09:19 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912747&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Benjamin Schollnick (bscholln) Assigned to: Jack Jansen (jackjansen) Summary: Unable to overwrite file with findertools.move Initial Comment: I am revising a application that was working on MOSX 10.2, but Python v2.3 appears to have subtle broke a few items... if mac_mode: findertools.move (old_path + filename, new_path) Is dying with the following error... Main, filename : 01_100_QTSKINS_L_12.JPG Moving ------------------------------------- Traceback (most recent call last): File "Panther:Users:benjamin:Desktop:Python:finders:re-dup- file.py", line 102, in ? move_file ( pathname, new_dir, filename ) File "Panther:Users:benjamin:Desktop:Python:finders:re-dup- file.py", line 53, in move_file findertools.move (old_path + filename, new_path) File "mac:Applications:Python 2.2.2:Mac:Lib:findertools.py", line 74, in move return finder.move(src_fss, to=dst_fss) File "mac:Applications:Python 2.2.2:Mac:Lib:lib-scriptpackages: Finder:Standard_Suite.py", line 294, in move raise aetools.Error, aetools.decodeerror(_arguments) aetools.Error: (-10000, 'errAEEventFailed', None) As far as I can tell, the move command is not allowing a overwrite situation... If this is expected behavior, is there any way we could add a flag for allowing overwrite? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912747&group_id=5470 From noreply at sourceforge.net Tue Mar 9 11:32:25 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 11:32:30 2004 Subject: [ python-Bugs-912845 ] urllib2 checks for http return code 200 only. Message-ID: Bugs item #912845, was opened at 2004-03-09 18:32 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912845&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Ahmed F. (oneofone) Assigned to: Nobody/Anonymous (nobody) Summary: urllib2 checks for http return code 200 only. Initial Comment: from urllib2 import * req = Request("http://someurl/page.html", headers={'range: bytes=%s':'20-40'}) result = urlopen(req) will die with something like : File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain result = func(*args) File "/usr/lib/python2.3/urllib2.py", line 412, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 206: Partial Content line 892 in {PATH}/urllib2.py should be changed from : if code == 200: to if code in [200, 206]: peace ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912845&group_id=5470 From noreply at sourceforge.net Tue Mar 9 14:16:46 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 14:16:53 2004 Subject: [ python-Bugs-912943 ] 7.5.6 Thread Objects is too vague Message-ID: Bugs item #912943, was opened at 2004-03-09 14:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912943&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Roy Smith (roysmith) Assigned to: Nobody/Anonymous (nobody) Summary: 7.5.6 Thread Objects is too vague Initial Comment: Some items which could be improved.... "Once the thread's activity is started, the thread is considered 'alive' and 'active' (these concepts are almost, but not quite exactly, the same; their definition is intentionally somewhat vague)." This is a bit silly. Either these attributes are intended to be exposed to users or they're not. If they are, they should be well defined. If not, they shouldn't be mentioned at all. "If the subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread." This is misleading. You need to call "Thread.__init__ (self)", i.e. pass along the self argument. At least I think you do :-) "join([timeout]) ... When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof)." What happens if you pass None? Does it wait forever? Is this any different from not passing any argument at all? What happens if a timeout occurs? Is there any way to differentiate between a timeout and a normal return? "A thread can be join()ed many times." Presumably only if all but the last call timed out? Or maybe not? If you get a normal return (i.e. not a timeout) from join(), and then call join() again, what happens? Does it just return immediately with no error? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912943&group_id=5470 From noreply at sourceforge.net Tue Mar 9 09:13:36 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 15:03:09 2004 Subject: [ python-Feature Requests-912738 ] Generator-support in map() and filter() Message-ID: Feature Requests item #912738, was opened at 2004-03-09 14:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=912738&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ragnar Kj?rstad (ragnark) Assigned to: Nobody/Anonymous (nobody) Summary: Generator-support in map() and filter() Initial Comment: The current implementation of map() and filter() returns a list when executed on any iterator, including generators. However, it may be very useful to map and filter the output from generators without having to generate all the data and allocate memory for it. I would propose for map() and filter() to return a generator-object instead of a list when the input-argument is a generator. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=912738&group_id=5470 From noreply at sourceforge.net Tue Mar 9 15:11:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 15:11:59 2004 Subject: [ python-Feature Requests-912738 ] Generator-support in map() and filter() Message-ID: Feature Requests item #912738, was opened at 2004-03-09 09:13 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=912738&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Ragnar Kj?rstad (ragnark) Assigned to: Nobody/Anonymous (nobody) Summary: Generator-support in map() and filter() Initial Comment: The current implementation of map() and filter() returns a list when executed on any iterator, including generators. However, it may be very useful to map and filter the output from generators without having to generate all the data and allocate memory for it. I would propose for map() and filter() to return a generator-object instead of a list when the input-argument is a generator. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-09 15:11 Message: Logged In: YES user_id=31435 It's (far) too late to change the signature of map() and filter (). Look in the itertools module instead: its ifilter() and imap () functions already do what you asked for (and more). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=912738&group_id=5470 From noreply at sourceforge.net Tue Mar 9 16:21:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 16:22:00 2004 Subject: [ python-Feature Requests-668905 ] logging module documentation Message-ID: Feature Requests item #668905, was opened at 2003-01-16 16:07 Message generated for change (Comment added) made by richard You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=668905&group_id=5470 Category: Documentation Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Richard Jones (richard) Assigned to: Vinay Sajip (vsajip) Summary: logging module documentation Initial Comment: I believe the logging module documentation needs to give an example of how to simply log to a file. The following example snippet could be appropriate: import logging logger = logging.getLogger('myapp') hdlr = FileHandler('/var/myapp/debug.log') hdlr.setFormatter(Formatter('%(asctime)s %(level)s %(message)s')) logger.addHandler(hdlr) logger.setLevel(DEBUG) ---------------------------------------------------------------------- >Comment By: Richard Jones (richard) Date: 2004-03-10 08:21 Message: Logged In: YES user_id=6405 Please consider adding a simpler interface for people who just want to log to a file: import logging logger = logging.open('/var/log/myapp.log') which does the equivalent of: import logging logger = logging.getLogger('') hdlr = logging.FileHandler('/var/log/myapp.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) which is what I expect most users will want when they first see this module. If they then want to mess around with additional handers, or different formatting or whatever, then they can read the reference doc. Please make the simplest use-case much simpler! ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-01-01 18:10 Message: Logged In: YES user_id=80475 I would also like to see a more thorough set of introductory examples. The second page of the unittest documentation could serve as a model -- it attempts to cover the 90% of what you need to know in a single page of examples. As it stands now, the documentation for the logging module is formidable. Those wanting to take advantage of the module face a steep learning curve from rather heavyweight documentation -- it's complexity exceeds that of almost all modules except for the email and xml packages. Assigning to Vinay Sajip to work with Anthony to improve the docs. ---------------------------------------------------------------------- Comment By: Anthony Baxter (anthonybaxter) Date: 2003-07-08 16:32 Message: Logged In: YES user_id=29957 Why was this closed? nnorwitz's doc fixes, as seen in CVS or http://www.python.org/dev/doc/devel/lib/module-logging.html have no examples section. Running the current logging module docs past a number of python coders here produced a consistent "what the heck?" response - the opening introduction provides no indications of how to use the package. This is a problem for me, right now, so I'm re-opening and assigning to myself to fix. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-28 16:37 Message: Logged In: YES user_id=80475 Reviewed. Closing RFE. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-26 08:36 Message: Logged In: YES user_id=33168 I just updated the logging documentation. Could you please review for accuracy and completeness? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=668905&group_id=5470 From noreply at sourceforge.net Tue Mar 9 16:35:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 16:35:05 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 12:10 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 15:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 15:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 13:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Tue Mar 9 18:22:49 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 18:22:53 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 18:10 Message generated for change (Comment added) made by nascheme You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- >Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 23:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 21:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 21:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 19:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Tue Mar 9 19:16:44 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 9 19:16:47 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 13:10 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-09 19:16 Message: Logged In: YES user_id=33168 IIRC, there was a command line switch to xlc which would change the math behaviour. I don't recall trying it but from the description it seemed like it would work. Neil, I'll try to look at your patch. If you think it's not controversial, just check it in. I'll definitely review it in that case. :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 18:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 16:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 16:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 14:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Wed Mar 10 11:52:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 11:52:54 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 12:10 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 10:52 Message: Logged In: YES user_id=994239 Looks like the test is still failing, even with this patch. Any idea what that xlc option might have been? I looked through the list of options, but it wasn't immediately obvious to me which one might have helped. Any other ideas? Thanks! ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-09 18:16 Message: Logged In: YES user_id=33168 IIRC, there was a command line switch to xlc which would change the math behaviour. I don't recall trying it but from the description it seemed like it would work. Neil, I'll try to look at your patch. If you think it's not controversial, just check it in. I'll definitely review it in that case. :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 17:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 15:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 15:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 13:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:00:17 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:00:24 2004 Subject: [ python-Bugs-913619 ] httplib: HTTPS does not close() connection properly Message-ID: Bugs item #913619, was opened at 2004-03-10 12:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913619&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: rick (sf_rick) Assigned to: Nobody/Anonymous (nobody) Summary: httplib: HTTPS does not close() connection properly Initial Comment: When looping through requests to an HTTP server close() closes out the active connection. An the second loop through a new HTTP connection is created. When looping through requests to an HTTPS server close() does not close the connection. It keeps it active. On the second pass through the loop httplib.HTTPS uses the previously initiated connection. Shouldn't close() close out the connection as it does for the HTTP connection? sample code to illustrate: def getdata(): params = urllib.urlencode({'username': 'test', 'password': 'test'}) h = httplib.HTTPS(host = "test.site.com", port = 443, key_file = "fake.pem", cert_file = "fake.pem") h.putrequest('POST', '/scripts/cgi.exe?') h.putheader('Content-length', '%d'%len(params)) h.putheader('Accept', 'text/plain') h.putheader('Host', 'test.site.com') h.endheaders() h.send(params) reply, msg, hdrs = h.getreply() data = h.getfile().read() file('test.file', 'w').write(data) h.close() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913619&group_id=5470 From noreply at sourceforge.net Wed Mar 10 11:02:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:06:51 2004 Subject: [ python-Bugs-913581 ] PythonLauncher-run scripts have funny $CWD Message-ID: Bugs item #913581, was opened at 2004-03-10 17:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913581&group_id=5470 Category: Macintosh Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jack Jansen (jackjansen) Assigned to: Jack Jansen (jackjansen) Summary: PythonLauncher-run scripts have funny $CWD Initial Comment: PythonLauncher suffers from the general .app problem that it's working directory is "/". This affects scripts run with PythonLauncher without a terminal window: they inherit that home directory. Scripts run with a terminal window get $HOME as working directory. PythonLauncher should do something unified, best is probably to either always use $HOME, or to use the directory where the script is located. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913581&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:14:30 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:14:39 2004 Subject: [ python-Bugs-678250 ] test_mmap failling on AIX Message-ID: Bugs item #678250, was opened at 2003-01-31 11:44 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678250&group_id=5470 Category: Extension Modules Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_mmap failling on AIX Initial Comment: test_mmap is failing on a flush while trying to do: Copy-on-write memory map data not written correctly The problem is that the mmap is opened with ACCESS_COPY. This translates to MAP_PRIVATE. On AIX, the msync man page says: "When the MS_SYNC and MAP_PRIVATE flags both are used, the msync subroutine returns an errno value of EINVAL." I'm not sure what the correct fix should be. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 11:14 Message: Logged In: YES user_id=994239 I'm running into this problem under both AIX 4.3.3 and 5.1. Is this something that's going to affect python if I put it into production, or is it "safe" to ignore it? ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2004-01-07 16:06 Message: Logged In: YES user_id=33168 run the test with the -v flag: ./python ./Lib/test/regrtest.py -v test_mmap I think only everything should be fine up to copy-on-write tests. Here's what a good run looks like: [neal@epoch c3]$ ./python ./Lib/test/regrtest.py -v test_mmap test_mmap Position of foo: 1.0 pages Length of file: 2.0 pages Contents of byte 0: '\x00' Contents of first 3 bytes: '\x00\x00\x00' Modifying file's content... Contents of byte 0: '3' Contents of first 3 bytes: '3\x00\x00' Contents of second page: '\x00foobar\x00' Regex match on mmap (page start, length of match): 1.0 6 Seek to zeroth byte Seek to 42nd byte Seek to last byte Try to seek to negative position... Try to seek beyond end of mmap... Try to seek to negative position... Attempting resize() Creating 10 byte test data file. Opening mmap with access=ACCESS_READ Ensuring that readonly mmap can't be slice assigned. Ensuring that readonly mmap can't be item assigned. Ensuring that readonly mmap can't be write() to. Ensuring that readonly mmap can't be write_byte() to. Ensuring that readonly mmap can't be resized. Opening mmap with size too big Opening mmap with access=ACCESS_WRITE Modifying write-through memory map. Opening mmap with access=ACCESS_COPY Modifying copy-on-write memory map. Ensuring copy-on-write maps cannot be resized. Ensuring invalid access parameter raises exception. Test passed 1 test OK. ---------------------------------------------------------------------- Comment By: Richard Wheeler (wheelrl) Date: 2004-01-07 15:57 Message: Logged In: YES user_id=249546 I am getting the same error on AIX 5.2 with Python 2.3.3 release. What can I do to get around the test error and verify the mmap is working? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-05-06 15:00 Message: Logged In: YES user_id=31435 Hmm. I suspect the flush docs() are too strong (does flush really promise to materialize bytes *on disk*? it doesn't for other Python file objects, you also need os.fsync() for that). Your point is well taken, though, and whatever flush() does normally do, it's not going to do it for a copy-on-write mmap. So fine by me if we declare that attempting to flush() a copy- on-write mmap raises an exception. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-05-03 05:09 Message: Logged In: YES user_id=21627 The documentation for flush says "Flushes changes made to the in-memory copy of a file back to disk." But it doesn't do that, and we all agree it shouldn't do that. So I would claim that it is an error to use .flush on an mmap object that was opened in ACCESS_COPY. This is like trying to write to a file that was opened for reading only: one *could* declare that the write just does nothing, but it helps the developer more if you get an exception, because the code is likely wrong (i.e. not following the likely intentions of the author). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-04-28 14:55 Message: Logged In: YES user_id=31435 Sorry, I've had nothing to do with mmap beyond fixing bugs. The "access" feature was due to Jay Miller, although I believe I checked in his patch. Martin, I don't understand why you think it's reasonable for flush to complain here: the mmap is open for writing, so what's surprising about expecting to be able to flush after a write? Simply that there's no associated file, due to copy-on- write? Then user code would have to be acutely aware of how an mmap'ed object was opened, just to avoid nuisance complaints when they flush after writing. So that's a third alternative: alter the implementation to make mmap.flush() do nothing when an mmap object was opened as copy-on-write. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-03-04 01:00 Message: Logged In: YES user_id=21627 I think the test is somewhat bogus: It tries to check that modification to an ACCESS_COPY doesn't modify the underlying file, but assumes that .flush becomes a no-op, even though an exception is more reasonable (IMO; errors should never pass silently). So I see two options: Declare that .flush() always raises an exception (and modify implementations that don't produce an exception accordingly), or declare that aspect to be system-dependent, and modify the test (and the documentation) to expect and ignore an exception. Assigning to Tim, as he incorporated that feature into mmap. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678250&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:22:34 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:22:42 2004 Subject: [ python-Bugs-713169 ] test_pty fails on HP-UX and AIX when run after test_openpty Message-ID: Bugs item #713169, was opened at 2003-04-01 01:35 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=713169&group_id=5470 Category: Build Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Richard Townsend (rptownsend) Assigned to: Neal Norwitz (nnorwitz) Summary: test_pty fails on HP-UX and AIX when run after test_openpty Initial Comment: Here is the output from test_pty.py: capulet:dist/src > ./python Lib/test/test_pty.py Calling master_open() Got master_fd '3', slave_name '/dev/pts/0' Calling slave_open('/dev/pts/0') Got slave_fd '4' Traceback (most recent call last): File "Lib/test/test_pty.py", line 58, in ? test_basic_pty() File "Lib/test/test_pty.py", line 29, in test_basic_pty if not os.isatty(slave_fd): File "Lib/test/test_pty.py", line 50, in handle_sig raise TestFailed, "isatty hung" test.test_support.TestFailed: isatty hung This was running Python 2.3a2 (downloaded from CVS on Sunday 30th March) built on HP-UX11i. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 11:22 Message: Logged In: YES user_id=994239 I'm running into this problem under both AIX 4.3.3 and 5.1. Is this going to cause a problem if I put python into produciton, or is it "safe" to ignore it? ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-04-01 10:31 Message: Logged In: YES user_id=33168 Actually, there is a 'fix' which is really a work-around the problem. You can disable os.openpty() in pty.master_open. I added a raise OSError at line 50 (before os.openpty()). This allows the test to pass. I think Martin and I agreed that globally disabling wasn't the best solution. That would probably be in some patch. Also, just in case it isn't clear--if you run test_pty BEFORE test_openpty, both tests pass. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-04-01 10:02 Message: Logged In: YES user_id=33168 I fixed the test hanging, but not the actual bug. The bug appears when running test_pty after test_openpty. There's some interaction, but I don't know what it is. The problem happens on AIX also. I searched through some man pages, but nothing leapt out at me. I think I tried googling for the answer to no avail. Any insight or ideas would be helpful. This may have started when adding /dev/ptmx (ptc for AIX) support. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2003-04-01 04:26 Message: Logged In: YES user_id=6656 Neal? I thought you thought this was fixed? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=713169&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:26:22 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:26:30 2004 Subject: [ python-Bugs-678264 ] test_resource fails when file size is limited Message-ID: Bugs item #678264, was opened at 2003-01-31 12:06 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678264&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Neal Norwitz (nnorwitz) Summary: test_resource fails when file size is limited Initial Comment: test_resource does: print resource.RLIM_INFINITY == max I'm not sure of the benefit of this line. For machines which have limited file sizes, it causes the test to fail. Otherwise the test seems to work properly. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 11:26 Message: Logged In: YES user_id=994239 I'm running into this problem under AIX 4.3.3 and 5.1. Is this going to cause a problem if I put python into production, or is it "safe" to ignore it? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-03-30 14:49 Message: Logged In: YES user_id=21627 I'm really not that much concerned about fixing the test, but more about fixing the code itself. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-03-30 14:25 Message: Logged In: YES user_id=33168 Hmmm, sounds like a lot of work. How about something like this: expected_max = resource.RLIM_INFINITY if expected_max != max: # read the file resource limit fsize_ulimit = os.popen('ulimit -f').read() try: # convert the file size to bytes (from 512 byte blocks) expected_max = int(fsize_ulimit.strip()) * 512 except ValueError: raise TestSkipped, "unable to determine expected resource value" print expected_max == max This works, but I'm pretty sure this is not portable. On Linux blocks are 1k. This only works when the block size is 512 bytes. Shall we close this bug as a test environment problem and won't fix? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-03-30 10:15 Message: Logged In: YES user_id=21627 The rationale of the line is explained in the comment: The code tests whether the limit is a really large number, i.e. whether represenation of large limits works. Unfortunately, it doesn't (which is a separate issue): On Linux, RLIM_INFINITY is reported as -1. This comes from RLIM_INFINITY being the larges unsigned long long number, i.e. 0xffffffffffffffffuLL. The resource module represents this incorrectly. I think there is no way to verify that Python computes the real limit correctly (unless we invoke the shell's ulimit for comparison). So you could weaken the test to verify that the limit is non-negative (and, as a side effect, verify that it doesn't raise an exception). If you do so, you'll also have to fix the implementation, so that the weakened-strengthened test passes on Linux. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-03-03 16:17 Message: Logged In: YES user_id=33168 Martin, welcome back! Now I get to assign some bugs to you to see if you have any input. :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678264&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:27:41 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:28:02 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 18:10 Message generated for change (Comment added) made by nascheme You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- >Comment By: Neil Schemenauer (nascheme) Date: 2004-03-10 17:27 Message: Logged In: YES user_id=35752 My patch didn't update the expected output for the test. I've uploaded a new patch that does (if you want to test it again). ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 16:52 Message: Logged In: YES user_id=994239 Looks like the test is still failing, even with this patch. Any idea what that xlc option might have been? I looked through the list of options, but it wasn't immediately obvious to me which one might have helped. Any other ideas? Thanks! ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-10 00:16 Message: Logged In: YES user_id=33168 IIRC, there was a command line switch to xlc which would change the math behaviour. I don't recall trying it but from the description it seemed like it would work. Neil, I'll try to look at your patch. If you think it's not controversial, just check it in. I'll definitely review it in that case. :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 23:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 21:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 21:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 19:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:34:59 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:35:05 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 12:10 Message generated for change (Comment added) made by mdr0 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Nobody/Anonymous (nobody) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 11:34 Message: Logged In: YES user_id=994239 Looks like that fixed it. Thanks! ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-10 11:27 Message: Logged In: YES user_id=35752 My patch didn't update the expected output for the test. I've uploaded a new patch that does (if you want to test it again). ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 10:52 Message: Logged In: YES user_id=994239 Looks like the test is still failing, even with this patch. Any idea what that xlc option might have been? I looked through the list of options, but it wasn't immediately obvious to me which one might have helped. Any other ideas? Thanks! ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-09 18:16 Message: Logged In: YES user_id=33168 IIRC, there was a command line switch to xlc which would change the math behaviour. I don't recall trying it but from the description it seemed like it would work. Neil, I'll try to look at your patch. If you think it's not controversial, just check it in. I'll definitely review it in that case. :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 17:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 15:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 15:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 13:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Wed Mar 10 12:39:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 12:39:42 2004 Subject: [ python-Bugs-678265 ] test_coercion fails on AIX Message-ID: Bugs item #678265, was opened at 2003-01-31 18:10 Message generated for change (Comment added) made by nascheme You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Neal Norwitz (nnorwitz) >Assigned to: Neil Schemenauer (nascheme) Summary: test_coercion fails on AIX Initial Comment: Tim, I assigned this to you to see if you had any insight/ideas about this problem. test_coercion fails on AIX. All the failures are due to the test expecting n+0j, but the output is n-0j. Here's an example: - / (2+0j) = (0.5+0j) ? ^ + / (2+0j) = (0.5-0j) ? ^ I have another compiler, so I'll probably try that. Especially since it's gcc. :-) ---------------------------------------------------------------------- >Comment By: Neil Schemenauer (nascheme) Date: 2004-03-10 17:39 Message: Logged In: YES user_id=35752 Patch commited (test_coercion.py 1.7, test_coercion 1.6). ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 17:34 Message: Logged In: YES user_id=994239 Looks like that fixed it. Thanks! ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-10 17:27 Message: Logged In: YES user_id=35752 My patch didn't update the expected output for the test. I've uploaded a new patch that does (if you want to test it again). ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-10 16:52 Message: Logged In: YES user_id=994239 Looks like the test is still failing, even with this patch. Any idea what that xlc option might have been? I looked through the list of options, but it wasn't immediately obvious to me which one might have helped. Any other ideas? Thanks! ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2004-03-10 00:16 Message: Logged In: YES user_id=33168 IIRC, there was a command line switch to xlc which would change the math behaviour. I don't recall trying it but from the description it seemed like it would work. Neil, I'll try to look at your patch. If you think it's not controversial, just check it in. I'll definitely review it in that case. :-) ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2004-03-09 23:22 Message: Logged In: YES user_id=35752 I really didn't intend for test_coercion to become a platform fp quirks test. The attached patch changes the test to format floating point numbers to one decimal place. ---------------------------------------------------------------------- Comment By: Mark D. Roth (mdr0) Date: 2004-03-09 21:35 Message: Logged In: YES user_id=994239 I've run into this same problem under AIX 4.3.3 with IBM compiler version 6.0.0.5 and under AIX 5.1 with IBM compiler version 6.0.0.4. Is there a work-around, other than building with gcc? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-31 21:08 Message: Logged In: YES user_id=31435 You really need a platform wizard for something like this. If there are any compiler options with descriptions like "generate IEEE-754 compatible code" (or "stricter 754 xyz"), or "disable generation of fused multiply-add", they would be relevant. OTOH, Python promises nothing about how the sign bit of a floating zero behaves, so it would be OK by me if the test were changed not to produce complex results with zero imaginary members. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-31 19:26 Message: Logged In: YES user_id=33168 The test passes with gcc 3.2. The C compiler is in vac.C version 4.4.0.3 (lslpp -l vac.C). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=678265&group_id=5470 From noreply at sourceforge.net Wed Mar 10 15:49:15 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 15:49:19 2004 Subject: [ python-Bugs-913698 ] smtplib module : fatal error with unresolved hostname Message-ID: Bugs item #913698, was opened at 2004-03-10 21:49 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913698&group_id=5470 Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Zarro (chaica) Assigned to: Nobody/Anonymous (nobody) Summary: smtplib module : fatal error with unresolved hostname Initial Comment: I checked in the last cvs and the bug wasn't corriged. if your hostname can't be resolved, so the module will panic and raise a socket.gaierror in line 254: addr = socket.gethostbyname(socket.gethostname()) >>> import socket >>> socket.gethostname() 'desktop' >>> socket.gethostbyname(socket.gethostname()) Traceback (most recent call last): File "", line 1, in ? socket.gaierror: (-2, 'Name or service not known') To correct, catch the exception and give a generic value for self.local_hostname, for example localhost 127.0.0.1 try: addr = socket.gethostbyname(socket.gethostname()) self.local_hostname = '[%s]' % addr except socket.gaierror, msg: self.local_hostname = '[%s]' % '127.0.0.1' Keep me tuned, chaica@ohmytux.com ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913698&group_id=5470 From noreply at sourceforge.net Wed Mar 10 17:22:42 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 10 17:22:48 2004 Subject: [ python-Bugs-875404 ] global stmt causes breakpoints to be ignored Message-ID: Bugs item #875404, was opened at 2004-01-12 06:52 Message generated for change (Comment added) made by isandler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=875404&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Maciej Kalisiak (mackal) Assigned to: Nobody/Anonymous (nobody) Summary: global stmt causes breakpoints to be ignored Initial Comment: It seems that having a "global" statement in "main()" (perhaps elsewhere too) causes pdb to ignore breakpoints in the whole application. See the attached example small program. Procedure: - pdb python_bug.py # the attached program - 's', and then 'n' once or twice to make sure prog loaded - 'break main' - 'c' If the "global foo" statement is present, pdb will not stop at the breakpoint. If it is commented out (and "foo = 1" as well, of course), the breakpoint is obeyed. I'm using Python 2.3 (from the Debian "sid" distribution) Tried under Linux 2.2.20, as well as 2.4.*. Maciej Kalisiak mac at dgp dot toronto dot edu ---------------------------------------------------------------------- Comment By: Ilya Sandler (isandler) Date: 2004-03-10 14:22 Message: Logged In: YES user_id=971153 The same behaviour exists in the CVS version of python Here is what (I think) happens: 1. When you try to set a break on a function: e.g "b main" pdb sets a breakpoint not at "def main", but at the next non comment/non-blank line of code 2. Sample code has "global " as a first non-comment/non-blank line of code, so that's where pdb sets the breakpoint 3. But global is a compile-time statement, the line with global is never reached at run time, so pdb never stops there Workaround for the original submitter: put any other executable stmt as the first line of your main(), or set a bkpt via line number However, this behaviour is still wrong...The bug could be probably fixed by adding more logic to pdb.checkline().... Are there any other compile-time only statements? I think I could submit a patch for this problem, but does anyone look at pdb related patches?? My previous pdb patch #896011 has been sitting in the queue for a month now... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=875404&group_id=5470 From noreply at sourceforge.net Thu Mar 11 09:14:13 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Mar 11 09:14:16 2004 Subject: [ python-Bugs-914148 ] xml.sax segfault on error Message-ID: Bugs item #914148, was opened at 2004-03-11 14:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=914148&group_id=5470 Category: XML Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Adam Sampson (adamsampson) Assigned to: Nobody/Anonymous (nobody) Summary: xml.sax segfault on error Initial Comment: While (mistakenly) using Mark Pilgrim's feedparser module to parse data from , Python segfaults when it should invoke an error handler for invalid XML. The attached code demonstrates the problem; it occurs with Python 2.2.3 and 2.3.3 on my system. I've tried to chop the example data down as far as possible, but reducing it any further doesn't exhibit the problem (it's currently just above 64k, which might be a coincidence). The gdb traceback I get from the example is as follows: #0 normal_updatePosition (enc=0x404a4fc0, ptr=0x40682000
, end=0x81e87e0 "a>\n\n
\n\n
\n [u'/', u'A', u'p', u'p', u'l', u'i', u'c', u'a', u't', u'i', u'o', u'n', u's', u'/', u'T', u'e', u'x', u't', u'E', u'd', u'i', u't', u'.', u'a', u'p', u'p', u'x00'] -- why is last character 0x00??? ####### ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=915942&group_id=5470 From noreply at sourceforge.net Sun Mar 14 08:29:36 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 14 08:29:41 2004 Subject: [ python-Bugs-916013 ] Improving MacPython's IAC support Message-ID: Bugs item #916013, was opened at 2004-03-14 13:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=916013&group_id=5470 Category: Macintosh Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: has (hhas) Assigned to: Jack Jansen (jackjansen) Summary: Improving MacPython's IAC support Initial Comment: While usable, MacPython's high-level Apple event-based inter- application communication (IAC) support is not as good as it could be. As a first step to overhauling it, I'd like to suggest replacing the aepack.py, aetools.py, aetypes.py and gensuitemodule.py modules with appscript, a new MacPython- Apple Event Manager bridge [c/o yrs truly] submitted here for your consideration: http://freespace.virgin.net/hamish.sanderson/appscript.html (Note: appscript development is ongoing as of 3/14/04. Assuming provisional acceptance, some discussion of Things To Be Done Before It's Included will be needed; the MacPython SIG might be a good place for this.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=916013&group_id=5470 From noreply at sourceforge.net Sun Mar 14 12:35:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 14 15:42:21 2004 Subject: [ python-Bugs-913698 ] smtplib : module bug with unresolved hostname Message-ID: Bugs item #913698, was opened at 2004-03-10 21:49 Message generated for change (Settings changed) made by chaica You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913698&group_id=5470 Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Zarro (chaica) Assigned to: Nobody/Anonymous (nobody) >Summary: smtplib : module bug with unresolved hostname Initial Comment: I checked in the last cvs and the bug wasn't corriged. if your hostname can't be resolved, so the module will panic and raise a socket.gaierror in line 254: addr = socket.gethostbyname(socket.gethostname()) >>> import socket >>> socket.gethostname() 'desktop' >>> socket.gethostbyname(socket.gethostname()) Traceback (most recent call last): File "", line 1, in ? socket.gaierror: (-2, 'Name or service not known') To correct, catch the exception and give a generic value for self.local_hostname, for example localhost 127.0.0.1 try: addr = socket.gethostbyname(socket.gethostname()) self.local_hostname = '[%s]' % addr except socket.gaierror, msg: self.local_hostname = '[%s]' % '127.0.0.1' Keep me tuned, chaica@ohmytux.com ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913698&group_id=5470 From noreply at sourceforge.net Sun Mar 14 23:27:21 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Mar 14 23:27:27 2004 Subject: [ python-Bugs-789290 ] Minor FP bug in object.c Message-ID: Bugs item #789290, was opened at 2003-08-15 11:15 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789290&group_id=5470 Category: Python Interpreter Core Group: Python 2.2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nick Maclaren (nmm1) Assigned to: Nobody/Anonymous (nobody) Summary: Minor FP bug in object.c Initial Comment: This is closely related to the one I have reported in floatobject.c (789159). VERY closely. It is shown up by the following test on a machine with 64-bit longs and floating-point trapping turned on (though it might show up as bogus results even with no trapping): print int( 9223372036854775200.0) print int( 9223372036854775800.0) print int(-9223372036854776800.0) print int(-9223372036854777000.0) 958,959c958,959 < double intpart, fractpart; < int expo; --- > double intpart, fractpart, z; > int expo, i, j; 978c978,989 < if (intpart > LONG_MAX || -intpart > LONG_MAX) { --- > /* Remember that (double)LONG_MAX can round either way. */ > if (intpart > LONG_MIN/2 && intpart < LONG_MAX/2) > z = 0.0; > else { > z = (intpart >= 0.0 ? intpart : -intpart); > for (i = (sizeof(long)*CHAR_BIT-1)/16; i >= 0; --i) { > x = LONG_MAX; > for (j = 0; j < i; ++j) x >>= 16; > z -= ldexp(x&0xffff,16*i); > } > } > if (z > 0.0) { ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-14 23:27 Message: Logged In: YES user_id=31435 Nick, that helps (thanks!), but I still don't understand the connection between your examples and the patch. The patch is indeed to _Py_HashDouble(), but that shouldn't get executed when doing, e.g., print int(9223372036854775200.0) Is there a relationship between the examples and the patch, or do the examples belong to some other bug report? Or is another assumption here that you're typing those examples in to an interactive Python shell? *Then* _Py_HashDouble() would get called, as part of compilation. ---------------------------------------------------------------------- Comment By: Nick Maclaren (nmm1) Date: 2004-03-09 07:20 Message: Logged In: YES user_id=652073 The bug is overflow (i.e. undefined behaviour), and so the symptoms will vary according to the system. Under the conditions I was running, there was no output, because Python terminated with a SIGFPE. As I said, it could as easily show up as erroneous results. In THIS case, the failure occurs in the input processing, and the purpose of prefixing it by print and int() is if you try it on a system where it gives wrong answers. If you don't have access to a system where overflow can be turned on or one that uses unusual arithmetic, you will not be able to repeat it. That is why I created a fix. The reason that I didn't attach is is that attachment was broken; I don't know why, and have neither the time nor the inclination to debug a Web interface that I do not manage. I can trivially send such things by Email, which is far more reliable. There doesn't appear to be a mechanism to try again, so here is a context diff: *** object.c.org Wed Feb 19 03:21:21 2003 --- object.c Fri Aug 15 15:22:50 2003 *************** *** 955,962 **** long _Py_HashDouble(double v) { ! double intpart, fractpart; ! int expo; long hipart; long x; /* the final hash value */ /* This is designed so that Python numbers of different types --- 955,962 ---- long _Py_HashDouble(double v) { ! double intpart, fractpart, z; ! int expo, i, j; long hipart; long x; /* the final hash value */ /* This is designed so that Python numbers of different types *************** *** 975,981 **** #endif if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ ! if (intpart > LONG_MAX || -intpart > LONG_MAX) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) --- 975,992 ---- #endif if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ ! /* Remember that (double)LONG_MAX can round either way. */ ! if (intpart > LONG_MIN/2 && intpart < LONG_MAX/2) ! z = 0.0; ! else { ! z = (intpart >= 0.0 ? intpart : -intpart); ! for (i = (sizeof(long)*CHAR_BIT-1)/16; i >= 0; --i) { ! x = LONG_MAX; ! for (j = 0; j < i; ++j) x >>= 16; ! z -= ldexp(x&0xffff,16*i); ! } ! } ! if (z > 0.0) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-02-16 19:22 Message: Logged In: YES user_id=31435 Sorry, I can't make for this, so unassigned it. To help the next person, 1. Please say something about what "the bug" is. You show 4 lines printing int(big_integer), but don't show any output. In addition, the patch *appears* to be against _Py_HashDouble (), but that function isn't involved in int() or in printing. 2. Please generate a context diff for patches, and attach the patch to the bug report instead of pasting it into the text box. SourceForge destroys the intended line structure and indentation in text boxes, and this non-context diff patch is very hard to follow in this mangled form. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789290&group_id=5470 From noreply at sourceforge.net Mon Mar 15 05:22:14 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 15 05:22:20 2004 Subject: [ python-Bugs-914148 ] xml.sax segfault on error Message-ID: Bugs item #914148, was opened at 2004-03-11 06:14 Message generated for change (Comment added) made by moraes You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=914148&group_id=5470 Category: XML Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Adam Sampson (adamsampson) Assigned to: Nobody/Anonymous (nobody) Summary: xml.sax segfault on error Initial Comment: While (mistakenly) using Mark Pilgrim's feedparser module to parse data from , Python segfaults when it should invoke an error handler for invalid XML. The attached code demonstrates the problem; it occurs with Python 2.2.3 and 2.3.3 on my system. I've tried to chop the example data down as far as possible, but reducing it any further doesn't exhibit the problem (it's currently just above 64k, which might be a coincidence). The gdb traceback I get from the example is as follows: #0 normal_updatePosition (enc=0x404a4fc0, ptr=0x40682000
, end=0x81e87e0 "a>
\n\n
\n\n
\n MacOS.Error: (-43, 'File not found') ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=919776&group_id=5470 From noreply at sourceforge.net Fri Mar 19 17:45:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Mar 19 17:45:48 2004 Subject: [ python-Bugs-914148 ] xml.sax segfault on error Message-ID: Bugs item #914148, was opened at 2004-03-11 15:14 Message generated for change (Comment added) made by jojoworks You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=914148&group_id=5470 Category: XML Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Adam Sampson (adamsampson) Assigned to: Nobody/Anonymous (nobody) Summary: xml.sax segfault on error Initial Comment: While (mistakenly) using Mark Pilgrim's feedparser module to parse data from , Python segfaults when it should invoke an error handler for invalid XML. The attached code demonstrates the problem; it occurs with Python 2.2.3 and 2.3.3 on my system. I've tried to chop the example data down as far as possible, but reducing it any further doesn't exhibit the problem (it's currently just above 64k, which might be a coincidence). The gdb traceback I get from the example is as follows: #0 normal_updatePosition (enc=0x404a4fc0, ptr=0x40682000
, end=0x81e87e0 "a>
\n\n
\n\n
\n MacOS.Error: (-43, 'File not found') ---------------------------------------------------------------------- >Comment By: Michael Hudson (mwh) Date: 2004-03-29 17:07 Message: Logged In: YES user_id=6656 I'm fairly sure this is a duplicate... at least, you can find mails on pythonmac-sig where I work around this. It's a bit of a pain. Ah, yes, it's 706592. Closing. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=919776&group_id=5470 From noreply at sourceforge.net Mon Mar 29 12:57:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 12:58:04 2004 Subject: [ python-Bugs-922964 ] file built-in object is after file() function Message-ID: Bugs item #922964, was opened at 2004-03-25 08:18 Message generated for change (Comment added) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922964&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Francesco Ricciardi (nerby) Assigned to: Nobody/Anonymous (nobody) Summary: file built-in object is after file() function Initial Comment: In section 2.1 of the HTML and PDF-A4 library references (so supposedly in all lib references), in the description of the file() function, it says that "Return a new file object (described earlier under Built-in Types)", but the Built-in Types section is later not earlier. ---------------------------------------------------------------------- >Comment By: Michael Hudson (mwh) Date: 2004-03-29 18:57 Message: Logged In: YES user_id=6656 That's not what he's complaining about, though. Seems to me that just removing the 'earlier' would suffice. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-25 08:28 Message: Logged In: YES user_id=80475 Forward references are only problematic in the tutorial. The rest of the docs tend to be used in a random access fashion rather than sequentially. That's a good thing because forward references are everywhere. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922964&group_id=5470 From noreply at sourceforge.net Mon Mar 29 13:41:56 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 13:41:59 2004 Subject: [ python-Bugs-925500 ] os.py uses #' - undocumented magic? Message-ID: Bugs item #925500, was opened at 2004-03-29 13:41 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: os.py uses #' - undocumented magic? Initial Comment: os.py wraps the first section of code (determining which operating system and path to use) in lines containing just #' (A comment start followed by a single-quote start.) This looks like unexplained magic. It should either be deleted, or commented to indicate why it is there. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 From noreply at sourceforge.net Mon Mar 29 13:42:53 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 13:42:56 2004 Subject: [ python-Bugs-925500 ] os.py uses #' - undocumented magic? Message-ID: Bugs item #925500, was opened at 2004-03-29 13:41 Message generated for change (Settings changed) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 Category: Python Library >Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: os.py uses #' - undocumented magic? Initial Comment: os.py wraps the first section of code (determining which operating system and path to use) in lines containing just #' (A comment start followed by a single-quote start.) This looks like unexplained magic. It should either be deleted, or commented to indicate why it is there. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 From noreply at sourceforge.net Mon Mar 29 14:28:20 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 14:28:23 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 14:28 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Mon Mar 29 14:39:34 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 14:39:45 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 14:28 Message generated for change (Comment added) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Mon Mar 29 14:58:17 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 15:02:28 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 14:28 Message generated for change (Comment added) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Mon Mar 29 15:53:18 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 15:53:22 2004 Subject: [ python-Bugs-903339 ] OpenVMS file system and UNIVERSAL_NEWLINES support Message-ID: Bugs item #903339, was opened at 2004-02-24 11:20 Message generated for change (Comment added) made by pieronne You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Pi?ronne Jean-Fran?ois (pieronne) Assigned to: Nobody/Anonymous (nobody) Summary: OpenVMS file system and UNIVERSAL_NEWLINES support Initial Comment: I am one of the maintainer of Python on OpenVMS. Building from time to time Python 2.4 from CVS snapshot, I have just noticed that all the conditional compilation against WITH_UNIVERSAL_NEWLINES has been removed. This is a major problem on OpenVMS. VMS has a complex file system which is mostly record oriented and not stream oriented (even if it support stream oriented files, this is not the default). For example it support the following record formats: fixed-length, variable-length, variable with fixed-length control, 3 stream format, etc... The default is variable-length. So reading (opening) text file, for example during a import, in binary mode lead to incorrect results because there are no '\n' or any character (or combinaison of characters) at the end of the line. If the file is not open in binary mode the VMS CRTL automatically append a '\n' at the end of the record, so all work correctly. This not the case in binary mode, in this case the record is read as is, in fact you even get the control part of the record for some record format. So, is it possible to maintain this test, even as undocumented or is it acceptable to transform it into a specific VMS test. But I suspect that other mainframe file systems will have the same problem. Thanks for any help. Regards, Jean-Fran?ois ---------------------------------------------------------------------- >Comment By: Pi?ronne Jean-Fran?ois (pieronne) Date: 2004-03-29 22:53 Message: Logged In: YES user_id=414701 I have attach a patch for Include/fileobject.h Modules/bz2module.c Objects/fileobject.c This patch use a new conditionnal compilation item: Py_USE_RECORD_IO which need to be define only on systems which use RECORD oriented IO and not stream oriented IO It also contain a small fix for OpenVMS. Jean-Fran?ois ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 From noreply at sourceforge.net Mon Mar 29 14:14:41 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 16:02:20 2004 Subject: [ python-Bugs-924218 ] socket._fileobject._getclosed() returns wrong value Message-ID: Bugs item #924218, was opened at 2004-03-26 13:33 Message generated for change (Comment added) made by gigamorph You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924218&group_id=5470 Category: Python Library Group: Python 2.3 >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: June Kim (gigamorph) Assigned to: Nobody/Anonymous (nobody) Summary: socket._fileobject._getclosed() returns wrong value Initial Comment: In socket.py, _getclosed() is defined as follows: class _fileobject(object) # ... def _getclosed(self): return self._sock is not None Which causes the following interaction: >>> import socket >>> s = socket.socket() >>> f = s.makefile() >>> f.closed True >>> f.close() >>> f.closed False Shouldn't the values of f.closed the opposite of the above? ---------------------------------------------------------------------- >Comment By: June Kim (gigamorph) Date: 2004-03-29 11:14 Message: Logged In: YES user_id=1007376 Duplicate, resolved in #924242. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924218&group_id=5470 From noreply at sourceforge.net Mon Mar 29 16:34:09 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 16:34:13 2004 Subject: [ python-Bugs-925628 ] help does not help with imported objects Message-ID: Bugs item #925628, was opened at 2004-03-29 16:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: help does not help with imported objects Initial Comment: help(re) just says it is a wrapper for sre. To get actually help, you need to explicitly import sre as well. re.__doc__ = re.__doc__ + sre.__doc__ helps, but still does not list information on classes or exported functions. Specific requests, such as help(re.subn) do work; it is only the module-level help that is lacking when a module reexports imported objects. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 From noreply at sourceforge.net Mon Mar 29 16:34:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 16:34:36 2004 Subject: [ python-Bugs-925628 ] help does not help with imported objects Message-ID: Bugs item #925628, was opened at 2004-03-29 16:34 Message generated for change (Settings changed) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None >Priority: 2 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: help does not help with imported objects Initial Comment: help(re) just says it is a wrapper for sre. To get actually help, you need to explicitly import sre as well. re.__doc__ = re.__doc__ + sre.__doc__ helps, but still does not list information on classes or exported functions. Specific requests, such as help(re.subn) do work; it is only the module-level help that is lacking when a module reexports imported objects. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 From noreply at sourceforge.net Mon Mar 29 16:34:50 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 16:34:55 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 14:28 Message generated for change (Settings changed) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None >Priority: 4 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Mon Mar 29 16:35:14 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 16:35:53 2004 Subject: [ python-Bugs-925500 ] os.py uses #' - undocumented magic? Message-ID: Bugs item #925500, was opened at 2004-03-29 13:41 Message generated for change (Settings changed) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None >Priority: 3 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: os.py uses #' - undocumented magic? Initial Comment: os.py wraps the first section of code (determining which operating system and path to use) in lines containing just #' (A comment start followed by a single-quote start.) This looks like unexplained magic. It should either be deleted, or commented to indicate why it is there. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:05:13 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:05:17 2004 Subject: [ python-Bugs-903339 ] OpenVMS file system and UNIVERSAL_NEWLINES support Message-ID: Bugs item #903339, was opened at 2004-02-24 11:20 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Pi?ronne Jean-Fran?ois (pieronne) Assigned to: Nobody/Anonymous (nobody) Summary: OpenVMS file system and UNIVERSAL_NEWLINES support Initial Comment: I am one of the maintainer of Python on OpenVMS. Building from time to time Python 2.4 from CVS snapshot, I have just noticed that all the conditional compilation against WITH_UNIVERSAL_NEWLINES has been removed. This is a major problem on OpenVMS. VMS has a complex file system which is mostly record oriented and not stream oriented (even if it support stream oriented files, this is not the default). For example it support the following record formats: fixed-length, variable-length, variable with fixed-length control, 3 stream format, etc... The default is variable-length. So reading (opening) text file, for example during a import, in binary mode lead to incorrect results because there are no '\n' or any character (or combinaison of characters) at the end of the line. If the file is not open in binary mode the VMS CRTL automatically append a '\n' at the end of the record, so all work correctly. This not the case in binary mode, in this case the record is read as is, in fact you even get the control part of the record for some record format. So, is it possible to maintain this test, even as undocumented or is it acceptable to transform it into a specific VMS test. But I suspect that other mainframe file systems will have the same problem. Thanks for any help. Regards, Jean-Fran?ois ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:05 Message: Logged In: YES user_id=21627 I don't understand the problem. What precisely is currently not working, and precisely why does it fail? (exact file and line that causes problems, please) ---------------------------------------------------------------------- Comment By: Pi?ronne Jean-Fran?ois (pieronne) Date: 2004-03-29 22:53 Message: Logged In: YES user_id=414701 I have attach a patch for Include/fileobject.h Modules/bz2module.c Objects/fileobject.c This patch use a new conditionnal compilation item: Py_USE_RECORD_IO which need to be define only on systems which use RECORD oriented IO and not stream oriented IO It also contain a small fix for OpenVMS. Jean-Fran?ois ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:09:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:10:29 2004 Subject: [ python-Bugs-925500 ] os.py uses #' - undocumented magic? Message-ID: Bugs item #925500, was opened at 2004-03-29 20:41 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 3 Submitted By: Jim Jewett (jimjjewett) >Assigned to: Skip Montanaro (montanaro) Summary: os.py uses #' - undocumented magic? Initial Comment: os.py wraps the first section of code (determining which operating system and path to use) in lines containing just #' (A comment start followed by a single-quote start.) This looks like unexplained magic. It should either be deleted, or commented to indicate why it is there. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:09 Message: Logged In: YES user_id=21627 Assigning to Skip, who added these in os.py 1.41, with a check-in message of added several more __all__ lists ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:11:27 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:11:32 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 21:28 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 4 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:11 Message: Logged In: YES user_id=21627 I fail to see a bug. Which specific usage of dir() does not work as intended? ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 21:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 21:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:17:03 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:17:16 2004 Subject: [ python-Bugs-924703 ] test_unicode_file fails on Win98SE Message-ID: Bugs item #924703, was opened at 2004-03-28 03:48 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 Category: Unicode Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: M.-A. Lemburg (lemburg) Summary: test_unicode_file fails on Win98SE Initial Comment: In current CVS, test_unicode_file fails on Win98SE. This has been going on for some time, actually. ERROR: test_single_files (__main__.TestUnicodeFiles) Traceback (most recent call last): File ".../lib/test/test_unicode_file.py", line 162, in test_single_files self._test_single(TESTFN_UNICODE) File ".../lib/test/test_unicode_file.py", line 136, in _test_single self._do_single(filename) File ".../lib/test/test_unicode_file.py", line 49, in _do_single new_base = unicodedata.normalize("NFD", new_base) TypeError: normalized() argument 2 must be unicode, not str At this point, filename is TESTFN_UNICODE is u'@test-\xe0\xf2' os.path.abspath(filename) is 'C:\Code\python\PC\VC6\@test-\xe0\xf2' new_base is '@test-\xe0\xf2 So abspath() removed the "Unicodeness" of filename, and new_base is indeed not a Unicode string at this point. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:17 Message: Logged In: YES user_id=21627 abspath(unicode) should return a Unicode path. Does it help if _abspath (in ntpath.py) is changed to contain if not isabs(path): if isinstance(path, unicode): cwd = os.getcwdu() else: cwd = os.getcwd() path = join(cwd, path) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:18:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:18:53 2004 Subject: [ python-Bugs-924361 ] unicodeobjct: bad argument to internal function Message-ID: Bugs item #924361, was opened at 2004-03-27 09:20 Message generated for change (Settings changed) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924361&group_id=5470 Category: Unicode Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Matthias Klose (doko) >Assigned to: Martin v. L?wis (loewis) Summary: unicodeobjct: bad argument to internal function Initial Comment: [forwarded from http://bugs.debian.org/239986] #! /usr/bin/python2.3 import unicodedata unicodedata.normalize('NFKC', u'') I guess (but haven't looked at the source) that something isn't cleaned up properly in this scenario. The bug doesn't manifest itself in the normalize() call itself but the exception is thrown in the next statement. (eg running unicodedata.normalize('NFKC', u'') ; x = 1 interactively causes the error to be printed after the x=1 statement) The x=1 doesn't seem to be needed, simply hitting return shows the message. $ python Python 2.3.3 (#2, Feb 24 2004, 09:29:20) [GCC 3.3.3 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import unicodedata >>> unicodedata.normalize('NFKC', u'') u'' >>> SystemError: ../Objects/unicodeobject.c:278: bad argument to internal function >>> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924361&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:19:57 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:20:01 2004 Subject: [ python-Bugs-924333 ] Build issues (lib path) on linux2-x86_64 Message-ID: Bugs item #924333, was opened at 2004-03-27 05:12 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924333&group_id=5470 Category: Build Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Christopher Petrilli (petrilli) Assigned to: Nobody/Anonymous (nobody) Summary: Build issues (lib path) on linux2-x86_64 Initial Comment: The current CVS HEAD won't build "out of the box" on a Fedora x86_64 box, nor on any other Linux AMD64 platform. This is due to the fact that the libraries for many things are not in /usr/lib, but /usr/lib64, and the current 'autoconf' script, as well as the current setup.py do not look there. When added, they detect, build. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:19 Message: Logged In: YES user_id=21627 Can you submit a patch? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924333&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:20:49 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:20:59 2004 Subject: [ python-Bugs-924294 ] IPV6 not correctly ifdef'd in socketmodule.c Message-ID: Bugs item #924294, was opened at 2004-03-27 01:07 Message generated for change (Settings changed) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924294&group_id=5470 Category: Build Group: Python 2.3 Status: Open Resolution: None >Priority: 7 Submitted By: David Meleedy (dmeleedy) >Assigned to: Martin v. L?wis (loewis) Summary: IPV6 not correctly ifdef'd in socketmodule.c Initial Comment: buckaroo-75: diff -c3 socketmodule.c-dist socketmodule.c *** socketmodule.c-dist Fri Mar 26 18:51:52 2004 --- socketmodule.c Fri Mar 26 18:52:47 2004 *************** *** 2971,2977 **** return NULL; } ! #ifndef ENABLE_IPV6 if(af == AF_INET6) { PyErr_SetString(socket_error, "can't use AF_INET6, IPv6 is disabled"); --- 2971,2977 ---- return NULL; } ! #ifdef ENABLE_IPV6 if(af == AF_INET6) { PyErr_SetString(socket_error, "can't use AF_INET6, IPv6 is disabled"); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924294&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:22:15 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:22:21 2004 Subject: [ python-Feature Requests-923697 ] SAX2 'property_encoding' feature not supported Message-ID: Feature Requests item #923697, was opened at 2004-03-26 07:39 Message generated for change (Settings changed) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=923697&group_id=5470 >Category: None Group: None Status: Open Resolution: None Priority: 4 Submitted By: Joseph Walton (josephw) Assigned to: Nobody/Anonymous (nobody) Summary: SAX2 'property_encoding' feature not supported Initial Comment: I need to parse a byte stream as an XML document and, afterwards, access the same document as a Unicode string. I would prefer to rely on the parser's charset-determining logic, and the 'property_encoding' feature ("http://www.python.org/sax/properties/encoding") seems to offer exactly this information. However, the default Expat parser doesn't support this feature. --- from xml.sax import make_parser, handler from xml.sax.xmlreader import InputSource from sys import stdin p = make_parser() # Should not fail. Should it return None, or UTF-8? assert(p.getProperty(handler.property_encoding) == None) source = InputSource() source.setByteStream(stdin) p.parse(source) # Should now be the name of the actual encoding used assert(p.getProperty(handler.property_encoding) != None) --- This raises SAXNotRecognizedException. Is there another SAX parser I could use instead? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=923697&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:26:05 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:26:11 2004 Subject: [ python-Bugs-922914 ] Installer misplaces tcl library Message-ID: Bugs item #922914, was opened at 2004-03-25 06:55 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: WS Wong (wswong) Assigned to: Nobody/Anonymous (nobody) Summary: Installer misplaces tcl library Initial Comment: Python 2.3.3 on Windows 2000 Professional ------------------------------------------- Could not start IDLE after installation of Python in C:\WSPrograms\Python23 Went to C:\WSPrograms\Python23\Lib\idlelib and from the command line typed C:\WSPrograms\Python23\python idle.py The following traceback obtained: C:\WSPrograms\Python23 \Lib\idlelib>c:\wsprograms\python23\python idle.py Traceback (most recent call last): File "idle.py", line 23, in ? idlelib.PyShell.main() File "C:\WSPrograms\Python23\lib\idlelib\PyShell.py", line 1269, in main root = Tk(className="Idle") File "C:\WSPrograms\Python23\lib\lib-tk\Tkinter.py", line 1564, in __init__ self.tk = _tkinter.create(screenName, baseName, className) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\WSPrograms\ruby167ms\tcl\lib\tcl8.3} {C:\WSPrograms\ruby167ms\tcl\lib\tc l8.3} C:/WSPrograms/ruby167ms/tcl/lib/tcl8.4 c:/wsprograms/python23/lib/tcl8.4 c :/wsprograms/lib/tcl8.4 c:/lib/tcl8.4 c:/wsprograms/library c:/library c:/../tcl 8.4.3/library Looking at the directories that was installed, I found that the tcl8.4 was actually located in C:\WSPrograms\Python23\tcl\tk8.4 which was never on the search path. After I copied the tcl8.4 directory to C:\WSPrograms\Python23\Lib and run the commands again, it worked. Not sure what other implications this will cause but at least I have IDLE running again. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:26 Message: Logged In: YES user_id=21627 Have you set the TCL_LIBRARY environment variable? If so, you should unset it. If you cannot unset it, you are on your own - as a system administrator, by setting this variable, you express the desire to use a different Tcl installation (apparently the one that comes with Ruby), and then it is your responsibility to make this setting work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:28:30 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:28:33 2004 Subject: [ python-Bugs-921077 ] embedding in multi-threaded & multi sub-interpreter environ Message-ID: Bugs item #921077, was opened at 2004-03-22 16:39 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=921077&group_id=5470 Category: None Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Atul (atulkshirsagar) Assigned to: Nobody/Anonymous (nobody) >Summary: embedding in multi-threaded & multi sub-interpreter environ Initial Comment: I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi- threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to explain it in details, 1. Python initialization [Py_Initialize()] and finalization [Py_Finalize()] is done in the *main* thread. 2. For each new thread I create a separate sub- interpreter [Py_NewInterpreter()]. 3. Using PyRun_String("import myModule"...) before execution of python script, extention module is imported. 4. Each thread executes *multiple* python script using PyEval_EvalCode() using the class objects in my extention DLL. 5. Each sub-interpreter is destroyed [Py_EndInterpreter ()] at the end of that particular thread. I am observing that; As explained above when multiple threads are running. And as one of these threads finishes, in other running threads I start getting "TypeError: 'NoneType' object is not callable" error on the methods called on class objects in extention module. The same code *works fine* with Python 2.2.2. I have found these links more or less talking about the same problem migrating from 2.2 to 2.3. http://mail.python.org/pipermail/python-dev/2003- September/038237.html http://mail.python.org/pipermail/python-list/2004- February/206851.html http://mail.python.org/pipermail/python-list/2004- January/204040.html I *guess* what is happening is global variables are zapped to "NoneType" when one thread finishes and other thread trying to access them through the Python script (step 4.) this error is generated. But it *works* sometimes when(*guess*) the running thread is at step 3. and by importing the module the global variables are re-initialized for "Type" information. I tried using reload(myModule) to solve the problem but that is generating big memory leak every time it is called. Is this a know issue with 2.3 (interpreter?) ? Or is there a change for 2.3 in the way embedding should be done in a multi-threaded and multi-sub-interpreter environment ? ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:28 Message: Logged In: YES user_id=21627 Can you provide an example that demonstrates the supposed bug? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=921077&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:29:55 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:30:05 2004 Subject: [ python-Bugs-905046 ] test_tcl fails -- Message-ID: Bugs item #905046, was opened at 2004-02-26 14:11 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=905046&group_id=5470 Category: Extension Modules Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michael Hudson (mwh) Assigned to: David Ascher (david_ascher) >Summary: test_tcl fails -- Initial Comment: As summary, really. Fairly stock Redhat 9 install, CVS as of a few minutes back. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:29 Message: Logged In: YES user_id=21627 mwh, does that still fail? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=905046&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:32:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:32:45 2004 Subject: [ python-Bugs-922914 ] Installer misplaces tcl library Message-ID: Bugs item #922914, was opened at 2004-03-25 00:55 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: WS Wong (wswong) Assigned to: Nobody/Anonymous (nobody) Summary: Installer misplaces tcl library Initial Comment: Python 2.3.3 on Windows 2000 Professional ------------------------------------------- Could not start IDLE after installation of Python in C:\WSPrograms\Python23 Went to C:\WSPrograms\Python23\Lib\idlelib and from the command line typed C:\WSPrograms\Python23\python idle.py The following traceback obtained: C:\WSPrograms\Python23 \Lib\idlelib>c:\wsprograms\python23\python idle.py Traceback (most recent call last): File "idle.py", line 23, in ? idlelib.PyShell.main() File "C:\WSPrograms\Python23\lib\idlelib\PyShell.py", line 1269, in main root = Tk(className="Idle") File "C:\WSPrograms\Python23\lib\lib-tk\Tkinter.py", line 1564, in __init__ self.tk = _tkinter.create(screenName, baseName, className) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\WSPrograms\ruby167ms\tcl\lib\tcl8.3} {C:\WSPrograms\ruby167ms\tcl\lib\tc l8.3} C:/WSPrograms/ruby167ms/tcl/lib/tcl8.4 c:/wsprograms/python23/lib/tcl8.4 c :/wsprograms/lib/tcl8.4 c:/lib/tcl8.4 c:/wsprograms/library c:/library c:/../tcl 8.4.3/library Looking at the directories that was installed, I found that the tcl8.4 was actually located in C:\WSPrograms\Python23\tcl\tk8.4 which was never on the search path. After I copied the tcl8.4 directory to C:\WSPrograms\Python23\Lib and run the commands again, it worked. Not sure what other implications this will cause but at least I have IDLE running again. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-29 17:32 Message: Logged In: YES user_id=31435 This is almost certainly Ruby's "fault" -- the Ruby Windows installer does set environment variables forcing every app to try using Ruby's version of Tcl/Tk. Get rid of the Ruby envars, and IDLE should work fine. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:26 Message: Logged In: YES user_id=21627 Have you set the TCL_LIBRARY environment variable? If so, you should unset it. If you cannot unset it, you are on your own - as a system administrator, by setting this variable, you express the desire to use a different Tcl installation (apparently the one that comes with Ruby), and then it is your responsibility to make this setting work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:34:07 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:34:22 2004 Subject: [ python-Bugs-908936 ] rexec.r_eval() does not work like eval() Message-ID: Bugs item #908936, was opened at 2004-03-03 10:58 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 Category: Python Library Group: Python 2.2.2 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Philippe Fremy (pfremy) Assigned to: Nobody/Anonymous (nobody) Summary: rexec.r_eval() does not work like eval() Initial Comment: I want to use the eval() function of python as simple ultra-restricted expression evaluator. So, when executing r_eval(), I want to pass a dictionnary of the local and global variables, just like it is possible with eval(). However, r_eval() does not allow it. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:34 Message: Logged In: YES user_id=21627 The rexec module does not provide restricted execution, so you should not be using it in the first place. Closing this as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 From noreply at sourceforge.net Mon Mar 29 17:35:22 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 17:36:12 2004 Subject: [ python-Bugs-906405 ] Build fails on XP Message-ID: Bugs item #906405, was opened at 2004-02-28 12:08 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=906405&group_id=5470 Category: Build Group: Python 2.2.3 Status: Open Resolution: None Priority: 5 Submitted By: Con (shrodingersdog) Assigned to: Nobody/Anonymous (nobody) Summary: Build fails on XP Initial Comment: When trying to build the source: Modules/posixmodule.c fails to build. I'm running on XP SP1 using mingw32-make ver 3.80 Is there any known issues on XP? ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:35 Message: Logged In: YES user_id=21627 In what way precisely does it fail? It builds fine for me with VC.NET 2003, which is the official build environment for Python on XP. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=906405&group_id=5470 From noreply at sourceforge.net Mon Mar 29 18:05:07 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 18:05:13 2004 Subject: [ python-Bugs-903339 ] OpenVMS file system and UNIVERSAL_NEWLINES support Message-ID: Bugs item #903339, was opened at 2004-02-24 11:20 Message generated for change (Comment added) made by pieronne You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 Category: None Group: Platform-specific Status: Open Resolution: None Priority: 5 Submitted By: Pi?ronne Jean-Fran?ois (pieronne) Assigned to: Nobody/Anonymous (nobody) Summary: OpenVMS file system and UNIVERSAL_NEWLINES support Initial Comment: I am one of the maintainer of Python on OpenVMS. Building from time to time Python 2.4 from CVS snapshot, I have just noticed that all the conditional compilation against WITH_UNIVERSAL_NEWLINES has been removed. This is a major problem on OpenVMS. VMS has a complex file system which is mostly record oriented and not stream oriented (even if it support stream oriented files, this is not the default). For example it support the following record formats: fixed-length, variable-length, variable with fixed-length control, 3 stream format, etc... The default is variable-length. So reading (opening) text file, for example during a import, in binary mode lead to incorrect results because there are no '\n' or any character (or combinaison of characters) at the end of the line. If the file is not open in binary mode the VMS CRTL automatically append a '\n' at the end of the record, so all work correctly. This not the case in binary mode, in this case the record is read as is, in fact you even get the control part of the record for some record format. So, is it possible to maintain this test, even as undocumented or is it acceptable to transform it into a specific VMS test. But I suspect that other mainframe file systems will have the same problem. Thanks for any help. Regards, Jean-Fran?ois ---------------------------------------------------------------------- >Comment By: Pi?ronne Jean-Fran?ois (pieronne) Date: 2004-03-30 01:05 Message: Logged In: YES user_id=414701 Hi Martin, A few week ago I have open a thread on the mailing list do you have read it which explain the problem and include a few others contributions. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:05 Message: Logged In: YES user_id=21627 I don't understand the problem. What precisely is currently not working, and precisely why does it fail? (exact file and line that causes problems, please) ---------------------------------------------------------------------- Comment By: Pi?ronne Jean-Fran?ois (pieronne) Date: 2004-03-29 22:53 Message: Logged In: YES user_id=414701 I have attach a patch for Include/fileobject.h Modules/bz2module.c Objects/fileobject.c This patch use a new conditionnal compilation item: Py_USE_RECORD_IO which need to be define only on systems which use RECORD oriented IO and not stream oriented IO It also contain a small fix for OpenVMS. Jean-Fran?ois ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=903339&group_id=5470 From noreply at sourceforge.net Mon Mar 29 18:11:17 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 18:11:26 2004 Subject: [ python-Bugs-924703 ] test_unicode_file fails on Win98SE Message-ID: Bugs item #924703, was opened at 2004-03-27 20:48 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 Category: Unicode Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: M.-A. Lemburg (lemburg) Summary: test_unicode_file fails on Win98SE Initial Comment: In current CVS, test_unicode_file fails on Win98SE. This has been going on for some time, actually. ERROR: test_single_files (__main__.TestUnicodeFiles) Traceback (most recent call last): File ".../lib/test/test_unicode_file.py", line 162, in test_single_files self._test_single(TESTFN_UNICODE) File ".../lib/test/test_unicode_file.py", line 136, in _test_single self._do_single(filename) File ".../lib/test/test_unicode_file.py", line 49, in _do_single new_base = unicodedata.normalize("NFD", new_base) TypeError: normalized() argument 2 must be unicode, not str At this point, filename is TESTFN_UNICODE is u'@test-\xe0\xf2' os.path.abspath(filename) is 'C:\Code\python\PC\VC6\@test-\xe0\xf2' new_base is '@test-\xe0\xf2 So abspath() removed the "Unicodeness" of filename, and new_base is indeed not a Unicode string at this point. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-29 18:11 Message: Logged In: YES user_id=31435 Nope, that can't help -- ntpath.py's _abspath doesn't exist on Win98SE (the "from nt import _getfullpathname" succeeds, so _abspath is never defined). It's _getfullpathname() that's taking a Unicode input and returning a str output here. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:17 Message: Logged In: YES user_id=21627 abspath(unicode) should return a Unicode path. Does it help if _abspath (in ntpath.py) is changed to contain if not isabs(path): if isinstance(path, unicode): cwd = os.getcwdu() else: cwd = os.getcwd() path = join(cwd, path) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 From noreply at sourceforge.net Mon Mar 29 20:33:46 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 20:33:51 2004 Subject: [ python-Bugs-922914 ] Installer misplaces tcl library Message-ID: Bugs item #922914, was opened at 2004-03-25 13:55 Message generated for change (Comment added) made by wswong You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 Category: IDLE Group: Python 2.3 >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: WS Wong (wswong) Assigned to: Nobody/Anonymous (nobody) Summary: Installer misplaces tcl library Initial Comment: Python 2.3.3 on Windows 2000 Professional ------------------------------------------- Could not start IDLE after installation of Python in C:\WSPrograms\Python23 Went to C:\WSPrograms\Python23\Lib\idlelib and from the command line typed C:\WSPrograms\Python23\python idle.py The following traceback obtained: C:\WSPrograms\Python23 \Lib\idlelib>c:\wsprograms\python23\python idle.py Traceback (most recent call last): File "idle.py", line 23, in ? idlelib.PyShell.main() File "C:\WSPrograms\Python23\lib\idlelib\PyShell.py", line 1269, in main root = Tk(className="Idle") File "C:\WSPrograms\Python23\lib\lib-tk\Tkinter.py", line 1564, in __init__ self.tk = _tkinter.create(screenName, baseName, className) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\WSPrograms\ruby167ms\tcl\lib\tcl8.3} {C:\WSPrograms\ruby167ms\tcl\lib\tc l8.3} C:/WSPrograms/ruby167ms/tcl/lib/tcl8.4 c:/wsprograms/python23/lib/tcl8.4 c :/wsprograms/lib/tcl8.4 c:/lib/tcl8.4 c:/wsprograms/library c:/library c:/../tcl 8.4.3/library Looking at the directories that was installed, I found that the tcl8.4 was actually located in C:\WSPrograms\Python23\tcl\tk8.4 which was never on the search path. After I copied the tcl8.4 directory to C:\WSPrograms\Python23\Lib and run the commands again, it worked. Not sure what other implications this will cause but at least I have IDLE running again. ---------------------------------------------------------------------- >Comment By: WS Wong (wswong) Date: 2004-03-30 09:33 Message: Logged In: YES user_id=868242 Thanks. You are right. Deleting Ruby and getting rid of the tcl environment variable worked. Didn't think that would have affected the search path, but apparently it did. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-03-30 06:32 Message: Logged In: YES user_id=31435 This is almost certainly Ruby's "fault" -- the Ruby Windows installer does set environment variables forcing every app to try using Ruby's version of Tcl/Tk. Get rid of the Ruby envars, and IDLE should work fine. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 06:26 Message: Logged In: YES user_id=21627 Have you set the TCL_LIBRARY environment variable? If so, you should unset it. If you cannot unset it, you are on your own - as a system administrator, by setting this variable, you express the desire to use a different Tcl installation (apparently the one that comes with Ruby), and then it is your responsibility to make this setting work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 From noreply at sourceforge.net Mon Mar 29 21:04:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 21:05:00 2004 Subject: [ python-Bugs-922914 ] Installer misplaces tcl library Message-ID: Bugs item #922914, was opened at 2004-03-25 00:55 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 Category: IDLE Group: Python 2.3 Status: Closed Resolution: Works For Me Priority: 5 Submitted By: WS Wong (wswong) Assigned to: Nobody/Anonymous (nobody) Summary: Installer misplaces tcl library Initial Comment: Python 2.3.3 on Windows 2000 Professional ------------------------------------------- Could not start IDLE after installation of Python in C:\WSPrograms\Python23 Went to C:\WSPrograms\Python23\Lib\idlelib and from the command line typed C:\WSPrograms\Python23\python idle.py The following traceback obtained: C:\WSPrograms\Python23 \Lib\idlelib>c:\wsprograms\python23\python idle.py Traceback (most recent call last): File "idle.py", line 23, in ? idlelib.PyShell.main() File "C:\WSPrograms\Python23\lib\idlelib\PyShell.py", line 1269, in main root = Tk(className="Idle") File "C:\WSPrograms\Python23\lib\lib-tk\Tkinter.py", line 1564, in __init__ self.tk = _tkinter.create(screenName, baseName, className) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\WSPrograms\ruby167ms\tcl\lib\tcl8.3} {C:\WSPrograms\ruby167ms\tcl\lib\tc l8.3} C:/WSPrograms/ruby167ms/tcl/lib/tcl8.4 c:/wsprograms/python23/lib/tcl8.4 c :/wsprograms/lib/tcl8.4 c:/lib/tcl8.4 c:/wsprograms/library c:/library c:/../tcl 8.4.3/library Looking at the directories that was installed, I found that the tcl8.4 was actually located in C:\WSPrograms\Python23\tcl\tk8.4 which was never on the search path. After I copied the tcl8.4 directory to C:\WSPrograms\Python23\Lib and run the commands again, it worked. Not sure what other implications this will cause but at least I have IDLE running again. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-29 21:04 Message: Logged In: YES user_id=31435 You didn't need to delete Ruby; just getting rid of the Tcl/Tk envars would have been enough. I'm not sure why Ruby sets them to begin with (and you've noticed that Python doesn't set them). ---------------------------------------------------------------------- Comment By: WS Wong (wswong) Date: 2004-03-29 20:33 Message: Logged In: YES user_id=868242 Thanks. You are right. Deleting Ruby and getting rid of the tcl environment variable worked. Didn't think that would have affected the search path, but apparently it did. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-03-29 17:32 Message: Logged In: YES user_id=31435 This is almost certainly Ruby's "fault" -- the Ruby Windows installer does set environment variables forcing every app to try using Ruby's version of Tcl/Tk. Get rid of the Ruby envars, and IDLE should work fine. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:26 Message: Logged In: YES user_id=21627 Have you set the TCL_LIBRARY environment variable? If so, you should unset it. If you cannot unset it, you are on your own - as a system administrator, by setting this variable, you express the desire to use a different Tcl installation (apparently the one that comes with Ruby), and then it is your responsibility to make this setting work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922914&group_id=5470 From noreply at sourceforge.net Mon Mar 29 23:21:10 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Mar 29 23:21:15 2004 Subject: [ python-Bugs-775353 ] IDLE: "Save As..." keybind (Ctrl+Shift+S) does not work Message-ID: Bugs item #775353, was opened at 2003-07-21 18:54 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775353&group_id=5470 Category: IDLE Group: Python 2.4 >Status: Closed Resolution: Fixed Priority: 6 Submitted By: Matthew Shomphe (mshomphe) Assigned to: Kurt B. Kaiser (kbk) Summary: IDLE: "Save As..." keybind (Ctrl+Shift+S) does not work Initial Comment: Info: -Python Version: Python 2.3c1 (#44, Jul 18 2003, 14:32: 36) [MSC v.1200 32 bit (Intel)] on win32 -IDLE Version:IDLE 1.0rc1 -OS: Windows 2000 SP4 -Source: Installed from Installer on website (http://www. python.org/ftp/python/2.3/Python-2.3c1.exe) Behavior: In the "File" dropdown menu in IDLE, the listed keybind for "Save As" is Ctrl+Shift+S. This does not work. When you hit Ctrl+Shift+S, nothing happens. Additionally, the keybind for "Save Copy As...", Alt+Shift+S, does not work. ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2004-03-29 23:21 Message: Logged In: YES user_id=149084 Backported to release23-maint ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-11-24 00:39 Message: Logged In: YES user_id=149084 config-keys.def 1.20 configHandler.py 1.32 keybindingDialog.py 1.12 2.3 Backport Candidate ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-07-23 00:23 Message: Logged In: YES user_id=149084 Duplicate of IDLEfork Bug 755647 None of the bindings with a Shift modifier work because it is then necessary to use the upper case keysym. IDLE is using the lower case. ---------------------------------------------------------------------- Comment By: Matthew Shomphe (mshomphe) Date: 2003-07-21 19:32 Message: Logged In: YES user_id=716326 Checking through the code, it seems that the problem is in the file "configHandler.py". The bindings are assigned with _lowercase_ letters: '<>': [''], '<>': [''], So the keybindings will work when CAPSLOCK is active. Otherwise, it won't. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775353&group_id=5470 From noreply at sourceforge.net Tue Mar 30 00:25:00 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 00:25:05 2004 Subject: [ python-Bugs-924703 ] test_unicode_file fails on Win98SE Message-ID: Bugs item #924703, was opened at 2004-03-28 03:48 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 Category: Unicode Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) >Assigned to: Martin v. L?wis (loewis) Summary: test_unicode_file fails on Win98SE Initial Comment: In current CVS, test_unicode_file fails on Win98SE. This has been going on for some time, actually. ERROR: test_single_files (__main__.TestUnicodeFiles) Traceback (most recent call last): File ".../lib/test/test_unicode_file.py", line 162, in test_single_files self._test_single(TESTFN_UNICODE) File ".../lib/test/test_unicode_file.py", line 136, in _test_single self._do_single(filename) File ".../lib/test/test_unicode_file.py", line 49, in _do_single new_base = unicodedata.normalize("NFD", new_base) TypeError: normalized() argument 2 must be unicode, not str At this point, filename is TESTFN_UNICODE is u'@test-\xe0\xf2' os.path.abspath(filename) is 'C:\Code\python\PC\VC6\@test-\xe0\xf2' new_base is '@test-\xe0\xf2 So abspath() removed the "Unicodeness" of filename, and new_base is indeed not a Unicode string at this point. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 07:25 Message: Logged In: YES user_id=21627 I see. I'll look into changing _getfullpathname to return Unicode output for Unicode input even if unicode_file_names() is false. However, I do wonder what the purpose of _abspath then is: On what system would it be used??? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-03-30 01:11 Message: Logged In: YES user_id=31435 Nope, that can't help -- ntpath.py's _abspath doesn't exist on Win98SE (the "from nt import _getfullpathname" succeeds, so _abspath is never defined). It's _getfullpathname() that's taking a Unicode input and returning a str output here. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:17 Message: Logged In: YES user_id=21627 abspath(unicode) should return a Unicode path. Does it help if _abspath (in ntpath.py) is changed to contain if not isabs(path): if isinstance(path, unicode): cwd = os.getcwdu() else: cwd = os.getcwd() path = join(cwd, path) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 From noreply at sourceforge.net Tue Mar 30 00:44:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 00:44:41 2004 Subject: [ python-Bugs-924703 ] test_unicode_file fails on Win98SE Message-ID: Bugs item #924703, was opened at 2004-03-27 20:48 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 Category: Unicode Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Martin v. L?wis (loewis) Summary: test_unicode_file fails on Win98SE Initial Comment: In current CVS, test_unicode_file fails on Win98SE. This has been going on for some time, actually. ERROR: test_single_files (__main__.TestUnicodeFiles) Traceback (most recent call last): File ".../lib/test/test_unicode_file.py", line 162, in test_single_files self._test_single(TESTFN_UNICODE) File ".../lib/test/test_unicode_file.py", line 136, in _test_single self._do_single(filename) File ".../lib/test/test_unicode_file.py", line 49, in _do_single new_base = unicodedata.normalize("NFD", new_base) TypeError: normalized() argument 2 must be unicode, not str At this point, filename is TESTFN_UNICODE is u'@test-\xe0\xf2' os.path.abspath(filename) is 'C:\Code\python\PC\VC6\@test-\xe0\xf2' new_base is '@test-\xe0\xf2 So abspath() removed the "Unicodeness" of filename, and new_base is indeed not a Unicode string at this point. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-30 00:44 Message: Logged In: YES user_id=31435 Just a guess: the os.path functions are generally just string manipulation, and on Windows I sometimes import posixpath.py directly to do Unixish path manipulations. So it's conceivable that someone (not me) on a non-Windows box imports ntpath directly to manipulate Windows paths. In fact, I see that Fredrik's "Python Standard Library" book explicitly mentions this use case for importing ntpath directly. So maybe he actually did it -- once . ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:25 Message: Logged In: YES user_id=21627 I see. I'll look into changing _getfullpathname to return Unicode output for Unicode input even if unicode_file_names() is false. However, I do wonder what the purpose of _abspath then is: On what system would it be used??? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-03-29 18:11 Message: Logged In: YES user_id=31435 Nope, that can't help -- ntpath.py's _abspath doesn't exist on Win98SE (the "from nt import _getfullpathname" succeeds, so _abspath is never defined). It's _getfullpathname() that's taking a Unicode input and returning a str output here. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:17 Message: Logged In: YES user_id=21627 abspath(unicode) should return a Unicode path. Does it help if _abspath (in ntpath.py) is changed to contain if not isabs(path): if isinstance(path, unicode): cwd = os.getcwdu() else: cwd = os.getcwd() path = join(cwd, path) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924703&group_id=5470 From noreply at sourceforge.net Tue Mar 30 02:31:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 02:31:18 2004 Subject: [ python-Bugs-908936 ] rexec.r_eval() does not work like eval() Message-ID: Bugs item #908936, was opened at 2004-03-03 10:58 Message generated for change (Comment added) made by pfremy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 Category: Python Library Group: Python 2.2.2 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Philippe Fremy (pfremy) Assigned to: Nobody/Anonymous (nobody) Summary: rexec.r_eval() does not work like eval() Initial Comment: I want to use the eval() function of python as simple ultra-restricted expression evaluator. So, when executing r_eval(), I want to pass a dictionnary of the local and global variables, just like it is possible with eval(). However, r_eval() does not allow it. ---------------------------------------------------------------------- >Comment By: Philippe Fremy (pfremy) Date: 2004-03-30 09:31 Message: Logged In: YES user_id=233844 http://www.python.org/doc/2.3.3/lib/module-rexec.html reads: "17.1 rexec -- Restricted execution framework" so it looks like the module does provide a "Restricted execution framework", no ? Now, I assume that you mean that the module has been marked obsolete in the most recent of python (which I am not using). Is there any replacement available ? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:34 Message: Logged In: YES user_id=21627 The rexec module does not provide restricted execution, so you should not be using it in the first place. Closing this as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 From noreply at sourceforge.net Tue Mar 30 10:27:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 10:28:41 2004 Subject: [ python-Bugs-926075 ] re.sub on u'' gives NON-unicode '' Message-ID: Bugs item #926075, was opened at 2004-03-30 17:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926075&group_id=5470 Category: Regular Expressions Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Alex Martelli (aleax) Assigned to: Fredrik Lundh (effbot) Summary: re.sub on u'' gives NON-unicode '' Initial Comment: >>> import re >>> re.sub(u'.', u'', u'') '' This holds for any RE that doesn't match the empty string. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926075&group_id=5470 From noreply at sourceforge.net Tue Mar 30 10:28:03 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 11:02:57 2004 Subject: [ python-Bugs-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Bugs item #925537, was opened at 2004-03-29 14:28 Message generated for change (Comment added) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 4 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Jim Jewett (jimjjewett) Date: 2004-03-30 10:28 Message: Logged In: YES user_id=764593 The ideal fix would be in documentation (and therefore policy). I want to do something like import_list = [x for x in dir(other_mod) if wanted(x)] It happens to work today on my machine, but the documentation says that dir(x) may return different results in different releases. This means that I can't safely use it in released code. If there were some indication that dir(module) would continue to return the same names as vars(module).keys(), then I could use it. If the differences were only in variables not intended for export, that would also be OK -- but dir does not current promise this. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:11 Message: Logged In: YES user_id=21627 I fail to see a bug. Which specific usage of dir() does not work as intended? ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925537&group_id=5470 From noreply at sourceforge.net Tue Mar 30 12:14:37 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 12:14:54 2004 Subject: [ python-Bugs-923576 ] Incorrect __name__ assignment Message-ID: Bugs item #923576, was opened at 2004-03-25 19:43 Message generated for change (Comment added) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: El cepi (elcepi) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect __name__ assignment Initial Comment: When you use PythonLauncher or PythonIDE the value of __name__ is incorrectly assigned. For example, in the attached file the output is "The module has been load" when the module is fun in PythonIDE. With this you can not disciminate between the code you should run when you load the module and when you try to run it. ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 12:14 Message: Logged In: YES user_id=593130 When making a bug report, please include at least the Python version. The system you are running on is sometimes essential info also. I am not familiar with either PythonLauncher or PythonIDE. Just PyWin and Idle. If they are third-party items not part of the distribution, then this report should go to their authors. 'When you use' is also somewhat vague. Saying what command line option or menu entry or buttom you used to run/load might also get a better answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 From noreply at sourceforge.net Tue Mar 30 12:50:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 15:02:49 2004 Subject: [ python-Bugs-925628 ] help does not help with imported objects Message-ID: Bugs item #925628, was opened at 2004-03-29 16:34 Message generated for change (Comment added) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 2 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: help does not help with imported objects Initial Comment: help(re) just says it is a wrapper for sre. To get actually help, you need to explicitly import sre as well. re.__doc__ = re.__doc__ + sre.__doc__ helps, but still does not list information on classes or exported functions. Specific requests, such as help(re.subn) do work; it is only the module-level help that is lacking when a module reexports imported objects. ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 12:50 Message: Logged In: YES user_id=593130 I am not sure a see a bug here (as opposed to enhancement request). re.__all__ and dir(re) list exported names. help (re.engine) gets the multipage doc from the wrapped engine without importing it. The re doc string could be enhanced by adding a FOR MORE section that says so. Automatically adding sre would have been wrong when there were multiple engines in the distribution. Not sure if are or will be in 2.4, but there could be in the future again. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925628&group_id=5470 From noreply at sourceforge.net Tue Mar 30 11:57:19 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 15:03:24 2004 Subject: [ python-Bugs-922690 ] package manager page outdated link Message-ID: Bugs item #922690, was opened at 2004-03-24 15:07 Message generated for change (Comment added) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922690&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Russell Owen (reowen) Assigned to: Nobody/Anonymous (nobody) Summary: package manager page outdated link Initial Comment: The page http://www.python.org/packman/ has outdated links to Bob Ippolito's page. The correct link appears to be http://undefined.org/python/ (which includes links to various versions of the packages and to descriptions of the same). ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 11:57 Message: Logged In: YES user_id=593130 To supplement the summary: the two links (xml and html) on the bottom of the packman page work but they are specific to (an older? verseion) the pimp package. The higher link suggested as a substitue lists other packages, including some that appear to have been extracted from pimp. Since the current page references aeve 0.0.3 while the suggested link references aeve 0.0.4, the suggest change seems proper. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=922690&group_id=5470 From noreply at sourceforge.net Tue Mar 30 14:10:43 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 15:03:51 2004 Subject: [ python-Bugs-876278 ] Unbounded recursion in modulefinder Message-ID: Bugs item #876278, was opened at 2004-01-13 19:46 Message generated for change (Comment added) made by theller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=876278&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Thomas Heller (theller) Assigned to: Just van Rossum (jvr) Summary: Unbounded recursion in modulefinder Initial Comment: modulefinder goes into unbounded recursion when a module named 'path.py', containing 'import os', is on sys.path. Last part of the traceback: File "c:\python23\lib\modulefinder.py", line 255, in import_module m = self.load_module(fqname, fp, pathname, stuff) File "c:\python23\lib\modulefinder.py", line 285, in load_module self.scan_code(co, m) File "c:\python23\lib\modulefinder.py", line 342, in scan_code self._safe_import_hook(name, m, fromlist) File "c:\python23\lib\modulefinder.py", line 300, in _safe_import_hook self.import_hook(name, caller) File "c:\python23\lib\modulefinder.py", line 124, in import_hook q, tail = self.find_head_package(parent, name) File "c:\python23\lib\modulefinder.py", line 166, in find_head_package q = self.import_module(head, qname, parent) File "c:\python23\lib\modulefinder.py", line 237, in import_module self.msgin(3, "import_module", partname, fqname, parent) RuntimeError: maximum recursion depth exceeded Running modulefinder with the '-x os.path' command line option prevents the recursion. This is not really a contrived situation, there's a possibly useful path.py module from Jason Orendorff at ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2004-03-30 21:10 Message: Logged In: YES user_id=11105 I think I have found something, but I still have to check if this cures the original problem. Imagine an (possibly empty) module foo.py. Without this patch, modulefinder would even find 'import foo.foo.foo' modules. The assert in the second hunk is commented out, although I think it should be correct. Just, any comments? ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2004-03-25 22:09 Message: Logged In: YES user_id=11105 It has something to do with os.path. Adding 'os.path' to the excludes list, the problem does not appear. Adding print statements it seems that mf is looking for os.os.os.os.os.......something, it seems that it recurses without noting that something failed. If I had to fix this myself, I probably had to first step through these imports with the C debugger, and then through mf. ---------------------------------------------------------------------- Comment By: Just van Rossum (jvr) Date: 2004-03-25 21:53 Message: Logged In: YES user_id=92689 Hm, not really. Do you have any idea what's causing it? ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2004-03-25 21:06 Message: Logged In: YES user_id=11105 Just, do you have time to look into this? ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2004-01-28 21:36 Message: Logged In: YES user_id=11105 Just, do you have time to look into this? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=876278&group_id=5470 From noreply at sourceforge.net Tue Mar 30 14:46:55 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 16:02:42 2004 Subject: [ python-Bugs-924333 ] Build issues (lib path) on linux2-x86_64 Message-ID: Bugs item #924333, was opened at 2004-03-26 23:12 Message generated for change (Comment added) made by petrilli You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924333&group_id=5470 Category: Build Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Christopher Petrilli (petrilli) Assigned to: Nobody/Anonymous (nobody) Summary: Build issues (lib path) on linux2-x86_64 Initial Comment: The current CVS HEAD won't build "out of the box" on a Fedora x86_64 box, nor on any other Linux AMD64 platform. This is due to the fact that the libraries for many things are not in /usr/lib, but /usr/lib64, and the current 'autoconf' script, as well as the current setup.py do not look there. When added, they detect, build. ---------------------------------------------------------------------- >Comment By: Christopher Petrilli (petrilli) Date: 2004-03-30 14:46 Message: Logged In: YES user_id=38410 See patch #926209 ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:19 Message: Logged In: YES user_id=21627 Can you submit a patch? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=924333&group_id=5470 From noreply at sourceforge.net Tue Mar 30 16:06:14 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 16:06:57 2004 Subject: [ python-Bugs-908936 ] rexec.r_eval() does not work like eval() Message-ID: Bugs item #908936, was opened at 2004-03-03 10:58 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 Category: Python Library Group: Python 2.2.2 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Philippe Fremy (pfremy) Assigned to: Nobody/Anonymous (nobody) Summary: rexec.r_eval() does not work like eval() Initial Comment: I want to use the eval() function of python as simple ultra-restricted expression evaluator. So, when executing r_eval(), I want to pass a dictionnary of the local and global variables, just like it is possible with eval(). However, r_eval() does not allow it. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 23:06 Message: Logged In: YES user_id=21627 No, not marked obsolete: "Changed in version 2.3: Disabled module." "While the rexec module is designed to perform as described below, it does have a few known vulnerabilities which could be exploited by carefully written code. " Even in 2.2, when it still was enabled, it did not actually do what it was designed to do, and it is not possible to fix it. Also, there is no replacement available. ---------------------------------------------------------------------- Comment By: Philippe Fremy (pfremy) Date: 2004-03-30 09:31 Message: Logged In: YES user_id=233844 http://www.python.org/doc/2.3.3/lib/module-rexec.html reads: "17.1 rexec -- Restricted execution framework" so it looks like the module does provide a "Restricted execution framework", no ? Now, I assume that you mean that the module has been marked obsolete in the most recent of python (which I am not using). Is there any replacement available ? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:34 Message: Logged In: YES user_id=21627 The rexec module does not provide restricted execution, so you should not be using it in the first place. Closing this as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=908936&group_id=5470 From noreply at sourceforge.net Tue Mar 30 16:09:24 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 17:02:31 2004 Subject: [ python-Feature Requests-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Feature Requests item #925537, was opened at 2004-03-29 21:28 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=925537&group_id=5470 >Category: None >Group: None Status: Open Resolution: None Priority: 4 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 23:09 Message: Logged In: YES user_id=21627 Ok, marking it as a feature request then: Explicitly pointing out that behaviour may change in the future has usually been done because change in behaviour is anticipated, or has happened in the past. Giving stronger guarantees about future versions a feature that is currently not provided. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-30 17:28 Message: Logged In: YES user_id=764593 The ideal fix would be in documentation (and therefore policy). I want to do something like import_list = [x for x in dir(other_mod) if wanted(x)] It happens to work today on my machine, but the documentation says that dir(x) may return different results in different releases. This means that I can't safely use it in released code. If there were some indication that dir(module) would continue to return the same names as vars(module).keys(), then I could use it. If the differences were only in variables not intended for export, that would also be OK -- but dir does not current promise this. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 00:11 Message: Logged In: YES user_id=21627 I fail to see a bug. Which specific usage of dir() does not work as intended? ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 21:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 21:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=925537&group_id=5470 From noreply at sourceforge.net Tue Mar 30 19:22:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 19:22:37 2004 Subject: [ python-Bugs-926369 ] pdb sometimes sets breakpoints in the wrong location Message-ID: Bugs item #926369, was opened at 2004-03-30 16:22 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926369&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Ilya Sandler (isandler) Assigned to: Nobody/Anonymous (nobody) Summary: pdb sometimes sets breakpoints in the wrong location Initial Comment: If one attempts to set a breakpoint in one line function: e.g for this code: def f(x): return x*x z=23 pdb silently sets a breakpoint on the line right after the function definition (i.e. outside the function body!): ../python pdb.py.v1.66 pdb_one_line_func > (1)?() (Pdb) b f Breakpoint 1 /src/Lib/pdb_one_line_func:3 (Pdb) c > /src/Lib/pdb_one_line_func(3)?() -> z=23 It's probably acceptable to limit pdb breakpoints to multiline functions, but i don't think, it's acceptable to create wrong breakpoints. Note: that anyone attempting to fix this should also take a look at bug 875404 (global statment causes breakpoints..), as both bugs are caused by pdb.checkline() logic ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926369&group_id=5470 From noreply at sourceforge.net Tue Mar 30 19:51:18 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 19:51:24 2004 Subject: [ python-Feature Requests-925537 ] dir(mod) OK or use vars(mod).keys()? Message-ID: Feature Requests item #925537, was opened at 2004-03-29 14:28 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=925537&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 4 Submitted By: Jim Jewett (jimjjewett) Assigned to: Nobody/Anonymous (nobody) Summary: dir(mod) OK or use vars(mod).keys()? Initial Comment: The documentation on dir() notes that its behavior may change across releases. Several library modules use dir(x) in ways that might break if it changed too much. Should these be changed to use vars(obj).keys() (and possibly sort()), or should the note on dir() be removed? My own preference would just be to provide some guidance, such as "The output of dir() will always include all public variables which do not have a magic meaning." I realize that the standard library itself could be updated if dir() changes in an uncomfortable way. My real concern is which spelling to use in my own code. The library examples suggest a simpler (and clearer) dir(), but the documentation still says otherwise. A quick search for modules using dir() showed possible trouble in at least cgitb, cmd, FCNTL, inspect, optparse, os, pickle, rlcompleter, SimpleXMLRPCServer, TERMIOS, tokenize, unittest, and urllib2. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-03-30 19:51 Message: Logged In: YES user_id=31435 Ya, dir() was *intended* to be a convenience for use at the interactive shell. I expect the only promise Guido wants to make about it is that it will show him stuff he finds interesting as Python changes <0.7 wink>. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-30 16:09 Message: Logged In: YES user_id=21627 Ok, marking it as a feature request then: Explicitly pointing out that behaviour may change in the future has usually been done because change in behaviour is anticipated, or has happened in the past. Giving stronger guarantees about future versions a feature that is currently not provided. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-30 10:28 Message: Logged In: YES user_id=764593 The ideal fix would be in documentation (and therefore policy). I want to do something like import_list = [x for x in dir(other_mod) if wanted(x)] It happens to work today on my machine, but the documentation says that dir(x) may return different results in different releases. This means that I can't safely use it in released code. If there were some indication that dir(module) would continue to return the same names as vars(module).keys(), then I could use it. If the differences were only in variables not intended for export, that would also be OK -- but dir does not current promise this. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 17:11 Message: Logged In: YES user_id=21627 I fail to see a bug. Which specific usage of dir() does not work as intended? ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:58 Message: Logged In: YES user_id=764593 Correction: "The output of dir (module) will always include ..." The most common use is figuring out what to do with (import from) a module. Symmetry suggests the same for a no-argument call or a class or type object, but object instances do not use their __dict__ for their attributes; the results are already different there. -jJ ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-03-29 14:39 Message: Logged In: YES user_id=764593 If there concern is over attributes that are "public" but don't exist until called, then most uses of dir and vars are already broken. An alternative reasonable promise would be The output of dir(obj) will always include all (public?, non-magical?) names in vars(obj).keys(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=925537&group_id=5470 From noreply at sourceforge.net Tue Mar 30 21:03:04 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 21:03:18 2004 Subject: [ python-Bugs-796042 ] sdist ignores scripts argument in setup Message-ID: Bugs item #796042, was opened at 2003-08-27 11:09 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=796042&group_id=5470 Category: Distutils Group: Python 2.3 Status: Open Resolution: Fixed Priority: 5 Submitted By: Anna Ravenscroft (annarave) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: sdist ignores scripts argument in setup Initial Comment: When writing the setup script for a distribution, section 3.4 explains: 3.4 Installing Scripts So far we have been dealing with pure and non-pure Python modules, which are usually not run by themselves but imported by scripts. Scripts are files containing Python source code, intended to be started from the command line. Scripts don't require Distutils to do anything very complicated. The only clever feature is that if the first line of the script starts with #! and contains the word ``python'', the Distutils will adjust the first line to refer to the current interpreter location. The scripts option simply is a list of files to be handled in this way. From the PyXML setup script: setup (... scripts = ['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) Unfortunately, this doesn't work with sdist unless you ALSO create a manifest.in file. Otherwise, it silently ignores the scripts listed in setup. bdist works just fine, so it's apparently something wrong in sdist. Please fix this. Thank you. Anna Ravenscroft ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-30 21:03 Message: Logged In: YES user_id=3066 Added note about inclusion of scripts in Doc/dist/dist.tex revision 1.73. This should be back-ported along with the actual fix. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-25 17:17 Message: Logged In: YES user_id=3066 This is fixed on the trunk as Lib/distutils/command/build_scripts.py 1.22 and sdist.py 1.57. I'm not entirely sure this should be backported for Python 2.3.x, but it probably should be. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=796042&group_id=5470 From noreply at sourceforge.net Tue Mar 30 22:48:42 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 22:48:46 2004 Subject: [ python-Bugs-926423 ] socket timeouts + Ctrl-C don't play nice Message-ID: Bugs item #926423, was opened at 2004-03-30 22:48 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926423&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: David M. Cooke (dmcooke) Assigned to: Nobody/Anonymous (nobody) Summary: socket timeouts + Ctrl-C don't play nice Initial Comment: As reported by Koen Vossen in c.l.py, when a timeout is set on a socket, a try...except block around a socket.recv (or socket.recvfrom) won't properly catch a keyboard interrupt (by Ctrl-C). I've attached example code that shows this. Run it and press Ctrl-C before the socket times out. This is for Python 2.3 under Linux. I believe the problem boils down to this sequence of events inside of the socketmodule.c::sock_recv function (and similiar for sock_recvfrom): 1) internal_select is called, which calls select, which waits for a timeout. A SIGINT is received (and caught by the default handler). The select returns with errno set to EINTR. internal_select returns with timeout==1 2) without checking errno, recv() is called. Since there is actually no data, it returns an error, with errno set to EAGAIN. 3) the default socket error handler is called, which calls PyErr_SetFromErrno(). Since errno != EINTR (it's now EAGAIN), a socket_error exception is thrown. 4) the innermost try..except block is triggered. 5) next loop around in eval_frame, notices that SIGINT was caught, and so KeyboardInterrupt is raised, exiting innermost try..except clause 6) KeyboardInterrupt is caught by the outermost try..except block. I was going to make a patch, but I couldn't figure out the best way to fix this in general :-( There are likely similiar problems with everywhere internal_select is used. The quick fix is to check errno before calling recv() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926423&group_id=5470 From noreply at sourceforge.net Tue Mar 30 23:05:00 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 23:05:03 2004 Subject: [ python-Bugs-926427 ] OEM codepage chars in mbcs filenames are misinterpreted Message-ID: Bugs item #926427, was opened at 2004-03-30 21:04 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Mike Brown (mike_j_brown) Assigned to: Nobody/Anonymous (nobody) Summary: OEM codepage chars in mbcs filenames are misinterpreted Initial Comment: My system: Windows XP, English - US locale, Python 2.3.3 I believe the bug I am reporting here is this: On Windows XP, when using os.listdir() with a non- Unicode argument, characters that are not in the default locale's encoding (e.g. Greek capital letter Sigma, (U+03A3), is not in windows-1252), but that are in the default OEM code page (e.g. Sigma is in cp437), get mapped to ASCII characters other than '?'. For example, things seem to work in a predictable way when I put windows-1252 characters into filenames (I do this in Explorer and then I see what os.listdir (r'C:\path\to\the\dir') returns): ? (U+2014) becomes \x97 ? (U+2022) becomes \x95 ? (U+00E9) becomes \xe9 But things are much less predictable when I use characters from outside this range. I thought I'd try some Greek characters first. Some of them (the ones that happen to be in cp437, interestingly enough) come back as random ASCII letters: Θ (U+0398) becomes "T" Σ (U+03A3) becomes "S" Φ (U+03A6) becomes "F" Greek letters that are not in cp437 come back as question marks, as expected (I guess): Τ (U+03A4) becomes "?" Υ (U+03A5) becomes "?" ...as do some Hebrew letters and Japanese hiragana: א (U+05D0) becomes "?" ה (U+05D4) becomes "?" ס (U+05E1) becomes "?" あ (U+305F) becomes "?" う (U+3046) becomes "?" た (U+3042) becomes "?" I don't know if this is something that anyone cares about, since the filenames are useless anyway, but it does seem to be unintended behavior. (And before you ask, it's just a theoretical exercise; I have no urgent need to use os.listdir with non-Unicode directory names on Windows.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 From noreply at sourceforge.net Tue Mar 30 23:45:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Mar 30 23:45:08 2004 Subject: [ python-Bugs-918368 ] urllib doesn't correct server returned urls Message-ID: Bugs item #918368, was opened at 2004-03-17 15:41 Message generated for change (Comment added) made by mike_j_brown You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=918368&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Rob Probin (robzed) Assigned to: Nobody/Anonymous (nobody) Summary: urllib doesn't correct server returned urls Initial Comment: On a URL request where the server returns a URL with spaces in, urllib doesn't correct it before requesting the new page. I think this is technically a server error, however, it does work from web browsers (Mozilla, Safari) but not from Python urllib. I would suggest that when urllib is following "moved temporarily" links (or similar) from a server it translates spaces to %20. See example program file for more including detailed server/client transactions text. ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-30 21:45 Message: Logged In: YES user_id=371366 I agree that it is a server error to put something that doesn't meet the syntactic definition of a URI in the Location header of a response. I don't see any harm in correcting obvious errors, though, in the interest of usability. As for your proposed fix, instead of just correcting spaces, I would do newurl = quote(newurl, safe="/:=&?#+!$,;'@()*[]") quote() is a urllib function that does percent-encoding. It is way out of date and does poorly with Unicode strings, but if called with the above arguments, it should safely clean up most mistakes. The set of additional "safe" characters I am passing in is the complete set of "reserved" characters according to the latest draft of RFC 2396bis; these are characters that definitely do or might possibly have special meaning in a URL and thus should not be percent-encoded blindly. I am currently working on a urllib.quote() replacement for 4Suite's Ft.Lib.Uri library, and will then see about getting the improvements folded back into urllib. ---------------------------------------------------------------------- Comment By: Rob Probin (robzed) Date: 2004-03-18 15:38 Message: Logged In: YES user_id=1000470 I've tested a change to "redirect_internal(self, url, fp, errcode, errmsg, headers, data)" in "urllib.py" that adds a single line newurl = newurl.replace(" ","%20") after the basejoin() function call that appears to fix the problem. This information is placed in the public domain. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=918368&group_id=5470 From noreply at sourceforge.net Wed Mar 31 00:44:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 00:44:37 2004 Subject: [ python-Bugs-918368 ] urllib doesn't correct server returned urls Message-ID: Bugs item #918368, was opened at 2004-03-17 15:41 Message generated for change (Comment added) made by mike_j_brown You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=918368&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Rob Probin (robzed) Assigned to: Nobody/Anonymous (nobody) Summary: urllib doesn't correct server returned urls Initial Comment: On a URL request where the server returns a URL with spaces in, urllib doesn't correct it before requesting the new page. I think this is technically a server error, however, it does work from web browsers (Mozilla, Safari) but not from Python urllib. I would suggest that when urllib is following "moved temporarily" links (or similar) from a server it translates spaces to %20. See example program file for more including detailed server/client transactions text. ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-30 22:44 Message: Logged In: YES user_id=371366 In my previous example, I forgot to add a tilde to the "safe" characters. Tilde is an "unreserved" character, a class of characters allowed in a URI but for which percent-encoding is discouraged. newurl = quote(newurl, safe="/:=&?~#+!$,;'@()*[]") ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-30 21:45 Message: Logged In: YES user_id=371366 I agree that it is a server error to put something that doesn't meet the syntactic definition of a URI in the Location header of a response. I don't see any harm in correcting obvious errors, though, in the interest of usability. As for your proposed fix, instead of just correcting spaces, I would do newurl = quote(newurl, safe="/:=&?#+!$,;'@()*[]") quote() is a urllib function that does percent-encoding. It is way out of date and does poorly with Unicode strings, but if called with the above arguments, it should safely clean up most mistakes. The set of additional "safe" characters I am passing in is the complete set of "reserved" characters according to the latest draft of RFC 2396bis; these are characters that definitely do or might possibly have special meaning in a URL and thus should not be percent-encoded blindly. I am currently working on a urllib.quote() replacement for 4Suite's Ft.Lib.Uri library, and will then see about getting the improvements folded back into urllib. ---------------------------------------------------------------------- Comment By: Rob Probin (robzed) Date: 2004-03-18 15:38 Message: Logged In: YES user_id=1000470 I've tested a change to "redirect_internal(self, url, fp, errcode, errmsg, headers, data)" in "urllib.py" that adds a single line newurl = newurl.replace(" ","%20") after the basejoin() function call that appears to fix the problem. This information is placed in the public domain. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=918368&group_id=5470 From noreply at sourceforge.net Wed Mar 31 01:01:58 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 01:02:03 2004 Subject: [ python-Bugs-833405 ] urllib.urlencode doesn't work for output from cgi.parse_qs Message-ID: Bugs item #833405, was opened at 2003-10-30 15:39 Message generated for change (Comment added) made by mike_j_brown You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Myers Carpenter (myers_carpenter) Assigned to: Nobody/Anonymous (nobody) Summary: urllib.urlencode doesn't work for output from cgi.parse_qs Initial Comment: >>> urllib.urlencode(cgi.parse_qsl('ext=.jpg&outquality=56')) 'ext=.jpg&outquality=56' >>> urllib.urlencode(cgi.parse_qs('ext=.jpg&outquality=56')) 'ext=%5B%27.jpg%27%5D&outquality=%5B%2756%27%5D' "%5B%27" = "['" ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-30 23:01 Message: Logged In: YES user_id=371366 As per the urlencode() API documentation, you are passing in sequences, so you need to set the doseq flag. >>> urllib.urlencode(cgi.parse_qs ('ext=.jpg&outquality=56'),doseq=1) 'ext=.jpg&outquality=56' I recommend that this bug report be closed as Invalid. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470 From noreply at sourceforge.net Wed Mar 31 02:40:20 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 02:40:40 2004 Subject: [ python-Bugs-926501 ] (ref-manual) position docstrings in source not documented Message-ID: Bugs item #926501, was opened at 2004-03-31 07:40 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926501&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: a.hofkamp (axhlkhb) Assigned to: Nobody/Anonymous (nobody) Summary: (ref-manual) position docstrings in source not documented Initial Comment: A colleaque of mine could not find anything about doc strings in the Python language ref manual. I checked his claim and found that there is indeed very little documented about docstrings in it. The current (online) ref manual has a number of __doc__ entries in the index, they all point to structure descriptions of internal objects (like a function object). A 'documentation string' entry points to the docstring of a code object. What is not documented is where docstrings come from, i.e. where in my program should I put it to make it appear as __doc__ attribute. The grammar only discusses Python statements. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926501&group_id=5470 From noreply at sourceforge.net Wed Mar 31 03:00:27 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 03:00:53 2004 Subject: [ python-Bugs-837228 ] Python.h must be included first Message-ID: Bugs item #837228, was opened at 2003-11-06 09:59 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=837228&group_id=5470 Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 7 Submitted By: Fred L. Drake, Jr. (fdrake) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Python.h must be included first Initial Comment: Both the API reference and the Extending and Embedding doc need to scream louder about the requirement to #include Python.h first. Should be fixed for all maintained versions. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-31 03:00 Message: Logged In: YES user_id=3066 Fixed for Python 2.3.4 and 2.4: Doc/api/intro.tex 1.3.24.3, 1.6 Doc/ext/extending.tex 1.24.10.3, 1.27 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=837228&group_id=5470 From noreply at sourceforge.net Wed Mar 31 05:28:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 05:28:18 2004 Subject: [ python-Bugs-926427 ] OEM codepage chars in mbcs filenames can be misinterpreted Message-ID: Bugs item #926427, was opened at 2004-03-30 21:04 Message generated for change (Comment added) made by mike_j_brown You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Mike Brown (mike_j_brown) Assigned to: Nobody/Anonymous (nobody) >Summary: OEM codepage chars in mbcs filenames can be misinterpreted Initial Comment: My system: Windows XP, English - US locale, Python 2.3.3 I believe the bug I am reporting here is this: On Windows XP, when using os.listdir() with a non- Unicode argument, characters that are not in the default locale's encoding (e.g. Greek capital letter Sigma, (U+03A3), is not in windows-1252), but that are in the default OEM code page (e.g. Sigma is in cp437), get mapped to ASCII characters other than '?'. For example, things seem to work in a predictable way when I put windows-1252 characters into filenames (I do this in Explorer and then I see what os.listdir (r'C:\path\to\the\dir') returns): ? (U+2014) becomes \x97 ? (U+2022) becomes \x95 ? (U+00E9) becomes \xe9 But things are much less predictable when I use characters from outside this range. I thought I'd try some Greek characters first. Some of them (the ones that happen to be in cp437, interestingly enough) come back as random ASCII letters: Θ (U+0398) becomes "T" Σ (U+03A3) becomes "S" Φ (U+03A6) becomes "F" Greek letters that are not in cp437 come back as question marks, as expected (I guess): Τ (U+03A4) becomes "?" Υ (U+03A5) becomes "?" ...as do some Hebrew letters and Japanese hiragana: א (U+05D0) becomes "?" ה (U+05D4) becomes "?" ס (U+05E1) becomes "?" あ (U+305F) becomes "?" う (U+3046) becomes "?" た (U+3042) becomes "?" I don't know if this is something that anyone cares about, since the filenames are useless anyway, but it does seem to be unintended behavior. (And before you ask, it's just a theoretical exercise; I have no urgent need to use os.listdir with non-Unicode directory names on Windows.) ---------------------------------------------------------------------- >Comment By: Mike Brown (mike_j_brown) Date: 2004-03-31 03:28 Message: Logged In: YES user_id=371366 I've added a script that demonstrates the issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 From noreply at sourceforge.net Wed Mar 31 05:56:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 05:56:56 2004 Subject: [ python-Bugs-923576 ] Incorrect __name__ assignment Message-ID: Bugs item #923576, was opened at 2004-03-26 00:43 Message generated for change (Comment added) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: El cepi (elcepi) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect __name__ assignment Initial Comment: When you use PythonLauncher or PythonIDE the value of __name__ is incorrectly assigned. For example, in the attached file the output is "The module has been load" when the module is fun in PythonIDE. With this you can not disciminate between the code you should run when you load the module and when you try to run it. ---------------------------------------------------------------------- >Comment By: Michael Hudson (mwh) Date: 2004-03-31 11:56 Message: Logged In: YES user_id=6656 Terry, this bug is in the 'Macintosh' category for a reason :-) ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 18:14 Message: Logged In: YES user_id=593130 When making a bug report, please include at least the Python version. The system you are running on is sometimes essential info also. I am not familiar with either PythonLauncher or PythonIDE. Just PyWin and Idle. If they are third-party items not part of the distribution, then this report should go to their authors. 'When you use' is also somewhat vague. Saying what command line option or menu entry or buttom you used to run/load might also get a better answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 From noreply at sourceforge.net Wed Mar 31 10:07:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 11:02:35 2004 Subject: [ python-Bugs-923576 ] Incorrect __name__ assignment Message-ID: Bugs item #923576, was opened at 2004-03-25 19:43 Message generated for change (Comment added) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: El cepi (elcepi) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect __name__ assignment Initial Comment: When you use PythonLauncher or PythonIDE the value of __name__ is incorrectly assigned. For example, in the attached file the output is "The module has been load" when the module is fun in PythonIDE. With this you can not disciminate between the code you should run when you load the module and when you try to run it. ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-31 10:07 Message: Logged In: YES user_id=593130 Lesson learned to check that header field. Inappropriate comments withdrawn. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-03-31 05:56 Message: Logged In: YES user_id=6656 Terry, this bug is in the 'Macintosh' category for a reason :-) ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 12:14 Message: Logged In: YES user_id=593130 When making a bug report, please include at least the Python version. The system you are running on is sometimes essential info also. I am not familiar with either PythonLauncher or PythonIDE. Just PyWin and Idle. If they are third-party items not part of the distribution, then this report should go to their authors. 'When you use' is also somewhat vague. Saying what command line option or menu entry or buttom you used to run/load might also get a better answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 From noreply at sourceforge.net Wed Mar 31 11:56:25 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 11:56:37 2004 Subject: [ python-Bugs-833405 ] urllib.urlencode doesn't work for output from cgi.parse_qs Message-ID: Bugs item #833405, was opened at 2003-10-30 17:39 Message generated for change (Comment added) made by myers_carpenter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Myers Carpenter (myers_carpenter) Assigned to: Nobody/Anonymous (nobody) Summary: urllib.urlencode doesn't work for output from cgi.parse_qs Initial Comment: >>> urllib.urlencode(cgi.parse_qsl('ext=.jpg&outquality=56')) 'ext=.jpg&outquality=56' >>> urllib.urlencode(cgi.parse_qs('ext=.jpg&outquality=56')) 'ext=%5B%27.jpg%27%5D&outquality=%5B%2756%27%5D' "%5B%27" = "['" ---------------------------------------------------------------------- >Comment By: Myers Carpenter (myers_carpenter) Date: 2004-03-31 11:56 Message: Logged In: YES user_id=335935 Can you name one web app that you know will take args in the form of "ext=[27.jpg]"? Why not do some type inspection to see what types you are dealing with? What is the use of encoding a list in a url using python syntax? ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-31 01:01 Message: Logged In: YES user_id=371366 As per the urlencode() API documentation, you are passing in sequences, so you need to set the doseq flag. >>> urllib.urlencode(cgi.parse_qs ('ext=.jpg&outquality=56'),doseq=1) 'ext=.jpg&outquality=56' I recommend that this bug report be closed as Invalid. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470 From noreply at sourceforge.net Wed Mar 31 12:09:05 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 12:09:08 2004 Subject: [ python-Bugs-926807 ] pdb sometimes sets breakpoints in the wrong location Message-ID: Bugs item #926807, was opened at 2004-03-31 09:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926807&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Ilya Sandler (isandler) Assigned to: Nobody/Anonymous (nobody) Summary: pdb sometimes sets breakpoints in the wrong location Initial Comment: If one attempts to set a breakpoint in one line function: e.g for this code: def f(x): return x*x z=23 pdb silently sets a breakpoint on the line right after the function definition (i.e. outside the function body!): ../python pdb.py.v1.66 pdb_one_line_func > (1)?() (Pdb) b f Breakpoint 1 /src/Lib/pdb_one_line_func:3 (Pdb) c > /src/Lib/pdb_one_line_func(3)?() -> z=23 It's probably acceptable to limit pdb breakpoints to multiline functions, but i don't think, it's acceptable to create wrong breakpoints. Note: that anyone attempting to fix this should also take a look at bug 875404 (global statment causes breakpoints..), as both bugs are caused by pdb.checkline() logic ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926807&group_id=5470 From noreply at sourceforge.net Wed Mar 31 12:11:50 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 12:11:54 2004 Subject: [ python-Bugs-926807 ] pdb sometimes sets breakpoints in the wrong location Message-ID: Bugs item #926807, was opened at 2004-03-31 09:09 Message generated for change (Comment added) made by isandler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926807&group_id=5470 Category: Python Library Group: Python 2.4 >Status: Deleted Resolution: None Priority: 5 Submitted By: Ilya Sandler (isandler) Assigned to: Nobody/Anonymous (nobody) Summary: pdb sometimes sets breakpoints in the wrong location Initial Comment: If one attempts to set a breakpoint in one line function: e.g for this code: def f(x): return x*x z=23 pdb silently sets a breakpoint on the line right after the function definition (i.e. outside the function body!): ../python pdb.py.v1.66 pdb_one_line_func > (1)?() (Pdb) b f Breakpoint 1 /src/Lib/pdb_one_line_func:3 (Pdb) c > /src/Lib/pdb_one_line_func(3)?() -> z=23 It's probably acceptable to limit pdb breakpoints to multiline functions, but i don't think, it's acceptable to create wrong breakpoints. Note: that anyone attempting to fix this should also take a look at bug 875404 (global statment causes breakpoints..), as both bugs are caused by pdb.checkline() logic ---------------------------------------------------------------------- >Comment By: Ilya Sandler (isandler) Date: 2004-03-31 09:11 Message: Logged In: YES user_id=971153 Sorry, accidentally resubmitted the bug ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926807&group_id=5470 From noreply at sourceforge.net Wed Mar 31 13:06:09 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 13:06:18 2004 Subject: [ python-Bugs-925500 ] os.py uses #' - undocumented magic? Message-ID: Bugs item #925500, was opened at 2004-03-29 12:41 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 Category: Python Library Group: Python 2.4 >Status: Closed >Resolution: Invalid Priority: 3 Submitted By: Jim Jewett (jimjjewett) Assigned to: Skip Montanaro (montanaro) Summary: os.py uses #' - undocumented magic? Initial Comment: os.py wraps the first section of code (determining which operating system and path to use) in lines containing just #' (A comment start followed by a single-quote start.) This looks like unexplained magic. It should either be deleted, or commented to indicate why it is there. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-03-31 12:06 Message: Logged In: YES user_id=44345 It's not magic. It's just there to get python-mode back in sync. Emacs's notion of string characters doesn't include triple-quoted strings, so if you have something like: """Madam, I'm Adam.""" it can look unbalanced to python-mode (lone apostrophe). The #' simply "closes" that apostrophe. I don't think it warrants a comment everywhere it's used. It's just something people need to understand. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-03-29 16:09 Message: Logged In: YES user_id=21627 Assigning to Skip, who added these in os.py 1.41, with a check-in message of added several more __all__ lists ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925500&group_id=5470 From noreply at sourceforge.net Wed Mar 31 14:14:19 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 14:14:52 2004 Subject: [ python-Bugs-923576 ] Incorrect __name__ assignment Message-ID: Bugs item #923576, was opened at 2004-03-26 00:43 Message generated for change (Comment added) made by elcepi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 Category: Macintosh Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: El cepi (elcepi) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect __name__ assignment Initial Comment: When you use PythonLauncher or PythonIDE the value of __name__ is incorrectly assigned. For example, in the attached file the output is "The module has been load" when the module is fun in PythonIDE. With this you can not disciminate between the code you should run when you load the module and when you try to run it. ---------------------------------------------------------------------- >Comment By: El cepi (elcepi) Date: 2004-03-31 19:14 Message: Logged In: YES user_id=1006669 No problem tjreedy Here are the version information relevant to the report * PythonIDE Version 1.0.1 Python 2.3.3 (#1 March 12 2004, 13:49:58) GCC 3.1 20020420 (prerelease) * PythonLauncher Version 0.1 * Mac OS X Version 10.2.8 (6R73) Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC * Machine PowerBook G4 (version = 11.3) This bug cause that your applications behave different when are executed from PythonLauncher or PythonIDE than from the shell For example, If I double-click the foo.pyc file it is executed by PythonLauncher but it execute the code under __name__==?test? instead of under __name__==?__main__? as append when I run it from the shell. ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-31 15:07 Message: Logged In: YES user_id=593130 Lesson learned to check that header field. Inappropriate comments withdrawn. ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2004-03-31 10:56 Message: Logged In: YES user_id=6656 Terry, this bug is in the 'Macintosh' category for a reason :-) ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2004-03-30 17:14 Message: Logged In: YES user_id=593130 When making a bug report, please include at least the Python version. The system you are running on is sometimes essential info also. I am not familiar with either PythonLauncher or PythonIDE. Just PyWin and Idle. If they are third-party items not part of the distribution, then this report should go to their authors. 'When you use' is also somewhat vague. Saying what command line option or menu entry or buttom you used to run/load might also get a better answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=923576&group_id=5470 From noreply at sourceforge.net Wed Mar 31 14:34:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 14:34:06 2004 Subject: [ python-Bugs-926910 ] Overenthusiastic check in Swap? Message-ID: Bugs item #926910, was opened at 2004-03-31 14:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926910&group_id=5470 Category: Threads Group: None Status: Open Resolution: None Priority: 5 Submitted By: benson margulies (benson_basis) Assigned to: Nobody/Anonymous (nobody) Summary: Overenthusiastic check in Swap? Initial Comment: When Py_DEBUG is turned on, PyThreadState_Swap calls in a fatal error if the two different thread states are ever used for a thread. I submit that this is not a good check. The documentation encourages us to write code that creates and destroys thread states as C threads come and go. Why can't a single C thread make a thread state, release it, and then make another one later? One particular usage pattern: We have an API that initializes embedded python. Then we have another API where the callers are allowed to be in any C thread. The second API has no easy way to tell if a thread used for it happens to be the same thread that made the initialization call. As the code is written now, any code running on the 'main thread' is required to fish out the build-in main-thread thread state. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926910&group_id=5470 From noreply at sourceforge.net Wed Mar 31 14:43:44 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 14:43:51 2004 Subject: [ python-Bugs-474836 ] Tix not included in windows distribution Message-ID: Bugs item #474836, was opened at 2001-10-25 13:22 Message generated for change (Comment added) made by theller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=474836&group_id=5470 Category: Tkinter Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Thomas Heller (theller) Summary: Tix not included in windows distribution Initial Comment: Although there is a Tix.py available, there is no Tix support in the precomiled Python-distribution for windows. So import Tix works fine, but root = Tix.Tk() results in TclError: package not found. It is possible to circumvent this problem by installing a regular Tcl/Tk distribution (e.g. in c:\programme\tcl) and installing Tix in the regular Tcl-path (i.e. tcl\lib). Mathias ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2004-03-31 21:43 Message: Logged In: YES user_id=11105 I'm willing to do some work to include tix in Python 2.3.4, if someone can update the instructions. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-02-24 18:16 Message: Logged In: YES user_id=764593 Note that the problem is still there in 2.3.3; if it can't be fixed, could the documentation at least mention that Tix requires 3rd-party libraries on Windows? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-10-03 15:15 Message: Logged In: YES user_id=21627 Reassigning to Thomas, who is doing Windows releases these days. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-10-03 15:13 Message: Logged In: YES user_id=31435 Unassigned (doesn't look like I'll ever get time for this). ---------------------------------------------------------------------- Comment By: Aaron Optimizer Digulla (digulla) Date: 2003-10-03 13:10 Message: Logged In: YES user_id=606 loewis, when will your package show up in the official Python distribution? It's still not there in 2.3.2 :-( ---------------------------------------------------------------------- Comment By: Aaron Optimizer Digulla (digulla) Date: 2003-07-28 15:22 Message: Logged In: YES user_id=606 The Tix8184.dll is still missing in Python 2.3c2. The included Tix8183.dll (which is in the directory tcl\tix8.1\ along with a couple of other dlls -> can't be found by Python) is linked against Tcl/Tk 8.3. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-06-15 14:40 Message: Logged In: YES user_id=21627 I found that the instructions need slight modification: In step 2, use tk...\mkd.bat for mkdir. Apart from that, these instructions work fine for me, now. I have made a binary release of tix8.1 for Python 2.3 at http://www.dcl.hpi.uni-potsdam.de/home/loewis/tix8.1.zip The tix8184.dll goes to DLLs, the tix8.1 subdirectory goes to tcl. It differs from the standard tix8.1 subdirectory only in fixing the path to the DLLs directory. To test whether this works, execute Demo/tix/tixwidgets.py. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-04-26 12:22 Message: Logged In: YES user_id=21627 I still think Python should include Tix. Here are some instructions on how to make Tix 8.1.4 work: 1. Unpack as a sibling of tcl8.4.1 and tk8.4.1 2. Edit win\common.mk, to set the following variables TCL_VER=8.4 INSTALLDIR= MKDIR=mkdir 3. Edit win\makefile.vc, to set the following variables TOOLS32= TOOLS32_rc= 4. Edit win\tk\pkgindex.tcl, to replace lappend dirs ../../Dlls with lappend dirs [file join [file dirname [info nameofexe]] Dlls] 5. nmake -f makefile.vc 6. nmake -f makefile.vc install 7. Copy INSTALLDIR\bin\tix8184.dll to \DLLs 8. Optionally copy tix8184.lib somewhere 9. copy INSTALLDIR\lib\tix8.1 into \tcl With these instructions, invoking t.tk.eval("package require Tix") succeeds. For some reason, Tix won't still find any of the commands; I'll investigate this later. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-12-11 10:14 Message: Logged In: YES user_id=33229 My you're courageous - going with a version of Tcl that doesn't even pass its own tests :-) Been there, seen it, done it .... 8.1.4 will be out this week, which compiles with 8.4 but I don't expect it to "support" 8.4 for a while yet (they added more problems in 8.4.1). 8.3.5 is definitely "supported". Check back with me before 2.3 goes into beta and I'll do another minor release if necessary. Maybe Tk will test clean then. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-11-20 02:36 Message: Logged In: YES user_id=31435 Parents shouldn't disagree in front of their children . Not all the Tcl or Tk tests (their tests, not ours) passed when I built 8.4.1, but I couldn't (and can't) make time to dig into that, and all the Python stuff I tried worked fine. So I don't fear 8.4, and am inclined to accept Martin's assurance that 8.4 is best for Python. We intend to put out the first 2.3 Python alpha by the end of the year, and my bet is it won't be a minute before that. If Tix 8.1.4 is at RC3 now, I'd *guess* you'll have a final release out well before then. Yes? No? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-11-19 23:12 Message: Logged In: YES user_id=21627 I think the recommendation cannot apply to Python; I'm very much in favour of releasing Python 2.3 with Tk 8.4.x. So the question then is whether Python 2.3 should include Tix 8.1.4 or no Tix at all, and at what time Tix 8.1.4 can be expected. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-19 20:10 Message: Logged In: YES user_id=33229 Look on http://tix.sourceforge.net/download.shtml for Tix 8.1.4 RC3. It works with Tk 8.4.1 and passes the test suite, but there are still issues with Tk 8.4 and it has not been widely tested with yet with 8.4.1, so we still recommend 8.3.5. (Tcl major releases often aren't stable until patch .3 or so.) If you have any problems let me know directly by email and I'll try and help. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-11-18 17:35 Message: Logged In: YES user_id=31435 Does Tix 8.1.3 play with Tcl/Tk 8.4.1? The 2.3. Windows distro is set up to include the latter now. The win\common.mak file from Tix 8.1.3 doesn't have a section for Tcl/Tk 8.4, though. There appear to be several reasons Tix won't compile on my box anyway without fiddling the Tix makefiles (e.g., my VC doesn't live in \DevStudio), so before spending more time on that I'd like to know whether it's doomed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-11-07 15:52 Message: Logged In: YES user_id=6380 I support this. Tim, I know you're not a big Tk user (to say the least). I'll offer to help in person. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-03 08:30 Message: Logged In: YES user_id=33229 I would really like to see Tix in 2.3 and will be glad to help. AFAIK there are no major issues with tix-8.1.3 and Python 2.x and it should be a simple drop in of a cannonically compiled Tix. If there are any issues that need dealing with at Tix's end, I'll be glad to put out a new minor release of Tix to address them. On Python's end I've suggested a fix for http://python.org/sf/564729 FYI, please also see my comments for bug 632323. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-03 06:34 Message: Logged In: YES user_id=33229 I would really like to see Tix in 2.3 and will be glad to help. AFAIK there are no major issues with tix-8.1.3 and Python 2.x and it should be a simple drop in of a cannonically compiled Tix. If there are any issues that need dealing with at Tix's end, I'll be glad to put out a new minor release of Tix to address them. On Python's end I've suggested a fix for http://python.org/sf/564729 FYI, please also see my comments for bug 632323. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-03-23 04:34 Message: Logged In: YES user_id=6380 Yes, for 2.3. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-03-10 02:48 Message: Logged In: YES user_id=31435 Guido, do you want me to spend time on this? ---------------------------------------------------------------------- Comment By: Mathias Palm (monos) Date: 2002-03-07 14:38 Message: Logged In: YES user_id=361926 Thanks. Mathias ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-02-25 13:57 Message: Logged In: YES user_id=21627 The zip file is slightly too large for SF, so it is now at http://www.informatik.hu- berlin.de/~loewis/python/tix813win.zip ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-02-25 13:56 Message: Logged In: YES user_id=21627 Building Tix from sources is non-trivial, and I could not find any recent Windows binary distribution (based on Tix 8.1). So I'll attach a build of Tix 8.1.3 for Tcl/Tk 8.3, as a drop-in into the Python binary distribution. Compared to the original distribution, only tix8.1 \pkgIndex.tcl required tweaking, to tell it that tix8183.dll can be found in the DLLs subdirectory. Also, unless TIX_LIBRARY is set, the Tix tcl files *must* live in tcl\tix8.1, since tix8183.dll will look in TCL_LIBRARY\..\tix (among other locations). If a major Tcl release happens before Python 2.3 is released (and it is then still desirable to distribute Python with Tix), these binaries need to be regenerated. Would these instructions (unpack zip file into distribution tree) be precise enough to allow incorporation into the windows installer? ---------------------------------------------------------------------- Comment By: Mathias Palm (monos) Date: 2001-10-29 12:53 Message: Logged In: YES user_id=361926 As mentioned in the mail above (by me, Mathias), Tix is a package belonging to Tcl/Tk (to be found on sourceforge: tix.sourceforge.net, or via the Python home page - tkinter link). Everything needed can be found there, just read about it (and dont forget about the winking, eyes might be getting dry) Mathias ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-10-25 20:26 Message: Logged In: YES user_id=31435 I don't know anything about Tix, so if somebody wants this in the Windows installer, they're going to have to explain exactly (by which I mean exactly <0.5 wink>) what's needed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=474836&group_id=5470 From noreply at sourceforge.net Wed Mar 31 15:03:49 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 15:03:59 2004 Subject: [ python-Bugs-474836 ] Tix not included in windows distribution Message-ID: Bugs item #474836, was opened at 2001-10-25 13:22 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=474836&group_id=5470 Category: Tkinter Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Thomas Heller (theller) Summary: Tix not included in windows distribution Initial Comment: Although there is a Tix.py available, there is no Tix support in the precomiled Python-distribution for windows. So import Tix works fine, but root = Tix.Tk() results in TclError: package not found. It is possible to circumvent this problem by installing a regular Tcl/Tk distribution (e.g. in c:\programme\tcl) and installing Tix in the regular Tcl-path (i.e. tcl\lib). Mathias ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-31 22:03 Message: Logged In: YES user_id=21627 The instructions from 2003-04-26/2003-06-15 should still be valid. For 2.4, the story will be different, as Tix does not currently build with VC7. ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2004-03-31 21:43 Message: Logged In: YES user_id=11105 I'm willing to do some work to include tix in Python 2.3.4, if someone can update the instructions. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2004-02-24 18:16 Message: Logged In: YES user_id=764593 Note that the problem is still there in 2.3.3; if it can't be fixed, could the documentation at least mention that Tix requires 3rd-party libraries on Windows? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-10-03 15:15 Message: Logged In: YES user_id=21627 Reassigning to Thomas, who is doing Windows releases these days. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-10-03 15:13 Message: Logged In: YES user_id=31435 Unassigned (doesn't look like I'll ever get time for this). ---------------------------------------------------------------------- Comment By: Aaron Optimizer Digulla (digulla) Date: 2003-10-03 13:10 Message: Logged In: YES user_id=606 loewis, when will your package show up in the official Python distribution? It's still not there in 2.3.2 :-( ---------------------------------------------------------------------- Comment By: Aaron Optimizer Digulla (digulla) Date: 2003-07-28 15:22 Message: Logged In: YES user_id=606 The Tix8184.dll is still missing in Python 2.3c2. The included Tix8183.dll (which is in the directory tcl\tix8.1\ along with a couple of other dlls -> can't be found by Python) is linked against Tcl/Tk 8.3. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-06-15 14:40 Message: Logged In: YES user_id=21627 I found that the instructions need slight modification: In step 2, use tk...\mkd.bat for mkdir. Apart from that, these instructions work fine for me, now. I have made a binary release of tix8.1 for Python 2.3 at http://www.dcl.hpi.uni-potsdam.de/home/loewis/tix8.1.zip The tix8184.dll goes to DLLs, the tix8.1 subdirectory goes to tcl. It differs from the standard tix8.1 subdirectory only in fixing the path to the DLLs directory. To test whether this works, execute Demo/tix/tixwidgets.py. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-04-26 12:22 Message: Logged In: YES user_id=21627 I still think Python should include Tix. Here are some instructions on how to make Tix 8.1.4 work: 1. Unpack as a sibling of tcl8.4.1 and tk8.4.1 2. Edit win\common.mk, to set the following variables TCL_VER=8.4 INSTALLDIR= MKDIR=mkdir 3. Edit win\makefile.vc, to set the following variables TOOLS32= TOOLS32_rc= 4. Edit win\tk\pkgindex.tcl, to replace lappend dirs ../../Dlls with lappend dirs [file join [file dirname [info nameofexe]] Dlls] 5. nmake -f makefile.vc 6. nmake -f makefile.vc install 7. Copy INSTALLDIR\bin\tix8184.dll to \DLLs 8. Optionally copy tix8184.lib somewhere 9. copy INSTALLDIR\lib\tix8.1 into \tcl With these instructions, invoking t.tk.eval("package require Tix") succeeds. For some reason, Tix won't still find any of the commands; I'll investigate this later. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-12-11 10:14 Message: Logged In: YES user_id=33229 My you're courageous - going with a version of Tcl that doesn't even pass its own tests :-) Been there, seen it, done it .... 8.1.4 will be out this week, which compiles with 8.4 but I don't expect it to "support" 8.4 for a while yet (they added more problems in 8.4.1). 8.3.5 is definitely "supported". Check back with me before 2.3 goes into beta and I'll do another minor release if necessary. Maybe Tk will test clean then. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-11-20 02:36 Message: Logged In: YES user_id=31435 Parents shouldn't disagree in front of their children . Not all the Tcl or Tk tests (their tests, not ours) passed when I built 8.4.1, but I couldn't (and can't) make time to dig into that, and all the Python stuff I tried worked fine. So I don't fear 8.4, and am inclined to accept Martin's assurance that 8.4 is best for Python. We intend to put out the first 2.3 Python alpha by the end of the year, and my bet is it won't be a minute before that. If Tix 8.1.4 is at RC3 now, I'd *guess* you'll have a final release out well before then. Yes? No? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-11-19 23:12 Message: Logged In: YES user_id=21627 I think the recommendation cannot apply to Python; I'm very much in favour of releasing Python 2.3 with Tk 8.4.x. So the question then is whether Python 2.3 should include Tix 8.1.4 or no Tix at all, and at what time Tix 8.1.4 can be expected. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-19 20:10 Message: Logged In: YES user_id=33229 Look on http://tix.sourceforge.net/download.shtml for Tix 8.1.4 RC3. It works with Tk 8.4.1 and passes the test suite, but there are still issues with Tk 8.4 and it has not been widely tested with yet with 8.4.1, so we still recommend 8.3.5. (Tcl major releases often aren't stable until patch .3 or so.) If you have any problems let me know directly by email and I'll try and help. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-11-18 17:35 Message: Logged In: YES user_id=31435 Does Tix 8.1.3 play with Tcl/Tk 8.4.1? The 2.3. Windows distro is set up to include the latter now. The win\common.mak file from Tix 8.1.3 doesn't have a section for Tcl/Tk 8.4, though. There appear to be several reasons Tix won't compile on my box anyway without fiddling the Tix makefiles (e.g., my VC doesn't live in \DevStudio), so before spending more time on that I'd like to know whether it's doomed. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-11-07 15:52 Message: Logged In: YES user_id=6380 I support this. Tim, I know you're not a big Tk user (to say the least). I'll offer to help in person. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-03 08:30 Message: Logged In: YES user_id=33229 I would really like to see Tix in 2.3 and will be glad to help. AFAIK there are no major issues with tix-8.1.3 and Python 2.x and it should be a simple drop in of a cannonically compiled Tix. If there are any issues that need dealing with at Tix's end, I'll be glad to put out a new minor release of Tix to address them. On Python's end I've suggested a fix for http://python.org/sf/564729 FYI, please also see my comments for bug 632323. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-03 06:34 Message: Logged In: YES user_id=33229 I would really like to see Tix in 2.3 and will be glad to help. AFAIK there are no major issues with tix-8.1.3 and Python 2.x and it should be a simple drop in of a cannonically compiled Tix. If there are any issues that need dealing with at Tix's end, I'll be glad to put out a new minor release of Tix to address them. On Python's end I've suggested a fix for http://python.org/sf/564729 FYI, please also see my comments for bug 632323. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-03-23 04:34 Message: Logged In: YES user_id=6380 Yes, for 2.3. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-03-10 02:48 Message: Logged In: YES user_id=31435 Guido, do you want me to spend time on this? ---------------------------------------------------------------------- Comment By: Mathias Palm (monos) Date: 2002-03-07 14:38 Message: Logged In: YES user_id=361926 Thanks. Mathias ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-02-25 13:57 Message: Logged In: YES user_id=21627 The zip file is slightly too large for SF, so it is now at http://www.informatik.hu- berlin.de/~loewis/python/tix813win.zip ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-02-25 13:56 Message: Logged In: YES user_id=21627 Building Tix from sources is non-trivial, and I could not find any recent Windows binary distribution (based on Tix 8.1). So I'll attach a build of Tix 8.1.3 for Tcl/Tk 8.3, as a drop-in into the Python binary distribution. Compared to the original distribution, only tix8.1 \pkgIndex.tcl required tweaking, to tell it that tix8183.dll can be found in the DLLs subdirectory. Also, unless TIX_LIBRARY is set, the Tix tcl files *must* live in tcl\tix8.1, since tix8183.dll will look in TCL_LIBRARY\..\tix (among other locations). If a major Tcl release happens before Python 2.3 is released (and it is then still desirable to distribute Python with Tix), these binaries need to be regenerated. Would these instructions (unpack zip file into distribution tree) be precise enough to allow incorporation into the windows installer? ---------------------------------------------------------------------- Comment By: Mathias Palm (monos) Date: 2001-10-29 12:53 Message: Logged In: YES user_id=361926 As mentioned in the mail above (by me, Mathias), Tix is a package belonging to Tcl/Tk (to be found on sourceforge: tix.sourceforge.net, or via the Python home page - tkinter link). Everything needed can be found there, just read about it (and dont forget about the winking, eyes might be getting dry) Mathias ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-10-25 20:26 Message: Logged In: YES user_id=31435 I don't know anything about Tix, so if somebody wants this in the Windows installer, they're going to have to explain exactly (by which I mean exactly <0.5 wink>) what's needed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=474836&group_id=5470 From noreply at sourceforge.net Wed Mar 31 15:11:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 15:12:06 2004 Subject: [ python-Bugs-926427 ] OEM codepage chars in mbcs filenames can be misinterpreted Message-ID: Bugs item #926427, was opened at 2004-03-31 06:04 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 Category: Python Library >Group: 3rd Party >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Mike Brown (mike_j_brown) Assigned to: Nobody/Anonymous (nobody) Summary: OEM codepage chars in mbcs filenames can be misinterpreted Initial Comment: My system: Windows XP, English - US locale, Python 2.3.3 I believe the bug I am reporting here is this: On Windows XP, when using os.listdir() with a non- Unicode argument, characters that are not in the default locale's encoding (e.g. Greek capital letter Sigma, (U+03A3), is not in windows-1252), but that are in the default OEM code page (e.g. Sigma is in cp437), get mapped to ASCII characters other than '?'. For example, things seem to work in a predictable way when I put windows-1252 characters into filenames (I do this in Explorer and then I see what os.listdir (r'C:\path\to\the\dir') returns): ? (U+2014) becomes \x97 ? (U+2022) becomes \x95 ? (U+00E9) becomes \xe9 But things are much less predictable when I use characters from outside this range. I thought I'd try some Greek characters first. Some of them (the ones that happen to be in cp437, interestingly enough) come back as random ASCII letters: Θ (U+0398) becomes "T" Σ (U+03A3) becomes "S" Φ (U+03A6) becomes "F" Greek letters that are not in cp437 come back as question marks, as expected (I guess): Τ (U+03A4) becomes "?" Υ (U+03A5) becomes "?" ...as do some Hebrew letters and Japanese hiragana: א (U+05D0) becomes "?" ה (U+05D4) becomes "?" ס (U+05E1) becomes "?" あ (U+305F) becomes "?" う (U+3046) becomes "?" た (U+3042) becomes "?" I don't know if this is something that anyone cares about, since the filenames are useless anyway, but it does seem to be unintended behavior. (And before you ask, it's just a theoretical exercise; I have no urgent need to use os.listdir with non-Unicode directory names on Windows.) ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-03-31 22:11 Message: Logged In: YES user_id=21627 There is nothing we can do about this: the mapping from characters outside the ANSI CP is done completely inside Windows, using an undocumented algorithm. This algorithm will typically replace characters with "similar" ones. E.g. U+0398 is GREEK CAPITAL LETTER THETA, which is similar in sound to LATIN CAPITAL LETTER T. Similarity is sometimes determined by sound, sometimes by glyph-likeness in a typical font. If no similar character is available, Windows puts in a question mark. The system call performing the directory listing does not indicate whether such a mapping has taken place. Closing this as third-party bug. ---------------------------------------------------------------------- Comment By: Mike Brown (mike_j_brown) Date: 2004-03-31 12:28 Message: Logged In: YES user_id=371366 I've added a script that demonstrates the issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=926427&group_id=5470 From noreply at sourceforge.net Wed Mar 31 21:48:38 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 21:49:00 2004 Subject: [ python-Bugs-917055 ] add a stronger PRNG Message-ID: Bugs item #917055, was opened at 2004-03-16 02:46 Message generated for change (Comment added) made by phr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=917055&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Raymond Hettinger (rhettinger) Summary: add a stronger PRNG Initial Comment: The default Mersenne Twister algorithm in the Random module is very fast but makes no serious attempt to generate output that stands up to adversarial analysis. Besides cryptography applications, this can be a serious problem in areas like computer games. Sites like www.partypoker.com routinely run online tournaments with prize funds of 100K USD or more. There's big financial incentives to find ways of guessing your opponent's cards with better than random chance probability. See bug #901285 for some discussion of possible correlations in Mersenne Twister's output. Teukolsky et al discuss PRNG issues at some length in their book "Numerical Recipes". The original edition of Numerical Recipes had a full blown version of the FIPS Data Encryption Standard implemented horrendously in Fortran, as a way of making a PRNG with no easily discoverable output correlations. Later editions replaced the DES routine with a more efficient one based on similar principles. Python already has an SHA module that makes a dandy PRNG. I coded a sample implementation: http://www.nightsong.com/phr/python/sharandom.py I'd like to ask that the Python lib include something like this as an alternative to MT. It would be similar to the existing whrandom module in that it's an alternative subclass to the regular Random class. The existing Random module wouldn't have to be changed. I don't propose directly including the module above, since I think the Random API should also be extended to allow directly requesting pseudo-random integers from the generator subclass, rather than making them from floating-point output. That would allow making the above subclass work more cleanly. I'll make a separate post about this, but first will have to examine the Random module source code. ---------------------------------------------------------------------- >Comment By: paul rubin (phr) Date: 2004-04-01 02:48 Message: Logged In: YES user_id=72053 FYI, this was just announced on the python-crypto list. It's a Python wrapper for EGADS, a cross platform entropy-gathering RNG. I haven't looked at the code for it and have no opinion about it. http://wiki.osafoundation.org/twiki/bin/view/Chandler/PyEgads ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-26 00:36 Message: Logged In: YES user_id=72053 1. OK, though the docs should mention this. 2. One-way just means collision resistant, and we're trying to make something without a distinguisher, which is a stronger criterion. I'm not saying there's any problem with a single hash; I just don't see an obvious proof that there's not a problem. Also it makes me cringe slightly to keep the seed around as plaintext even temporarily. The PC that I'm using (midrange Athlon) can do about a million sha1 hashes per second, so an extra hash per reseed "multiple" times per second shouldn't be noticible, for reasonable values of "multiple". 3. Since most of the real computation of this function is in the sha1 compression, the timing indicates that evaluation is dominated by interpreter overhead rather than by hashing. I presume you're using CPython. The results may be different in Jython or with Psyco and different again under PyPy once that becomes real. I think we should take the view that we're designing a mathematical function that exists independently of any specific implementation, then figure out what characteristics it should have and implement those, rather than tailoring it to the peculiarities of CPython. If people are really going to be using this function in 2010, CPython will hopefully be dead and gone (replaced by PyPy) by then, so that's all the more reason to not worry about small CPython-specific effects since the function will outlast CPython. Maybe also sometime between now and then, these libraries can be compiled with psyco. 4. OK 5. OK. Would be good to also change %s for cnt in setstate to %x. 6. Synchronization can be avoided by hashing different fixed strings into s0 and s1 at each rehash (I did that in my version). I think it's worth doing that just to kick the hash function away from standard sha. I actually don't see much need for the counter in either hash, but you were concerned about hitting possible short cycles in sha. 7. OK. WHrandom is already non-threadsafe, so there's precedent. I do have to wonder if the 160 bit arithmetic is slowing things down. If we don't care about non-IEEE doubles, we're ok with 53 bits. Hmm, I also wonder whether the 160 bit int to float conversion is precisely specified even for IEEE and isn't an artifact of Python's long int implementation. But I guess it doesn't matter, since we're never hashing those floats. Re bugs til 2010: oh let's have more confidence than that :). I think if we're careful and get the details correct before deployment, we shouldn't have any problems. This is just one screenful of code or so, not complex by most reasonable standards. However, we might want post the algorithm on sci.crypt for comments, since there's some knowledgeable people there. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-25 09:08 Message: Logged In: YES user_id=80475 Took another look at #5 and will change str() to hex(). ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-25 08:25 Message: Logged In: YES user_id=80475 1. We don't care about non IEEE. 2. One-way is one-way, so double hashing is unnecessary. Also, I've fielded bug reports from existing user apps that re-seed very frequently (multiple times per second). 3. The implementations reflect the results of timing experiments which showed that the fastest intermediate representation was hex. 4. ['0x0'] is necessary to hanlde the case where n==0. int('', 16) raises a ValueError while int('0x0', 16) does not. 5. random() and getrandbits() do not have to go through the same intermediate steps (it's okay for one to use hex and the other to use str) -- speed and space issues dominate. 0x comes up enough in Python, there is little use in tossing it away for an obscure, hypothetical micro-controller implementation. 6. Leaving cnt out of the s1 computation guarantees that it will never track the updates of s0 -- any syncronization would be a disaster. Adding a count or some variant smacks of desperation rather than reliance on proven hash properties. 7. The function is already 100 times slower than MT. Adding locks will make the situation worse. It is better to simply document it as being non-threadsafe. Look at back at the mt/sha version. Its code is much cleaner, faster, and threadsafe. It goes a long way towards meeting your request and serving as an alternate generator to validate simulation results. If we use the sha/sha version, I'm certain that we will be fielding bug reports on this through 2010. It is also sufficiently complex that it will spawn lengthy, wasteful discussions and it will create a mine-field for future maintainers. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-25 05:15 Message: Logged In: YES user_id=72053 I'm not sure why the larger state space of mt/sha1 is supposed to be an advantage, but the other points are reasonable. I like the new sha1/sha1 implementation except for a few minor points (below). I made the old version hopefully threadsafe by adding a threading.Lock() object to the instance and locking it on update. I generally like your version better so maybe the lock can be added. Of course that slows it down even further, but in the context of an interpreted Python program I feel that the generator is still fast enough compared to the other stuff the program is likely to be doing. Re the new attachment, some minor issues: 1) The number 2.0**-160 is < 10**-50. This is a valid IEEE double but on some non-IEEE machines it may be a floating underflow or even equal to zero. I don't know if this matters. 2) Paranoia led me to hash the seed twice in the seed operation in my version, to defeat unlikely message-extension attacks against the hash function. I figured reseeding is infrequent enough that an extra hash operation doesn't matter. 3) Storing s1 as a string of 40 hex digits in SHARandom2 means that s1+s2 is 60 characters, which means hashing it will need two sha1 compression operations, slowing it down some. 4) the intiialization of ciphertxt to ["0x0"] instead of [] doesn't seem to do anything useful. int('123abc', 16) is valid without the 0x prefix. 5) random() uses hex(cnt) while getrandbits uses str(cnt) (converting to decimal instead of hex). I think it's better to use hex and remove the 0x prefix from the output, which is cleanest, and simpler to implement on some targets (embedded microcontroller). The same goes for the %s conversion in jumpahead (my version also uses %s there). 6) It may be worthwhile to include cnt in both the s0 and s1 hash updates. That guarantees the s1 hash never gets the same input twice. 7) The variable "s1" in getrandbits (instead of self.s1) is set but never used. Note in my version of sharandom.py, I didn't put a thread lock around the tuple assignment in setstate(). I'm not sure if that's safe or not. But it looks to me like random.py in the CVS does the same thing, so maybe both are unsafe. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-24 11:31 Message: Logged In: YES user_id=80475 I attached a new version of the mt/sha1 combination. Here are the relative merits as compared sha1/sha1 approach: * simpiler to implement/maintain since state tracking is builtin * larger state space (2**19937 vs 2**160) * faster * threadsafe Favoring sha1/sha1: * uses only one primitive * easier to replace in situations where MT is not available ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-22 00:56 Message: Logged In: YES user_id=72053 Two small corrections to below: 1) "in favor of an entropy" is an editing error--the intended meaning should be obvious. 2) I meant Bryan Mongeau, not Eric Mongeau. Bryan's lib is at . Sorry for any confusion. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-22 00:49 Message: Logged In: YES user_id=72053 I'm very much in favor of an entropy and Bram's suggested interface of entropy(x) supplying x bytes of randomness is fine. Perhaps it should really live in a cryptography API rather than in the Random API, but either way is ok. Mark Moraes wrote a Windows module that gets random numbers from the Windows CAPI; I put up a copy at http://www.nightsong.com/phr/python/winrand.module For Linux, Cygwin, and *BSD (including MacOS 10, I think), just read /dev/urandom for random bytes. However, various other systems (I think including Solaris) don't include anything like this. OpenSSL has an entropy gathering daemon that might be of some use in that situation. There's also the Yarrow generator (http://www.schneier.com/yarrow.html) and Eric Mongeau(?) wrote a pure-Python generator a while back that tried to gather entropy from thread racing, similar to Java's default SecureRandom class (I consider that method to be a bit bogus in both Python and Java). I think, though, simply supporting /dev/*random and the Windows CAPI is a pretty good start, even if other OS's aren't supported. Providing that function in the Python lib will make quite a few people happy. A single module integrating both methods would be great. I don't have any Windows dev tools so can't test any wrappers for Mark Moraes's function but maybe one of you guys can do it. I'm not too keen on the md5random.py patch for reasons discussed in the c.l.py thread. It depends too deeply on the precise characteristics of both md5 and Mersenne Twister. I think for a cryptography-based generator, it's better to stick to one cryptography-based primitive, and to use sha instead of md5. That also helps portability since it means other environments (maybe including Jython) can reproduce the PRNG stream without having to re-implement MT, as long as they have SHA (which is a US federal standard). ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-21 19:50 Message: Logged In: YES user_id=80475 Bram, if you have a patch, I would be happy to look at it. Please make it as platform independent as possible (its okay to have it conditionally compile differently so long as the API stays the same). Submit it as a separate patch and assign to me -- it doesn't have to be orginal, you can google around to determine prior art. ---------------------------------------------------------------------- Comment By: Bram Cohen (bram_cohen) Date: 2004-03-21 19:34 Message: Logged In: YES user_id=52561 The lack of a 'real' entropy source is the gap which can't be fixed with an application-level bit of code. I think there are simple hooks for this on all systems, such as /dev/random on linux, but they aren't cross platform. A unified API which always calls the native entropy hook would be a very good thing. An example of a reasonable API would be to have a module named entropy, with a single function entropy(x) which returns a random string of length x. This is a problem which almost anyone writing a security-related application runs into, and lots of time is wasted writing dubious hacks to harvest entropy when a single simple library could magically solve it the right way. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-21 17:33 Message: Logged In: YES user_id=80475 Attaching my alternative. If it fulfills your use case, let me know and I'll apply it. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-18 08:51 Message: Logged In: YES user_id=72053 Updated version of sharandom.py is at same url. It folds a counter into the hash and also includes a getrandbits method. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-18 06:27 Message: Logged In: YES user_id=72053 I don't mind dropping the time() auto-seed but I think that means eliminating any auto-seed, and requiring a user-supplied seed. There is no demonstrable minimum period for the SHA-OFB and it would be bad if there was, since it would then no longer act like a PRF. Note that the generator in the sample code actually comes from two different SHA instances and thus its expected period is about 2**160. Anyway, adding a simple counter (incrementing by 1 on every SHA call) to the SHA input removes any lingering chance of a repeating sequence. I'll update the code to do that. It's much less ugly than stirring in Mersenne Twister output. I don't have Python 2.4 yet but will look at it when I get a chance. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-17 11:27 Message: Logged In: YES user_id=80475 It has some potential for being added. That being said, try to avoid a religious fervor. I would like to see considerably more discussion and evolution first. The auto-seeding with time *must* be dropped -- it is not harmonious with the goal of creating a secure random sequence. It is okay for the a subclass to deviate in this way. Also, I was soliciting references stronger than (I don't know of any results ... It is generally considered ... ). If we put this in, people are going to rely on it. The docs *must* include references indicating the strengths and weaknesses of the approach. It should also concisely say why it works (a summary proof that makes it clear how a one-way digest function can be tranformed into a sequence generator that is cryptographicly strong to both the left and right with the latter being the one that is not obvious). Not having a demonstrable minimum period is also bad. Nothing in the discussion so far precludes the existence of a bad seed that has a period of only 1 or 2. See my suggestion on comp.lang.python for a means of mitigating this issue. With respect to the randint question, be sure to look at the current Py2.4 source for random.py. The API is expanded to include and an option method, getrandbits(). That in turn feeds the other integer methods without the int to float to int dance. Upon further consideration, I think the export control question is moot since we're using an existing library function and not really expressing new art. ---------------------------------------------------------------------- Comment By: paul rubin (phr) Date: 2004-03-17 09:05 Message: Logged In: YES user_id=72053 There are no research results that I know of that can distinguish the output of sha1-ofb from random output in any practical way. To find such a distinguisher would be a significant result. It's a safe bet that cryptographers have searched for distinguishers, though I don't promise to have heard of every result that's been published. I'll ask on sci.crypt if anyone else has heard of such a thing, if you want. SHA1-HMAC is generally considered to be indistinguishable from a PRF (pseudorandom function, i.e. a function selected at random from the space of all functions from arbitrary strings to 160-bit outputs; this term is from concrete security theory). MD5 is deprecated these days and there's no point to using it instead of sha1 for this. I'm not sure what happens if randint is added to the API. If you subclass Random and don't provide a randint method, you inherit from the base class, which can call self.random() to get floats to make the ints from. US export restrictions basically don't exist any more. In principle, if you want to export something, you're supposed to send an email to an address at the commerce department, saying the name of the program and the url where it can be obtained and a few similar things. In practice, email to that address is ignored, they never check anything. I heard the address even stopped working for a while, though they may have fixed it since then. See http://www.bxa.doc.gov/Encryption/ for info. I've emailed notices to the address a few times and never heard back anything. Anyway, I don't think this should count as cryptography; it's simply using a cryptographic hash function as an PRNG to avoid the correlations in other PRNG's; scientific rationale for doing that is given in the Numerical Recipes book mentioned above. The code that I linked uses the standard API but I wonder if the floating point output is optimally uniform, i.e. the N/2**56 calculation may not be exactly the right thing for an ieee float64. Using the time of day is what the Random docs say to do by default. You're correct that any security application needs to supply a higher entropy seed. I would like it very much if the std lib included a module that read some random bytes from the OS for OS's that support it. That means reading /dev/urandom on recent Un*x-ish systems or Cygwin, or calling CryptGenRandom on Windows. Reading /dev/urandom is trivial, and there's a guy on the pycrypt list who wrote a Windows function to call CryptGenRandom and return the output through the Python API. I forwarded the function to Guido with the author's permission but nothing seemed to happen with it. However, this gets away from this sharandom subclass. I'd like to make a few more improvements to the module but after that I think it can be dropped into the lib. Let me know what you think. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-16 11:52 Message: Logged In: YES user_id=80475 One other thought: if cryptographic strength is a goal, then seeding absolutely should require a long seed (key) as an input and the time should *never* be used. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-16 11:49 Message: Logged In: YES user_id=80475 It would have been ideal if the Random API had been designed with an integer generator at the core and floating point as a computed value, but that it the way it has been for a long time and efforts to switch it over would likely result in either incompatibility with existing subclasses or introducing new complexity (making it even harder to subclass). I think the API should be left alone until Py3.0. The attached module would make a good recipe on ASPN where improvements and critiques can be posted. Do you have links to research showing that running SHA-1 in a cipher block feedback mode results in a cryptographically strong random number generator -- the result seems likely, but a research link would be great. Is there a link to research showing the RNG properties of the resulting generator (period, equidistribution, passing tests for randomness, etc)? Also, is there research showing the relative merits of this approach vs MD5, AES, or DES? If something like this gets added to the library, I prefer it to be added to random.py using the existing API. Adding yet another random module would likely do more harm than good. One other question (I don't know the answer to this): would including a cryptographically strong RNG trigger US export restrictions on the python distribution? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=917055&group_id=5470 From noreply at sourceforge.net Wed Mar 31 23:07:17 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 23:07:22 2004 Subject: [ python-Bugs-927248 ] Python segfaults when freeing "deep" objects Message-ID: Bugs item #927248, was opened at 2004-03-31 23:07 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=927248&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jp Calderone (kuran) Assigned to: Nobody/Anonymous (nobody) Summary: Python segfaults when freeing "deep" objects Initial Comment: An example to produce this behavior: >>> f = lambda: None >>> for i in range(1000000): ... f = f.__call__ ... >>> f = None Segmentation fault ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=927248&group_id=5470 From noreply at sourceforge.net Wed Mar 31 23:09:50 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 23:10:02 2004 Subject: [ python-Bugs-796042 ] sdist ignores scripts argument in setup Message-ID: Bugs item #796042, was opened at 2003-08-27 11:09 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=796042&group_id=5470 Category: Distutils Group: Python 2.3 >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Anna Ravenscroft (annarave) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: sdist ignores scripts argument in setup Initial Comment: When writing the setup script for a distribution, section 3.4 explains: 3.4 Installing Scripts So far we have been dealing with pure and non-pure Python modules, which are usually not run by themselves but imported by scripts. Scripts are files containing Python source code, intended to be started from the command line. Scripts don't require Distutils to do anything very complicated. The only clever feature is that if the first line of the script starts with #! and contains the word ``python'', the Distutils will adjust the first line to refer to the current interpreter location. The scripts option simply is a list of files to be handled in this way. From the PyXML setup script: setup (... scripts = ['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) Unfortunately, this doesn't work with sdist unless you ALSO create a manifest.in file. Otherwise, it silently ignores the scripts listed in setup. bdist works just fine, so it's apparently something wrong in sdist. Please fix this. Thank you. Anna Ravenscroft ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-31 23:09 Message: Logged In: YES user_id=3066 Backported for Python 2.3.4 as: Lib/distutils/command/build_scripts.py 1.21.8.1 Lib/distutils/command/sdist.py 1.56.14.1 Doc/dist/dist.tex 1.56.8.5 ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-30 21:03 Message: Logged In: YES user_id=3066 Added note about inclusion of scripts in Doc/dist/dist.tex revision 1.73. This should be back-ported along with the actual fix. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-25 17:17 Message: Logged In: YES user_id=3066 This is fixed on the trunk as Lib/distutils/command/build_scripts.py 1.22 and sdist.py 1.57. I'm not entirely sure this should be backported for Python 2.3.x, but it probably should be. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=796042&group_id=5470 From noreply at sourceforge.net Wed Mar 31 23:19:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 23:19:24 2004 Subject: [ python-Bugs-832251 ] Wrong reference for specific minidom methods Message-ID: Bugs item #832251, was opened at 2003-10-29 04:39 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=832251&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed Resolution: Fixed Priority: 6 Submitted By: Francesco Ricciardi (nerby) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Wrong reference for specific minidom methods Initial Comment: In the HTML documentation the method in section 13.7.1 "DOM Objects" of the library reference are listed as HTMLParser method. In the "paper" documentation (PDF-A4 and Ps-A4) the same methods have no module reference. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-31 23:19 Message: Logged In: YES user_id=3066 Backported for Python 2.3.4 as Doc/lib/xmldomminidom.tex 1.8.12.1. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-25 11:51 Message: Logged In: YES user_id=3066 Fixed in Doc/lib/xmldomminidom.tex revision 1.9. Someone should backport this to Python 2.3.x and close this bug report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=832251&group_id=5470 From noreply at sourceforge.net Wed Mar 31 23:23:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 23:23:57 2004 Subject: [ python-Bugs-725265 ] urlopen object's read() doesn't read to EOF Message-ID: Bugs item #725265, was opened at 2003-04-21 16:49 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=725265&group_id=5470 Category: Documentation Group: Python 2.2.2 >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Christopher Smith (smichr) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: urlopen object's read() doesn't read to EOF Initial Comment: On http://python.org/doc/current/lib/module-urllib.html it says that the object returned by urlopen supports the read()method and that this and other methods "have the same interface as for file objects -- see section 2.2.8". In that section on page http://python.org/doc/current/lib/bltin-file-objects.html it says about the read() method that "if the size argument is negative or omitted, [read should] read all data until EOF is reached." I was a bit surprised when a project that students of mine were working on were failing when they tried to process the data obtained by the read() method on a connection made to a web page. The problem, apparently, is that the read may not obtain all of the data requested in the first request and the total response has to be built up someting like follows: import urllib c=urllib.urlopen("http://www.blakeschool.org") data = '' while 1: packet=c.read() if packet == '': break data+=packet I'm not sure if this is a feature or a bug. Could a file's read method fail to obtain the whole file in one read(), too? It seems that either the documentation should be changed or the read() method for at least urllib objects should be changed. /c Christopher P. Smith The Blake School Minneapolis, MN ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-31 23:23 Message: Logged In: YES user_id=3066 Backported to Python 2.3.4 as Doc/lib/liburllib.tex 1.50.8.2. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-25 12:04 Message: Logged In: YES user_id=3066 This is an issue with reading from a socket; there's no way to recognize the end of the stream until the remote end of the socket actually closes the socket. I've documented this limitation in Doc/lib/liburllib.tex 1.52. Someone should backport the patch to Python 2.3.x and close this report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=725265&group_id=5470 From noreply at sourceforge.net Wed Mar 31 23:45:44 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Mar 31 23:45:48 2004 Subject: [ python-Bugs-793702 ] Section 13.1 HTMLParser documentation error Message-ID: Bugs item #793702, was opened at 2003-08-23 06:01 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793702&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Martin Baker (kemokid) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Section 13.1 HTMLParser documentation error Initial Comment: The description for handle_comment() says: The comment argument is a string containing the text between the "" delimiters, but not the delimiters themselves. For example, the comment "" will cause this method to be called with the argument 'text'. This is incorrect - the comment delimiters are "" (two hyphens, not just one). Purusing the code, it appears that the module itself behaves correctly, so this is only a very minor documentation bug, but to a HTML newbie, it could be an incredibly frustrating one. This was seen on 2003/8/23 at http://www.python.org/doc/current/lib/module-HTMLParser.html And a big thank you to all Pythonic volunteers! ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-03-31 23:45 Message: Logged In: YES user_id=3066 Hmm, I must not have noticed this report when I fixed the bug. This was fixed in Doc/perl/python.perl 1.144. I've backported the fix to Python 2.3.4 as Doc/perl/python.perl 1.137.8.2. This problem was only an issue for the HTML and iSilo conversions (the later only because it relied on the HTML conversion). ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-17 02:04 Message: Logged In: YES user_id=80475 My fix didn't take. Re-opening and assigning to Fred so the job gets done right. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-24 23:32 Message: Logged In: YES user_id=80475 Thanks for the bug report. It looks like TeX was considering -- as a special character and only printing it once. Escaping the hyphen ought to fix it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793702&group_id=5470