[ python-Bugs-1193190 ] MACOSX_DEPLOYMENT_TARGET checked incorrectly
Bugs item #1193190, was opened at 2005-04-30 20:15 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=1193190&group_id=5470 Category: Distutils Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Bob Ippolito (etrepum) Assigned to: Bob Ippolito (etrepum) Summary: MACOSX_DEPLOYMENT_TARGET checked incorrectly Initial Comment: MACOSX_DEPLOYMENT_TARGET should be checked to be >= the configure time value (or not set). Currently, it checks for equality. For example, this is necessary in order to use a Python built for Mac OS X 10.3 but build an extension with features specific to Mac OS X 10.4. Backport candidate to 2.4, patches attached. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193190&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1193180 ] Strange os.path.exists() results with invalid chars
Bugs item #1193180, was opened at 2005-04-30 23:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193180&group_id=5470 Category: Windows Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Daniele Varrazzo (dvarrazzo) Assigned to: Nobody/Anonymous (nobody) Summary: Strange os.path.exists() results with invalid chars Initial Comment: Hi, when there are invalid chars in a filename, os.path.exists () behaves oddly, returning True. The bug appears on win32 system, not on unix ones. Thus is probably related to some weird windows api call and doesn't maybe worth fixing. Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> f = file("a_b", "w") >>> f.close() >>> os.listdir(".") ['a_b'] >>> os.path.exists("a>> os.path.exists("a>b") True And, even more strange... >>> os.path.exists("a<") True >>> os.path.exists("a>") False Better answers would have been: * False * raise ValueError -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193180&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-1193128 ] 'str'.translate(None) => identity translation
Feature Requests item #1193128, was opened at 2005-04-30 13:31 Message generated for change (Settings changed) made by bokr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1193128&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bengt Richter (bokr) >Assigned to: Raymond Hettinger (rhettinger) Summary: 'str'.translate(None) => identity translation Initial Comment: This feature would permit passing None as the first argument to str.translate in place of an identity translation table like ''.join([[chr(i) for i in xrange(256)]) This should be handy for deleting characters, e.g., as in s = s.translate(None, delchars) -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1193128&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-1193128 ] 'str'.translate(None) => identity translation
Feature Requests item #1193128, was opened at 2005-04-30 13:31 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=1193128&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bengt Richter (bokr) Assigned to: Nobody/Anonymous (nobody) Summary: 'str'.translate(None) => identity translation Initial Comment: This feature would permit passing None as the first argument to str.translate in place of an identity translation table like ''.join([[chr(i) for i in xrange(256)]) This should be handy for deleting characters, e.g., as in s = s.translate(None, delchars) -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1193128&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1193099 ] Embedded python thread crashes
Bugs item #1193099, was opened at 2005-04-30 12: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=1193099&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: ugodiggi (ugodiggi) Assigned to: Nobody/Anonymous (nobody) Summary: Embedded python thread crashes Initial Comment: The following code crashes about 1/3 of the times. My platform is Python 2.4.1 on WXP (I tried the release version from the msi and the debug version built by me). I can reproduce the same behavior on another wxp system, under python 2.4. The crash happens (in the python thread) while the main thread is in Py_Finalize. I traced the crash to _Py_ForgetReference(op) in object.c at line 1847, where I have op->_ob_prev == NULL. The open file seems to be the issue, since if I remove all the references to the file I cannot get the program to crash. Cheers and ciao Ugo // TestPyThreads.cpp // #include // Sleep #include "Python.h" int main() { PyEval_InitThreads(); Py_Initialize(); PyGILState_STATE main_restore_state = PyGILState_UNLOCKED; PyGILState_Release(main_restore_state); // start the thread { PyGILState_STATE state = PyGILState_Ensure(); int trash = PyRun_SimpleString( "import thread\n" "import time\n" "def foo():\n" " f = open('pippo.out', 'w', 0)\n" " i = 0;\n" " while 1:\n" "f.write('%d\n'%i)\n" "time.sleep(0.01)\n" "i += 1\n" "t = thread.start_new_thread(foo, ())\n" ); PyGILState_Release(state); } // wait 300 ms Sleep(300); PyGILState_Ensure(); Py_Finalize(); return 0; } -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193099&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-1191699 ] make slices pickable
Feature Requests item #1191699, was opened at 2005-04-28 13:44 Message generated for change (Comment added) made by sdementen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1191699&group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sebastien de Menten (sdementen) Assigned to: Nobody/Anonymous (nobody) Summary: make slices pickable Initial Comment: As suggested by the summary, provide pickability of slices by default. Currently one has to use copy_reg module to register slices as pickables. -- >Comment By: Sebastien de Menten (sdementen) Date: 2005-04-30 18:02 Message: Logged In: YES user_id=820079 Use case for pickable slices. Let A be a numeric array of size M x N. We want to consider sub-arrays in this array like A[:4, :] (the first 4 lines of the array). If we want to store both the array and the information of sub-arrays structures, we need to store slices (we can also store start/end indices of the array ... but this is call a slice so it would be better to have pickable slices). In fact, whenever one wants to write generic algorithm working on "sublist of lists" or "subarrays of arrays" or "sub-items of collection of items", it is nicer to use slice objects explicitly and so store them also explicitly. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-30 12:32 Message: Logged In: YES user_id=80475 Use cases? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1191699&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1193061 ] Python and Turkish Locale
Bugs item #1193061, was opened at 2005-04-30 20:37 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=1193061&group_id=5470 Category: Unicode Group: None Status: Open Resolution: None Priority: 5 Submitted By: S.Çağlar Onur (caglar) Assigned to: M.-A. Lemburg (lemburg) Summary: Python and Turkish Locale Initial Comment: On behalf of this thread; http://mail.python.org/pipermail/python-dev/2005-April/052968.html As described in http://www.i18nguy.com/unicode/turkish-i18n.html [ How Applications Fail With Turkish Language ] , Turkish has 4 "i" in their alphabet. Without --with-wctype-functions support Python convert these characters locare-independent manner in tr_TR.UTF-8 locale. So all conversitons maps to "i" or "I" which is wrong in Turkish locale. So if Python Developers will remove the wctype functions from Python, then there must be a locale-dependent upper/lower funtion to handle these characters properly. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193061&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1193001 ] Notation
Bugs item #1193001, was opened at 2005-04-30 16:01 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=1193001&group_id=5470 Category: Documentation Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Mythril (mythrix) Assigned to: Nobody/Anonymous (nobody) Summary: Notation Initial Comment: In Notation, it says the BNF form used is: name: lc_letter (lc_letter | "_")* lc_letter: "a"..."z" But in the documentation, it is: identifier ::= (letter|"_") (letter | digit | "_")* letter ::= lowercase | uppercase (ie, ::=, and not :) -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193001&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-1191699 ] make slices pickable
Feature Requests item #1191699, was opened at 2005-04-28 08:44 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1191699&group_id=5470 >Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sebastien de Menten (sdementen) Assigned to: Nobody/Anonymous (nobody) Summary: make slices pickable Initial Comment: As suggested by the summary, provide pickability of slices by default. Currently one has to use copy_reg module to register slices as pickables. -- >Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-30 07:32 Message: Logged In: YES user_id=80475 Use cases? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1191699&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-1184678 ] "replace" function should accept lists.
Feature Requests item #1184678, was opened at 2005-04-17 11:05 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1184678&group_id=5470 Category: None Group: None Status: Open Resolution: Rejected Priority: 5 Submitted By: Poromenos (poromenos) Assigned to: Nobody/Anonymous (nobody) Summary: "replace" function should accept lists. Initial Comment: It would be nice if the "replace" function accepted lists/ tuples and replaced each item in the "old" list with the corresponding item in the "new" list. -- >Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-30 07:30 Message: Logged In: YES user_id=80475 Sorry, am not going to gum up the API for this. It doesn't come up much and when it does it is an easy problem. Each additional option on a function makes it harder to learn, use, and remember. Likewise, it complicates maintenance. Also, this one has its own complexities that make it worth avoiding (examples can be contrived when the for-loop version produces a different result than replacing each match as found). A good implementation would take time. It would involve regexps and have to be done for unicode objects. -- Comment By: Poromenos (poromenos) Date: 2005-04-30 04:48 Message: Logged In: YES user_id=267121 That is true, the alternative loop is quite usable, but the API change would be backwards-compatible, and the implementation is not very difficult... I just see this as a nice feature of replace, it's not really necessary if it'll break other stuff. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-29 09:10 Message: Logged In: YES user_id=80475 Given the multiple alternative input matches, this is a job for regular expressions. See the string.substitute() source code for an approach to making the transformation you outlined. I do not think multi-replace is sufficiently common to warrant a change to the API. If needed and if the regexp solution is too hard, then a regular for-loop is a reasonable alternative: for old, new in zip(oldlist, newlist): s = s.replace(old, new) -- Comment By: Poromenos (poromenos) Date: 2005-04-29 08:03 Message: Logged In: YES user_id=267121 There was an oversight on my part... Translate can only be used to change individual characters, what I am proposing could replace strings of multiple characters, essentially concatenating multiple replace()s in one: >>> "h.w".replace(["h", ".", "w"], ["Hello", " ", "World!"]) 'Hello, World!' -- Comment By: Poromenos (poromenos) Date: 2005-04-18 17:23 Message: Logged In: YES user_id=267121 Ah, I did not know that... The docs are a bit complicated on . translate, but since it can do that, yes, it would be unwise to implement my suggestion. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-18 17:20 Message: Logged In: YES user_id=80475 I'm -1 on complicating str.replace()'s API for functionality that substantially duplicates that offered by str.translate(): >>> "Hello world".translate(string.maketrans('ed', 'ae')) 'Hallo worle' -- Comment By: Poromenos (poromenos) Date: 2005-04-18 16:15 Message: Logged In: YES user_id=267121 Hmm, actually I was requesting that string.replace() accepted lists of substitutions, like so: >>> "Hello world".replace(["e", "d"], ["a", "e"]) 'Hallo worle' But your suggestion would also be very useful. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-18 16:11 Message: Logged In: YES user_id=80475 Are you requesting that lists be given a replace() method that parallels the replace() method for strings? def replace(self, old, new): result = [] for elem in self: if elem == old: result.append(new) else: result.append(elem) self[:] = result -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1184678&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-1184678 ] "replace" function should accept lists.
Feature Requests item #1184678, was opened at 2005-04-17 19:05 Message generated for change (Comment added) made by poromenos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1184678&group_id=5470 Category: None Group: None Status: Open Resolution: Rejected Priority: 5 Submitted By: Poromenos (poromenos) Assigned to: Nobody/Anonymous (nobody) Summary: "replace" function should accept lists. Initial Comment: It would be nice if the "replace" function accepted lists/ tuples and replaced each item in the "old" list with the corresponding item in the "new" list. -- >Comment By: Poromenos (poromenos) Date: 2005-04-30 12:48 Message: Logged In: YES user_id=267121 That is true, the alternative loop is quite usable, but the API change would be backwards-compatible, and the implementation is not very difficult... I just see this as a nice feature of replace, it's not really necessary if it'll break other stuff. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-29 17:10 Message: Logged In: YES user_id=80475 Given the multiple alternative input matches, this is a job for regular expressions. See the string.substitute() source code for an approach to making the transformation you outlined. I do not think multi-replace is sufficiently common to warrant a change to the API. If needed and if the regexp solution is too hard, then a regular for-loop is a reasonable alternative: for old, new in zip(oldlist, newlist): s = s.replace(old, new) -- Comment By: Poromenos (poromenos) Date: 2005-04-29 16:03 Message: Logged In: YES user_id=267121 There was an oversight on my part... Translate can only be used to change individual characters, what I am proposing could replace strings of multiple characters, essentially concatenating multiple replace()s in one: >>> "h.w".replace(["h", ".", "w"], ["Hello", " ", "World!"]) 'Hello, World!' -- Comment By: Poromenos (poromenos) Date: 2005-04-19 01:23 Message: Logged In: YES user_id=267121 Ah, I did not know that... The docs are a bit complicated on . translate, but since it can do that, yes, it would be unwise to implement my suggestion. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-19 01:20 Message: Logged In: YES user_id=80475 I'm -1 on complicating str.replace()'s API for functionality that substantially duplicates that offered by str.translate(): >>> "Hello world".translate(string.maketrans('ed', 'ae')) 'Hallo worle' -- Comment By: Poromenos (poromenos) Date: 2005-04-19 00:15 Message: Logged In: YES user_id=267121 Hmm, actually I was requesting that string.replace() accepted lists of substitutions, like so: >>> "Hello world".replace(["e", "d"], ["a", "e"]) 'Hallo worle' But your suggestion would also be very useful. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-04-19 00:11 Message: Logged In: YES user_id=80475 Are you requesting that lists be given a replace() method that parallels the replace() method for strings? def replace(self, old, new): result = [] for elem in self: if elem == old: result.append(new) else: result.append(elem) self[:] = result -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1184678&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com