[ python-Bugs-1388489 ] bug in rstrip & lstrip
Bugs item #1388489, was opened at 2005-12-23 01:43 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388489&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Python 2.4 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Jason Whitlark (jcdelta) Assigned to: Nobody/Anonymous (nobody) Summary: bug in rstrip & lstrip Initial Comment: quick detail: Python 2.4.2 (#1, Dec 9 2005, 22:48:42) [GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> "net.tpl".rstrip('.tpl') 'ne' >>> "foo.tpl".rstrip('.tpl') 'foo' I ran the following code to test this: 26 - [EMAIL PROTECTED]: ~/pythonBugTest 0> cat testForRStripBug.py #! /usr/bin/python for word in open('/opt/openoffice/share/dict/ooo/en_US.dic', 'r'): word = word.split('/')[0] testWord = (word + '.tpl').rstrip('.tpl') if word != testWord: print word, testWord And came up with the attached file of incorrect matches. Out of 62075 words in the en_US.dic, 6864 do not match. Here is the frequency count of the last letter of the origional word, the only pattern I could discern so far: 0> ./freqCount.py < run1 {'p': 566, 'l': 2437, 't': 3861} No other letters seem to be clipped. Why this should be so, I have no idea. I would guess that the error was in function do_xstrip in python/trunk/Objects/stringobject.c, but C is not my strong suit. I will be looking at it further when I have time, but if anyone knows how to fix this, please help. -- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-12-23 09:49 Message: Logged In: YES user_id=1188172 The docs clearly state this behavior. """ >>> 'www.example.com'.lstrip('cmowz.') 'example.com' """ -- Comment By: Walter Dörwald (doerwalter) Date: 2005-12-23 02:23 Message: Logged In: YES user_id=89016 This is not a bug. The documentation (http://docs.python.org/lib/string-methods.html) says that: "The chars argument is a string specifying the set of characters to be removed". i.e. "net.tpl".rstrip(".tpl") strips every ".", "t", "p" and "l" character from the right end of the string, *not* every occurence of the character sequence ".tpl". This seems to be a frequent misunderstanding, so if you can suggest improvements to the docstring or the documentation, please do so. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388489&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1388804 ] Polymorphic getters / setters
Bugs item #1388804, was opened at 2005-12-23 12:26 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=1388804&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Adde (trialcode) Assigned to: Nobody/Anonymous (nobody) Summary: Polymorphic getters / setters Initial Comment: If you add a property to a class with a getter and/or setter and override the getter and/or setter in a subclass the baseclass implementation of the methods is still called when the property is accessed on objects of the subclass. class base(object): def get_foo(self): print "Base get" def set_foo(self, value): print "Base set" foo = property(get_foo, set_foo) class sub(base): def get_foo(self): print "Sub get" def set_foo(self, value): print "Sub set" s = sub() s.foo = s.foo -- Prints: Base get Base set -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388804&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1388804 ] Polymorphic getters / setters
Bugs item #1388804, was opened at 2005-12-23 12:26 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388804&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: Python 2.4 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Adde (trialcode) Assigned to: Nobody/Anonymous (nobody) Summary: Polymorphic getters / setters Initial Comment: If you add a property to a class with a getter and/or setter and override the getter and/or setter in a subclass the baseclass implementation of the methods is still called when the property is accessed on objects of the subclass. class base(object): def get_foo(self): print "Base get" def set_foo(self, value): print "Base set" foo = property(get_foo, set_foo) class sub(base): def get_foo(self): print "Sub get" def set_foo(self, value): print "Sub set" s = sub() s.foo = s.foo -- Prints: Base get Base set -- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-12-23 12:32 Message: Logged In: YES user_id=1188172 This is expected behavior. The property is created with references to the specific methods "base.get_foo" and "base.set_foo". -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388804&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Feature Requests-1388872 ] Polymorphic getters / setters
Feature Requests item #1388872, was opened at 2005-12-23 14:08 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=1388872&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Adde (trialcode) Assigned to: Nobody/Anonymous (nobody) Summary: Polymorphic getters / setters Initial Comment: If you add a property to a class with a getter and/or setter and override the getter and/or setter in a subclass the baseclass implementation of the methods is still called when the property is accessed on objects of the subclass (see below for example). This feels like a pretty arbitrary limitation that prevents overriding the behaviour of properties like you would with a normal method. I'm sure there's a way to make the property search the inheritance-hierarchy for the provided method signature when called. class base(object): def get_foo(self): print "Base get" def set_foo(self, value): print "Base set" foo = property(get_foo, set_foo) class sub(base): def get_foo(self): print "Sub get" def set_foo(self, value): print "Sub set" s = sub() s.foo = s.foo -- Prints: Base get Base set -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1388872&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1388910 ] xmlrpc howto link incorrect
Bugs item #1388910, was opened at 2005-12-23 14: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=1388910&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Jonathan Marshall (jonmarsh) Assigned to: Nobody/Anonymous (nobody) Summary: xmlrpc howto link incorrect Initial Comment: Clicking the link for the xml-rpc HOWTO in the xml-rpc module documentation results in an error 404. This is true for both the 2.3 and 2.4 documentation on pages http://www.python.org/doc/2.3.5/lib/module-xmlrpclib.html and http://docs.python.org/lib/module-xmlrpclib.html The target page is http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html. Perhaps it should be http://tldp.org/HOWTO/XML-RPC-HOWTO/index.html ? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388910&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1388949 ] Decimal sqrt() ignores rounding
Bugs item #1388949, was opened at 2005-12-23 08:11 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=1388949&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Adam Olsen (rhamphoryncus) Assigned to: Nobody/Anonymous (nobody) Summary: Decimal sqrt() ignores rounding Initial Comment: Decimal Contexts' sqrt() method exhibits the same rounding behavior irregardless of the rounding parameter. >>> c = decimal.Context(rounding=decimal.ROUND_CEILING) >>> f = decimal.Context(rounding=decimal.ROUND_FLOOR) >>> cs = decimal.Context(rounding=decimal.ROUND_CEILING, prec=14) >>> fs = decimal.Context(rounding=decimal.ROUND_FLOOR, prec=14) >>> c.sqrt(D(2)) Decimal("1.414213562373095048801688724") >>> f.sqrt(D(2)) Decimal("1.414213562373095048801688724") >>> cs.sqrt(D(2)) Decimal("1.4142135623731") >>> fs.sqrt(D(2)) Decimal("1.4142135623731") It appears to always round up. Python 2.4.2 (#2, Nov 20 2005, 17:04:48) Debian unstable -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388949&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1388910 ] xmlrpc howto link incorrect
Bugs item #1388910, was opened at 2005-12-23 15:02 Message generated for change (Comment added) made by effbot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388910&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: Python 2.3 >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Jonathan Marshall (jonmarsh) Assigned to: Nobody/Anonymous (nobody) Summary: xmlrpc howto link incorrect Initial Comment: Clicking the link for the xml-rpc HOWTO in the xml-rpc module documentation results in an error 404. This is true for both the 2.3 and 2.4 documentation on pages http://www.python.org/doc/2.3.5/lib/module-xmlrpclib.html and http://docs.python.org/lib/module-xmlrpclib.html The target page is http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html. Perhaps it should be http://tldp.org/HOWTO/XML-RPC-HOWTO/index.html ? -- >Comment By: Fredrik Lundh (effbot) Date: 2005-12-23 19:03 Message: Logged In: YES user_id=38376 This is a duplicate of http://www.python.org/sf/1368827 (which is already fixed in the trunk) -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388910&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1389051 ] imaplib causes excessive fragmentation for large documents
Bugs item #1389051, was opened at 2005-12-23 19:11 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=1389051&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Fredrik Lundh (effbot) Assigned to: Nobody/Anonymous (nobody) Summary: imaplib causes excessive fragmentation for large documents Initial Comment: When fetching large documents via SSL, the imaplib attempts to read it all in one chunk, but the SSL socket layer only returns ~16k at a time. The result is that Python will end up allocating, say, a 15 megabyte block, shrink it to a few kilobytes, occasionally allocate a medium-sized block (to hold the list of chunks), and repeat this again and again and again. Not all malloc implementations can reuse the (15 megabytes minus a few kilobyte) block when allocating the next 15 megabyte block. In a worst case scenario, you'll need some 13 gigabytes of virtual memory to read a 15 megabyte message... A simple solution is to change data = self.sslobj.read(size-read) to data = self.sslobj.read(min(size-read, 16384)) For more on this, see this thread: http://groups.google.com/group/comp.lang.python/browse_ frm/thread/3737500bac287575/d715bf614a86e786 -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1389051&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1389157 ] test_tarfile fails with readonly source dir for Python 2.4.2
Bugs item #1389157, was opened at 2005-12-23 22:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1389157&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Langly (langly) Assigned to: Nobody/Anonymous (nobody) Summary: test_tarfile fails with readonly source dir for Python 2.4.2 Initial Comment: When compiling Python-2.4.2 and using separate source and build directories, the test_tarfile test fails if the source directory is read-only. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1389157&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com