From: SourceForge.net <no...@so...> - 2007-08-16 09:20:54
|
Patches item #1775263, was opened at 2007-08-16 13:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ayesha (ayeshaiqbal) Assigned to: Nobody/Anonymous (nobody) Summary: patch for bug [1768979]:hasattr,getattr Initial Comment: This fix checks whether the attribute string is unicode.If SO a UnicodeError is raised.The test file test_builtin now executes without any error Thanks, Ayesha ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 |
From: SourceForge.net <no...@so...> - 2007-08-22 23:34:44
|
Patches item #1775263, was opened at 2007-08-16 10:20 Message generated for change (Comment added) made by pjenvey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ayesha (ayeshaiqbal) Assigned to: Nobody/Anonymous (nobody) Summary: patch for bug [1768979]:hasattr,getattr Initial Comment: This fix checks whether the attribute string is unicode.If SO a UnicodeError is raised.The test file test_builtin now executes without any error Thanks, Ayesha ---------------------------------------------------------------------- Comment By: Philip Jenvey (pjenvey) Date: 2007-08-23 00:34 Message: Logged In: YES user_id=145787 Originator: NO throwing a UnicodeError here isn't the same as CPython. Since CPython is dealing with an actual unicode object, it will encode() it, and when the encoding fails you'll end up with the typical UnicodeEncodeError: 'ascii' codec can't encode character u'\xe' in position 0: ordinal not in range(128) This patch's behavior is similar, but python code will be expecting to catch UnicodeEncodeErrors when these operations fail, not its base class UnicodeError. You might want to force an encode operation here instead. If encode() is much slower than isunicode, maybe only encode() if isunicode() returns true. You could also throw the UnicodeEncodeError yourself, but preserving the full UnicodeEncodeError's message with the failed character and its position is preferable -- for developers to see exactly why it failed ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 |
From: SourceForge.net <no...@so...> - 2007-08-23 05:05:42
|
Patches item #1775263, was opened at 2007-08-16 13:20 Message generated for change (Comment added) made by ayeshaiqbal You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ayesha (ayeshaiqbal) Assigned to: Nobody/Anonymous (nobody) Summary: patch for bug [1768979]:hasattr,getattr Initial Comment: This fix checks whether the attribute string is unicode.If SO a UnicodeError is raised.The test file test_builtin now executes without any error Thanks, Ayesha ---------------------------------------------------------------------- >Comment By: ayesha (ayeshaiqbal) Date: 2007-08-23 09:05 Message: Logged In: YES user_id=1856489 Originator: YES That was a valuable suggestion .I have made the necessary changes and uploaded the new patch File Added: hasattr.patch ---------------------------------------------------------------------- Comment By: Philip Jenvey (pjenvey) Date: 2007-08-23 03:34 Message: Logged In: YES user_id=145787 Originator: NO throwing a UnicodeError here isn't the same as CPython. Since CPython is dealing with an actual unicode object, it will encode() it, and when the encoding fails you'll end up with the typical UnicodeEncodeError: 'ascii' codec can't encode character u'\xe' in position 0: ordinal not in range(128) This patch's behavior is similar, but python code will be expecting to catch UnicodeEncodeErrors when these operations fail, not its base class UnicodeError. You might want to force an encode operation here instead. If encode() is much slower than isunicode, maybe only encode() if isunicode() returns true. You could also throw the UnicodeEncodeError yourself, but preserving the full UnicodeEncodeError's message with the failed character and its position is preferable -- for developers to see exactly why it failed ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 |
From: SourceForge.net <no...@so...> - 2007-09-22 19:13:36
|
Patches item #1775263, was opened at 2007-08-16 04:20 Message generated for change (Comment added) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ayesha (ayeshaiqbal) Assigned to: Nobody/Anonymous (nobody) Summary: patch for bug [1768979]:hasattr,getattr Initial Comment: This fix checks whether the attribute string is unicode.If SO a UnicodeError is raised.The test file test_builtin now executes without any error Thanks, Ayesha ---------------------------------------------------------------------- >Comment By: Charles Groves (cgroves) Date: 2007-09-22 14:13 Message: Logged In: YES user_id=1174327 Originator: NO It makes more sense for this check to live in __findattr__(PyString) instead of __findattr__(String). The first place would allow you to do an instanceof PyUnicode check instead of making a PyString out of every String that comes in to __findattr__. __findattr__ is used from all over the place, so slowing it down is a bad idea. If some Java code is calling __findattr__(String) with unicode Strings, this should be fixed there rather than in PyObject. Also, you're using tabs rather than spaces for indentation. ---------------------------------------------------------------------- Comment By: ayesha (ayeshaiqbal) Date: 2007-08-23 00:05 Message: Logged In: YES user_id=1856489 Originator: YES That was a valuable suggestion .I have made the necessary changes and uploaded the new patch File Added: hasattr.patch ---------------------------------------------------------------------- Comment By: Philip Jenvey (pjenvey) Date: 2007-08-22 18:34 Message: Logged In: YES user_id=145787 Originator: NO throwing a UnicodeError here isn't the same as CPython. Since CPython is dealing with an actual unicode object, it will encode() it, and when the encoding fails you'll end up with the typical UnicodeEncodeError: 'ascii' codec can't encode character u'\xe' in position 0: ordinal not in range(128) This patch's behavior is similar, but python code will be expecting to catch UnicodeEncodeErrors when these operations fail, not its base class UnicodeError. You might want to force an encode operation here instead. If encode() is much slower than isunicode, maybe only encode() if isunicode() returns true. You could also throw the UnicodeEncodeError yourself, but preserving the full UnicodeEncodeError's message with the failed character and its position is preferable -- for developers to see exactly why it failed ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1775263&group_id=12867 |