[Python-Dev] problem installing current cvs
Hi, I'm having 2 problems with the current cvs : During compilation this warning occurs: *** WARNING: renaming dbm since importing it failed: build/lib.linux-i686-2.5/ dbm.so: undefined symbol: dbm_firstkey and the 'dbm' module is unavailable. I'm running MandrakeLinux 2005 (10.2) gcc 3.4.3 (I'm also having this problem when compiling python 2.3.5 or 2.4.1) furthermore the 'make install' of current cvs fails halfway trough with the following errors: . . Compiling /opt/python25/lib/python2.5/bsddb/test/test_associate.py ... Sorry: TabError: ('inconsistent use of tabs and spaces in indentation', ('/opt/python25/lib/python2.5/bsddb/test/test_associate.py', 97, 23, '\t os.mkdir(homeDir)\n')) Compiling /opt/python25/lib/python2.5/bsddb/test/test_basics.py ... Sorry: TabError: ('inconsistent use of tabs and spaces in indentation', ('/opt/python25/lib/python2.5/bsddb/test/test_basics.py', 400, 26, '\tif get_raises_error:\n')) Compiling /opt/python25/lib/python2.5/bsddb/test/test_compare.py ... Sorry: TabError: ('inconsistent use of tabs and spaces in indentation', ('/opt/python25/lib/python2.5/bsddb/test/test_compare.py', 167, 5, '\t\n')) . . Compiling /opt/python25/lib/python2.5/bsddb/test/test_recno.py ... Sorry: TabError: ('inconsistent use of tabs and spaces in indentation', ('/opt/python25/lib/python2.5/bsddb/test/test_recno.py', 38, 46, '\tget_returns_none = d.set_get_returns_none(2)\n')) . . make: *** [libinstall] Error 1 $ And then it quits. Fixing the tab indentation errors locally makes the problem go away. Regards, Irmen de Jong ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] shadow password module (spwd) is never built due to error in setup.py
Martin v. Löwis wrote: Irmen de Jong wrote: Please advise? setup.py should refer to config_h_vars, which in turn should be set earlier. Regards, Martin Ah so the setup.py script is flawed. However, the sysconfig object doesn't contain a config_h_vars... So I guess distutils must be patched too? --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] shadow password module (spwd) is never built due to error in setup.py
Hello, A modification was made in setup.py, cvs rel 1.213 (see diff here: http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/setup.py?r1=1.212r2=1.213 ) which appears to be wrong. At least, on my system, the spwd module is never built anymore, because the if statement is never true. Actually, the sysconfig doesn't contain *any* of the HAVE_ vars that occur in pyconfig.h (I checked by printing all vars). I don't really understand the distutils magic that is done in setup.py, but it appears to me that either the if statement is wrong (because the vars never exist) or distutils does something wrong by leaving out all HAVE_XXX vars from pyconfig.h. Please advise? I want my spwd module back ;-) --Irmen de Jong PS I checked that pyconfig.h correctly #defines both HAVE_GETSPNAM and HAVE_GETSPENT to 1 on my system (Mandrake linux 10.1), so the rest of the configure script runs fine (it should, I created the original patches for it... see SF patch # 579435) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Unified or context diffs?
Raymond Hettinger wrote: [Nick Coghlan] Are context diffs still favoured for patches? The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say. Submit whichever is the most informative. For some changes, it is easier to see the changed lines immediately above and below each other. For others, it helps to be able to see the whole algorithm. And for the 'patch' tool, it doesn't really matter what you use, right? --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] New bug, directly assigned, okay?
I just added a new bug on SF (1175396) and because I think that it is related to other bugs that were assigned to Walter Doerwald, I assigned this new bug directly to Walter too. Is that good practice or does someone else usually assign SF bugs to people? --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] New bug, directly assigned, okay?
Nick Coghlan wrote: Irmen de Jong wrote: I just added a new bug on SF (1175396) and because I think that it is related to other bugs that were assigned to Walter Doerwald, I assigned this new bug directly to Walter too. Is that good practice or does someone else usually assign SF bugs to people? I've certainly done that a few times myself - I figure that even if I get it wrong, the recipient will either pass it on to a more appropriate person, or simply revert it back to unassigned. Ah, okay. I usually try to put in a comment to say *why* I've assigned it the way I have, though. Picking an assignee at random should probably be discouraged, but if there is someone that makes sense, then I don't see a problem with asking them to look at it directly. Yep, that's what I've done. In my bug report (about codecs.readline) I referenced the two other bugs related to it (those were assigned to Walter). Thanks, Irmen. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] a bunch of Patch reviews
Martin v. Löwis wrote: Irmen de Jong wrote: I've looked at one bug and a bunch of patches and added a comment to them: Thanks! I have now processed the ones for which I found guidance. Thank you As for the remaining ones: [ 756021 ] Allow socket.inet_aton('255.255.255.255') on Windows Looks good but added suggestion about when to test for special case So what to do about this? Wait whether he revises the patch? Accept anyway? Update the patch myself? I think I will revise the patch myself. I was just waiting for some more input, but since nobody replied, I'll just go ahead with it. [ 1103350 ] send/recv SEGMENT_SIZE should be used more in socketmodule So what do you propose to do? AFAICT, there is no definition of SEGMENT_SIZE in a TCP implementation, and I think we should not try to make up a value. Well, for the VMS platform a value has been made up... Why make an exception for that one and not for Win32? IMO, Python should expose sockets more or less as-is. If the system has a flaw, Python should expose it instead of working around it. Is this the default way of treating system flaws, or should they be considered on a per-case basis? I can imagine that some system flaws are just plain stupid and are easy to hide (or circumvent) in the Python implementation. The recv/send segment size issue can have nasty results on Win32, see the referenced bug report 853507 socket.recv() raises MemoryError exception which I think is related to this. (yes, I know that Tim marked that bug as wontfix) Note: I'm not too experienced with Win32 programming and so I don't have a very good argumentation for the buffer size issue on this platform. If there is somebody with better understanding of the issues involved here, please advise. (it's just empirical knowledge that I have that leads me to believe that win32's tcp implementation suffers from similar recv/send size problems as VMS does-- for which a special case was made in the code) [ 1062014 ] fix for 764437 AF_UNIX socket special linux socket names Can you please elaborate the problem? What is a special linux socket name? See bug report 764437. AF_UNIX sockets on Linux can have so-called 'kernel' socket names that don't show up in the filesystem (regular unix domain sockets do). The current socketmodule doesn't treat this special kind of unix domain sockets well. This fix was submitted during the last python bug day you can find some more info here too: http://www.python.org/moin/PythonBugDayStatus Regardless, the comment of the other reviewer is also valid: any patch needs documentation and test cases. Yes, Johannes is right. I should have made docs and test cases but didn't get around to doing that yet. When my home network is fixed (router failure) I'll try to spend some time improving the patches. Regards Irmen de Jong ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] string find(substring) vs. substring in string
Mike Brown wrote: Fredrik Lundh wrote: any special reason why in is faster if the substring is found, but a lot slower if it's not in there? Just guessing here, but in general I would think that it would stop searching as soon as it found it, whereas until then, it keeps looking, which takes more time. But I would also hope that it would be smart enough to know that it doesn't need to look past the 2nd character in 'not the xyz' when it is searching for 'not there' (due to the lengths of the sequences). There's the Boyer-Moore string search algorithm which is allegedly much faster than a simplistic scanning approach, and I also found this: http://portal.acm.org/citation.cfm?id=79184 So perhaps there's room for improvement :) --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] a bunch of Patch reviews
Irmen de Jong wrote: Hello I've looked at one bug and a bunch of patches and added a comment to them: [...] [ 579435 ] Shadow Password Support Module Would be nice to have, I recently just couldn't do the user authentication that I wanted: based on the users' unix passwords I'm almost done with completing this thing. (including doc and unittest). However: 1- I can't add new files to this tracker item. Should I open a new patch and refer to it? 2- As shadow passwords can only be retrieved when you are root, is a unit test module even useful? 3- Should the order of the chapters in the documentation be preserved? I'd rather add spwd below pwd, but this pushes the other unix modules 1 down... --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] a bunch of Patch reviews
Hello I've looked at one bug and a bunch of patches and added a comment to them: (bug) [ 1102649 ] pickle files should be opened in binary mode Added a comment about a possible different solution [ 946207 ] Non-blocking Socket Server Useless, what are the mixins for? Recommend close [ 756021 ] Allow socket.inet_aton('255.255.255.255') on Windows Looks good but added suggestion about when to test for special case [ 740827 ] add urldecode() method to urllib I think it's better to group these things into urlparse [ 579435 ] Shadow Password Support Module Would be nice to have, I recently just couldn't do the user authentication that I wanted: based on the users' unix passwords [ 1093468 ] socket leak in SocketServer Trivial and looks harmless, but don't the sockets get garbage collected once the request is done? [ 1049151 ] adding bool support to xdrlib.py Simple patch and 2.4 is out now, so... It would be nice if somebody could have a look at my own patches or help me a bit with them: [ 1102879 ] Fix for 926423: socket timeouts + Ctrl-C don't play nice [ 1103213 ] Adding the missing socket.recvall() method [ 1103350 ] send/recv SEGMENT_SIZE should be used more in socketmodule [ 1062014 ] fix for 764437 AF_UNIX socket special linux socket names [ 1062060 ] fix for 1016880 urllib.urlretrieve silently truncates dwnld Some of them come from the last Python Bug Day, see http://www.python.org/moin/PythonBugDayStatus Thank you ! Regards, --Irmen de Jong ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Possible bug in codecs readline? It breaks lines apart.
Simon Percivall wrote: It looks like the readline method broke at revision 1.36 of codecs.py, when it was modified, yes. Okay. I've created a bug report 1098990: codec readline() splits lines apart --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Possible bug in codecs readline? It breaks lines apart.
Okay. I've created a bug report 1098990: codec readline() splits lines apart Btw, I've set it to group Python 2.5, is that correct? Or should bugs that relate to the current CVS trunk have no group? Thx Irmen. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Possible bug in codecs readline? It breaks lines apart.
Hello using current cvs Python on Linux, I observe this weird behavior of the readline() method on file-like objects returned from the codecs module: [EMAIL PROTECTED] ypage]$ cat testfile1.txt xxx yyy offending line: ladfj askldfj klasdj fskla dfzaskdj fasklfj laskd fjasklfaa%whereisthis!!! next line. [EMAIL PROTECTED] ypage]$ cat testfile2.txt stillokay:xx brokenbadbad againokay. [EMAIL PROTECTED] ypage]$ cat bug.py import codecs for name in (testfile1.txt,testfile2.txt): f=codecs.open(name,encoding=iso-8859-1) # precise encoding doesn't matter print ,name, for line in f: print LINE:+repr(line) [EMAIL PROTECTED] ypage]$ python25 bug.py testfile1.txt LINE:u'xxx yyy\r\n' LINE:u'offendi' LINE:u'ng line: ladfj askldfj klasdj fskla dfzaskdj fasklfj laskd fjasklfaa' LINE:u'%whereisthis!!!\r\n' LINE:u'next line.\r\n' testfile2.txt LINE:u'\n' LINE:u'\n' LINE:u'stillokay:xx\n' LINE:u'broke' LINE:u'nbadbad\n' LINE:u'againokay.\n' [EMAIL PROTECTED] ypage]$ See how it breaks certain lines in half? It only happens when a certain encoding is used, so regular file objects behave as expected. Also, readlines() works fine. Python 2.3.4 and Python 2.4 do not have this problem. Am I missing something or is this a bug? Thanks! --Irmen ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Re:[Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80
Tim Delaney wrote: Irmen de Jong wrote: Also, I'm not sure how a test-case should be constructed for this patch? Can the Python regression test download stuff as part of a test? Or is there some other way to make a testcase for this. Hmm - perhaps start a server on the local machine at the start of the test, and tear it down at the end? you've then got full control of that server and can make it do whatever you want. Or replace the socket objects with mock objects? Thanks for those suggestions. Let's see what I can concoct. Never made (or studied in detail) a python regression test case before so now is a good time :) --Irmen ___ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80
Raymond Hettinger wrote: Perhaps a rather quick Py2.4.1 would be in order. Ideally, it should include other important fixes: [...] * Fix for off-by-one bug in urllib.URLopener.retrieve http://www.python.org/sf/810023 (assigned to me) Is http://www.python.org/sf/1062060 perhaps of similar importance? (fix for urllib.urlretrieve silently truncating download) --Irmen ___ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Re:[Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80
Raymond Hettinger wrote: * Fix for off-by-one bug in urllib.URLopener.retrieve http://www.python.org/sf/810023 (assigned to me) Is http://www.python.org/sf/1062060 perhaps of similar importance? (fix for urllib.urlretrieve silently truncating download) That seems reasonable to me. There is no point in having the error pass silently. Well, I wanted to make the patches that Johannes suggested, but ran into trouble when building the Python docs from CVS source (see my other message about this). Also, I'm not sure how a test-case should be constructed for this patch? Can the Python regression test download stuff as part of a test? Or is there some other way to make a testcase for this. --Irmen ___ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com