From noreply at sourceforge.net Mon Sep 1 02:02:05 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 04:02:14 2003 Subject: [Python-bugs-list] [ python-Bugs-797447 ] locale.setlocale(locale.LC_ALL, "de") raises exception Message-ID: Bugs item #797447, was opened at 2003-08-30 06:16 Message generated for change (Comment added) made by anadelonbrin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797447&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Peter Otten (potten) Assigned to: Martin v. L?wis (loewis) Summary: locale.setlocale(locale.LC_ALL, "de") raises exception Initial Comment: Python 2.3 (#1, Jul 30 2003, 11:19:43) [GCC 3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale as lo >>> lo.setlocale(lo.LC_ALL, 'de') Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/locale.py", line 381, in setlocale return _setlocale(category, locale) locale.Error: locale setting not supported The above was taken from the example section of the locale module documentation. But this works: >>> lo.setlocale(lo.LC_ALL, 'de_DE') 'de_DE' >>> So the error message should at least be changed to "unknown/unsupported locale" and the documentation example updated to 'de_DE' instead of 'de'. However, if there are no side effects, I'd prefer to change the locale.setlocale() implementation to always normalize() the locale: def setlocale(category, locale=None): if locale: if type(locale) is not type(""): # convert to string locale = _build_localename(locale) locale = normalize(locale) return _setlocale(category, locale) ---------------------------------------------------------------------- Comment By: Tony Meyer (anadelonbrin) Date: 2003-09-01 20:02 Message: Logged In: YES user_id=552329 Just my 2c, but I would agree that a wording change to either "unsupported locale setting" or "%s locale setting not supported" with the attempted locale would be much clearer. No opinion on (2) :) ---------------------------------------------------------------------- Comment By: Peter Otten (potten) Date: 2003-09-01 09:37 Message: Logged In: YES user_id=703365 (1) I read "locale setting not supported" and understood (not being a native speaker) "(any) locale setting not supported", whereas "unknown/unsupported locale" would make it clear you can set a locale but not the one that was requested. (2) I would expect setlocale(..., "de") and setlocale(..., ("de", None)) to either both fail or both succeed, but currently only the latter form works; thus the proposed change in the code. I hope this clarifies the issue and you will reconsider. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-09-01 05:00 Message: Logged In: YES user_id=21627 I fail to see the bug. "locale setting not supported" is exactly identical, in its meaning, with "unsupported locale". Changing the example to de_DE won't help much, either, since the next system might support "de" but not "de_DE", or it might support "de_DE.ISO-8859-1" only. Locale names are not standardized. ---------------------------------------------------------------------- Comment By: Peter Otten (potten) Date: 2003-08-30 19:29 Message: Logged In: YES user_id=703365 I forgot to mention that the following also works: >>> import locale >>> locale.setlocale(locale.LC_ALL, ("de", None)) 'de_DE.ISO8859-1' >>> So the it really seems to be an implementation rather than a documentation issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797447&group_id=5470 From noreply at sourceforge.net Mon Sep 1 04:41:17 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 06:41:21 2003 Subject: [Python-bugs-list] [ python-Bugs-798473 ] inconsistent behavior of map and imap Message-ID: Bugs item #798473, was opened at 2003-09-01 19: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=798473&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: inconsistent behavior of map and imap Initial Comment: If you pass sequences to map and imap and the sizes of sequences are not equal, map and imap don't behave the same way. The code below is a simple example. The size of seq1 and seq2 is not equal. >>> seq1 = [0, 1, 2] >>> seq2 = ['a', 'b'] >>> import itertools >>> for x,y in map(None, seq1, seq2):print x,y ... 0 a 1 b 2 None >>> for x,y in itertools.imap(None, seq1, seq2):print x,y ... 0 a 1 b ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470 From noreply at sourceforge.net Mon Sep 1 04:41:20 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 06:41:30 2003 Subject: [Python-bugs-list] [ python-Bugs-774546 ] popen does not like filenames with spaces Message-ID: Bugs item #774546, was opened at 2003-07-20 14:29 Message generated for change (Comment added) made by pfremy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774546&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: popen does not like filenames with spaces Initial Comment: The argument for the target executable are passed as a string to popen. The problem is that with filenames which contains spaces, the argument breaking routine will fail and create two arguments for one filename. It would be more convenient if one could pass the argument to popen as a list of string. ---------------------------------------------------------------------- >Comment By: Philippe Fremy (pfremy) Date: 2003-09-01 12:41 Message: Logged In: YES user_id=233844 I was trying to use python as a shell replacement for simple scripts, but I was disapppointed by the poor level of support of python for those things. In my case, the list of files was pulled from a command and passed to another one. I have some suggestions on how to improve python shell scripting capability. Right now, as soon as you want to do something a little bit complicated, like feeding a program (let's say grep) from the output of another program and checking the output and the exit status is quite complicated. For such an interface to be good, it has to provide _very_ easy way to: - read stdout from a command - provide stdin to a command - read exit status of a command. - pipe a command into another one Let's say I want to run the equivalent of find . -name '*.cpp' | grep -i toto My suggested interface to run a simple command would be as following: cmd( "find", ".", "-name", "*.cpp") This defines a command to be run. To be versatile, this would have to accept although the following format: cmd( [ "find", ".", "-name", "*.cpp" ] ) cmd( "find", [ ".", "-name", "*.cpp" ] ) which are slightly different ways of spawning a command. I think all these three ways have a usage pattern. To actually execute the command, you woud do: cmd( "find", ".", "-name", "*.cpp" ).go() This create an object which has To run it, you just apply the go() method: cmd( "find", ".", "*.cpp" ).go() This could return a tuple (stdout, stderr, return_code) Now, if you want to pipe a command into another one, we can either override the operator | or write it manually. My initial command would become: cmd( "find", ".", "-name", "*.cpp" ).pipe().cmd( "grep", "-i", "toto" ) I dislike using a syntax like cmd().pipe( cmd ) because piping multiple commands would required parenthesis nesting which does not look nice. The goal is to reach the simplicity of shell scripting. To execute the previous command, one would simple again use the go() method: (stdout, stderr, ret_status) = cmd( "find", ".", "-name", "*.cpp" ).pipe().cmd( "grep", "-i", "toto" ).go() Here for my suggestion. It might be more appropriate to post it to a mailing list, to get more feedback ? I am sorry, I am very busy now and won't have time to implement this myself. ---------------------------------------------------------------------- Comment By: Andrew Gaul (gaul) Date: 2003-08-19 14:17 Message: Logged In: YES user_id=139865 Yes, it works. This is also the same behaviour as os.system. os.popen2 allows one to pass either a quoted string or a sequence of strings (pfremy's suggested behaviour). It would be nice to have consistent functionality, and using a sequence would be easier when providing a list of files to be operated on. I am willing to provide a patch if this is the desired functionality. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-07-21 01:03 Message: Logged In: YES user_id=80475 Does it work for you if the filename is quoted: "thrill seeker.txt" ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774546&group_id=5470 From noreply at sourceforge.net Mon Sep 1 06:34:48 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 08:34:52 2003 Subject: [Python-bugs-list] [ python-Feature Requests-798520 ] os.popen with invalid mode differs on Windows and POSIX Message-ID: Feature Requests item #798520, was opened at 2003-09-01 07:34 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=798520&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Gaul (gaul) Assigned to: Nobody/Anonymous (nobody) Summary: os.popen with invalid mode differs on Windows and POSIX Initial Comment: On Windows, os.popen with an invalid mode throw a ValueError and on POSIX systems it throws an OSError. 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 os >>> os.popen('dir', '') Traceback (most recent call last): File "", line 1, in ? ValueError: popen() arg 2 must be 'r' or 'w' Python 2.3 (#167, Sep 1 2003, 06:38:18) [GCC 3.0.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.popen('ls', '') Traceback (most recent call last): File "", line 1, in ? OSError: [Errno 22] Invalid argument Additionally, the ValueError message is incorrect; arg 2 can be 'r', 'rb', 'rt', 'w', 'wb', or 'wt'. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=798520&group_id=5470 From noreply at sourceforge.net Mon Sep 1 10:32:51 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 12:32:55 2003 Subject: [Python-bugs-list] [ python-Bugs-798652 ] Clarify trailing comma in func arg list Message-ID: Bugs item #798652, was opened at 2003-09-01 12: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=798652&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Terry J. Reedy (tjreedy) Assigned to: Nobody/Anonymous (nobody) Summary: Clarify trailing comma in func arg list Initial Comment: Current Ref Man 5.3.4 Calls says after grammar: "A trailing comma may be present after an argument list but does not affect the semantics. " But this is not true if arg list ends with *expr or **expr: >>> dict(*l,) # any function will do since not called File "", line 1 dict(*l,) ^ # points at ')' SyntaxError: invalid syntax >>> dict(**d,) File "", line 1 dict(**d,) ^ # points at ',' SyntaxError: invalid syntax Suggestion: "If an argument list does *not* end with *expr or **expr, a trailing comma may be added without affecting the semantics." The same exception applies to function defs as well as calls, but 7.5 Function definitions does not have a statement such as above. However, the production for parameter_list does end with 'defparameter [","]'. I suggest that this be the first of the parenthesized alternatives, as it logically should be, rather than the last, so it flows better and so that no one (ignorant that '[]' binds tighter than '|') could possible think that the '[,]' applies to the * and ** parts. IE: change parameter_list ::= (defparameter ",")* ("*" identifier [, "**" identifier] | "**" identifier | defparameter [","]) to parameter_list ::= (defparameter ",")* (defparameter [","] |'*' identifier [, "**" identifier] | "**" identifier) Squeezing out a line is a suboptimazation. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798652&group_id=5470 From noreply at sourceforge.net Mon Sep 1 10:38:29 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 12:38:34 2003 Subject: [Python-bugs-list] [ python-Bugs-798473 ] inconsistent behavior of map and imap Message-ID: Bugs item #798473, was opened at 2003-09-01 05:41 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470 Category: Python Library Group: Python 2.3 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: inconsistent behavior of map and imap Initial Comment: If you pass sequences to map and imap and the sizes of sequences are not equal, map and imap don't behave the same way. The code below is a simple example. The size of seq1 and seq2 is not equal. >>> seq1 = [0, 1, 2] >>> seq2 = ['a', 'b'] >>> import itertools >>> for x,y in map(None, seq1, seq2):print x,y ... 0 a 1 b 2 None >>> for x,y in itertools.imap(None, seq1, seq2):print x,y ... 0 a 1 b ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 11:38 Message: Logged In: YES user_id=80475 This difference was intended and is considered a feature: 1. It allows imap() to be used with infinite iterators. 2. None fill-in is rarely useful (how many functions respond well to having arguments suddendy switch to None?). 3. If needed, None padding is easy to add: for x,y in imap(None, seq1, chain(seq2, repeat(None))) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470 From noreply at sourceforge.net Mon Sep 1 10:39:50 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 12:40:15 2003 Subject: [Python-bugs-list] [ python-Bugs-798254 ] doctest crash Message-ID: Bugs item #798254, was opened at 2003-08-31 15:26 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798254&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Alexander Belopolsky (belopolsky) >Assigned to: Raymond Hettinger (rhettinger) Summary: doctest crash Initial Comment: This code: class A: def f(self): pass class C(A): g = A.f import doctest, sys doctest.testmod(sys.modules[__name__]) crashes with the following diagnostic: Traceback (most recent call last): File "", line 8, in ? File "/lib/python2.3/doctest.py", line 1147, in testmod f, t = tester.rundict(m.__dict__, name, m) File "/lib/python2.3/doctest.py", line 907, in rundict f2, t2 = self.__runone(value, name + "." + thisname) File "/lib/python2.3/doctest.py", line 1068, in __runone return self.rundoc(target, name) File "/lib/python2.3/doctest.py", line 827, in rundoc f2, t2 = self.run__test__(d, name) File "/lib/python2.3/doctest.py", line 936, in run__test__ raise TypeError("Tester.run__test__: values in " TypeError: Tester.run__test__: values in dict must be strings, functions or classes; ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798254&group_id=5470 From noreply at sourceforge.net Mon Sep 1 10:51:31 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 12:51:37 2003 Subject: [Python-bugs-list] [ python-Bugs-798274 ] absolute import patch breaks external users of test.regrtest Message-ID: Bugs item #798274, was opened at 2003-08-31 16:39 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798274&group_id=5470 Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nicholas Riley (nriley) >Assigned to: Barry A. Warsaw (bwarsaw) Summary: absolute import patch breaks external users of test.regrtest Initial Comment: I've built a test system using Python's test.regrtest mechanism, and it worked very well under Python 2.2. In Python 2.3, the output looks like this: test_inttypes test_inttypes skipped -- No module named test_inttypes test_string test_unittest test_unittest skipped -- No module named test_unittest [...] I've tracked the problem down to a change made about a year ago. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/ python/dist/src/Lib/test/regrtest.py.diff?r1=1.91&r2=1.92 test.regrtest is finding the modules, but is failing to import them because it is prepending 'test.' to the module names, in a mistaken assumption that all tests will be in a package named test. As it happened, I had my test modules inside a directory named 'test', and I tried making the directory a module and futzing with sys.path to get it to work, but now test.regrtest can't find the system implementation of test.test_support. I've also now got the problem of namespace pollution - the "test_string" above is Python's version, not my version with the same name. So, it appears non-Python users of test.regrtest are broken by this change in Python 2.3. I was pretty careful to make sure that I was doing something supported - the docstring for test.regrtest.main explicitly refers to non-Python test suite users - and ran into some weird cases like test.* not being installed on Mac OS X by default, but it worked very well otherwise. One potential solution would be that if 'testdir' is specified, test.regrtest.main() does not attempt to prepend 'test.' to the module names. This seems to match pretty well with the spirit of the documentation for that method. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 11:51 Message: Logged In: YES user_id=80475 Barry, this was your change. Would you take a look at this bug report? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798274&group_id=5470 From noreply at sourceforge.net Mon Sep 1 11:37:32 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 13:37:46 2003 Subject: [Python-bugs-list] [ python-Bugs-798058 ] IDLE / PyOS_InputHook Message-ID: Bugs item #798058, was opened at 2003-08-31 03:45 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798058&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Michiel de Hoon (mdehoon) >Assigned to: Kurt B. Kaiser (kbk) Summary: IDLE / PyOS_InputHook Initial Comment: [This bug report is a follow-up of a discussion with Matthew Cowler of help@python] I noticed an inconsistency with the usage of the PyOS_InputHook variable between Python 2.3's IDLE and Python run from the (DOS or linux) command prompt. This problem does not occur with earlier versions of Python. First I will describe the problem, then why it is important to me. The PyOS_InputHook variable can be used to install a callback function that gets called periodically (via readline's rl_event_hook) when Python is waiting for terminal input. When Python is run as a terminal application (from the DOS or linux command prompt), PyOS_InputHook is NULL initially. Python C extension modules can set PyOS_InputHook to a function which is to be called periodically. This works with Python 2.3 and older versions. In Python 2.2, IDLE makes use of the PyOS_InputHook variable, presumably to get messages delivered to the Tkinter window. Python C extension modules that are loaded from IDLE find that PyOS_InputHook is not NULL, and therefore cannot specify a different callback function via PyOS_InputHook, as that would freeze the Tkinter window. Now on Python 2.2, in practice that is not a problem. IDLE in Python 2.2 runs in a single thread. This thread contains a message loop (probably hidden in the Tk library) that takes care of the messages destined for the Tk window. If we open an additional (non-Tk) window from our C extension module, then its messages also get processed by Tk's message loop as it is running in the same thread. So we don't need an additional message loop for our non-Tk window, and we don't need to change PyOS_InputHook. In Python 2.3, IDLE works differently, as it talks to its interactive interpreter on the TCP/IP loopback interface and does not make use of PyOS_InputHook. If I import my C extension module from IDLE, it shows that PyOS_InputHook is NULL. In addition, multithreading is now used, with three threads on Windows and two on Linux and Mac OS X. (I am not sure where the additional thread on Windows is coming from). In particular, the C extension module and Tk's message loop are running in separate threads. So if I open a non-Tk window from my C extension module, its messages are not handled by Tk's message loop. The solution would be to have a message loop in my C extension module also, which is how the C extension module works when Python is run as a terminal application. As PyOS_InputHook is NULL (both with and without IDLE) when I import my extension module, I can point it to a message loop in the extension module without causing havoc. However, whereas Python without IDLE calls the function specified by PyOS_InputHook correctly, Python with IDLE fails to call PyOS_InputHook. Hence, with IDLE I am stuck in a thread without a message loop, and no way to provide a message loop of my own. If I run IDLE with the "-n" command-line argument to disable running Python code in a sub-process, there is only one thread, and I can use that thread's message loop without problems. Would it be possible in Python 2.3 to have PyOS_InputHook called also if IDLE / Tkinter is running? I would think that that no longer interferes with the correct operation of Tkinter / IDLE, as after importing IDLE, PyOS_InputHook is NULL anyway. This problem is important to me because of the Windows-port of Pygist (gist scientific plotting package for Python), which I codeveloped several months ago. The core graphics routines of Pygist are written in C for performance reasons. Pygist does not work with Python 2.3 with IDLE, while it does work with Python 2.2 with IDLE. There are no problems with Python 2.3 run from the DOS command prompt, nor with PythonWin or PyShell. The problem with Python 2.3 with IDLE is that the graphics window no longer receives its messages. In usual Windows programs, there is one message loop, which looks like while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } In Python 2.2 with IDLE, we use Tk's message loop to get messages delivered to the Pygist graphics window. When running Python 2.2 and Python 2.3 as a terminal application, we start our own message loop in the C extension module and point to it using PyOS_InputHook. With Python 2.3 with IDLE, Tk's message loop is in a separate thread, so we can't use it, while at the same time PyOS_InputHook is being ignored. Hence Pygist's graphics window freezes. Note that Pygist is different from many other plotting packages for Python, as it returns to the Python prompt after opening a graphics Window (allowing you to modify the window interactively). So the trick is to let both the Python interpreter and the graphics window receive their messages. With regards, Michiel de Hoon, University of Tokyo. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798058&group_id=5470 From noreply at sourceforge.net Mon Sep 1 16:44:28 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 18:44:32 2003 Subject: [Python-bugs-list] [ python-Bugs-798473 ] inconsistent behavior of map and imap Message-ID: Bugs item #798473, was opened at 2003-09-01 19:41 Message generated for change (Comment added) made by quiver You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470 Category: Python Library Group: Python 2.3 Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: inconsistent behavior of map and imap Initial Comment: If you pass sequences to map and imap and the sizes of sequences are not equal, map and imap don't behave the same way. The code below is a simple example. The size of seq1 and seq2 is not equal. >>> seq1 = [0, 1, 2] >>> seq2 = ['a', 'b'] >>> import itertools >>> for x,y in map(None, seq1, seq2):print x,y ... 0 a 1 b 2 None >>> for x,y in itertools.imap(None, seq1, seq2):print x,y ... 0 a 1 b ---------------------------------------------------------------------- >Comment By: George Yoshida (quiver) Date: 2003-09-02 07:44 Message: Logged In: YES user_id=671362 I should have read the Library Reference more carefully. It documents the difference of map and imap in detail. Thanks for taking time off to reply to my post. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-02 01:38 Message: Logged In: YES user_id=80475 This difference was intended and is considered a feature: 1. It allows imap() to be used with infinite iterators. 2. None fill-in is rarely useful (how many functions respond well to having arguments suddendy switch to None?). 3. If needed, None padding is easy to add: for x,y in imap(None, seq1, chain(seq2, repeat(None))) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470 From noreply at sourceforge.net Mon Sep 1 19:31:14 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 21:31:18 2003 Subject: [Python-bugs-list] [ python-Bugs-798876 ] windows sys.path contains nonexistant directory Message-ID: Bugs item #798876, was opened at 2003-09-01 20:31 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=798876&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) Assigned to: Nobody/Anonymous (nobody) Summary: windows sys.path contains nonexistant directory Initial Comment: Starting in python 2.3, sys.path on Windows contains the nonexistant directory "c:\python23\lib\plat-win". I don't know if this is really a bug, since we can no longer assume that an entry in sys.path exists or is a physical directory. Still, it seems like each entry in sys.path should be able to resolve to SOMETHING. I would've flagged this low priority if I had the capability. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798876&group_id=5470 From noreply at sourceforge.net Mon Sep 1 19:31:34 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 21:31:44 2003 Subject: [Python-bugs-list] [ python-Bugs-798876 ] windows sys.path contains nonexistant directory Message-ID: Bugs item #798876, was opened at 2003-09-01 20:31 Message generated for change (Settings changed) made by logistix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798876&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None >Priority: 1 Submitted By: logistix (logistix) Assigned to: Nobody/Anonymous (nobody) Summary: windows sys.path contains nonexistant directory Initial Comment: Starting in python 2.3, sys.path on Windows contains the nonexistant directory "c:\python23\lib\plat-win". I don't know if this is really a bug, since we can no longer assume that an entry in sys.path exists or is a physical directory. Still, it seems like each entry in sys.path should be able to resolve to SOMETHING. I would've flagged this low priority if I had the capability. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798876&group_id=5470 From noreply at sourceforge.net Mon Sep 1 19:40:00 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 21:40:04 2003 Subject: [Python-bugs-list] [ python-Bugs-798876 ] windows sys.path contains nonexistant directory Message-ID: Bugs item #798876, was opened at 2003-09-01 21:31 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798876&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None >Priority: 4 Submitted By: logistix (logistix) Assigned to: Nobody/Anonymous (nobody) Summary: windows sys.path contains nonexistant directory Initial Comment: Starting in python 2.3, sys.path on Windows contains the nonexistant directory "c:\python23\lib\plat-win". I don't know if this is really a bug, since we can no longer assume that an entry in sys.path exists or is a physical directory. Still, it seems like each entry in sys.path should be able to resolve to SOMETHING. I would've flagged this low priority if I had the capability. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2003-09-01 21:40 Message: Logged In: YES user_id=31435 Strange. I see it under Python 2.1.3 too. So it's not a new thing, but somehow 2.2.3 managed to get rid of it temporarily . Boosting the priority to 4, since it's at least a mystery! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798876&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:15:08 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:16:02 2003 Subject: [Python-bugs-list] [ python-Bugs-798254 ] doctest crash Message-ID: Bugs item #798254, was opened at 2003-08-31 15:26 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798254&group_id=5470 Category: Python Library Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Alexander Belopolsky (belopolsky) Assigned to: Raymond Hettinger (rhettinger) Summary: doctest crash Initial Comment: This code: class A: def f(self): pass class C(A): g = A.f import doctest, sys doctest.testmod(sys.modules[__name__]) crashes with the following diagnostic: Traceback (most recent call last): File "", line 8, in ? File "/lib/python2.3/doctest.py", line 1147, in testmod f, t = tester.rundict(m.__dict__, name, m) File "/lib/python2.3/doctest.py", line 907, in rundict f2, t2 = self.__runone(value, name + "." + thisname) File "/lib/python2.3/doctest.py", line 1068, in __runone return self.rundoc(target, name) File "/lib/python2.3/doctest.py", line 827, in rundoc f2, t2 = self.run__test__(d, name) File "/lib/python2.3/doctest.py", line 936, in run__test__ raise TypeError("Tester.run__test__: values in " TypeError: Tester.run__test__: values in dict must be strings, functions or classes; ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 21:15 Message: Logged In: YES user_id=80475 Applied patch #798269 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798254&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:43:45 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:44:10 2003 Subject: [Python-bugs-list] [ python-Bugs-231207 ] Fatal Python Error during program shutdown Message-ID: Bugs item #231207, was opened at 2001-02-05 21:50 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=231207&group_id=5470 Category: Tkinter >Group: Python 2.2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Doug Henderson (djhender) Assigned to: Nobody/Anonymous (nobody) Summary: Fatal Python Error during program shutdown Initial Comment: The windows builds of versions 2.0 and 2.1a2 contain an intermittent bug which often appears when a script using Tkinter stops by calling self.tk.quit() and sometimes (less often) appears following a event or call to a ?.destory() function. Under Windows 98SE, this results in a GPF. Under Windows 2000, a message to the console window shows "Fatal Python Error", "PyEval_RestoreThread NULL tstate". The following script demonstrates the problem: --------------------- # BugDemo.py from Tkinter import * class BugDemo(Frame): def __init__(self, parent): Frame.__init__(self, parent) Button(self, text='Hi', command=self.hi).pack() Button(self, text='Quit', command=self.tk.quit).pack() def hi(self): print "hi" bd = BugDemo(Tk()) bd.pack() bd.mainloop() ---------------------- Execute in console window: "c:> python BugDemo.py" Test this by 1) clicking Quit button 2) clicking Hi button, then Quit button. Test 1: The script runs successfully most of the time. I found I had to minimize and restore its window to make it fail regularly. Test 2: I need to click Hi button before clicking the Quit button. Then it failed about half the time. The problem appears to occur after the script has completed, during some kind of cleanup perhaps. The more useful error message on the Win2k machine may help to locate the problem. Problem also manifests using the PythonWare 2.0 release on Win98. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 21:43 Message: Logged In: YES user_id=80475 FWIW, the bug demos fail under Py2.2.3 but were fixed for Py2.3. Since it is unlikely that there will be a Py2.2.4, am closing this bug and marking as fixed. Thanks for the report and the short demo scripts. ---------------------------------------------------------------------- Comment By: Dennis Benzinger (dcbbcd) Date: 2003-07-19 10:36 Message: Logged In: YES user_id=826043 Python reliably crashes on Win XP - SP1 with the following test program too: import Tkinter tk = Tkinter.Tk() quit_btn = Tkinter.Button(tk, text='quit', #command=tk.quit) # This crashs command=tk.destroy) # This works quit_btn.pack() Tkinter.mainloop() The error message is something like (bad english translation): The instruction in "0x77f4b2ab" points to "0x00000028". The memory can't be read. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-11-07 09:58 Message: Logged In: YES user_id=6380 idiscovery, when you say "PythonWin" do you actually mean Pythonwin (a Win32-specific Python IDE, part of Mark Hammond's win32all)? Or do you simple mean "Python under Windows", as installed by the Python installer you get from python.org? This difference is significant; I would not expect Tkinter apps to work well using Pythonwin, because it has its own Win32 event loop. ---------------------------------------------------------------------- Comment By: Doug Henderson (djhender) Date: 2002-11-04 13:12 Message: Logged In: YES user_id=148444 I modified my BugDemo program to change the last 3 lines to root = Tk() bd = BugDemo(root) bd.pack() bd.mainloop() root.destory() This did not resolve the problem under Win98SE Python 2.2.1. Both Python 2.2.1 and 2.2.2 use Tk/tcl 8.3. I have seen comments that indicate that this is a known problem in stock 8.3 which is fixed in 8.4. I also tested using the other two scripts presented elsewhere among the comments to this bug report. These tests also hang, even with the added root.destroy() statement. I no longer have access to a Win2k machine, so I cannot test there. ---------------------------------------------------------------------- Comment By: Internet Discovery (idiscovery) Date: 2002-11-03 01:52 Message: Logged In: YES user_id=33229 I know I'm a Python newbie but I know Tcl well and I think I know at least part of what's going on. Looking specifically at nobody's 2002-04-22 14:21 code, I see that this uses mainloop and quit in a way that many Python books and examples do, as if quit() will "Quit the Tcl interpreter. All widgets will be destroyed." But if you look at MainLoop and Quit in _tkinter.c you see that Quit just sets a variable that causes MainLoop to end - it doesn't destroy anything nor quit the interpreter. IMHO all Tkinter programs need a root.destroy() after root.mainloop() If you change nobody's program to add a root.destroy() it runs fine under PythonWin. The "bug" is in the documentation of quit() in Tkinter.py def quit(self): """Quit the Tcl interpreter. All widgets will be destroyed.""" self.tk.quit() The comment should read """Quit the main event loop. It is up to you to call root.destroy() after.""" If I'm right the documentation for Tkinter in the library reference should be changed too; there should be a root.destroy() at the end of http://www.python.org/doc/2.2.1/lib/node503.html If I'm right then I'll stick my neck out a little further: Tkinter's mainloop and quit should be dropped from _tkinter.c and replaced with the following idiom and usage: In Tkinter.py declare a class variable in Misc: _exit = -1 and change in Misc TCL_ALL_EVENTS = 0 def quit(self): """Quit the Tcl interpreter. All widgets will be destroyed.""" self._exit = 0 def mainloop(self): """Loop until we call quit()""" while self._exit < 0: try: self.root.tk.dooneevent(TCL_ALL_EVENTS) except SystemExit: #print 'Exit' self.exit = 1 break except # do something intelligent with errors or interrupts I believe this is more transparent and more open to creativity. I have experimented (all my code is like this now) and feel that there is no performance penalty to looping in Python. In addition it avoids the 20msec sleep in _tkinter.mainloop() that is an abomination. It would also allow people to think more clearly about what happens when you have 2 Tk() instances, in which case you have 2 Tcl interpeters. It may make you move _exit to be an instance variable of the Tk class. In any event you'll be able to see what's going on. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-04-22 09:21 Message: Logged In: NO I confirm the behaviour for: WinNT 4.0 SP5 tested with Python 2.2Beta1 (ActiveState) tested with Python 2.2.1.222 (ActiveState) PythonWinIDE will hang when the following program is "quit"ted. But will "quit" normally when run standalone (not within PythonWinIDE): # # from Tkinter import * from tkMessageBox import * class App: def __init__(self, winRoot): frame = Frame(winRoot) frame.pack() self.btnQuit = Button(frame, text="QUIT", bg="blue", foreground="light blue", command=frame.quit) self.btnQuit.pack(side=LEFT) self.btnHiThere = Button(frame, text="Hi there!",command=self.sayHiThere) self.btnHiThere.pack(side=LEFT) def sayHiThere(self): showinfo("Greeting", "Hi There") if __name__ == "__main__": root = Tk() test = App(root) root.mainloop() ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2002-03-01 17:49 Message: Logged In: YES user_id=31392 Unassign as it appears that effbot isn't going to look at it. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-07-18 06:13 Message: Logged In: NO i won't to be a hacker ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-05-29 02:30 Message: Logged In: NO Note: I am running Windows98 ActivePython 2.1 Even with console apps in python this same error appears I tried using another Distribution of Python for win32, PythonWare20 So this leads me to believe that some lib is missing on win98. Because at work I use Win95, and Installed ActivePython 2.1, and it works fine and dandy ---------------------------------------------------------------------- Comment By: Joel Gould (joelgould) Date: 2001-03-24 11:52 Message: Logged In: YES user_id=20954 I also see a GPF on shutdown under Windows 98 using Tkinter. I tested this using the PythonWare 2.0 release as well. I have attached a very simple Tkinter program. When I run this on my Windows 98 SE machine, a crash occurs when the program exits. Without the MainDialog class it works OK. Without the Pmw initialization call it works OK. But as written it will crash around 75% of the time. (1) run the program (2) press the Test Button (3) click Cancel in the file open dialog (you do not need to select a file) (4) click the close button in the upper right corner --> Boom -------------------- import Tkinter import tkFileDialog import Pmw def action(): tkFileDialog.askopenfilename(filetypes=[('All','*')]) class MainDialog: def __init__(self,parent): Tkinter.Button(parent,text='Test Button',command=action).pack() root = Pmw.initialise() dialog = MainDialog(root) root.mainloop() ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-02-09 18:34 Message: Assigned to /F, under the theory he can confirm that "this kind of thing" is still a general problem with Tk we can't do anything about. ---------------------------------------------------------------------- Comment By: Doug Henderson (djhender) Date: 2001-02-06 00:30 Message: See also #116289 (and my comment to it) which describes what often happened to my 'real' programs which lead to developing the above BugDemo script. My 'real' programs were developed over the last two years or so, and worked in Jan 2000 with 1.5.2. I upgraded the Python version recently, and then started working on these programs again. It was "WTF is wrong with my code", until I found the same problem showing up in the small test cases. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=231207&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:47:10 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:47:21 2003 Subject: [Python-bugs-list] [ python-Bugs-411881 ] Use of "except:" in modules Message-ID: Bugs item #411881, was opened at 2001-03-28 07:58 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=411881&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None >Priority: 2 Submitted By: Itamar Shtull-Trauring (itamar) Assigned to: Skip Montanaro (montanaro) Summary: Use of "except:" in modules Initial Comment: A large amount of modules in the standard library use "except:" instead of specifying the exceptions to be caught. In some cases this may be correct, but I think in most cases this not true and this may cause problems. Here's the list of modules, which I got by doing: grep "except:" *.py | cut -f 1 -d " " | sort | uniq Bastion.py CGIHTTPServer.py Cookie.py SocketServer.py anydbm.py asyncore.py bdb.py cgi.py chunk.py cmd.py code.py compileall.py doctest.py fileinput.py formatter.py getpass.py htmllib.py imaplib.py inspect.py locale.py locale.py mailcap.py mhlib.py mimetools.py mimify.py os.py pdb.py popen2.py posixfile.py pre.py pstats.py pty.py pyclbr.py pydoc.py repr.py rexec.py rfc822.py shelve.py shutil.py tempfile.py threading.py traceback.py types.py unittest.py urllib.py zipfile.py ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 21:47 Message: Logged In: YES user_id=80475 Some efforts were made to remove many bare excepts prior to Py2.3a1. Briefly scanning those that remain, it looks like many of them are appropriate or best left alone. I recommend that this bug be closed unless someone sees something specific that demands a change. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-05-16 18:30 Message: Logged In: YES user_id=357491 threading.py is clear. It's blanket exceptions are for printing debug output since exceptions in threads don't get passed back to the original frame anyway. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2002-08-13 22:15 Message: Logged In: YES user_id=44345 checked in fileinput.py (v 1.15) with three except:'s tightened up. The comment in the code about IOError notwithstanding, I don't see how any of the three situations would have caught anything other than OSError. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2002-08-12 14:58 Message: Logged In: YES user_id=44345 Note that this particular item was expected to be an ongoing item, with no obvious closure. Some of the bare excepts will have subtle ramifications, and it's not always obvious what specific exceptions should be caught. I've made a few changes to my local source tree which I should check in. Rather than opening new tracker items, I believe those with checkin privileges should correct those flaws they identify and attach a comment which will alert those monitoring the item. Those people without checkin privileges should just attach a patch with a note. Skip ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-08-12 02:22 Message: Logged In: YES user_id=21627 My proposal would be to track this under a different issue: Terry, if you volunteer, please produce a new list of offenders (perhaps in an attachment to the report so it can be updated), and attach any fixes that you have to that report. People with CVS write access can then apply those patches and delete them from the report. If you do so, please post the new issue number in this report, so we have a link. ---------------------------------------------------------------------- Comment By: Terry J. Reedy (tjreedy) Date: 2002-08-11 13:16 Message: Logged In: YES user_id=593130 Remove types.py from the list. As distributed with 2.2.1, it has 5 'except xxxError:' statements but no offending bare except:'s. Skip (or anyone else): if/when you pursue this, I volunteer to do occasional sleuthing and send reports with suggestions and/or questions. Example: getpass.py has one 'offense': try: fd = sys.stdin.fileno() except: return default_getpass(prompt) According to lib doc 2.2.8 File Objects (as I interpret) fileno () should either work without exception or *not* be implemented. Suggestion: insert AttributeError . Question: do we protect against pseudofile objects that ignore doc and have fake .fileno() that raises NotImplementedError or whatever? ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2002-03-23 01:02 Message: Logged In: YES user_id=44345 as partial fix, checked in changes for the following modules: mimetools.py (1.24) popen2.py (1.23) quopripy (1.19) CGIHTTPServer.py (1.22) ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2002-03-20 16:24 Message: Logged In: YES user_id=44345 Here is a context diff with proposed changes for the following modules: CGIHTTPServer, cgi, cmd, code, fileinput, httplib, inspect, locale, mimetools, popen2, quopri ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2001-08-11 10:06 Message: Logged In: YES user_id=21627 Fixed urllib in 1.131 and types in 1.19. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-07-04 02:11 Message: Logged In: YES user_id=3066 Fixed modules mhlib and rfc822 (SF is having a problem generating the checkin emails, though). ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-05-11 14:40 Message: Logged In: YES user_id=3066 OK, I've fixed up a few more modules: anydbm chunk formatter htmllib mailcap pre pty I made one change to asyncore as well, but other bare except clauses remain there; I'm not sufficiently familiar with that code to just go digging into those. I also fixed an infraction in pstats, but left others for now. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-04-23 03:14 Message: Logged In: YES user_id=31435 Ping's intent is that pydoc work under versions of Python as early as 1.5.2, so that sys._getframe is off-limits in pydoc and its supporting code (like inspect.py). ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2001-04-23 02:32 Message: Logged In: YES user_id=21627 For inspect.py, why is it necessary to keep the old code at all? My proposal: remove currentframe altogether, and do currentframe = sys._getframe unconditionally. ---------------------------------------------------------------------- Comment By: Itamar Shtull-Trauring (itamar) Date: 2001-04-22 09:52 Message: Logged In: YES user_id=32065 I submitted a 4th patch. I'm starting to run out of easy cases... ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2001-04-19 04:15 Message: Logged In: YES user_id=44345 I believe the following patch is correct for the try/except in inspect.currentframe. Note that it fixes two problems. One, it avoids a bare except. Two, it gets rid of a string argument to the raise statement (string exceptions are now deprecated, right?). *** /tmp/skip/inspect.py Thu Apr 19 04:13:36 2001 --- /tmp/skip/inspect.py.~1.16~ Thu Apr 19 04:13:36 2001 *************** *** 643,650 **** def currentframe(): """Return the frame object for the caller's stack frame.""" try: ! 1/0 ! except ZeroDivisionError: return sys.exc_traceback.tb_frame.f_back if hasattr(sys, '_getframe'): currentframe = sys._getframe --- 643,650 ---- def currentframe(): """Return the frame object for the caller's stack frame.""" try: ! raise 'catch me' ! except: return sys.exc_traceback.tb_frame.f_back if hasattr(sys, '_getframe'): currentframe = sys._getframe ---------------------------------------------------------------------- Comment By: Itamar Shtull-Trauring (itamar) Date: 2001-04-17 10:27 Message: Logged In: YES user_id=32065 inspect.py uses sys_getframe if it's there, the other code is for backwards compatibility. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-11 12:24 Message: Logged In: YES user_id=6380 Actually, inspect.py should use sys._getframe()! And yes, KeyboardError is definitely one of the reasons why this is such a bad idiom... ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2001-04-11 12:15 Message: Logged In: YES user_id=89016 > Can you identify modules where catching everything > is incorrect If "everything" includes KeyboardInterrupt, it's definitely incorrect, even in inspect.py's simple try: raise 'catch me' except: return sys.exc_traceback.tb_frame.f_back which should probably be: try: raise 'catch me' except KeyboardInterrupt: raise except: return sys.exc_traceback.tb_frame.f_back ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2001-04-11 12:13 Message: Logged In: YES user_id=89016 > Can you identify modules where catching everything > is incorrect If "everything" includes KeyboardInterrupt, it's definitely incorrect, even in inspect.py's simple try: raise 'catch me' except: return sys.exc_traceback.tb_frame.f_back which should probably be: try: raise 'catch me' except KeyboardInterrupt: raise except: return sys.exc_traceback.tb_frame.f_back ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-04-10 10:45 Message: Logged In: YES user_id=6380 I've applied the three patches you supplied. I agree with Martin that to do this right we'll have to tread carefully. But please go on! (No way more of this will find its way into 2.1 though.) ---------------------------------------------------------------------- Comment By: Itamar Shtull-Trauring (itamar) Date: 2001-03-30 05:54 Message: Logged In: YES user_id=32065 inspect.py should be removed from this list, the use is correct. In general, I just submitted this bug so that when people are editing a module they'll notice these things, since in some cases only someone who knows the code very well can know if the "expect:" is needed or not. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2001-03-30 01:59 Message: Logged In: YES user_id=21627 Can you identify modules where catching everything is incorrect, and propose changes to correct them. This should be done one-by-one, with careful analysis in each case, and may take well months or years to complete. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=411881&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:53:01 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:53:06 2003 Subject: [Python-bugs-list] [ python-Bugs-450803 ] smtpd.py needs documentation Message-ID: Bugs item #450803, was opened at 2001-08-14 09:18 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=450803&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 6 Submitted By: Barry A. Warsaw (bwarsaw) >Assigned to: Raymond Hettinger (rhettinger) Summary: smtpd.py needs documentation Initial Comment: smtpd.py needs documentation for the standard library ---------------------------------------------------------------------- Comment By: Moshe Zadka (moshez) Date: 2002-06-11 04:48 Message: Logged In: YES user_id=11645 Here's something you can use as a start, Barry. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=450803&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:54:20 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:54:25 2003 Subject: [Python-bugs-list] [ python-Bugs-467924 ] Improve the ZipFile Interface Message-ID: Bugs item #467924, was opened at 2001-10-04 10:54 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=467924&group_id=5470 Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Greg Ward (gward) Summary: Improve the ZipFile Interface Initial Comment: There exist two methods to write to a ZipFile write(self, filename, arcname=None, compress_type=None) writestr(self, zinfo, bytes) but only one to read from it read(self, name) Additionally, the two 'write's behave differently with respect to compression. --- (a) 'read' does not fit to 'write', since 'write' takes a file and adds it to a ZipFile, but 'read' is not the reverse operation. 'read' should be called 'readstr' since it much better matches to 'writestr'. (b) It is confusing what 'write' and 'read' actually mean. Does 'write' write a file, or into the ZipFile? It would be more obvious if ZipFile has 4 methods which pair-wise fit together: writestr (self, zinfo, bytes) # same as now readstr (self, name) # returns bytes (as string), currently called 'read' # 'read' could still live but should be deprecated add (self, filename, arcname=None, compress_type=None) # currently 'write' # 'write' could still live but should be deprecated extract (self, name, filename, arcname=None) # new, desired functionality (c) BOTH, 'writestr' and 'add' should by default use the 'compress_type' that was passed to the constructor of 'ZipFile'. Currently, 'write' does it, 'writestr' via zinfo does it not. 'ZipInfo' sets the compression strict to 'ZIP_STORED' :-( It should not do that! It rather should: - allow more parameters in the signature of the constructor to also pass the compression type (and some other attributes, too) - default to 'None', so that 'writestr' can see this, and then take the default from the 'ZipFile' instance. ---------------------------------------------------------------------- Comment By: Matt Zimmerman (mzimmerman) Date: 2003-07-31 09:22 Message: Logged In: YES user_id=196786 It would also be very useful to be able to have ZipFile read/write the uncompressed file data from/to a file-like object, instead of just strings and files (respectively). I would like to use this module to work with zip files containing large files, but this is unworkable because the current implementation would use excessive amounts of memory. Currently, read() reads all of the compressed data into memory, then uncompresses it into memory. For files which may be hundreds of megabytes compressed, this is undesirable. Likewise for write(), I would like to be able to stream data into a zip file, passing in a ZipInfo to specify the metadata as is done with writestr(). The implementation of this functionality is quite straightforward, but I am not sure whether (or how) the interface should change. Some other parts of the library allow for a file object to be passed to the same interface which accepts a filename. The object is examined to see if it has the necessary read/write methods and if not, it is assumed to be a filename. Would this be the correct way to do it? I, too, am a bit irked by the lack of symmetry exhibited by read vs. write/writestr, and think that the interface suggested above would be a significant improvement. ---------------------------------------------------------------------- Comment By: Just van Rossum (jvr) Date: 2003-01-05 15:54 Message: Logged In: YES user_id=92689 In Python 2.3, writestr() has an enhanced signature: the first arg may now also be an archive name, in which case the correct default settings are used (ie. the compression value is taken from the file). See patch #651621. extract() could be moderately useful (although I don't understand the 'arcname' arg, how's that different from 'name'?) but would have to deal with file modes (bin/text). The file mode isn't in the archive so would have to (optionally) be supplied by the caller. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=467924&group_id=5470 From noreply at sourceforge.net Mon Sep 1 20:59:46 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 22:59:49 2003 Subject: [Python-bugs-list] [ python-Bugs-560286 ] Add docs for 'basestring' Message-ID: Bugs item #560286, was opened at 2002-05-24 14:50 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=560286&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Raymond Hettinger (rhettinger) Summary: Add docs for 'basestring' Initial Comment: Please document the new built-in abstract type 'string'. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2002-06-03 20:23 Message: Logged In: YES user_id=33168 Updated summary, since string was changed to basestring. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=560286&group_id=5470 From noreply at sourceforge.net Mon Sep 1 21:03:39 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 23:03:55 2003 Subject: [Python-bugs-list] [ python-Bugs-453515 ] filecmp.dircmp case sensitivity bug Message-ID: Bugs item #453515, was opened at 2001-08-20 16:39 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Rik Kabel (ving) >Assigned to: Raymond Hettinger (rhettinger) Summary: filecmp.dircmp case sensitivity bug Initial Comment: (warning: python newbie submission) Platforms: W2K w/Activestate 2.1.1 (same library source found in 2.0 and 2.11 on NetBSD). filecmp.dircmp performs incorrect filename comparisons when building lists of common and directory-unique files. In particular, it sets a dictionary key to the filename (and value to 1) for each file in the right-hand tree, and looks for matching names (has_key). This fails on case-insensitive platforms when the names are equivalent except for case. A simple workaround would be to use os.path.normcase() around the filenames before storing and comparing, but this is not case-preserving. Case preservation is to be preferred. A case-preserving workaround might use os.path.normcase() for the dictionary entry keys, but store the unchanged filename as the value, and use that value when constructing the list from the dictionary. -- Rik creating tomorrow's legacy systems, today ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2003-02-05 15:30 Message: Logged In: YES user_id=11375 Snatching this bug. See bug #680494 for a test suite for filecmp.py. Once that's checked in, I'll look into this one. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-12-06 16:14 Message: Logged In: YES user_id=3066 I've attached a preliminary patch for this, completely untested. Problems: - We don't have any tests for the filecmp module. - Im not running Windows, so I can't test this in an environment similar to that for which the bug was reported. If someone can create a test case for this, and test the patch, that would really help. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:12 Message: Logged In: YES user_id=6380 While this was reported as an ActivePython bug, the problem is the same with filecmp.py in CVS, so I'm unassigning this from Paul (it's not like Paul's track record of responding to bug reports is so great :-). ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 10:34 Message: Logged In: YES user_id=31392 Can you look at this, Paul? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 From noreply at sourceforge.net Mon Sep 1 21:06:18 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 23:06:25 2003 Subject: [Python-bugs-list] [ python-Bugs-658254 ] Accept None for time.ctime() and friends Message-ID: Bugs item #658254, was opened at 2002-12-24 11:58 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=658254&group_id=5470 Category: Extension Modules Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Fred L. Drake, Jr. (fdrake) >Assigned to: Raymond Hettinger (rhettinger) Summary: Accept None for time.ctime() and friends Initial Comment: Several functions in the time module can have the time value they operate on omitted to indicate the current time, but they do not accept None as equivalent to omitting the value. It should be equivalent. ---------------------------------------------------------------------- Comment By: Christopher Blunck (blunck2) Date: 2003-01-06 22:43 Message: Logged In: YES user_id=531881 see patch 663482 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=658254&group_id=5470 From noreply at sourceforge.net Mon Sep 1 21:08:44 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 23:08:50 2003 Subject: [Python-bugs-list] [ python-Bugs-654783 ] doctest and exception messages Message-ID: Bugs item #654783, was opened at 2002-12-16 14:23 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=654783&group_id=5470 Category: Documentation Group: Python 2.2.2 Status: Open Resolution: None Priority: 5 Submitted By: Aahz (aahz) >Assigned to: Raymond Hettinger (rhettinger) Summary: doctest and exception messages Initial Comment: doctest should include information something like this: doctest docstrings should not rely on the text of internal Python exceptions. Notice the way factorial() uses its own error messages with the standard Python exceptions. The internal messages can change even in bugfix releases (as in 2.2.1 to 2.2.2). ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-04-25 14:08 Message: Logged In: YES user_id=31435 Back to Aahz. I don't mind if you change this -- edit the docs and check it in. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2002-12-16 18:39 Message: Logged In: YES user_id=31435 It could, but it shouldn't: error msgs in docs that don't match reality are also an insult to users. doctest should grow some sort of option here, though, as its uses outgrew its original purposes. ---------------------------------------------------------------------- Comment By: Neil Schemenauer (nascheme) Date: 2002-12-16 17:01 Message: Logged In: YES user_id=35752 Couldn't doctest be modified so that it only compares the exception name only? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=654783&group_id=5470 From noreply at sourceforge.net Mon Sep 1 21:54:34 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Sep 1 23:54:41 2003 Subject: [Python-bugs-list] [ python-Bugs-798274 ] absolute import patch breaks external users of test.regrtest Message-ID: Bugs item #798274, was opened at 2003-08-31 17:39 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798274&group_id=5470 Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nicholas Riley (nriley) Assigned to: Barry A. Warsaw (bwarsaw) Summary: absolute import patch breaks external users of test.regrtest Initial Comment: I've built a test system using Python's test.regrtest mechanism, and it worked very well under Python 2.2. In Python 2.3, the output looks like this: test_inttypes test_inttypes skipped -- No module named test_inttypes test_string test_unittest test_unittest skipped -- No module named test_unittest [...] I've tracked the problem down to a change made about a year ago. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/ python/dist/src/Lib/test/regrtest.py.diff?r1=1.91&r2=1.92 test.regrtest is finding the modules, but is failing to import them because it is prepending 'test.' to the module names, in a mistaken assumption that all tests will be in a package named test. As it happened, I had my test modules inside a directory named 'test', and I tried making the directory a module and futzing with sys.path to get it to work, but now test.regrtest can't find the system implementation of test.test_support. I've also now got the problem of namespace pollution - the "test_string" above is Python's version, not my version with the same name. So, it appears non-Python users of test.regrtest are broken by this change in Python 2.3. I was pretty careful to make sure that I was doing something supported - the docstring for test.regrtest.main explicitly refers to non-Python test suite users - and ran into some weird cases like test.* not being installed on Mac OS X by default, but it worked very well otherwise. One potential solution would be that if 'testdir' is specified, test.regrtest.main() does not attempt to prepend 'test.' to the module names. This seems to match pretty well with the spirit of the documentation for that method. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-09-01 23:54 Message: Logged In: YES user_id=12800 IIRC, this patch was necessary because some tests required absolute imports and we cannot mix relative and absolute imports in the test suite. IMO, regrtest's primary mission in life is to support Python's test suite and any other use is secondary (for example, it isn't documented in the standard library manual). OTOH, you might think about contributing a patch that allows regrtest to be used outside the Python test suite, but doesn't break the absolute import requirement while in the test suite. (You might also consider adding some standard lib documentation to your patch ). The other problems you mention are inherent in Python's import machinery. If you have two packages named "test" on your sys.path, Python will not by default search them both for submodules. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 12:51 Message: Logged In: YES user_id=80475 Barry, this was your change. Would you take a look at this bug report? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798274&group_id=5470 From noreply at sourceforge.net Mon Sep 1 23:48:13 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 01:48:21 2003 Subject: [Python-bugs-list] [ python-Bugs-453515 ] filecmp.dircmp case sensitivity bug Message-ID: Bugs item #453515, was opened at 2001-08-20 16:39 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 Category: Python Library Group: Python 2.1.1 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Rik Kabel (ving) Assigned to: Raymond Hettinger (rhettinger) Summary: filecmp.dircmp case sensitivity bug Initial Comment: (warning: python newbie submission) Platforms: W2K w/Activestate 2.1.1 (same library source found in 2.0 and 2.11 on NetBSD). filecmp.dircmp performs incorrect filename comparisons when building lists of common and directory-unique files. In particular, it sets a dictionary key to the filename (and value to 1) for each file in the right-hand tree, and looks for matching names (has_key). This fails on case-insensitive platforms when the names are equivalent except for case. A simple workaround would be to use os.path.normcase() around the filenames before storing and comparing, but this is not case-preserving. Case preservation is to be preferred. A case-preserving workaround might use os.path.normcase() for the dictionary entry keys, but store the unchanged filename as the value, and use that value when constructing the list from the dictionary. -- Rik creating tomorrow's legacy systems, today ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-02 00:48 Message: Logged In: YES user_id=80475 Fixed. See: Lib/filecmp.py 1.17 and 1.16.10.1 Lib/test/test_filecmp 1.3 and 1.2.8.1 ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2003-02-05 15:30 Message: Logged In: YES user_id=11375 Snatching this bug. See bug #680494 for a test suite for filecmp.py. Once that's checked in, I'll look into this one. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2001-12-06 16:14 Message: Logged In: YES user_id=3066 I've attached a preliminary patch for this, completely untested. Problems: - We don't have any tests for the filecmp module. - Im not running Windows, so I can't test this in an environment similar to that for which the bug was reported. If someone can create a test case for this, and test the patch, that would really help. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 13:12 Message: Logged In: YES user_id=6380 While this was reported as an ActivePython bug, the problem is the same with filecmp.py in CVS, so I'm unassigning this from Paul (it's not like Paul's track record of responding to bug reports is so great :-). ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2001-08-28 10:34 Message: Logged In: YES user_id=31392 Can you look at this, Paul? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=453515&group_id=5470 From noreply at sourceforge.net Tue Sep 2 05:40:11 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 07:40:16 2003 Subject: [Python-bugs-list] [ python-Bugs-799088 ] distutils ignored LDFLAGS in Makefile Message-ID: Bugs item #799088, was opened at 2003-09-02 13: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=799088&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: distutils ignored LDFLAGS in Makefile Initial Comment: Distutils ignores the LDFLAGS variable in the Python Makefile. This is bad, since LDFLAGS typically contains the -L linker flag telling the linker where to look for extra libraries. A possible patch is attached (if the checkbox works this time :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799088&group_id=5470 From noreply at sourceforge.net Tue Sep 2 05:59:38 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 07:59:43 2003 Subject: [Python-bugs-list] [ python-Bugs-701751 ] WINDOW in py_curses.h needs ncurses-devel Message-ID: Bugs item #701751, was opened at 2003-03-11 14:13 Message generated for change (Comment added) made by akuchling You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=701751&group_id=5470 Category: Build Group: Python 2.2.2 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Moshe Yudkowsky (myudkowsky) Assigned to: A.M. Kuchling (akuchling) Summary: WINDOW in py_curses.h needs ncurses-devel Initial Comment: When trying to build 2.2.2 (Mandrake 9.1 Linux), I got errors when trying to compile _cursesmodule.c. This is because py_curses uses WINDOW. Ultimately, I traced this to my configuration: I had a curses.h file (from somewhere), I had ncurses 5.2 installed (part of the standard Mandrake RPM-based installation), but I didn't have libncurses-devel installed. I installed that RPM and the modules compiled (and tested) correctly. The "configure" program didn't catch this problem. Python compiled and ran anyway, but I would expect that the requirement for an obscure "devel" package ought to be flagged, either in the README or in the configure script. I'd submit a fix, but I don't know what the behavior is *supposed* to be. What I see from the output of "configure" is that configure *still* didn't find the "ncurses.h" file, even though the compiler caught it later. Logs of this compile on request. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2003-09-02 07:59 Message: Logged In: YES user_id=11375 It's unclear that this is a bug; the configure script looks for ncurses.h, and uses curses.h if it isn't found. It may not have found ncurses.h because attempting to compile with that header file failed for some other reason, other than it not existing. In any case, it's Mandrake's problem if it includes header files that don't work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=701751&group_id=5470 From noreply at sourceforge.net Tue Sep 2 06:31:08 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 08:31:14 2003 Subject: [Python-bugs-list] [ python-Bugs-799104 ] CPPFLAGS should not be aded to ldshard command Message-ID: Bugs item #799104, was opened at 2003-09-02 14:31 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=799104&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: CPPFLAGS should not be aded to ldshard command Initial Comment: CPPFLAGS contains flags for the C preprocessor. It has no business being added to the ldshared command (this is in sysconfig.py). In fact, it may be harmful since the ldshared command may well be ld with some flags which typically does not understand cpp flags. Irix where the ldshared command is "ld -shared -all" is a good example of where it is plain wrong to add CPPFLAGS. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799104&group_id=5470 From noreply at sourceforge.net Tue Sep 2 08:49:15 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 10:49:36 2003 Subject: [Python-bugs-list] [ python-Bugs-797844 ] csv.DictWriter -- inconsistent doc & code Message-ID: Bugs item #797844, was opened at 2003-08-30 12:39 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797844&group_id=5470 Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Florent Rougon (frougon) >Assigned to: Skip Montanaro (montanaro) Summary: csv.DictWriter -- inconsistent doc & code Initial Comment: csv.DictWriter has similar problems as csv.DictReader as described in bug #792558. The signature of csv.DictWriter.__init__ is: def __init__(self, f, fieldnames, restval="", extrasaction="raise", dialect="excel", *args): but the docs says: class DictWriter(csvfile, fieldnames[, restval=""[, extrasaction='raise'[, dialect='excel'[, fmtparam]]]]) Problems: 1. f != csvfile 2. The constructor does not accept **arguments, which is a problem to pass along the (one or several) fmtparam mentioned in the doc. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2003-09-02 09:49 Message: Logged In: YES user_id=44345 I'm probably the right person for the DictWriter class. I've been off the net or basically swamped much of the time lately what with the stupid virus crap and a house move. I'll try to get to it this week sometime. S ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-08-30 15:51 Message: Logged In: YES user_id=33168 Andrew are you the right person to look at this and 797853? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797844&group_id=5470 From noreply at sourceforge.net Tue Sep 2 12:11:56 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 14:12:17 2003 Subject: [Python-bugs-list] [ python-Bugs-793822 ] gc.get_referrers() is inherently dangerous Message-ID: Bugs item #793822, was opened at 2003-08-23 17:17 Message generated for change (Comment added) made by arigo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793822&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Armin Rigo (arigo) Assigned to: Nobody/Anonymous (nobody) Summary: gc.get_referrers() is inherently dangerous Initial Comment: gc.get_referrers() can be used to crash any Python interpreter because it allows the user to obtain objects which are still under construction. Here is an example where an iterator can use it to obtain a tuple while it is still being populated by the 'tuple' built-in function. The following example triggers a SystemError, but as the tuple 't' is at the moment still full of null values it can easily generate segfaults instead. from gc import get_referrers def iter(): tag = object() yield tag # 'tag' gets stored in the result tuple lst = [x for x in get_referrers(tag) if isinstance(x, tuple)] t = lst[0] # this *is* the result tuple print t # full of nulls ! tuple(iter()) Unless someone has more ideas than me as to how to prevent this problem, I'd suggest that gc.get_referrers() should be deemed 'officially dangerous' in the docs. ---------------------------------------------------------------------- >Comment By: Armin Rigo (arigo) Date: 2003-09-02 18:11 Message: Logged In: YES user_id=4771 Here is the doc patch (attached). A clean solution to this problem would involve delaying GC registration, which I think would imply changes in the C API. It is probably not worth it. I don't think it would be a problem for the GC not to be able to browse through objects still under constructions because such objects are never part of a dead cycle anyway, and probably not part of a cycle at all until later mutated. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-08-31 23:36 Message: Logged In: YES user_id=31435 Martin, it's easy to transform the example into one that crashes. For example, adding "print t[3]" as the last line of the iter() function causes it to die with a segfault on my box. Virtually anything that fetches a NULL from the tuple will try to Py_INCREF it (that's all "t[3]" does), and that's an instant NULL-pointer dereferencing death. That said, it would be more helpful if Armin submitted a doc patch. The introspective features of the gc module are intended to be used by consenting adults facing hard debugging problems, and I don't care if they can be tricked into blowing up. I agree the docs should point out the possibility, though. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-08-31 17:18 Message: Logged In: YES user_id=21627 I see no harm in your example. Even though the tuple has NULLs in it, is in a stable state. The lesson learned is that an object should become gc-tracked only if it is in a stable state, as gc-tracking means to expose references to the object. This is true independent of get_referrers, as gc-tracking means that tp_traverse might be called for the object, so it *has* to be in a stable state. I fail to see how the example "crashes" the Python interpreter. I causes a SystemError when the tuple is resized, that's all. There are many ways to cause a SystemError, including raise SystemError I recommend not to declare a function as "dangerous" in the docs. Instead, the actual problem should be explained, both in the GC part of the C API, and in gc module docs (for both get_referrers, and get_objects). ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2003-08-28 13:23 Message: Logged In: YES user_id=4771 But it would be very difficult to fix the code base to avoid the problem. The 'tuple' constructor was only an example; it is actually a quite common pattern everywhere in the C code base of both the core and extension modules. Expecting an object not to be seen before you first hand it out is extremely common, and get_referrers() breaks that assumption. Hence the claim that the problem really lies in get_referrers(). ---------------------------------------------------------------------- Comment By: Denis S. Otkidach (ods) Date: 2003-08-28 07:35 Message: Logged In: YES user_id=63454 I guess it's dangerous to make object that is not properly initialized reachable from other code. Even if it's reachable with get_referrers() only. There is no danger in get_referrers() itself. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793822&group_id=5470 From noreply at sourceforge.net Tue Sep 2 12:23:47 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 14:23:52 2003 Subject: [Python-bugs-list] [ python-Bugs-798046 ] select module doesn't allow any iterable. Message-ID: Bugs item #798046, was opened at 2003-08-31 07:31 Message generated for change (Comment added) made by arigo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798046&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Fincher (jemfinch) Assigned to: Nobody/Anonymous (nobody) Summary: select module doesn't allow any iterable. Initial Comment: The select module only allows lists, not any iterable. While this may slightly increase efficiency for the select.select() function itself, for many applications passing select.select a sets.Set would probably be much more efficient (i.e., when things are being added/removed from the readable or writable lists quite often, the O(n) removal of lists would certainly be worse than the O(1) removal of sets.) ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2003-09-02 18:23 Message: Logged In: YES user_id=4771 Using select.poll() instead of select.select() might be a good alternative, at least on platforms that support it, if the sets are getting large enough for you to want to avoid having to build lists explicitely as in : select.select(list(a), list(b), list(c)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798046&group_id=5470 From noreply at sourceforge.net Tue Sep 2 14:11:02 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 16:11:08 2003 Subject: [Python-bugs-list] [ python-Bugs-794140 ] cygwin builds do not embed Message-ID: Bugs item #794140, was opened at 2003-08-24 07:18 Message generated for change (Comment added) made by jlt63 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 Category: Build Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alejandro Lopez-Valencia (dradul) Assigned to: Jason Tishler (jlt63) Summary: cygwin builds do not embed Initial Comment: As an example case, try to build a copy of vim with an embeded python interpreter: """ indow.o objects/if_python.o objects/py_config.o objects/netbeans.o object s/version.o -lncurses -liconv -lintl - L/usr/lib/python2.3/config -lpyt hon2.3 -lutil -lm objects/py_config.o(.data+0x4):config.c: referencia a `_initthread' sin definir objects/py_config.o(.data+0xc):config.c: referencia a `_initsignal' sin definir objects/py_config.o(.data+0x14):config.c: referencia a `_initposix' sin definir objects/py_config.o(.data+0x1c):config.c: referencia a `_initerrno' sin definir objects/py_config.o(.data+0x24):config.c: referencia a `_init_sre' sin definir objects/py_config.o(.data+0x2c):config.c: referencia a `_init_codecs' sin defini r """ As you can see, it doesn't embed. I have tracked down the failure to a problem in the LDSHARED defaults provided by configure.in. The default supplied is: LDSHARED="gcc -shared -Wl,--enable-auto-image- base";; but this *does not* work. As per Cygwin documentation on the creation of DLLs, this works (already tested compiling vim under the same conditions): LDSHARED="gcc -shared -Wl,--enable-auto-image-base - Wl,--export-all-symbols -Wl,--enable-auto-import";; As a side note, please notice that this problem, proper user of GNU ld flags under win32, has a direct impact on the possible success of a true Mingw32 port (which I expect eagerly). ---------------------------------------------------------------------- >Comment By: Jason Tishler (jlt63) Date: 2003-09-02 12:11 Message: Logged In: YES user_id=86216 Please try again with the second patch applied too. The combination of them seem to work for me. > I have tested it against the release23-maint CVS branch, >and unfortunately it doesn't work.. BTW, it would have been helpful it you indicated that the first patch eliminated all but 3 link errors. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 07:31 Message: Logged In: YES user_id=86216 What do you get when you execute the following? $ objdump -p libpython2.3.dll | fgrep '] init' Are you building vim against the newly built Python? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 07:13 Message: Logged In: YES user_id=659006 I have tested it against the release23-maint CVS branch, and unfortunately it doesn't work.. *Sigh* I mentioned the autotools because I didn't see the patch at first (the wonders of top posting, who designed this bug-tracker?). But now... I think we need an export symbols definition file... :-( ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 06:12 Message: Logged In: YES user_id=86216 > Yes, I am willing to test it. Thanks. Are you willing to build against Python CVS? Or, do you need me to provide you with replacements for libpython2.3.dll.a and libpython2.3.dll? > Yet... Don't you think you are complicating the issue, the > autotool files and your life, too much? I don't think so. Note that my approach does not affect any autotools files. > There are no obvious security issues involved and... IIRC, exporting all symbols under Win32 can cause multiple definition link errors. > Anyway, it's your ballgame, it's your call. I appreciate your willingness to acquiesce. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 05:06 Message: Logged In: YES user_id=659006 Yes, I am willing to test it. Yet... Don't you think you are complicating the issue, the autotool files and your life, too much? There are no obvious security issues involved and the procedure only adds extra text to the DATA segment in the DLLs, there are no changes in the actual object code; it won't become a hybrid DLL/implib such as cygwin1.dll! Take any Unix shared library (Linux, Solaris, BSD, whatever), and it is already exporting *all symbols*, how else would you be able to link to them? There are no import libs, that's a Windows/MacOS Classic abomination as far as I am concerned :-) Anyway, it's your ballgame, it's your call. Cheers ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-26 05:46 Message: Logged In: YES user_id=86216 I would prefer to just export the missing symbols than all of them which is unnecessary and possibly problematic. The attached patch (against Python CVS) exports the following additionally symbols: $ objdump -p libpython2.3.dll | fgrep '] init' [ 794] init_codecs [ 795] init_sre [ 796] init_symtable [ 797] initerrno [ 798] initposix [ 799] initsignal [ 800] initthread [ 801] initxxsubtype [ 802] initzipimport Does the above meet your needs? Are you willing to test your vim build against it? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:05 Message: Logged In: YES user_id=659006 Opps! Sorry, my link fell down in the middle of submitting the form. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:00 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 02:57 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-25 10:32 Message: Logged In: YES user_id=86216 AFAICT, changing LDSHARED will affect building extensions too. So, I am very hesitant to change its definition without fully understanding the ramifications. Note that Cygwin Python extensions have been working for almost three years now. Additionally, I WAG that there are many more people building extensions than embedding. > LDSHARED="gcc -shared -Wl,--enable-auto-image-base > -Wl,--export-all-symbols -Wl,--enable-auto-import";; I can understand why adding "-Wl,--export-all-symbols" fixes the above link errors. However, I don't understand why "-Wl,--enable-auto-import" would help. IIRC, it defaults to enabled anyway. Does vim with an embeded python interpreter build without this option? Can you provide me a small embedded example so I can do some testing? Using vim seems a bit unwieldy. > As a side note, please notice that this problem, proper > user of GNU ld flags under win32, has a direct impact on > the possible success of a true Mingw32 port (which I > expect eagerly). Huh? How is this related to the report Cygwin problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 From noreply at sourceforge.net Tue Sep 2 14:16:15 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 16:16:18 2003 Subject: [Python-bugs-list] [ python-Bugs-799369 ] documentation for sys.platform is unclear Message-ID: Bugs item #799369, was opened at 2003-09-02 22: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=799369&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Bram Moolenaar (vimboss) Assigned to: Nobody/Anonymous (nobody) Summary: documentation for sys.platform is unclear Initial Comment: The use of sys.platform is very risky, because it is not at all clear what the possible values are. For example, on Mac OS X "darwin" is used, but this can only be discovered by trying it out and asking Jack when another value will be used. Another problem is that the examples given include a number, which suggests that an OS version number might be included here. Is that only a major version number? And why doesn't Mac OS X report "macosx10.2"? Suggestion: Add a list of known values and for what platforms they are used. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799369&group_id=5470 From noreply at sourceforge.net Tue Sep 2 15:58:36 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Sep 2 17:58:40 2003 Subject: [Python-bugs-list] [ python-Bugs-799428 ] tk_focusNext() fails Message-ID: Bugs item #799428, was opened at 2003-09-02 17: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=799428&group_id=5470 Category: Tkinter Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Perry Greenfield (perrygreenfield) Assigned to: Nobody/Anonymous (nobody) Summary: tk_focusNext() fails Initial Comment: Calls to the widget method tk_focusNext() fail with "unsubscriptable object" error. Looking at the Tkinter.py code for the routine shows this statement: name = self.tk.call('tk_focusNext', self._w) (line 433) which used to return a string in 2.2 but now returns a "cmdName object". When this is passed to self._nametowidget(name), it fails when it tries to subscript name (line 1006) since the object does not support indexing. Perhaps str(name) or name.string is more appropriate now? (when that change is made, it works--well, I tested name.string and that worked) Perry Greenfield (perry@stsci.edu) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799428&group_id=5470 From noreply at sourceforge.net Thu Sep 4 13:04:34 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:13:12 2003 Subject: [Python-bugs-list] [ python-Bugs-603724 ] setting file buffer size is unreliable Message-ID: Bugs item #603724, was opened at 2002-09-03 00:37 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=603724&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jeremy Yallop (yallop) Assigned to: Nobody/Anonymous (nobody) Summary: setting file buffer size is unreliable Initial Comment: The description of open() (ie file()) says: "If the buffering argument is given, 0 means unbuffered, 1 means line buffered, and larger numbers specify the buffer size." PyFile_SetBufSize() passes the requested buffer size on to setvbuf(), with NULL as setvbuf()'s second parameter. The C89 standard doesn't guarantee any change to the buffer size when the second parameter is NULL, and some stdio implementations (legitimately) ignore the size parmater in such circumstances. C99's gives more guidelines, but nothing that can be relied upon: "If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by the setvbuf function and the argument size specifies the size of the array; otherwise, size may determine the size of buffer allocated by the setvbuf function." (7.19.5.6) (What good is "may" to anyone?) The result of all this is that fd = open('file', 'w', 8) will not have the desired (and documented) effect (flushing the output buffer every 8 characters) on some platforms, so either the documentation of open() or the code (PyFile_SetBufSize()) should be fixed. The same problems exist with setbuf() as well. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-04 21:04 Message: Logged In: YES user_id=21627 Fixed with #788249, in fileobject.h 2.33 fileobject.c 2.181 fileobject.h 2.32.8.1 NEWS 1.831.4.33 fileobject.c 2.179.8.1 ---------------------------------------------------------------------- Comment By: Andrew Gaul (gaul) Date: 2003-08-22 10:48 Message: Logged In: YES user_id=139865 See patch 788249 for a fix. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-09-12 10:12 Message: Logged In: YES user_id=21627 I see, it appears indeed that the size argument is unused on Linux. Any volunteers to come up with a patch? ---------------------------------------------------------------------- Comment By: Jeremy Yallop (yallop) Date: 2002-09-11 22:49 Message: Logged In: YES user_id=479330 Debian on x86 with glibc-2.2.5 (which I believe uses Per Bothner's libio) ignores the size parameter when the buffer parameter is NULL. I've attached a demonstration program which calls setvbuf with a size of 2 and with either NULL or a static buffer (depending on argc). Run it and kill (with Ctrl-C or whatever) before it's finished. Alternatively, the effect can be observed in python by something like >>> fd = open('file', 'write', 2) >>> fd.write('Hello, world.\n') >>> Ctrl-Z [1]+ Stopped python $ killall -9 python $ cat file $ PS I'm not sure declaring Debian as unsupported would be very popular :-). ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2002-09-11 18:56 Message: Logged In: YES user_id=21627 Can you please report which systems ignore the setvbuf call? Python makes loads of assumptions about systems which are not backed by any standard. On systems which meet Python's expectation, Python behaves as documented. On systems which don't meet the expectations, we have two options a) declare the system as unsupported, or b) fix the implementation for the specific system to meet the documentation. So in the abstract, I don't see a bug here - setting the buffer size *is* reliable on Linux and Windows and many other supported systems. ---------------------------------------------------------------------- Comment By: Jeremy Hylton (jhylton) Date: 2002-09-04 00:35 Message: Logged In: YES user_id=31392 The C99 rationale has a helpful comment on the subject of setvbuf(): C90 was not clear about what, if anything, the size argument means when buf is a null pointer. Existing practice is mixed: some implementations ignore it completely, other implementations use it as guidance for determining the size of the buffer allocated by setvbuf. C9X gives warning that size might be ignored in this case, so portable programs must be sure to supply a reasonable value. I'd be mostly inclined to change the documentation to say that the buffer is under control of the C library and that Python does whatever setvbuf() does. Or however we write the C99 weasel words in Python docstring-ease. Thankfully, Linux and Windows both have sane setvbuf() implementations. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=603724&group_id=5470 From noreply at sourceforge.net Thu Sep 4 12:48:42 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:13:47 2003 Subject: [Python-bugs-list] [ python-Bugs-698282 ] __file__ attribute missing from dynamicly loaded module Message-ID: Bugs item #698282, was opened at 2003-03-05 21:52 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=698282&group_id=5470 Category: Python Interpreter Core Group: Python 2.2.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: David C. Sweeton (dsweeton) Assigned to: Nobody/Anonymous (nobody) Summary: __file__ attribute missing from dynamicly loaded module Initial Comment: Only the first instanceof a dynamically loaded module gets the __file__ attribute. It is missing from all later instances. The problem is in importdl.c in the function _PyImport_LoadDynamicModule. The first time a module is loaded a copy of its module dictionary is made by a call to _PyImport_FixupExtension. After that copy was made, _PyImport_LoadDynamicModule adds the _file__ attribute to the original module dictionary. Thus the first instance of the module has the __file__attribute. Later when another instance of the module loads, its module dictionary is duplicated from the copy of the dictionary from the first instance. The problem is that when that copy was made, the __file__ attribute was not yet there. Thus the later instance of the module does not have the __file__ attribute. The required fix is in importdl.c and consists of simply moving the call of _PyImport_FixupExtension to a point just after the __file__ attribute is added, instead of just before it. I have tested this fix and it solves the problem. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-04 20:48 Message: Logged In: YES user_id=21627 This is fixed with patch 794826, in importdl.c 2.71 and 2.70.14.1, NEWS 1.831.4.31. ---------------------------------------------------------------------- Comment By: Shack Toms (shacktoms) Date: 2003-08-25 20:04 Message: Logged In: YES user_id=603293 This only appears to be a problem when embedding multiple python interpreters in a single application, when more than one interpreter does an import that refers to the __file__ attribute. Maybe this would also be a problem for the Apache mod_python? In any case, I have a cdiff file based on revision 2.70 of importdl.c. I hope it can be incorporated. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=698282&group_id=5470 From noreply at sourceforge.net Thu Sep 4 09:16:21 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:14:58 2003 Subject: [Python-bugs-list] [ python-Bugs-800432 ] color highlighting not working on EDIT windows Message-ID: Bugs item #800432, was opened at 2003-09-04 08:03 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800432&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: F. Javier Jarava Jarava (developjavier) >Assigned to: Kurt B. Kaiser (kbk) Summary: color highlighting not working on EDIT windows Initial Comment: ON idle 1.0/python 2.3/Tk 8.4: When starting IDLE "normally" (ie: with Shell window), and using File->New Window (Ctrl-N) to get a new Edit window, syntax higlihting is off until the contents of the file are saved with a .py extension. BUT, when starting IDLE after configuring it to start with a EDIT window, syntax highlighting is ON for that first window (although not for any other new Edit windows) The behaviour happens both on IDLE as shipped with the python.org 2.3 installer and with cygwin's idle: (idle 1.0, Python 2.3 (#1, Aug 5 2003, 09:49:11) [GCC 3.2 20020927 (prerelease)] on cygwin) - started with -n switch to avoid the "missing menus" bug on cygwin) On idle 0.8 (as shipped with ActiveState ActivePython 2.2.2 Build 224) syntax highlighting is ON in edit ("new") windows. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800432&group_id=5470 From noreply at sourceforge.net Thu Sep 4 07:03:45 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:15:20 2003 Subject: [Python-bugs-list] [ python-Bugs-800432 ] color highlighting not working on EDIT windows Message-ID: Bugs item #800432, was opened at 2003-09-04 15: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=800432&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: F. Javier Jarava Jarava (developjavier) Assigned to: Nobody/Anonymous (nobody) Summary: color highlighting not working on EDIT windows Initial Comment: ON idle 1.0/python 2.3/Tk 8.4: When starting IDLE "normally" (ie: with Shell window), and using File->New Window (Ctrl-N) to get a new Edit window, syntax higlihting is off until the contents of the file are saved with a .py extension. BUT, when starting IDLE after configuring it to start with a EDIT window, syntax highlighting is ON for that first window (although not for any other new Edit windows) The behaviour happens both on IDLE as shipped with the python.org 2.3 installer and with cygwin's idle: (idle 1.0, Python 2.3 (#1, Aug 5 2003, 09:49:11) [GCC 3.2 20020927 (prerelease)] on cygwin) - started with -n switch to avoid the "missing menus" bug on cygwin) On idle 0.8 (as shipped with ActiveState ActivePython 2.2.2 Build 224) syntax highlighting is ON in edit ("new") windows. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800432&group_id=5470 From noreply at sourceforge.net Thu Sep 4 06:01:52 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:15:32 2003 Subject: [Python-bugs-list] [ python-Bugs-794140 ] cygwin builds do not embed Message-ID: Bugs item #794140, was opened at 2003-08-24 07:18 Message generated for change (Comment added) made by jlt63 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 Category: Build >Group: Python 2.4 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Alejandro Lopez-Valencia (dradul) Assigned to: Jason Tishler (jlt63) Summary: cygwin builds do not embed Initial Comment: As an example case, try to build a copy of vim with an embeded python interpreter: """ indow.o objects/if_python.o objects/py_config.o objects/netbeans.o object s/version.o -lncurses -liconv -lintl - L/usr/lib/python2.3/config -lpyt hon2.3 -lutil -lm objects/py_config.o(.data+0x4):config.c: referencia a `_initthread' sin definir objects/py_config.o(.data+0xc):config.c: referencia a `_initsignal' sin definir objects/py_config.o(.data+0x14):config.c: referencia a `_initposix' sin definir objects/py_config.o(.data+0x1c):config.c: referencia a `_initerrno' sin definir objects/py_config.o(.data+0x24):config.c: referencia a `_init_sre' sin definir objects/py_config.o(.data+0x2c):config.c: referencia a `_init_codecs' sin defini r """ As you can see, it doesn't embed. I have tracked down the failure to a problem in the LDSHARED defaults provided by configure.in. The default supplied is: LDSHARED="gcc -shared -Wl,--enable-auto-image- base";; but this *does not* work. As per Cygwin documentation on the creation of DLLs, this works (already tested compiling vim under the same conditions): LDSHARED="gcc -shared -Wl,--enable-auto-image-base - Wl,--export-all-symbols -Wl,--enable-auto-import";; As a side note, please notice that this problem, proper user of GNU ld flags under win32, has a direct impact on the possible success of a true Mingw32 port (which I expect eagerly). ---------------------------------------------------------------------- >Comment By: Jason Tishler (jlt63) Date: 2003-09-04 04:01 Message: Logged In: YES user_id=86216 > python import vim; vim.current.line = vim.current.line.upper () The above example works fine with embed2.diff applied. I tested (builing Python) under Red Hat Linux 8.0 too. Commited as: Include/pyport.h 2.63 Modules/gcmodule.c 2.72 Python/import.c 2.223 Python/marshal.c 1.75 ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-04 03:51 Message: Logged In: YES user_id=86216 I should have mentioned that the patch assumes Python's builtin modules are only written in C (not C++). If this assumption is incorrect, then I will add the standard __cplusplus/extern "C" idiom. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-04 03:37 Message: Logged In: YES user_id=86216 Combined the original two patches into one and refreshed against current CVS. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-02 12:11 Message: Logged In: YES user_id=86216 Please try again with the second patch applied too. The combination of them seem to work for me. > I have tested it against the release23-maint CVS branch, >and unfortunately it doesn't work.. BTW, it would have been helpful it you indicated that the first patch eliminated all but 3 link errors. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 07:31 Message: Logged In: YES user_id=86216 What do you get when you execute the following? $ objdump -p libpython2.3.dll | fgrep '] init' Are you building vim against the newly built Python? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 07:13 Message: Logged In: YES user_id=659006 I have tested it against the release23-maint CVS branch, and unfortunately it doesn't work.. *Sigh* I mentioned the autotools because I didn't see the patch at first (the wonders of top posting, who designed this bug-tracker?). But now... I think we need an export symbols definition file... :-( ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 06:12 Message: Logged In: YES user_id=86216 > Yes, I am willing to test it. Thanks. Are you willing to build against Python CVS? Or, do you need me to provide you with replacements for libpython2.3.dll.a and libpython2.3.dll? > Yet... Don't you think you are complicating the issue, the > autotool files and your life, too much? I don't think so. Note that my approach does not affect any autotools files. > There are no obvious security issues involved and... IIRC, exporting all symbols under Win32 can cause multiple definition link errors. > Anyway, it's your ballgame, it's your call. I appreciate your willingness to acquiesce. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 05:06 Message: Logged In: YES user_id=659006 Yes, I am willing to test it. Yet... Don't you think you are complicating the issue, the autotool files and your life, too much? There are no obvious security issues involved and the procedure only adds extra text to the DATA segment in the DLLs, there are no changes in the actual object code; it won't become a hybrid DLL/implib such as cygwin1.dll! Take any Unix shared library (Linux, Solaris, BSD, whatever), and it is already exporting *all symbols*, how else would you be able to link to them? There are no import libs, that's a Windows/MacOS Classic abomination as far as I am concerned :-) Anyway, it's your ballgame, it's your call. Cheers ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-26 05:46 Message: Logged In: YES user_id=86216 I would prefer to just export the missing symbols than all of them which is unnecessary and possibly problematic. The attached patch (against Python CVS) exports the following additionally symbols: $ objdump -p libpython2.3.dll | fgrep '] init' [ 794] init_codecs [ 795] init_sre [ 796] init_symtable [ 797] initerrno [ 798] initposix [ 799] initsignal [ 800] initthread [ 801] initxxsubtype [ 802] initzipimport Does the above meet your needs? Are you willing to test your vim build against it? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:05 Message: Logged In: YES user_id=659006 Opps! Sorry, my link fell down in the middle of submitting the form. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:00 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 02:57 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-25 10:32 Message: Logged In: YES user_id=86216 AFAICT, changing LDSHARED will affect building extensions too. So, I am very hesitant to change its definition without fully understanding the ramifications. Note that Cygwin Python extensions have been working for almost three years now. Additionally, I WAG that there are many more people building extensions than embedding. > LDSHARED="gcc -shared -Wl,--enable-auto-image-base > -Wl,--export-all-symbols -Wl,--enable-auto-import";; I can understand why adding "-Wl,--export-all-symbols" fixes the above link errors. However, I don't understand why "-Wl,--enable-auto-import" would help. IIRC, it defaults to enabled anyway. Does vim with an embeded python interpreter build without this option? Can you provide me a small embedded example so I can do some testing? Using vim seems a bit unwieldy. > As a side note, please notice that this problem, proper > user of GNU ld flags under win32, has a direct impact on > the possible success of a true Mingw32 port (which I > expect eagerly). Huh? How is this related to the report Cygwin problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 From noreply at sourceforge.net Tue Sep 2 22:54:23 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:20:20 2003 Subject: [Python-bugs-list] [ python-Bugs-797447 ] locale.setlocale(locale.LC_ALL, "de") raises exception Message-ID: Bugs item #797447, was opened at 2003-08-29 20:16 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797447&group_id=5470 Category: Python Library Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Peter Otten (potten) Assigned to: Martin v. L?wis (loewis) Summary: locale.setlocale(locale.LC_ALL, "de") raises exception Initial Comment: Python 2.3 (#1, Jul 30 2003, 11:19:43) [GCC 3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale as lo >>> lo.setlocale(lo.LC_ALL, 'de') Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/locale.py", line 381, in setlocale return _setlocale(category, locale) locale.Error: locale setting not supported The above was taken from the example section of the locale module documentation. But this works: >>> lo.setlocale(lo.LC_ALL, 'de_DE') 'de_DE' >>> So the error message should at least be changed to "unknown/unsupported locale" and the documentation example updated to 'de_DE' instead of 'de'. However, if there are no side effects, I'd prefer to change the locale.setlocale() implementation to always normalize() the locale: def setlocale(category, locale=None): if locale: if type(locale) is not type(""): # convert to string locale = _build_localename(locale) locale = normalize(locale) return _setlocale(category, locale) ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 06:54 Message: Logged In: YES user_id=21627 This bug is now fixed in liblocale.tex 1.35 _localemodule.c 2.41 _localemodule.c 2.40.4.1 NEWS 1.831.4.28 liblocale.tex 1.33.10.2 by changing the error message, and changing the example to read de_DE. ---------------------------------------------------------------------- Comment By: Tony Meyer (anadelonbrin) Date: 2003-09-01 10:02 Message: Logged In: YES user_id=552329 Just my 2c, but I would agree that a wording change to either "unsupported locale setting" or "%s locale setting not supported" with the attempted locale would be much clearer. No opinion on (2) :) ---------------------------------------------------------------------- Comment By: Peter Otten (potten) Date: 2003-08-31 23:37 Message: Logged In: YES user_id=703365 (1) I read "locale setting not supported" and understood (not being a native speaker) "(any) locale setting not supported", whereas "unknown/unsupported locale" would make it clear you can set a locale but not the one that was requested. (2) I would expect setlocale(..., "de") and setlocale(..., ("de", None)) to either both fail or both succeed, but currently only the latter form works; thus the proposed change in the code. I hope this clarifies the issue and you will reconsider. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-08-31 19:00 Message: Logged In: YES user_id=21627 I fail to see the bug. "locale setting not supported" is exactly identical, in its meaning, with "unsupported locale". Changing the example to de_DE won't help much, either, since the next system might support "de" but not "de_DE", or it might support "de_DE.ISO-8859-1" only. Locale names are not standardized. ---------------------------------------------------------------------- Comment By: Peter Otten (potten) Date: 2003-08-30 09:29 Message: Logged In: YES user_id=703365 I forgot to mention that the following also works: >>> import locale >>> locale.setlocale(locale.LC_ALL, ("de", None)) 'de_DE.ISO8859-1' >>> So the it really seems to be an implementation rather than a documentation issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=797447&group_id=5470 From noreply at sourceforge.net Thu Sep 4 15:26:29 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:26:40 2003 Subject: [Python-bugs-list] [ python-Bugs-727692 ] Documentation formatting bugs Message-ID: Bugs item #727692, was opened at 2003-04-25 14:57 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727692&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Martin v. L?wis (loewis) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Documentation formatting bugs Initial Comment: I found that some of my changes get incorrectly formatted, but I don't know how to fix them. Assigning to Fred in the hope that he knows the proper incantations. - HTML version of 4.9.2 (standard encodings): The table is incorrect in the lines that have an empty Aliases column (e.g. cp874). The Alias ought to be empty, and "Thai" ought to occur in the third column - HTML version of 4.9.3 (encodings.IDNA) The first paragraph starts with a bogus "P>" - HTML of whatsnew, 17, "Support for internationalized domain names": The first line of Python prints as a guillemet, not as ">>" Notice that I used a non- preformatted enviroment so that I could output c-cedilla. - Postscript version of 4.9.2: the table is overfull in its width. It would be ok to wrap the aliases lists as much as necessary ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-09-04 17:26 Message: Logged In: YES user_id=3066 Fixed table generation in HTML that caused cells to be dropped in the standard encodings table in Doc/perl/python.perl revision 1.140. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-04-30 11:06 Message: Logged In: YES user_id=3066 - Standard encodings table: ouch! I'll see what I can do about this, but it'll take more time than I can spend right now. - encodings.idna documentation: That's a bug in the formatting software; hopefully I'll be able to fix it. Worked around it for now (Doc/lib/libcodecs.tex 1.20). - What's New document: I've worked around the problem so the interactive prompt shows up properly, but an extraneous space is generated at the beginning of the line; not sure why (Doc/whatsnew/whatsnew23.tex 1.144). - Postscript: I expect the PDF to exhibit the same problem. This is a general problem for tables with a lot of horizontal-mode material in LaTeX; I don't know how to work around this (yet). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727692&group_id=5470 From noreply at sourceforge.net Thu Sep 4 05:51:20 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:29:45 2003 Subject: [Python-bugs-list] [ python-Bugs-794140 ] cygwin builds do not embed Message-ID: Bugs item #794140, was opened at 2003-08-24 07:18 Message generated for change (Comment added) made by jlt63 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 Category: Build Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alejandro Lopez-Valencia (dradul) Assigned to: Jason Tishler (jlt63) Summary: cygwin builds do not embed Initial Comment: As an example case, try to build a copy of vim with an embeded python interpreter: """ indow.o objects/if_python.o objects/py_config.o objects/netbeans.o object s/version.o -lncurses -liconv -lintl - L/usr/lib/python2.3/config -lpyt hon2.3 -lutil -lm objects/py_config.o(.data+0x4):config.c: referencia a `_initthread' sin definir objects/py_config.o(.data+0xc):config.c: referencia a `_initsignal' sin definir objects/py_config.o(.data+0x14):config.c: referencia a `_initposix' sin definir objects/py_config.o(.data+0x1c):config.c: referencia a `_initerrno' sin definir objects/py_config.o(.data+0x24):config.c: referencia a `_init_sre' sin definir objects/py_config.o(.data+0x2c):config.c: referencia a `_init_codecs' sin defini r """ As you can see, it doesn't embed. I have tracked down the failure to a problem in the LDSHARED defaults provided by configure.in. The default supplied is: LDSHARED="gcc -shared -Wl,--enable-auto-image- base";; but this *does not* work. As per Cygwin documentation on the creation of DLLs, this works (already tested compiling vim under the same conditions): LDSHARED="gcc -shared -Wl,--enable-auto-image-base - Wl,--export-all-symbols -Wl,--enable-auto-import";; As a side note, please notice that this problem, proper user of GNU ld flags under win32, has a direct impact on the possible success of a true Mingw32 port (which I expect eagerly). ---------------------------------------------------------------------- >Comment By: Jason Tishler (jlt63) Date: 2003-09-04 03:51 Message: Logged In: YES user_id=86216 I should have mentioned that the patch assumes Python's builtin modules are only written in C (not C++). If this assumption is incorrect, then I will add the standard __cplusplus/extern "C" idiom. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-04 03:37 Message: Logged In: YES user_id=86216 Combined the original two patches into one and refreshed against current CVS. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-02 12:11 Message: Logged In: YES user_id=86216 Please try again with the second patch applied too. The combination of them seem to work for me. > I have tested it against the release23-maint CVS branch, >and unfortunately it doesn't work.. BTW, it would have been helpful it you indicated that the first patch eliminated all but 3 link errors. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 07:31 Message: Logged In: YES user_id=86216 What do you get when you execute the following? $ objdump -p libpython2.3.dll | fgrep '] init' Are you building vim against the newly built Python? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 07:13 Message: Logged In: YES user_id=659006 I have tested it against the release23-maint CVS branch, and unfortunately it doesn't work.. *Sigh* I mentioned the autotools because I didn't see the patch at first (the wonders of top posting, who designed this bug-tracker?). But now... I think we need an export symbols definition file... :-( ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 06:12 Message: Logged In: YES user_id=86216 > Yes, I am willing to test it. Thanks. Are you willing to build against Python CVS? Or, do you need me to provide you with replacements for libpython2.3.dll.a and libpython2.3.dll? > Yet... Don't you think you are complicating the issue, the > autotool files and your life, too much? I don't think so. Note that my approach does not affect any autotools files. > There are no obvious security issues involved and... IIRC, exporting all symbols under Win32 can cause multiple definition link errors. > Anyway, it's your ballgame, it's your call. I appreciate your willingness to acquiesce. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 05:06 Message: Logged In: YES user_id=659006 Yes, I am willing to test it. Yet... Don't you think you are complicating the issue, the autotool files and your life, too much? There are no obvious security issues involved and the procedure only adds extra text to the DATA segment in the DLLs, there are no changes in the actual object code; it won't become a hybrid DLL/implib such as cygwin1.dll! Take any Unix shared library (Linux, Solaris, BSD, whatever), and it is already exporting *all symbols*, how else would you be able to link to them? There are no import libs, that's a Windows/MacOS Classic abomination as far as I am concerned :-) Anyway, it's your ballgame, it's your call. Cheers ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-26 05:46 Message: Logged In: YES user_id=86216 I would prefer to just export the missing symbols than all of them which is unnecessary and possibly problematic. The attached patch (against Python CVS) exports the following additionally symbols: $ objdump -p libpython2.3.dll | fgrep '] init' [ 794] init_codecs [ 795] init_sre [ 796] init_symtable [ 797] initerrno [ 798] initposix [ 799] initsignal [ 800] initthread [ 801] initxxsubtype [ 802] initzipimport Does the above meet your needs? Are you willing to test your vim build against it? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:05 Message: Logged In: YES user_id=659006 Opps! Sorry, my link fell down in the middle of submitting the form. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:00 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 02:57 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-25 10:32 Message: Logged In: YES user_id=86216 AFAICT, changing LDSHARED will affect building extensions too. So, I am very hesitant to change its definition without fully understanding the ramifications. Note that Cygwin Python extensions have been working for almost three years now. Additionally, I WAG that there are many more people building extensions than embedding. > LDSHARED="gcc -shared -Wl,--enable-auto-image-base > -Wl,--export-all-symbols -Wl,--enable-auto-import";; I can understand why adding "-Wl,--export-all-symbols" fixes the above link errors. However, I don't understand why "-Wl,--enable-auto-import" would help. IIRC, it defaults to enabled anyway. Does vim with an embeded python interpreter build without this option? Can you provide me a small embedded example so I can do some testing? Using vim seems a bit unwieldy. > As a side note, please notice that this problem, proper > user of GNU ld flags under win32, has a direct impact on > the possible success of a true Mingw32 port (which I > expect eagerly). Huh? How is this related to the report Cygwin problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 From noreply at sourceforge.net Thu Sep 4 05:37:51 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:34:25 2003 Subject: [Python-bugs-list] [ python-Bugs-794140 ] cygwin builds do not embed Message-ID: Bugs item #794140, was opened at 2003-08-24 07:18 Message generated for change (Comment added) made by jlt63 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 Category: Build Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alejandro Lopez-Valencia (dradul) Assigned to: Jason Tishler (jlt63) Summary: cygwin builds do not embed Initial Comment: As an example case, try to build a copy of vim with an embeded python interpreter: """ indow.o objects/if_python.o objects/py_config.o objects/netbeans.o object s/version.o -lncurses -liconv -lintl - L/usr/lib/python2.3/config -lpyt hon2.3 -lutil -lm objects/py_config.o(.data+0x4):config.c: referencia a `_initthread' sin definir objects/py_config.o(.data+0xc):config.c: referencia a `_initsignal' sin definir objects/py_config.o(.data+0x14):config.c: referencia a `_initposix' sin definir objects/py_config.o(.data+0x1c):config.c: referencia a `_initerrno' sin definir objects/py_config.o(.data+0x24):config.c: referencia a `_init_sre' sin definir objects/py_config.o(.data+0x2c):config.c: referencia a `_init_codecs' sin defini r """ As you can see, it doesn't embed. I have tracked down the failure to a problem in the LDSHARED defaults provided by configure.in. The default supplied is: LDSHARED="gcc -shared -Wl,--enable-auto-image- base";; but this *does not* work. As per Cygwin documentation on the creation of DLLs, this works (already tested compiling vim under the same conditions): LDSHARED="gcc -shared -Wl,--enable-auto-image-base - Wl,--export-all-symbols -Wl,--enable-auto-import";; As a side note, please notice that this problem, proper user of GNU ld flags under win32, has a direct impact on the possible success of a true Mingw32 port (which I expect eagerly). ---------------------------------------------------------------------- >Comment By: Jason Tishler (jlt63) Date: 2003-09-04 03:37 Message: Logged In: YES user_id=86216 Combined the original two patches into one and refreshed against current CVS. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-09-02 12:11 Message: Logged In: YES user_id=86216 Please try again with the second patch applied too. The combination of them seem to work for me. > I have tested it against the release23-maint CVS branch, >and unfortunately it doesn't work.. BTW, it would have been helpful it you indicated that the first patch eliminated all but 3 link errors. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 07:31 Message: Logged In: YES user_id=86216 What do you get when you execute the following? $ objdump -p libpython2.3.dll | fgrep '] init' Are you building vim against the newly built Python? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 07:13 Message: Logged In: YES user_id=659006 I have tested it against the release23-maint CVS branch, and unfortunately it doesn't work.. *Sigh* I mentioned the autotools because I didn't see the patch at first (the wonders of top posting, who designed this bug-tracker?). But now... I think we need an export symbols definition file... :-( ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-27 06:12 Message: Logged In: YES user_id=86216 > Yes, I am willing to test it. Thanks. Are you willing to build against Python CVS? Or, do you need me to provide you with replacements for libpython2.3.dll.a and libpython2.3.dll? > Yet... Don't you think you are complicating the issue, the > autotool files and your life, too much? I don't think so. Note that my approach does not affect any autotools files. > There are no obvious security issues involved and... IIRC, exporting all symbols under Win32 can cause multiple definition link errors. > Anyway, it's your ballgame, it's your call. I appreciate your willingness to acquiesce. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-27 05:06 Message: Logged In: YES user_id=659006 Yes, I am willing to test it. Yet... Don't you think you are complicating the issue, the autotool files and your life, too much? There are no obvious security issues involved and the procedure only adds extra text to the DATA segment in the DLLs, there are no changes in the actual object code; it won't become a hybrid DLL/implib such as cygwin1.dll! Take any Unix shared library (Linux, Solaris, BSD, whatever), and it is already exporting *all symbols*, how else would you be able to link to them? There are no import libs, that's a Windows/MacOS Classic abomination as far as I am concerned :-) Anyway, it's your ballgame, it's your call. Cheers ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-26 05:46 Message: Logged In: YES user_id=86216 I would prefer to just export the missing symbols than all of them which is unnecessary and possibly problematic. The attached patch (against Python CVS) exports the following additionally symbols: $ objdump -p libpython2.3.dll | fgrep '] init' [ 794] init_codecs [ 795] init_sre [ 796] init_symtable [ 797] initerrno [ 798] initposix [ 799] initsignal [ 800] initthread [ 801] initxxsubtype [ 802] initzipimport Does the above meet your needs? Are you willing to test your vim build against it? ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:05 Message: Logged In: YES user_id=659006 Opps! Sorry, my link fell down in the middle of submitting the form. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 03:00 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Alejandro Lopez-Valencia (dradul) Date: 2003-08-26 02:57 Message: Logged In: YES user_id=659006 Ramifications to changing LDSHARED? I don't perceive any besides having slightly bigger dlls, and the possibility to extract symbol definitions and create import libraries out of plugins, perhaps even linking extensoins directly (as in writing derivative extensions from, say, Numeric). Adding -Wl,--enable-auto-import doesn't modify the defaults but hushes the linker, less perturbing line noise in stderr. On giving you an example, I only use python under cygwin and having just managed to build my first embedded vim, I'm starting to experiment. There are some reasonable examples in vim's documentation (see ':h if_pyth.txt'). This works for me: 1. Type a line of text. Leave cursor on line. 2. Enter command mode and type: python import vim; vim.current.line = vim.current.line.upper () And about your "Huh?", this is the python bug tracker last time I checked. The issue is a GNU ld/Win32 issue, not necessarily exclusive to Cygwin. I am leaving a hint for future developers. Cheers. ---------------------------------------------------------------------- Comment By: Jason Tishler (jlt63) Date: 2003-08-25 10:32 Message: Logged In: YES user_id=86216 AFAICT, changing LDSHARED will affect building extensions too. So, I am very hesitant to change its definition without fully understanding the ramifications. Note that Cygwin Python extensions have been working for almost three years now. Additionally, I WAG that there are many more people building extensions than embedding. > LDSHARED="gcc -shared -Wl,--enable-auto-image-base > -Wl,--export-all-symbols -Wl,--enable-auto-import";; I can understand why adding "-Wl,--export-all-symbols" fixes the above link errors. However, I don't understand why "-Wl,--enable-auto-import" would help. IIRC, it defaults to enabled anyway. Does vim with an embeded python interpreter build without this option? Can you provide me a small embedded example so I can do some testing? Using vim seems a bit unwieldy. > As a side note, please notice that this problem, proper > user of GNU ld flags under win32, has a direct impact on > the possible success of a true Mingw32 port (which I > expect eagerly). Huh? How is this related to the report Cygwin problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794140&group_id=5470 From noreply at sourceforge.net Tue Sep 2 23:16:08 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 17:59:16 2003 Subject: [Python-bugs-list] [ python-Bugs-788378 ] Unsupported 'locale' setting causes Idle to crash on startup Message-ID: Bugs item #788378, was opened at 2003-08-13 23:49 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788378&group_id=5470 Category: IDLE Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Andre Posumentov (aposumentov) Assigned to: Martin v. L?wis (loewis) Summary: Unsupported 'locale' setting causes Idle to crash on startup Initial Comment: If the 'LANG' environment variable is set to an unsupported value, Idle crashes on startup. The error occurs in IOBinding.py, as follows: Traceback (most recent call last): File "Resources/__argvemulator_idle", line 4, in ? execfile(os.path.join(os.path.split(__file__)[0], "idle")) File "Resources/idle", line 4, in ? import idlelib.PyShell File "/Applications/MacPython-2.3/IDLE.app/ Contents/Resources/idlelib/PyShell.py", line 22, in ? from EditorWindow import EditorWindow, fixwordbreaks File "/Applications/MacPython-2.3/IDLE.app/ Contents/Resources/idlelib/EditorWindow.py", line 39, in ? class EditorWindow: File "/Applications/MacPython-2.3/IDLE.app/ Contents/Resources/idlelib/EditorWindow.py", line 43, in EditorWindow from IOBinding import IOBinding File "/Applications/MacPython-2.3/IDLE.app/ Contents/Resources/idlelib/IOBinding.py", line 31, in ? locale.setlocale(locale.LC_CTYPE, "") File "/Library/Frameworks/Python.framework/ Versions/2.3/lib/python2.3/locale.py", line 381, in setlocale return _setlocale(category, locale) locale.Error: locale setting not supported Here are the offending lines in IOBinding.py: try: import locale locale.setlocale(locale.LC_CTYPE, "") except ImportError: pass As it's not an 'ImportError'... The error is reproducible on Mac OS X 10.2.6, running MacPython-2.3. I have not been able to test on other operating systems. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 07:16 Message: Logged In: YES user_id=21627 This is now fixed in IOBinding.py 1.21 and 1.19.8.2, NEWS 1.831.4.29. ---------------------------------------------------------------------- Comment By: Andre Posumentov (aposumentov) Date: 2003-08-14 13:48 Message: Logged In: YES user_id=677286 >> except (ImportError, locale.Error): I've tested the change on my system, and it looks good. No crashing on startup, and everything else seems to function as it should. ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-08-14 06:49 Message: Logged In: YES user_id=149084 I suppose the right thing to do here is except (ImportError, locale.Error): Is that correct? I'm going to be away for a few days.... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788378&group_id=5470 From noreply at sourceforge.net Wed Sep 3 07:29:41 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 18:22:20 2003 Subject: [Python-bugs-list] [ python-Bugs-799428 ] tk_focusNext() fails Message-ID: Bugs item #799428, was opened at 2003-09-02 17:58 Message generated for change (Comment added) made by perrygreenfield You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799428&group_id=5470 Category: Tkinter Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Perry Greenfield (perrygreenfield) Assigned to: Nobody/Anonymous (nobody) Summary: tk_focusNext() fails Initial Comment: Calls to the widget method tk_focusNext() fail with "unsubscriptable object" error. Looking at the Tkinter.py code for the routine shows this statement: name = self.tk.call('tk_focusNext', self._w) (line 433) which used to return a string in 2.2 but now returns a "cmdName object". When this is passed to self._nametowidget(name), it fails when it tries to subscript name (line 1006) since the object does not support indexing. Perhaps str(name) or name.string is more appropriate now? (when that change is made, it works--well, I tested name.string and that worked) Perry Greenfield (perry@stsci.edu) ---------------------------------------------------------------------- >Comment By: Perry Greenfield (perrygreenfield) Date: 2003-09-03 09:29 Message: Logged In: YES user_id=252130 Presumably the same problem exists with tk_focusPrev. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799428&group_id=5470 From noreply at sourceforge.net Wed Sep 3 02:15:31 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:11:43 2003 Subject: [Python-bugs-list] [ python-Bugs-799088 ] distutils ignored LDFLAGS in Makefile Message-ID: Bugs item #799088, was opened at 2003-09-02 13:40 Message generated for change (Comment added) made by sjoerd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799088&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: distutils ignored LDFLAGS in Makefile Initial Comment: Distutils ignores the LDFLAGS variable in the Python Makefile. This is bad, since LDFLAGS typically contains the -L linker flag telling the linker where to look for extra libraries. A possible patch is attached (if the checkbox works this time :-) ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2003-09-03 10:15 Message: Logged In: YES user_id=43607 This solution is fine with me. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 07:24 Message: Logged In: YES user_id=21627 I think this is incorrect: LDFLAGS should *not* be used by distutils. Instead, LDSHARED should incorporate LDFLAGS where needed. Atleast that is what is done on a number of platforms (*BSD, Darwin, ...). If your proposed route is taken, these incorporations would need to be undone, AFAICT. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799088&group_id=5470 From noreply at sourceforge.net Tue Sep 2 23:24:04 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:34:11 2003 Subject: [Python-bugs-list] [ python-Bugs-799088 ] distutils ignored LDFLAGS in Makefile Message-ID: Bugs item #799088, was opened at 2003-09-02 13:40 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799088&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: distutils ignored LDFLAGS in Makefile Initial Comment: Distutils ignores the LDFLAGS variable in the Python Makefile. This is bad, since LDFLAGS typically contains the -L linker flag telling the linker where to look for extra libraries. A possible patch is attached (if the checkbox works this time :-) ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 07:24 Message: Logged In: YES user_id=21627 I think this is incorrect: LDFLAGS should *not* be used by distutils. Instead, LDSHARED should incorporate LDFLAGS where needed. Atleast that is what is done on a number of platforms (*BSD, Darwin, ...). If your proposed route is taken, these incorporations would need to be undone, AFAICT. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799088&group_id=5470 From noreply at sourceforge.net Thu Sep 4 17:46:29 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:46:52 2003 Subject: [Python-bugs-list] [ python-Bugs-800796 ] Difference between hash() and __hash__() Message-ID: Bugs item #800796, was opened at 2003-09-04 23:46 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=800796&group_id=5470 Category: None Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Stefan Fleiter (fleiter) Assigned to: Nobody/Anonymous (nobody) Summary: Difference between hash() and __hash__() Initial Comment: Raymond told me in comp.lang.python to submit this bug, he is working on a fix. >>> s = slice(None,5) >>> s.__hash__() 136748064 >>> hash(s) Traceback (most recent call last): File "", line 1, in ? TypeError: unhashable type ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 From noreply at sourceforge.net Wed Sep 3 06:15:47 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:47:58 2003 Subject: [Python-bugs-list] [ python-Bugs-736407 ] Problem With email.MIMEText Package Message-ID: Bugs item #736407, was opened at 2003-05-12 05:41 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736407&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: John Abel (judasiscariot) Assigned to: Barry A. Warsaw (bwarsaw) Summary: Problem With email.MIMEText Package Initial Comment: Problem with email.MIMEText. I created a MIMEText message (following the example in the documentation). The problem occurs when as_string() is called. This is the traceback: File "/usr/local/lib/python2.3/email/Message.py", line 113, in as_string g.flatten(self, unixfrom=unixfrom) File "/usr/local/lib/python2.3/email/Generator.py", line 102, in flatten self._write(msg) File "/usr/local/lib/python2.3/email/Generator.py", line 137, in _write self._write_headers(msg) File "/usr/local/lib/python2.3/email/Generator.py", line 183, in _write_headers header_name=h, continuation_ws='\t').encode() File "/usr/local/lib/python2.3/email/Header.py", line 415, in encode return self._encode_chunks(newchunks, maxlinelen) File "/usr/local/lib/python2.3/email/Header.py", line 375, in _encode_chunks _max_append(chunks, s, maxlinelen, extra) File "/usr/local/lib/python2.3/email/quopriMIME.py", line 84, in _max_append L.append(s.lstrip()) AttributeError: 'list' object has no attribute 'lstrip' I'm using 2.3b1, on RH9. The same piece of code works with 2.2.2. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-09-03 08:15 Message: Logged In: YES user_id=12800 Sorry, but you're going to have to work harder at trying to boil down the buggy code. When I run ServerMonitor.py, I get an immediate traceback Traceback (most recent call last): File "ServerMonitor.py", line 18, in ? import ThreadUtils, NetMon ImportError: No module named ThreadUtils Here's one thing you can try to do: catch the exception in your code, then pickle the Message object up and post the pickle. I can at least reconstitute the pickle and look at the structure. Also, I'm guessing the problem is somewhere in ProcessMail() in PostITControl.py. Be sure that the mailBody argument is a string and nothing else. ---------------------------------------------------------------------- Comment By: John Abel (judasiscariot) Date: 2003-05-21 04:16 Message: Logged In: YES user_id=221478 The Config.ini will need to modifying to suit your machine settings. Run the ServerMonitor.py, and then run PostITControl.py. PostITControl.py crashes when trying to send a mail. ---------------------------------------------------------------------- Comment By: John Abel (judasiscariot) Date: 2003-05-21 04:13 Message: Logged In: YES user_id=221478 Sorry, been trying to narrow the code down. If I have a bare minimum script, it works, yet the original still fails. I'll upload the required files (3). ---------------------------------------------------------------------- Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-05-19 15:59 Message: Logged In: YES user_id=12800 I'm moving this to Pending since wthout more information I can't help. This starts the 14 day clock ticking. After 2 weeks this bug report will be closed, unless someone follows up with more information. ---------------------------------------------------------------------- Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-05-15 10:07 Message: Logged In: YES user_id=12800 Sorry, the attached code sample is incomplete. It is not sufficient for me to reproduce the problem. Please boil down your example to a self-contained -- but as small as possible -- example. ---------------------------------------------------------------------- Comment By: John Abel (judasiscariot) Date: 2003-05-15 05:32 Message: Logged In: YES user_id=221478 Sorry, forgot the comment. When running the script using python2.2 (email 2.4.3), I don't receive any errors, mail gets sent. It only seems to happen with 2.3b. ---------------------------------------------------------------------- Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-05-13 11:45 Message: Logged In: YES user_id=12800 Can you upload the exact code that you wrote that caused this crash? Please don't paste it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736407&group_id=5470 From noreply at sourceforge.net Thu Sep 4 17:49:59 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:50:23 2003 Subject: [Python-bugs-list] [ python-Bugs-800796 ] Difference between hash() and __hash__() Message-ID: Bugs item #800796, was opened at 2003-09-04 23:46 Message generated for change (Settings changed) made by fleiter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 Category: None Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Stefan Fleiter (fleiter) >Assigned to: Raymond Hettinger (rhettinger) Summary: Difference between hash() and __hash__() Initial Comment: Raymond told me in comp.lang.python to submit this bug, he is working on a fix. >>> s = slice(None,5) >>> s.__hash__() 136748064 >>> hash(s) Traceback (most recent call last): File "", line 1, in ? TypeError: unhashable type ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 From noreply at sourceforge.net Thu Sep 4 17:52:49 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 19:52:56 2003 Subject: [Python-bugs-list] [ python-Bugs-800796 ] Difference between hash() and __hash__() Message-ID: Bugs item #800796, was opened at 2003-09-04 23:46 Message generated for change (Comment added) made by fleiter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 Category: None Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Stefan Fleiter (fleiter) Assigned to: Raymond Hettinger (rhettinger) Summary: Difference between hash() and __hash__() Initial Comment: Raymond told me in comp.lang.python to submit this bug, he is working on a fix. >>> s = slice(None,5) >>> s.__hash__() 136748064 >>> hash(s) Traceback (most recent call last): File "", line 1, in ? TypeError: unhashable type ---------------------------------------------------------------------- >Comment By: Stefan Fleiter (fleiter) Date: 2003-09-04 23:52 Message: Logged In: YES user_id=502578 Terry J. Reedy commented in comp.lang.python: ------------------------------------------------------------------------- Ref Manual 5.3.3 Slicings says nothing about hashability. If not hashable, in spite of being mutable, "Slices are not hashable" could be added at end. Ref Manual 3.3.1 Basic customization, __hash__( self) entry says "Called for the key object for dictionary operations, and by the built-in function hash() " This implies to me that if there is a __hash__() method, then hash() will call it. If not true, then a 'maybe' could be added. Lif Maual 2.1 Built-in Functions, hash( object) says only "Return the hash value of the object (if it has one)." If having __hash__() does not mean 'has one', then what does. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 From noreply at sourceforge.net Tue Sep 2 21:16:22 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 21:03:28 2003 Subject: [Python-bugs-list] [ python-Bugs-780996 ] pynche does not start Message-ID: Bugs item #780996, was opened at 2003-07-31 13:47 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780996&group_id=5470 Category: Demos and Tools Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Mihai Ibanescu (misa) Assigned to: Barry A. Warsaw (bwarsaw) Summary: pynche does not start Initial Comment: On a Red Hat 9 box with python 2.3 compiled: -bash-2.05b# python /usr/lib/python2.3/site-packages/pynche/pynche Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pynche/pynche", line 7, in ? Main.main() File "/usr/lib/python2.3/site-packages/pynche/Main.py", line 220, in main dbfile=dbfile) File "/usr/lib/python2.3/site-packages/pynche/Main.py", line 130, in build dbfile = s.optiondb()['DBFILE'] KeyError: 'DBFILE' By looking at the constructor for Switchboard, if ~/.pynche is missing, then self.__optiondb is the empty hash. Copying a .pynche file from an older python makes pynche happy again. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-09-02 23:16 Message: Logged In: YES user_id=12800 Fixed in Main.py 2.23 (and backported) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780996&group_id=5470 From noreply at sourceforge.net Tue Sep 2 22:09:50 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 21:46:11 2003 Subject: [Python-bugs-list] [ python-Bugs-794466 ] email module param parsing bug Message-ID: Bugs item #794466, was opened at 2003-08-24 23:50 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794466&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Stuart D. Gathman (customdesigned) Assigned to: Barry A. Warsaw (bwarsaw) Summary: email module param parsing bug Initial Comment: Run the included test program in Python 2.2.2 or 2.3. ------------------ $ python2 testemail.py [('image/pjpeg', ''), ('name', '"Jim&'), ('&', ''), ('Jill"', '')] [('image/pjpeg', ''), ('name', 'Jim&&Jill')] The first answer is wrong. The second is correct. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-09-03 00:09 Message: Logged In: YES user_id=12800 Accepted your fix of _parseparamv(). Thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=794466&group_id=5470 From noreply at sourceforge.net Thu Sep 4 20:02:12 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 22:02:25 2003 Subject: [Python-bugs-list] [ python-Bugs-800824 ] test_dumbdbm failing Message-ID: Bugs item #800824, was opened at 2003-09-04 19: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=800824&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Brett Cannon (bcannon) Assigned to: Nobody/Anonymous (nobody) Summary: test_dumbdbm failing Initial Comment: Getting the following failures: test_close_twice (__main__.DumbDBMTestCase) ... ok test_dumbdbm_creation (__main__.DumbDBMTestCase) ... ok test_dumbdbm_keys (__main__.DumbDBMTestCase) ... ERROR test_dumbdbm_modification (__main__.DumbDBMTestCase) ... ERROR test_dumbdbm_read (__main__.DumbDBMTestCase) ... ERROR test_random (__main__.DumbDBMTestCase) ... ERROR test_write_write_read (__main__.DumbDBMTestCase) ... ERROR They all error out with the same problem: Traceback (most recent call last): File "Lib/test/test_dumbdbm.py", line 73, in test_write_write_read f = dumbdbm.open(_fname) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 232, in open return _Database(file, mode) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 73, in __init__ self._update() File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 84, in _update key, pos_and_siz_pair = eval(line) TypeError: expected string without null bytes test_whichdb is also failing for essentially the same reason although it is hidden under some executed code: test_whichdb_dbm (__main__.WhichDBTestCase) ... ok test_whichdb_dumbdbm (__main__.WhichDBTestCase) ... FAIL ===================================== ================================= FAIL: test_whichdb_dumbdbm (__main__.WhichDBTestCase) -------------------------------------------------------------------- -- Traceback (most recent call last): File "Lib/test/test_whichdb.py", line 56, in test_whichdb_name self.assertEqual(name, whichdb.whichdb(_fname)) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ unittest.py", line 292, in failUnlessEqual raise self.failureException, \ AssertionError: 'dumbdbm' != None If I run the test by hand by copy-n-paste in the interpreter I get the same error as above about null bytes. Now I compile with --enable-unicode=ucs4, if that has anything to do with it. This is all on OS X 10.2.6 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800824&group_id=5470 From noreply at sourceforge.net Tue Sep 2 21:35:26 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 22:10:12 2003 Subject: [Python-bugs-list] [ python-Bugs-737947 ] Failed assert in stringobject.c Message-ID: Bugs item #737947, was opened at 2003-05-14 18:51 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=737947&group_id=5470 Category: Python Interpreter Core Group: Python 2.2.1 Status: Open Resolution: None >Priority: 5 Submitted By: Fernando P?rez (fer_perez) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Failed assert in stringobject.c Initial Comment: Here's how to reproduce the problem: [~]> cat test.py import readline readline.get_completer_delims() [~]> echo 'execfile("test.py");print 10' | python python: Objects/stringobject.c:111: PyString_FromString: Assertion `str !=((void *)0)' failed. Abort This was tested with 2.2.1 under RedHat 8.0. On c.l.py, a Mandrake 9.0 (py2.2.2) user reported a segfault with the same. Martin reported not seeing the problem with 2.3b1. However, others suggested still filing it for a possible backport, and also in case the fix was accidental. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2003-09-02 23:35 Message: Logged In: YES user_id=12800 I obviously didn't get to this for 2.2.3. Reassigning to Fred who threatened to be the 2.2.4 RM. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-05-22 17:14 Message: Logged In: YES user_id=33168 Barry, should this be handled for 2.2.3? ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-05-14 22:28 Message: Logged In: YES user_id=33168 revision 2.54 in Modules/readline.c fixed this problem. Patch #512981: Update readline input stream on sys.stdin/out change. The patch must be modified for 2.2.3 because there is an API change. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=737947&group_id=5470 From noreply at sourceforge.net Thu Sep 4 20:18:45 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 22:18:49 2003 Subject: [Python-bugs-list] [ python-Bugs-800828 ] Doc bug in PEP-0278 Message-ID: Bugs item #800828, was opened at 2003-09-04 21:18 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=800828&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) Assigned to: Nobody/Anonymous (nobody) Summary: Doc bug in PEP-0278 Initial Comment: PEP 278 suggests that the proper way to test for universal newline support is 'hasattr (sys.stdout, "newline")' However, this doesn't work too well when sys.stdout is overridden. One big example of this is PythonWin's sys.stdout, which doesn't have an newlines attribute even when it is supported by python23.dll. Testing 'hasattr(file, "newlines")' seems to be a more reliable way to test. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800828&group_id=5470 From noreply at sourceforge.net Thu Sep 4 20:23:50 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 22:23:57 2003 Subject: [Python-bugs-list] [ python-Bugs-800828 ] Doc bug in PEP-0278 Message-ID: Bugs item #800828, was opened at 2003-09-04 21:18 Message generated for change (Settings changed) made by logistix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800828&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) >Assigned to: Jack Jansen (jackjansen) Summary: Doc bug in PEP-0278 Initial Comment: PEP 278 suggests that the proper way to test for universal newline support is 'hasattr (sys.stdout, "newline")' However, this doesn't work too well when sys.stdout is overridden. One big example of this is PythonWin's sys.stdout, which doesn't have an newlines attribute even when it is supported by python23.dll. Testing 'hasattr(file, "newlines")' seems to be a more reliable way to test. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800828&group_id=5470 From noreply at sourceforge.net Thu Sep 4 19:53:12 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 22:25:06 2003 Subject: [Python-bugs-list] [ python-Bugs-791542 ] test_threading Message-ID: Bugs item #791542, was opened at 2003-08-19 14:32 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=791542&group_id=5470 Category: Build Group: Python 2.2.3 Status: Open Resolution: None Priority: 5 Submitted By: Shawn Leard (sleard1) Assigned to: Nobody/Anonymous (nobody) Summary: test_threading Initial Comment: Due the problems reported with version 2.3 I thought I would give version 2.2.3 a shot. The problem I am having here is no matter what switches I pass configure to disable threading it still tries to test them and as a result the make test fails. 168 tests OK. 1 test failed: test_threading 24 tests skipped: test_al test_asynchat test_bsddb test_cd test_cl test_curses test_dl test_email_codecs test_fork1 test_gl test_imgfile test_linuxaudiodev test_minidom test_openpty test_pyexpat test_queue test_sax test_socket_ssl test_socketserver test_thread test_threaded_import test_threadedtempfile test_winreg test_winsound -------- ./configure --prefix=/usr/local --with-gnu-ld --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld --enable-nls --with-included-gettext --with-fpectl --with-threads=no --without-threads --disable-threads --with-gnu-as -------- mars$ /files/local/src/Python-2.2.3/python test_threading.py Traceback (most recent call last): File "test_threading.py", line 7, in ? import threading File "/files/local/src/Python-2.2.3/Lib/threading.py", line 5, in ? import thread ImportError: No module named thread ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-04 18:53 Message: Logged In: YES user_id=357491 In order to better debug this, can you state what the line says when test_threading fails; e.g., "test_sunaudiodev skipped -- ..."? The test will be run regardless of whether you compiled with threads or not, but it should be listed as a skip instead of a failure. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=791542&group_id=5470 From noreply at sourceforge.net Wed Sep 3 02:14:13 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 23:35:54 2003 Subject: [Python-bugs-list] [ python-Bugs-799104 ] CPPFLAGS should not be aded to ldshard command Message-ID: Bugs item #799104, was opened at 2003-09-02 14:31 Message generated for change (Comment added) made by sjoerd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799104&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: CPPFLAGS should not be aded to ldshard command Initial Comment: CPPFLAGS contains flags for the C preprocessor. It has no business being added to the ldshared command (this is in sysconfig.py). In fact, it may be harmful since the ldshared command may well be ld with some flags which typically does not understand cpp flags. Irix where the ldshared command is "ld -shared -all" is a good example of where it is plain wrong to add CPPFLAGS. ---------------------------------------------------------------------- >Comment By: Sjoerd Mullender (sjoerd) Date: 2003-09-03 10:14 Message: Logged In: YES user_id=43607 I maintain that CPPFLAGS has no business being part of LDSHARED. LDSHARED is used at link time only, and the C preprocessor is not in any way involved in that step. If you can come up with a better way of creating shared libraries on Irix, be my guest. The current way has served us well for many years. Looking at configure.in, it's mostly gcc based systems that use gcc to do the linking of shared libraries. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 07:19 Message: Logged In: YES user_id=21627 OTOH, it also seems wrong that, on Irix, ldshared is "ld -shared -all". ld should never be used directly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799104&group_id=5470 From noreply at sourceforge.net Tue Sep 2 23:19:14 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Sep 4 23:50:32 2003 Subject: [Python-bugs-list] [ python-Bugs-799104 ] CPPFLAGS should not be aded to ldshard command Message-ID: Bugs item #799104, was opened at 2003-09-02 14:31 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799104&group_id=5470 Category: Distutils Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sjoerd Mullender (sjoerd) Assigned to: Nobody/Anonymous (nobody) Summary: CPPFLAGS should not be aded to ldshard command Initial Comment: CPPFLAGS contains flags for the C preprocessor. It has no business being added to the ldshared command (this is in sysconfig.py). In fact, it may be harmful since the ldshared command may well be ld with some flags which typically does not understand cpp flags. Irix where the ldshared command is "ld -shared -all" is a good example of where it is plain wrong to add CPPFLAGS. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-03 07:19 Message: Logged In: YES user_id=21627 OTOH, it also seems wrong that, on Irix, ldshared is "ld -shared -all". ld should never be used directly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799104&group_id=5470 From noreply at sourceforge.net Fri Sep 5 00:59:49 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 03:00:00 2003 Subject: [Python-bugs-list] [ python-Bugs-800899 ] Making "|" directive from REs a bit clearer Message-ID: Bugs item #800899, was opened at 2003-09-05 08:59 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=800899&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Wojtek Walczak (gminick) Assigned to: Nobody/Anonymous (nobody) Summary: Making "|" directive from REs a bit clearer Initial Comment: Let's take a look, Library Reference, 4.2.1 Regular Expression Syntax says: "|" A|B, where A and B can be arbitrary REs, creates a regular expression that will match either A or B. [...] !!here_starts_the_darkness!! REs separated by "|" are tried from left to right, and the first one that allows the complete pattern to match is considered the accepted branch. This means that if A matches, B will never be tested, even if it would produce a longer overall match. !!here_ends_the_darkness!! It's not as clear as it can be. For more information take a look at: Here's a proposal from Terry Reedy for changing those lines from darkness ;-) """As the target string is scanned, REs separated by "|" are tried from left to right. When one pattern completely matches, that branch is accepted. This means that once A matches, B will not be tested further, even if it would produce a longer overall match.""" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800899&group_id=5470 From noreply at sourceforge.net Fri Sep 5 02:00:28 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 04:00:32 2003 Subject: [Python-bugs-list] [ python-Feature Requests-800926 ] Python version numbers in headers/footers PDF documentation Message-ID: Feature Requests item #800926, was opened at 2003-09-05 08:00 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=800926&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Giles Antonio Radford (mewf) Assigned to: Nobody/Anonymous (nobody) Summary: Python version numbers in headers/footers PDF documentation Initial Comment: To avoid much confusion with swathes of printouts that I have lying around, it would be really useful to get a little header or footer saying "Python Library Reference v. 2.3" or "Python Language Reference v.2.4beta". The HTML versions already have this, but it would be nice to have it in the hard copy versions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=800926&group_id=5470 From noreply at sourceforge.net Fri Sep 5 02:04:40 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 04:04:45 2003 Subject: [Python-bugs-list] [ python-Feature Requests-800929 ] Module-specific PDFs Message-ID: Feature Requests item #800929, was opened at 2003-09-05 08:04 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=800929&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Giles Antonio Radford (mewf) Assigned to: Nobody/Anonymous (nobody) Summary: Module-specific PDFs Initial Comment: I regularly find myself printing out individual module documentation, and at the moment, the only way I've found is by printing out the relevant pages from the full library docs, which is confusing, as the name of the module this printout pertains to is not immediately obvious at the top of the front page. I'm wondering if it would be possible to do invidual PDFs of each module's documentation, downloadable, say, from the HTML documentation pages for that modules. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=800929&group_id=5470 From noreply at sourceforge.net Fri Sep 5 07:45:16 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 09:45:33 2003 Subject: [Python-bugs-list] [ python-Bugs-799369 ] documentation for sys.platform is unclear Message-ID: Bugs item #799369, was opened at 2003-09-02 22:16 Message generated for change (Comment added) made by jackjansen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799369&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Bram Moolenaar (vimboss) Assigned to: Nobody/Anonymous (nobody) Summary: documentation for sys.platform is unclear Initial Comment: The use of sys.platform is very risky, because it is not at all clear what the possible values are. For example, on Mac OS X "darwin" is used, but this can only be discovered by trying it out and asking Jack when another value will be used. Another problem is that the examples given include a number, which suggests that an OS version number might be included here. Is that only a major version number? And why doesn't Mac OS X report "macosx10.2"? Suggestion: Add a list of known values and for what platforms they are used. ---------------------------------------------------------------------- >Comment By: Jack Jansen (jackjansen) Date: 2003-09-05 15:45 Message: Logged In: YES user_id=45365 A first step would be to document that for Unix the value is based on the information returned by "uname" *at the time of building Python*, mapped to lowercase and with some cruft removed. For other platforms for which the value is known (Windows, MacOS9) we could document the actual values. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799369&group_id=5470 From noreply at sourceforge.net Fri Sep 5 08:40:01 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 10:40:12 2003 Subject: [Python-bugs-list] [ python-Bugs-800796 ] Difference between hash() and __hash__() Message-ID: Bugs item #800796, was opened at 2003-09-04 18:46 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 >Category: Python Interpreter Core Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Stefan Fleiter (fleiter) Assigned to: Raymond Hettinger (rhettinger) Summary: Difference between hash() and __hash__() Initial Comment: Raymond told me in comp.lang.python to submit this bug, he is working on a fix. >>> s = slice(None,5) >>> s.__hash__() 136748064 >>> hash(s) Traceback (most recent call last): File "", line 1, in ? TypeError: unhashable type ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-05 09:40 Message: Logged In: YES user_id=80475 Fixed. Now, they both raise TypeError. See Objects/sliceobject.c 2.21.16.1 and 2.22. Thanks for the bug report. ---------------------------------------------------------------------- Comment By: Stefan Fleiter (fleiter) Date: 2003-09-04 18:52 Message: Logged In: YES user_id=502578 Terry J. Reedy commented in comp.lang.python: ------------------------------------------------------------------------- Ref Manual 5.3.3 Slicings says nothing about hashability. If not hashable, in spite of being mutable, "Slices are not hashable" could be added at end. Ref Manual 3.3.1 Basic customization, __hash__( self) entry says "Called for the key object for dictionary operations, and by the built-in function hash() " This implies to me that if there is a __hash__() method, then hash() will call it. If not true, then a 'maybe' could be added. Lif Maual 2.1 Built-in Functions, hash( object) says only "Return the hash value of the object (if it has one)." If having __hash__() does not mean 'has one', then what does. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800796&group_id=5470 From noreply at sourceforge.net Fri Sep 5 13:03:07 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 15:03:24 2003 Subject: [Python-bugs-list] [ python-Bugs-801306 ] Bad RE in scanf example Message-ID: Bugs item #801306, was opened at 2003-09-05 14: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=801306&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jimm Domingo (jimm_domingo) Assigned to: Nobody/Anonymous (nobody) Summary: Bad RE in scanf example Initial Comment: In section 4.2.6 "Examples" of the Python Library Reference, the regular expression for scanf format tokens %e, %E, %f, %g does not allow an optional sign in the exponent. The RE should be: [-+]?(\d+(\.\d*)?|\d*\.\d+)([eE][-+]?\d+)? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801306&group_id=5470 From noreply at sourceforge.net Fri Sep 5 14:21:15 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 16:21:26 2003 Subject: [Python-bugs-list] [ python-Bugs-801342 ] Bug (documentation or real, your choice) in random.sample. Message-ID: Bugs item #801342, was opened at 2003-09-05 16:21 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=801342&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Fincher (jemfinch) Assigned to: Nobody/Anonymous (nobody) Summary: Bug (documentation or real, your choice) in random.sample. Initial Comment: First, the bug: >>> s Set([1, 2, 4, 5, 6, 34]) >>> random.sample(s, 1) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/random.py", line 266, in sample result[i] = selected[j] = population[j] TypeError: unindexable object The interesting thing is this: >>> random.sample(s, 4) [6, 4, 2, 5] So it works when the sample size is sufficiently large, but not when it's small relative to the size of the population. Now, the documentation: >>> print random.sample.__doc__ Chooses k unique random elements from a population sequence. I think either the documentation needs to be changed to indicate that the sequence must be indexable, or the behavior when the sample is small relative to the population should be changed to allow non-indexable sequences. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801342&group_id=5470 From noreply at sourceforge.net Fri Sep 5 14:26:30 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 16:26:32 2003 Subject: [Python-bugs-list] [ python-Bugs-801342 ] Bug (documentation or real, your choice) in random.sample. Message-ID: Bugs item #801342, was opened at 2003-09-05 15:21 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801342&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Fincher (jemfinch) >Assigned to: Raymond Hettinger (rhettinger) Summary: Bug (documentation or real, your choice) in random.sample. Initial Comment: First, the bug: >>> s Set([1, 2, 4, 5, 6, 34]) >>> random.sample(s, 1) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/random.py", line 266, in sample result[i] = selected[j] = population[j] TypeError: unindexable object The interesting thing is this: >>> random.sample(s, 4) [6, 4, 2, 5] So it works when the sample size is sufficiently large, but not when it's small relative to the size of the population. Now, the documentation: >>> print random.sample.__doc__ Chooses k unique random elements from a population sequence. I think either the documentation needs to be changed to indicate that the sequence must be indexable, or the behavior when the sample is small relative to the population should be changed to allow non-indexable sequences. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801342&group_id=5470 From noreply at sourceforge.net Fri Sep 5 14:28:59 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 16:29:02 2003 Subject: [Python-bugs-list] [ python-Bugs-801349 ] New slice behaviour. Bug or feature? Message-ID: Bugs item #801349, was opened at 2003-09-05 15: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=801349&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) Assigned to: Nobody/Anonymous (nobody) Summary: New slice behaviour. Bug or feature? Initial Comment: Using a slice of x[:None] returns the whole list. I would thing that if this sort of statement is valid, it should return an empty list, like x[:0]. In 2.2, you'll get an error with this statement. This bit me when I was using None as a sentinel. I'll be able to write a patch when I find out what the desired behaviour is (fine as-is, None should behave as 0, it should throw an error, or other) assuming sf's cvs is playing nice. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\grant>c:\python23\python 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. >>> a = [1,2,3,4] >>> a[:None] [1, 2, 3, 4] >>> ^Z C:\Documents and Settings\grant>c:\python22\python 'import site' failed; use -v for traceback Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a = [1,2,3,4] >>> a[:None] Traceback (most recent call last): File "", line 1, in ? TypeError: sequence index must be integer >>> ^Z C:\Documents and Settings\grant> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801349&group_id=5470 From noreply at sourceforge.net Fri Sep 5 15:28:57 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 17:29:02 2003 Subject: [Python-bugs-list] [ python-Bugs-801306 ] Bad RE in scanf example Message-ID: Bugs item #801306, was opened at 2003-09-05 14:03 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801306&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jimm Domingo (jimm_domingo) >Assigned to: Raymond Hettinger (rhettinger) Summary: Bad RE in scanf example Initial Comment: In section 4.2.6 "Examples" of the Python Library Reference, the regular expression for scanf format tokens %e, %E, %f, %g does not allow an optional sign in the exponent. The RE should be: [-+]?(\d+(\.\d*)?|\d*\.\d+)([eE][-+]?\d+)? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801306&group_id=5470 From noreply at sourceforge.net Fri Sep 5 15:45:13 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 17:45:18 2003 Subject: [Python-bugs-list] [ python-Bugs-801342 ] Bug (documentation or real, your choice) in random.sample. Message-ID: Bugs item #801342, was opened at 2003-09-05 15:21 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801342&group_id=5470 Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jeremy Fincher (jemfinch) Assigned to: Raymond Hettinger (rhettinger) Summary: Bug (documentation or real, your choice) in random.sample. Initial Comment: First, the bug: >>> s Set([1, 2, 4, 5, 6, 34]) >>> random.sample(s, 1) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/random.py", line 266, in sample result[i] = selected[j] = population[j] TypeError: unindexable object The interesting thing is this: >>> random.sample(s, 4) [6, 4, 2, 5] So it works when the sample size is sufficiently large, but not when it's small relative to the size of the population. Now, the documentation: >>> print random.sample.__doc__ Chooses k unique random elements from a population sequence. I think either the documentation needs to be changed to indicate that the sequence must be indexable, or the behavior when the sample is small relative to the population should be changed to allow non-indexable sequences. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-05 16:45 Message: Logged In: YES user_id=80475 This isn't a bug, documentation or otherwise. The docs specified that the population argument be a sequence (meaning that it defines __len__ and is indexable). However, I do see the usefulness of taking samples of sets, so I fixed-up the code to accept sets, dictionaries, files, and other iterables defining __len__() that aren't indexable. See: Lib/random.py 1.51.8.2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801342&group_id=5470 From noreply at sourceforge.net Fri Sep 5 16:15:42 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 18:15:48 2003 Subject: [Python-bugs-list] [ python-Bugs-775012 ] No syntax hilite on new file until saved as *.py Message-ID: Bugs item #775012, was opened at 2003-07-21 08:35 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775012&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open >Resolution: Accepted >Priority: 4 Submitted By: Andy Jewell (cybervegan) Assigned to: Kurt B. Kaiser (kbk) Summary: No syntax hilite on new file until saved as *.py Initial Comment: python 2.3c1, on windows xp, uk english. When typing or pasting into a new text window, no syntax highlighting appears until the file is saved with a .py name. I know it doesn't make sense to python-syntax highlight a non-python file, but shouldn't it default to highlighting? IDLE never used to do this - I assume it's a quirk of IDLEfork (maybe intentional behaviour i suppose). ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 17:15 Message: Logged In: YES user_id=149084 The following from GvR on IDLEfork Bug 763524 30Jun03: "I've been using the latest version from Python CVS on Win9: quite intensively over the last week. Some observations: - When reusing a blank untitled window to edit a Text file, it keeps using Python coloring. - When saving a Python with a non-Python extension (e.g. .txt), it keeps the coloring. - When switching off coloring by saving an untitle buffer as a non-Python extension (e.g. .txt), it keeps existing coloring. - When opening a file reuses a blank untitled window, it doesn't set the focus on the window." ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775012&group_id=5470 From noreply at sourceforge.net Fri Sep 5 17:13:00 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 19:13:05 2003 Subject: [Python-bugs-list] [ python-Bugs-775061 ] 2 problems with IDLE Message-ID: Bugs item #775061, was opened at 2003-07-21 10:08 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open >Resolution: Accepted >Priority: 3 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Kurt B. Kaiser (kbk) Summary: 2 problems with IDLE Initial Comment: Lib/idlelib/idle.py should use #!/usr/bin/env python not /usr/bin/python so the user can modify their path to execute the correct version of python. In Lib/idlelib/rpc.py around line 623, svr.register (svr is an RPCServer instance) is called, but there is no register method AFAICT. ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 18:13 Message: Logged In: YES user_id=149084 I use (from the idlelib dir): ../../python ./PyShell.py to start an uninstalled IDLE for testing. There is a more elaborate idle.py in IDLEfork which allows starting an uninstalled IDLEfork from anywhere in the file system. Maybe something like that would be useful to someone? It's not useful to me, I either use the above, or call my installed version (which is the latest official release) from outside that directory. There is always an installed IDLE now. I recommend removing the idle script from idlelib, since it is actually installed from Tools/scripts. The files there uniformly start with #! /usr/bin/env python. Exceptions: gprof2html.py, parseentities.py Without objection, I'm going to remove idlelib/idle. As far as the RPCServer issue goes, this is defunct test code. I'll comment it out for now. A proper unit test of the rpc.py module is needed. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-07-21 21:19 Message: Logged In: YES user_id=33168 Hmmm, I do remember something about distutils rewriting the line, but I'm not sure. My problem was that I was running an uninstalled version in the CVS tree: ./Lib/idlelib/idle Perhaps this isn't a bug. RPCServer still appears to be a problem either way. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-07-21 17:43 Message: Logged In: YES user_id=21627 I fail to see the first problem. Shouldn't distutils replace the path in #! with sys.exec_prefix? /usr/bin/env should *not* be used, as this might be a different python than the one IDLE was installed for. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 From noreply at sourceforge.net Fri Sep 5 17:17:06 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 19:17:11 2003 Subject: [Python-bugs-list] [ python-Bugs-780887 ] recent-files defaulted to strange place and bad permissions Message-ID: Bugs item #780887, was opened at 2003-07-31 09:48 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780887&group_id=5470 Category: IDLE Group: Python 2.3 >Status: Pending Resolution: None >Priority: 3 Submitted By: Lloyd Hugh Allen (lha2) Assigned to: Kurt B. Kaiser (kbk) Summary: recent-files defaulted to strange place and bad permissions Initial Comment: After a non-admin install of Python 2.3 with Python 2.2 admin-installed, I got: C:\Python23\Lib\idlelib>c:\python23\python idle.py Traceback (most recent call last): File "idle.py", line 23, in ? idlelib.PyShell.main() File "C:\Python23\lib\idlelib\PyShell.py", line 1277, in main flist.pyshell = PyShell(flist) File "C:\Python23\lib\idlelib\PyShell.py", line 721, in __init__ OutputWindow.__init__(self, flist, None, None) File "C:\Python23\lib\idlelib\OutputWindow.py", line 16, in __init__ EditorWindow.__init__(self, *args) File "C:\Python23\lib\idlelib\EditorWindow.py", line 181, in __init__ self.UpdateRecentFilesList() File "C:\Python23\lib\idlelib\EditorWindow.py", line 580, in UpdateRecentFilesList RFfile=open(self.recentFilesPath,'r') IOError: [Errno13] Permission denied: 'F:\.idlerc\recent- files.lst' ====== I have a login to a university server, and the F drive is the user drive. I don't recall specifying that anything should be kept on the F drive, and would prefer that recent files be kept on the local machine. Changing my own permissions to .idlerc to allow full permissions, and to apply these permissions to contents, worked and resolved the problem, except that multiple users use the same network drive and will now share recent files. Idle 1.0 under the brand-spanking-new Python2.3, with Windows XP Professional 5.1.2600 Service Pack 1 Build 2600. ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 18:17 Message: Logged In: YES user_id=149084 No response from OP, change status to Pending. ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-08-13 23:58 Message: Logged In: YES user_id=149084 What are the vaules of HOME HOMEDRIVE USERPROFILE on your machine? ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-08-03 13:23 Message: Logged In: YES user_id=21627 IDLE first tries %HOME%, then %HOMEDRIVE%/%HOMEPATH% The latter is the system convention, so IDLE should follow it. So setting the HOME environment variable should fix this problem. Is this a sufficient solution? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780887&group_id=5470 From noreply at sourceforge.net Fri Sep 5 17:26:17 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 19:26:20 2003 Subject: [Python-bugs-list] [ python-Bugs-783887 ] Tab / Space Configuration Does Not Work in IDLE Message-ID: Bugs item #783887, was opened at 2003-08-05 22:00 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=783887&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: None >Priority: 3 Submitted By: Andy Huibers (ahuibers) Assigned to: Kurt B. Kaiser (kbk) Summary: Tab / Space Configuration Does Not Work in IDLE Initial Comment: On Python 2.3/IDLE 1.0, when I go from the editor to: Options->Configure Idle->Font/Tabs And set it to "Tab key inserts tabs" what actually happens is that the tab key inserts spaces (4 spaces). ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 18:26 Message: Logged In: YES user_id=149084 I can reproduce this on XP and Linux. Of course, everyone should use 4 spaces :) ---------------------------------------------------------------------- Comment By: Andy Huibers (ahuibers) Date: 2003-08-06 14:09 Message: Logged In: YES user_id=838612 Mmm.. I re-installed the Windows Python-2.3 installer EXE on a fresh PC and I have the problem, even when I hit "Apply" and "OK". It is not a big deal of course, but would be nice if it worked.. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-06 00:17 Message: Logged In: YES user_id=80475 I cannot reproduce the problem. This may be a silly question, but did you click Apply after changing the setting? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=783887&group_id=5470 From noreply at sourceforge.net Fri Sep 5 17:51:13 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 19:51:22 2003 Subject: [Python-bugs-list] [ python-Bugs-790162 ] a bug in IDLE on Python 2.3 i think Message-ID: Bugs item #790162, was opened at 2003-08-17 13:18 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=790162&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open >Resolution: Works For Me >Priority: 3 Submitted By: Ricardo Nunes Cerqueira (caifas1800) Assigned to: Kurt B. Kaiser (kbk) Summary: a bug in IDLE on Python 2.3 i think Initial Comment: Hi, my name is Ricardo and i think there is a bug in the new release of Python 2.3. When i open a .py file with IDLE(after opening IDLE i open another .py file with it) the second window does not close after clicking the respective button, only the first(when i click the first window of IDLE) that has no code inserted, after trying to close the group(2 windows) only the first (the first IDLE window with no code inserted) closes leaving the other with code inserted open. i'm using Python 2.3 on Windows XP under an Intel PIII 1000EB FC-PGA. What i described happens after i open Python win then i open IDLE and then i open a .py file with IDLE, and when i try to close the .py and i can't. thanks ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 18:51 Message: Logged In: YES user_id=149084 Assuming that IDLE is configured to open a shell (the default action), then opening a .py file and closing that .py window works for me. Assuming that IDLE is configured to open an edit window, it comes up empty. If you then open a .py, the empty window is replaced with the whatever.py file and can be closed. Works for me. Assuming you start python, and then in the interactive window "import idle", the windows open and close correctly, as far as I can tell. I'm using XP / SP 1 / P4 2.4 Please provide (in short sentences) a precise recipe to reproduce your problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=790162&group_id=5470 From noreply at sourceforge.net Fri Sep 5 19:31:26 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 21:31:33 2003 Subject: [Python-bugs-list] [ python-Bugs-801349 ] New slice behaviour. Bug or feature? Message-ID: Bugs item #801349, was opened at 2003-09-05 16:28 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801349&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) >Assigned to: Michael Hudson (mwh) Summary: New slice behaviour. Bug or feature? Initial Comment: Using a slice of x[:None] returns the whole list. I would thing that if this sort of statement is valid, it should return an empty list, like x[:0]. In 2.2, you'll get an error with this statement. This bit me when I was using None as a sentinel. I'll be able to write a patch when I find out what the desired behaviour is (fine as-is, None should behave as 0, it should throw an error, or other) assuming sf's cvs is playing nice. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\grant>c:\python23\python 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. >>> a = [1,2,3,4] >>> a[:None] [1, 2, 3, 4] >>> ^Z C:\Documents and Settings\grant>c:\python22\python 'import site' failed; use -v for traceback Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a = [1,2,3,4] >>> a[:None] Traceback (most recent call last): File "", line 1, in ? TypeError: sequence index must be integer >>> ^Z C:\Documents and Settings\grant> ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2003-09-05 21:31 Message: Logged In: YES user_id=33168 Michael, do you think happened with your extended slice changes? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801349&group_id=5470 From noreply at sourceforge.net Fri Sep 5 20:04:37 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 22:04:41 2003 Subject: [Python-bugs-list] [ python-Bugs-775061 ] 2 problems with IDLE Message-ID: Bugs item #775061, was opened at 2003-07-21 10:08 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: Accepted Priority: 3 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Kurt B. Kaiser (kbk) Summary: 2 problems with IDLE Initial Comment: Lib/idlelib/idle.py should use #!/usr/bin/env python not /usr/bin/python so the user can modify their path to execute the correct version of python. In Lib/idlelib/rpc.py around line 623, svr.register (svr is an RPCServer instance) is called, but there is no register method AFAICT. ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 21:04 Message: Logged In: YES user_id=149084 My idea on how to resolve this: remove the "idle" script from idlelib and remove the shebang from idlelib/idle.py so it has to be called explicitly. Any objections? ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 18:13 Message: Logged In: YES user_id=149084 I use (from the idlelib dir): ../../python ./PyShell.py to start an uninstalled IDLE for testing. There is a more elaborate idle.py in IDLEfork which allows starting an uninstalled IDLEfork from anywhere in the file system. Maybe something like that would be useful to someone? It's not useful to me, I either use the above, or call my installed version (which is the latest official release) from outside that directory. There is always an installed IDLE now. I recommend removing the idle script from idlelib, since it is actually installed from Tools/scripts. The files there uniformly start with #! /usr/bin/env python. Exceptions: gprof2html.py, parseentities.py Without objection, I'm going to remove idlelib/idle. As far as the RPCServer issue goes, this is defunct test code. I'll comment it out for now. A proper unit test of the rpc.py module is needed. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-07-21 21:19 Message: Logged In: YES user_id=33168 Hmmm, I do remember something about distutils rewriting the line, but I'm not sure. My problem was that I was running an uninstalled version in the CVS tree: ./Lib/idlelib/idle Perhaps this isn't a bug. RPCServer still appears to be a problem either way. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-07-21 17:43 Message: Logged In: YES user_id=21627 I fail to see the first problem. Shouldn't distutils replace the path in #! with sys.exec_prefix? /usr/bin/env should *not* be used, as this might be a different python than the one IDLE was installed for. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 From noreply at sourceforge.net Fri Sep 5 20:08:31 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 22:08:34 2003 Subject: [Python-bugs-list] [ python-Bugs-801486 ] markup error(lib/libtest.tex) Message-ID: Bugs item #801486, was opened at 2003-09-06 11:08 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=801486&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: markup error(lib/libtest.tex) Initial Comment: Library Reference of test.testsupport seems to fail translating to HTML document. The subsection title is something odd. 5.4.1 [test.testsupport]test.test_support -- -- Utility functions for tests I guess this part is intended to look like this: 5.4.1 test.test_support -- -- Utility functions for tests The corresponding tex source is as follows: \subsection{\module[test.testsupport] {test.test_support} --- --- Utility functions for tests} \declaremodule[test.testsupport]{standard} {test.test_support} ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801486&group_id=5470 From noreply at sourceforge.net Fri Sep 5 20:10:55 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 22:10:59 2003 Subject: [Python-bugs-list] [ python-Bugs-775061 ] 2 problems with IDLE Message-ID: Bugs item #775061, was opened at 2003-07-21 11:08 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 Category: IDLE Group: Python 2.3 Status: Open Resolution: Accepted Priority: 3 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Kurt B. Kaiser (kbk) Summary: 2 problems with IDLE Initial Comment: Lib/idlelib/idle.py should use #!/usr/bin/env python not /usr/bin/python so the user can modify their path to execute the correct version of python. In Lib/idlelib/rpc.py around line 623, svr.register (svr is an RPCServer instance) is called, but there is no register method AFAICT. ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2003-09-05 22:10 Message: Logged In: YES user_id=33168 No objection from me. ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 22:04 Message: Logged In: YES user_id=149084 My idea on how to resolve this: remove the "idle" script from idlelib and remove the shebang from idlelib/idle.py so it has to be called explicitly. Any objections? ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2003-09-05 19:13 Message: Logged In: YES user_id=149084 I use (from the idlelib dir): ../../python ./PyShell.py to start an uninstalled IDLE for testing. There is a more elaborate idle.py in IDLEfork which allows starting an uninstalled IDLEfork from anywhere in the file system. Maybe something like that would be useful to someone? It's not useful to me, I either use the above, or call my installed version (which is the latest official release) from outside that directory. There is always an installed IDLE now. I recommend removing the idle script from idlelib, since it is actually installed from Tools/scripts. The files there uniformly start with #! /usr/bin/env python. Exceptions: gprof2html.py, parseentities.py Without objection, I'm going to remove idlelib/idle. As far as the RPCServer issue goes, this is defunct test code. I'll comment it out for now. A proper unit test of the rpc.py module is needed. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-07-21 22:19 Message: Logged In: YES user_id=33168 Hmmm, I do remember something about distutils rewriting the line, but I'm not sure. My problem was that I was running an uninstalled version in the CVS tree: ./Lib/idlelib/idle Perhaps this isn't a bug. RPCServer still appears to be a problem either way. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-07-21 18:43 Message: Logged In: YES user_id=21627 I fail to see the first problem. Shouldn't distutils replace the path in #! with sys.exec_prefix? /usr/bin/env should *not* be used, as this might be a different python than the one IDLE was installed for. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=775061&group_id=5470 From noreply at sourceforge.net Fri Sep 5 21:50:32 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 5 23:50:37 2003 Subject: [Python-bugs-list] [ python-Bugs-520325 ] Double underscore needs clarification Message-ID: Bugs item #520325, was opened at 2002-02-19 23:44 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=520325&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Wayne C. Smith (wcsmith) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Double underscore needs clarification Initial Comment: Double underscore (DU) is pervasive in Python but nowhere is clearly explained. In print and onscreen from formatted html it is visually ambiguous because the DUs run together to appear as one. The table in 2.3.2 of the Reference Manual 2.3a0 2/4/02 presents the contrast with single underscore but it is subtle. The usage of DU should be clarified in accompanying text and perhaps mentioned again in the Library Reference. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-09-05 23:50 Message: Logged In: YES user_id=3066 I've substantially elaborated the explanations at that point in the reference manual in Doc/ref/ref2.tex: Python 2.2.4: revision 1.34.6.8 Python 2.3.1: revision 1.48.10.1 Python 2.4: revision 1.49 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=520325&group_id=5470 From noreply at sourceforge.net Fri Sep 5 22:40:51 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 00:40:55 2003 Subject: [Python-bugs-list] [ python-Bugs-801486 ] markup error(lib/libtest.tex) Message-ID: Bugs item #801486, was opened at 2003-09-05 21:08 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801486&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: markup error(lib/libtest.tex) Initial Comment: Library Reference of test.testsupport seems to fail translating to HTML document. The subsection title is something odd. 5.4.1 [test.testsupport]test.test_support -- -- Utility functions for tests I guess this part is intended to look like this: 5.4.1 test.test_support -- -- Utility functions for tests The corresponding tex source is as follows: \subsection{\module[test.testsupport] {test.test_support} --- --- Utility functions for tests} \declaremodule[test.testsupport]{standard} {test.test_support} ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-05 23:40 Message: Logged In: YES user_id=80475 Fixed! Thanks for the report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801486&group_id=5470 From noreply at sourceforge.net Fri Sep 5 22:44:36 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 00:44:40 2003 Subject: [Python-bugs-list] [ python-Bugs-792649 ] RESET_ERROR is not defined(logging module) Message-ID: Bugs item #792649, was opened at 2003-08-21 12:45 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=792649&group_id=5470 Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: George Yoshida (quiver) >Assigned to: Raymond Hettinger (rhettinger) Summary: RESET_ERROR is not defined(logging module) Initial Comment: ConfigStreamHandler class(logging/config.py) has the following code in its handle method: except socket.error, e: if type(e.args) != types.TupleType: raise else: errcode = e.args[0] if errcode != RESET_ERROR: raise However, RESET_ERROR is not defined. So if the handle method catches socket.error, this will raise NameError. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=792649&group_id=5470 From noreply at sourceforge.net Fri Sep 5 22:52:18 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 00:52:21 2003 Subject: [Python-bugs-list] [ python-Bugs-800824 ] test_dumbdbm failing Message-ID: Bugs item #800824, was opened at 2003-09-04 21:02 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800824&group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Brett Cannon (bcannon) >Assigned to: Martin v. L?wis (loewis) Summary: test_dumbdbm failing Initial Comment: Getting the following failures: test_close_twice (__main__.DumbDBMTestCase) ... ok test_dumbdbm_creation (__main__.DumbDBMTestCase) ... ok test_dumbdbm_keys (__main__.DumbDBMTestCase) ... ERROR test_dumbdbm_modification (__main__.DumbDBMTestCase) ... ERROR test_dumbdbm_read (__main__.DumbDBMTestCase) ... ERROR test_random (__main__.DumbDBMTestCase) ... ERROR test_write_write_read (__main__.DumbDBMTestCase) ... ERROR They all error out with the same problem: Traceback (most recent call last): File "Lib/test/test_dumbdbm.py", line 73, in test_write_write_read f = dumbdbm.open(_fname) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 232, in open return _Database(file, mode) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 73, in __init__ self._update() File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ dumbdbm.py", line 84, in _update key, pos_and_siz_pair = eval(line) TypeError: expected string without null bytes test_whichdb is also failing for essentially the same reason although it is hidden under some executed code: test_whichdb_dbm (__main__.WhichDBTestCase) ... ok test_whichdb_dumbdbm (__main__.WhichDBTestCase) ... FAIL ===================================== ================================= FAIL: test_whichdb_dumbdbm (__main__.WhichDBTestCase) -------------------------------------------------------------------- -- Traceback (most recent call last): File "Lib/test/test_whichdb.py", line 56, in test_whichdb_name self.assertEqual(name, whichdb.whichdb(_fname)) File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/ unittest.py", line 292, in failUnlessEqual raise self.failureException, \ AssertionError: 'dumbdbm' != None If I run the test by hand by copy-n-paste in the interpreter I get the same error as above about null bytes. Now I compile with --enable-unicode=ucs4, if that has anything to do with it. This is all on OS X 10.2.6 . ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-05 23:52 Message: Logged In: YES user_id=80475 Martin, this appears to be caused by your recent patch to fileobject.c and fileobject.h. FYI, it only fails when run with python_d. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800824&group_id=5470 From noreply at sourceforge.net Sat Sep 6 07:08:25 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 09:08:30 2003 Subject: [Python-bugs-list] [ python-Bugs-801631 ] file.truncate fault on windows Message-ID: Bugs item #801631, was opened at 2003-09-06 13:08 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=801631&group_id=5470 Category: Windows Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: simon place (psi-man) Assigned to: Tim Peters (tim_one) Summary: file.truncate fault on windows Initial Comment: >manual says file.truncate leave the pointer unmoved, >>> f=file('test.dat', 'wb') to make things easier >>> f.write('1234567890') >>> f.close() >>> f=file('test.dat','rb+') >>> f.read(5) >>>'12345' >>> f.tell() >>>5L >>> f.truncate() >>> f.tell() >>>10L >>>( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32. ) Seems it's a Windows only bug. On a 2.4.3 linux, libc-2.2.5 the final statement produces 5L (and the file is only 5 bytes long). Same on another 2.4.19 libc-2.2.5, and a 2.4.21 libc-2.3.1 Linux, all with a recent Python 2.4a0 . reproduce on Windows. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801631&group_id=5470 From noreply at sourceforge.net Sat Sep 6 08:58:31 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 10:58:37 2003 Subject: [Python-bugs-list] [ python-Bugs-788183 ] build fails on Tru64 Unix (osf1V5) Message-ID: Bugs item #788183, was opened at 2003-08-13 19:00 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788183&group_id=5470 Category: Build >Group: 3rd Party >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Anthony Tuininga (atuining) Assigned to: Nobody/Anonymous (nobody) Summary: build fails on Tru64 Unix (osf1V5) Initial Comment: the build on an alpha (Tru64 Unix) machine fails when compiling Modules/posixModule.c; it complains about stat and lstat, which HP has defined as _F64_stat and _F64_lstat. HP claims that they automatically convert them to stat and lstat for portability but my guess is that the Python #define STAT code overrides this and so it fails. Changing it to expliciltly reference _F64_stat and _F64_lstat solves the problem. In the same module, plock() and unsetenv() are referenced but neither are found in the include files on the box. Setting the HAVE_PLOCk and HAVE_UNSETENV macros properly solves this problem (why didn't configure detect this?) Finally, once everything is done, distutils does not include -lpthread in the list of libraries needed for link. If you have any questions about these issues, let me know. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2003-09-06 16:58 Message: Logged In: YES user_id=21627 See http://python.org/sf/524600 You are probably using gcc, and this is a compiler bug. Closing it as third-party. I believe a newer gcc version should fix this; if not, you should use the system compiler. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788183&group_id=5470 From noreply at sourceforge.net Sat Sep 6 10:29:38 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 12:29:46 2003 Subject: [Python-bugs-list] [ python-Bugs-801631 ] file.truncate fault on windows Message-ID: Bugs item #801631, was opened at 2003-09-06 09:08 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801631&group_id=5470 Category: Windows Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: simon place (psi-man) Assigned to: Tim Peters (tim_one) Summary: file.truncate fault on windows Initial Comment: >manual says file.truncate leave the pointer unmoved, >>> f=file('test.dat', 'wb') to make things easier >>> f.write('1234567890') >>> f.close() >>> f=file('test.dat','rb+') >>> f.read(5) >>>'12345' >>> f.tell() >>>5L >>> f.truncate() >>> f.tell() >>>10L >>>( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32. ) Seems it's a Windows only bug. On a 2.4.3 linux, libc-2.2.5 the final statement produces 5L (and the file is only 5 bytes long). Same on another 2.4.19 libc-2.2.5, and a 2.4.21 libc-2.3.1 Linux, all with a recent Python 2.4a0 . reproduce on Windows. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2003-09-06 12:29 Message: Logged In: YES user_id=31435 Oh, fudge. The Windows code here is trying very hard to preserve the file position, but it turns out that C fflush() on Windows changes the file position in this specific test case. However, the C standard says (about fflush): """ If stream points to an output stream or an update stream in which the most recent operation was not input, the fflush function causes any unwritten data for that stream to be delivered to the host environment to be written to the file; otherwise, the behavior is undefined. """ The last operation performed by the test program before Python's internals call fflush() was an input operation, so the effect of calling fflush() is undefined. If it varies across platforms (as appears to be the case here), that's fine by the standard, and Python is relying on undefined behavior. If you stick, e.g., f.seek(5) after the f.tell() call, then on Windows this test program works as intended (prints 5 at the end, and the file is truncated to 5 bytes). Then the last operation performed on the stream opened for update is *not* an input operation, so the effect of fflush() is defined. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801631&group_id=5470 From noreply at sourceforge.net Sat Sep 6 11:58:41 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 13:58:47 2003 Subject: [Python-bugs-list] [ python-Bugs-727692 ] Documentation formatting bugs Message-ID: Bugs item #727692, was opened at 2003-04-25 14:57 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727692&group_id=5470 Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Martin v. L?wis (loewis) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Documentation formatting bugs Initial Comment: I found that some of my changes get incorrectly formatted, but I don't know how to fix them. Assigning to Fred in the hope that he knows the proper incantations. - HTML version of 4.9.2 (standard encodings): The table is incorrect in the lines that have an empty Aliases column (e.g. cp874). The Alias ought to be empty, and "Thai" ought to occur in the third column - HTML version of 4.9.3 (encodings.IDNA) The first paragraph starts with a bogus "P>" - HTML of whatsnew, 17, "Support for internationalized domain names": The first line of Python prints as a guillemet, not as ">>" Notice that I used a non- preformatted enviroment so that I could output c-cedilla. - Postscript version of 4.9.2: the table is overfull in its width. It would be ok to wrap the aliases lists as much as necessary ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-09-06 13:58 Message: Logged In: YES user_id=3066 The original problem in the "What's New" document is worked around in the current CVS version of the formatting tools, so I no longer consider that to be an issue. The only remaining problem of those described in this report is the overly-wide tables in the PDF and PostScript formats, and that's a well known problem in the Python documentation. Closing this report as "fixed as we can make it for now." ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-09-04 17:26 Message: Logged In: YES user_id=3066 Fixed table generation in HTML that caused cells to be dropped in the standard encodings table in Doc/perl/python.perl revision 1.140. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2003-04-30 11:06 Message: Logged In: YES user_id=3066 - Standard encodings table: ouch! I'll see what I can do about this, but it'll take more time than I can spend right now. - encodings.idna documentation: That's a bug in the formatting software; hopefully I'll be able to fix it. Worked around it for now (Doc/lib/libcodecs.tex 1.20). - What's New document: I've worked around the problem so the interactive prompt shows up properly, but an extraneous space is generated at the beginning of the line; not sure why (Doc/whatsnew/whatsnew23.tex 1.144). - Postscript: I expect the PDF to exhibit the same problem. This is a general problem for tables with a lot of horizontal-mode material in LaTeX; I don't know how to work around this (yet). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727692&group_id=5470 From noreply at sourceforge.net Sat Sep 6 15:10:07 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 17:10:21 2003 Subject: [Python-bugs-list] [ python-Bugs-801306 ] Bad RE in scanf example Message-ID: Bugs item #801306, was opened at 2003-09-05 12:03 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801306&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jimm Domingo (jimm_domingo) Assigned to: Raymond Hettinger (rhettinger) Summary: Bad RE in scanf example Initial Comment: In section 4.2.6 "Examples" of the Python Library Reference, the regular expression for scanf format tokens %e, %E, %f, %g does not allow an optional sign in the exponent. The RE should be: [-+]?(\d+(\.\d*)?|\d*\.\d+)([eE][-+]?\d+)? ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 14:10 Message: Logged In: YES user_id=357491 Double-checking with K&R, Jimm is right and regex looks good to me. Hope that helps in some way, Raymond. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801306&group_id=5470 From noreply at sourceforge.net Sat Sep 6 15:13:57 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 17:14:03 2003 Subject: [Python-bugs-list] [ python-Bugs-800899 ] Making "|" directive from REs a bit clearer Message-ID: Bugs item #800899, was opened at 2003-09-04 23:59 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800899&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None >Priority: 3 Submitted By: Wojtek Walczak (gminick) Assigned to: Nobody/Anonymous (nobody) Summary: Making "|" directive from REs a bit clearer Initial Comment: Let's take a look, Library Reference, 4.2.1 Regular Expression Syntax says: "|" A|B, where A and B can be arbitrary REs, creates a regular expression that will match either A or B. [...] !!here_starts_the_darkness!! REs separated by "|" are tried from left to right, and the first one that allows the complete pattern to match is considered the accepted branch. This means that if A matches, B will never be tested, even if it would produce a longer overall match. !!here_ends_the_darkness!! It's not as clear as it can be. For more information take a look at: Here's a proposal from Terry Reedy for changing those lines from darkness ;-) """As the target string is scanned, REs separated by "|" are tried from left to right. When one pattern completely matches, that branch is accepted. This means that once A matches, B will not be tested further, even if it would produce a longer overall match.""" ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 14:13 Message: Logged In: YES user_id=357491 This was also brought to the attention of python-dev directly and discussed in the thread "Discordance in Documentation..." which can be found at http://mail.python.org/pipermail/python-dev/ 2003-September/037924.html . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800899&group_id=5470 From noreply at sourceforge.net Sat Sep 6 15:23:24 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 17:23:29 2003 Subject: [Python-bugs-list] [ python-Bugs-799369 ] documentation for sys.platform is unclear Message-ID: Bugs item #799369, was opened at 2003-09-02 13:16 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799369&group_id=5470 Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Bram Moolenaar (vimboss) Assigned to: Nobody/Anonymous (nobody) Summary: documentation for sys.platform is unclear Initial Comment: The use of sys.platform is very risky, because it is not at all clear what the possible values are. For example, on Mac OS X "darwin" is used, but this can only be discovered by trying it out and asking Jack when another value will be used. Another problem is that the examples given include a number, which suggests that an OS version number might be included here. Is that only a major version number? And why doesn't Mac OS X report "macosx10.2"? Suggestion: Add a list of known values and for what platforms they are used. ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 14:23 Message: Logged In: YES user_id=357491 How often are new platforms supported? From my short time on python-dev I would say not very often. So listing all known platforms shouldn't suffer *too* much from bit rot, but it is something to consider before going forward with this. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2003-09-05 06:45 Message: Logged In: YES user_id=45365 A first step would be to document that for Unix the value is based on the information returned by "uname" *at the time of building Python*, mapped to lowercase and with some cruft removed. For other platforms for which the value is known (Windows, MacOS9) we could document the actual values. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=799369&group_id=5470 From noreply at sourceforge.net Sat Sep 6 15:42:06 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 17:42:15 2003 Subject: [Python-bugs-list] [ python-Bugs-798652 ] Clarify trailing comma in func arg list Message-ID: Bugs item #798652, was opened at 2003-09-01 09:32 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798652&group_id=5470 Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Terry J. Reedy (tjreedy) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Clarify trailing comma in func arg list Initial Comment: Current Ref Man 5.3.4 Calls says after grammar: "A trailing comma may be present after an argument list but does not affect the semantics. " But this is not true if arg list ends with *expr or **expr: >>> dict(*l,) # any function will do since not called File "", line 1 dict(*l,) ^ # points at ')' SyntaxError: invalid syntax >>> dict(**d,) File "", line 1 dict(**d,) ^ # points at ',' SyntaxError: invalid syntax Suggestion: "If an argument list does *not* end with *expr or **expr, a trailing comma may be added without affecting the semantics." The same exception applies to function defs as well as calls, but 7.5 Function definitions does not have a statement such as above. However, the production for parameter_list does end with 'defparameter [","]'. I suggest that this be the first of the parenthesized alternatives, as it logically should be, rather than the last, so it flows better and so that no one (ignorant that '[]' binds tighter than '|') could possible think that the '[,]' applies to the * and ** parts. IE: change parameter_list ::= (defparameter ",")* ("*" identifier [, "**" identifier] | "**" identifier | defparameter [","]) to parameter_list ::= (defparameter ",")* (defparameter [","] |'*' identifier [, "**" identifier] | "**" identifier) Squeezing out a line is a suboptimazation. ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 14:42 Message: Logged In: YES user_id=357491 Terry is right that the line is wrong. You can examine the actual Grammar/Grammar file to see that: varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] As you can see the actual grammar does not even have the definition of a 'call' token. Not only that, but the example in the docs is not entirely correct since is says that the * and ** syntax take an 'expression' token which in the grammar in the docs is basically a tuple-like syntax while the official grammar wants a NAME which is defined as a primitive token. I don't know how extensive of a change is warranted. That one line does need to be changed, but if *only* that line is changed then the text won't match the example grammar. But since the example grammar does not mirror the real grammar I don't want to go messing with it without Fred weighing in on this. I am going to assign to Fred to see what he has to say. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798652&group_id=5470 From noreply at sourceforge.net Sat Sep 6 15:53:49 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 17:53:58 2003 Subject: [Python-bugs-list] [ python-Bugs-801349 ] New slice behaviour. Bug or feature? Message-ID: Bugs item #801349, was opened at 2003-09-05 15:28 Message generated for change (Comment added) made by logistix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801349&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) Assigned to: Michael Hudson (mwh) Summary: New slice behaviour. Bug or feature? Initial Comment: Using a slice of x[:None] returns the whole list. I would thing that if this sort of statement is valid, it should return an empty list, like x[:0]. In 2.2, you'll get an error with this statement. This bit me when I was using None as a sentinel. I'll be able to write a patch when I find out what the desired behaviour is (fine as-is, None should behave as 0, it should throw an error, or other) assuming sf's cvs is playing nice. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\grant>c:\python23\python 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. >>> a = [1,2,3,4] >>> a[:None] [1, 2, 3, 4] >>> ^Z C:\Documents and Settings\grant>c:\python22\python 'import site' failed; use -v for traceback Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a = [1,2,3,4] >>> a[:None] Traceback (most recent call last): File "", line 1, in ? TypeError: sequence index must be integer >>> ^Z C:\Documents and Settings\grant> ---------------------------------------------------------------------- >Comment By: logistix (logistix) Date: 2003-09-06 16:53 Message: Logged In: YES user_id=699438 Actually I now think this is behaving properly since slice uses None as sentinels. 'a[slice(None,None)]' is equivilent to a[:]. Although 'a[None:None]' isn't a backward-compatible statement, it doesn't cause any forward compatibility issues with pre-2.3 code. And changing the definition of 'None' on slice attributes would cause some serious breakage on third- party packages. However, if this is defined behaviour, I'll need to write some documentation patches. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-09-05 20:31 Message: Logged In: YES user_id=33168 Michael, do you think happened with your extended slice changes? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801349&group_id=5470 From noreply at sourceforge.net Sat Sep 6 16:22:01 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 18:22:06 2003 Subject: [Python-bugs-list] [ python-Bugs-798046 ] select module doesn't allow any iterable. Message-ID: Bugs item #798046, was opened at 2003-08-31 00:31 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798046&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jeremy Fincher (jemfinch) Assigned to: Nobody/Anonymous (nobody) Summary: select module doesn't allow any iterable. Initial Comment: The select module only allows lists, not any iterable. While this may slightly increase efficiency for the select.select() function itself, for many applications passing select.select a sets.Set would probably be much more efficient (i.e., when things are being added/removed from the readable or writable lists quite often, the O(n) removal of lists would certainly be worse than the O(1) removal of sets.) ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 15:22 Message: Logged In: YES user_id=357491 There seems to be two things that are preventing the use of an object that supports the iterator protocol instead of a list. One is the explicit check that the arguments are lists; PyList_Check is run on the passed-in lists for a basic sanity check. Then there is a call to a function called list2set that takes in a Python list and then sets the passed-in fd_set properly. In that function there is nothing that screams "we should only use lists" beyond it allows assuming a list and thus doesn't have any hoops to jump through. But the iterator protocol was set up to minimize hoop jumping. There seems to be little stopping a move over to using the iterator protocol beyond a minimial amount of recoding to rip out the list check to replace it with PyIter_Check and instead of using a 'for' loop through a list you just use a 'while' calling PyIter_Next . But since this seems to have gone so long without being changed I would feel better about having someone tell me it is okay to change. I will email python-dev and ask. ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2003-09-02 11:23 Message: Logged In: YES user_id=4771 Using select.poll() instead of select.select() might be a good alternative, at least on platforms that support it, if the sets are getting large enough for you to want to avoid having to build lists explicitely as in : select.select(list(a), list(b), list(c)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798046&group_id=5470 From noreply at sourceforge.net Sat Sep 6 16:51:03 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 18:51:12 2003 Subject: [Python-bugs-list] [ python-Bugs-793822 ] gc.get_referrers() is inherently dangerous Message-ID: Bugs item #793822, was opened at 2003-08-23 10:17 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793822&group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Armin Rigo (arigo) Assigned to: Nobody/Anonymous (nobody) Summary: gc.get_referrers() is inherently dangerous Initial Comment: gc.get_referrers() can be used to crash any Python interpreter because it allows the user to obtain objects which are still under construction. Here is an example where an iterator can use it to obtain a tuple while it is still being populated by the 'tuple' built-in function. The following example triggers a SystemError, but as the tuple 't' is at the moment still full of null values it can easily generate segfaults instead. from gc import get_referrers def iter(): tag = object() yield tag # 'tag' gets stored in the result tuple lst = [x for x in get_referrers(tag) if isinstance(x, tuple)] t = lst[0] # this *is* the result tuple print t # full of nulls ! tuple(iter()) Unless someone has more ideas than me as to how to prevent this problem, I'd suggest that gc.get_referrers() should be deemed 'officially dangerous' in the docs. ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2003-09-06 15:51 Message: Logged In: YES user_id=357491 The wording Armin proposes in his patch makes sense to me. ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2003-09-02 11:11 Message: Logged In: YES user_id=4771 Here is the doc patch (attached). A clean solution to this problem would involve delaying GC registration, which I think would imply changes in the C API. It is probably not worth it. I don't think it would be a problem for the GC not to be able to browse through objects still under constructions because such objects are never part of a dead cycle anyway, and probably not part of a cycle at all until later mutated. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-08-31 16:36 Message: Logged In: YES user_id=31435 Martin, it's easy to transform the example into one that crashes. For example, adding "print t[3]" as the last line of the iter() function causes it to die with a segfault on my box. Virtually anything that fetches a NULL from the tuple will try to Py_INCREF it (that's all "t[3]" does), and that's an instant NULL-pointer dereferencing death. That said, it would be more helpful if Armin submitted a doc patch. The introspective features of the gc module are intended to be used by consenting adults facing hard debugging problems, and I don't care if they can be tricked into blowing up. I agree the docs should point out the possibility, though. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2003-08-31 10:18 Message: Logged In: YES user_id=21627 I see no harm in your example. Even though the tuple has NULLs in it, is in a stable state. The lesson learned is that an object should become gc-tracked only if it is in a stable state, as gc-tracking means to expose references to the object. This is true independent of get_referrers, as gc-tracking means that tp_traverse might be called for the object, so it *has* to be in a stable state. I fail to see how the example "crashes" the Python interpreter. I causes a SystemError when the tuple is resized, that's all. There are many ways to cause a SystemError, including raise SystemError I recommend not to declare a function as "dangerous" in the docs. Instead, the actual problem should be explained, both in the GC part of the C API, and in gc module docs (for both get_referrers, and get_objects). ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2003-08-28 06:23 Message: Logged In: YES user_id=4771 But it would be very difficult to fix the code base to avoid the problem. The 'tuple' constructor was only an example; it is actually a quite common pattern everywhere in the C code base of both the core and extension modules. Expecting an object not to be seen before you first hand it out is extremely common, and get_referrers() breaks that assumption. Hence the claim that the problem really lies in get_referrers(). ---------------------------------------------------------------------- Comment By: Denis S. Otkidach (ods) Date: 2003-08-28 00:35 Message: Logged In: YES user_id=63454 I guess it's dangerous to make object that is not properly initialized reachable from other code. Even if it's reachable with get_referrers() only. There is no danger in get_referrers() itself. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793822&group_id=5470 From noreply at sourceforge.net Sat Sep 6 16:57:08 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Sep 6 18:57:13 2003 Subject: [Python-bugs-list] [ python-Bugs-793753 ] sgmllib parser problem Message-ID: Bugs item #793753, was opened at 2003-08-23 06:37 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793753&group_id=5470 Category: Extension Modules Group: Python 2.3 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Walter Hofmann (walterh) Assigned to: Nobody/Anonymous (nobody) Summary: sgmllib parser problem Initial Comment: Hi, I notices that the parser htmllib.HTMLParser has a problem with parsing the following code: