[issue11244] Negative tuple elements produce inefficient code.
Mark Dickinson dicki...@gmail.com added the comment: Eugene's new patch looks good to me; +1 on applying it. Raymond, do you happen to remember why it was necessary to add the zero-check in the first place? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3 but 10.5 during configure
Ned Deily n...@acm.org added the comment: Another way this issue can show up: when building Python itself. If Parser/Python.asdl needs to be built (as with a new source checkout), the makefile target executes a python script (Parser/asdl_c.py) via /usr/bin/env python (a bootstrap dependency). If that python happens to be python2.7 and the build MACOSX_DEPLOYMENT_TARGET target is not the same as that as that of the python2.7, the python2.7 fails with the $MACOSX_DEPLOYMENT_TARGET mismatch from sysconfig.py _init_posix and thus the build fails. The patch looks good to me except that all of the assertEquals (now deprecated) should be changed to assertEqual. I think parts 1 and 2 should definitely be applied to py3k, 3.2, and 2.7. I'm less certain about the distutils changes (parts 3 and 4) but I agree they are probably the right thing to do. Then there's the issue of getting corresponding changes into distutils2 if needed. -- nosy: +ned.deily stage: needs patch - commit review versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11244] Negative tuple elements produce inefficient code.
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nvawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Eugene Crosser cros...@average.org added the comment: I don't know if the solution suggested in the report is right, but I can confirm the the current logic of getdefaultlocale() produces wrong results. I have LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 which means, according to the documentation, Do everything in English, but recognize Russian words and sort according to Russian alphabet. All other software honors that semantics, except Python that returns Russian as the overall default locale: Python 2.7.1+ (r271:86832, Feb 24 2011, 15:00:15) [GCC 4.5.2] on linux2 Type help, copyright, credits or license for more information. import locale print locale.getdefaultlocale() ('ru_RU', 'UTF8') I believe that because LC_CTYPE controls only one specific aspect of the locale, it either should not be used at all, or used only as the last resort when locale cannot be determined from LANG or LANGUAGE. I think that the current search order envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE') is wrong. -- nosy: +crosser ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11131] decimal.py: plus/minus with ROUND_FLOOR
Roundup Robot devnull@devnull added the comment: New changeset d5fe8b33f711 by Mark Dickinson in branch '2.7': Issue 11131: Fix sign of zero result on plus and minus operations in ROUND_FLOOR rounding mode. http://hg.python.org/cpython/rev/d5fe8b33f711 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11131] decimal.py: plus/minus with ROUND_FLOOR
Roundup Robot devnull@devnull added the comment: New changeset 1c4be28cda5b by Mark Dickinson in branch '3.1': Issue 11131: Fix sign of zero result on decimal.Decimal plus and minus operations in ROUND_FLOOR rounding mode. http://hg.python.org/cpython/rev/1c4be28cda5b New changeset 426057570bee by Mark Dickinson in branch '3.2': Merge #11131 http://hg.python.org/cpython/rev/426057570bee New changeset af0dcd9df0c0 by Mark Dickinson in branch 'default': Merge #11131 http://hg.python.org/cpython/rev/af0dcd9df0c0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11131] decimal.py: plus/minus with ROUND_FLOOR
Mark Dickinson dicki...@gmail.com added the comment: Fixed in 2.7, 3.1, 3.2, 3.3. Closing. -- resolution: - fixed status: open - closed versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Eugene: i disagree. The semantics are correct according to C standards: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html -- nosy: +sdaoden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1099] Mac compile fails with pydebug and framework enabled
Ned Deily n...@acm.org added the comment: The patch, as is, fixes another build failure mode that has been reported (http://article.gmane.org/gmane.comp.python.general/685151): ./configure --enable-framework ; make I verified that 3.2 builds without the patch fail on both 10.5 ppc and 10.4 ppc (10.4 fails thusly): ld: Undefined symbols: ___divdi3 ___moddi3 ___fixdfdi /usr/bin/libtool: internal link edit command failed and builds works and tests pass with the patch on both. It doesn't totally fix yet another use case (http://permalink.gmane.org/gmane.comp.python.general/685512), that of building an i386-only Python on a 10.6 64-bit-capable system: ./configure '--enable-framework' 'CFLAGS=-arch i386' 'CPPFLAGS=-arch i386' 'LDFLAGS=-arch i386' With the patch, the build gets a bit further and the modified libpython make step emits the warning: ld: warning: in libpython3.3m.a, file was built for unsupported file format which is not the architecture being linked (x86_64) but then the python.exe build step fails with: ld: warning: in Python.framework/Versions/3.3/Python, file was built for unsupported file format which is not the architecture being linked (i386) The problem is that the libpython step (both originally and in the patch) does not take LDFLAGS into account. Changing one line in the patch fixes that: $(CC) -o $(LDLIBRARY) @UNIVERSAL_ARCH_FLAGS@ -dynamiclib \ - @FRAMEWORK_LINK_FLAGS@ \ + @FRAMEWORK_LINK_FLAGS@ $(PY_LDFLAGS) \ -all_load $(LIBRARY) -Wl,-single_module \ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1099 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1271] Raw string parsing fails with backslash as last character
Graham Wideman initcont...@grahamwideman.com added the comment: Thanks to all for your patient comments. I think I am resigned to raw-string forever being medium-rare-string :-). Perhaps it's obvious once you get over the initial shock of non-rawness, but workarounds for the disallowed trailing backslash include (note the final space character): mydir = rC:\somedir\ .rstrip() or... mydir = rC:\somedir\ [:-1] It might be worth mentioning one of these in the raw string docs to emphasize that there is this gotcha, that it's easy to fix, and prompting this as an idiom that becomes familiar in applications where it's needed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1271 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: (Eugene, whereas i still disagree (i'm a C programmer in daily life), Python 3.3a0 (default, Mar 10 2011, 11:50:55) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type help, copyright, credits or license for more information. import locale print(locale.getdefaultlocale()) ('en_GB', 'UTF8') So it seems i'm still to new to give you a hint here, sorry..) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Eugene Crosser cros...@average.org added the comment: Steffen: can you please be more specific? As I read the seciton 8.2 of the cited document, I do not see a disparity with my statement. There is even an example: For example, if a user wanted to interact with the system in French, but required to sort German text files, LANG and LC_COLLATE could be defined as: LANG=Fr_FR LC_COLLATE=De_DE which is (almost) exactly my case. I have LANG set to en_US to tell the system that I want to interact in English, and LC_CTYPE - to Russian to tell it that classification of characters needs to be Russian-specific. Note that I do *not* have LC_ALL set, because it takes precedence over all other LC_* variables which is *not* what I want. I believe that the correct guessing order, according to the document that you cited, would be: LANG LC_ALL then possibly (possibly because it does not have encoding info) LANGUAGE then optionally, as a last resort LC_CTYPE and other LC_* variables. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6981] locale.getdefaultlocale() envvars default code and documentation mismatch
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: On Sat, Mar 12, 2011 at 12:54:08PM +, Eugene Crosser wrote: Steffen: can you please be more specific? I can't, dear Eugene, because you are completely right and i am completely wrong. I believe that the correct guessing order [...] Well, thank you ... but it would have been better for me to go to the kitchen and drink a cup of nice tea before my post! I believe that because LC_CTYPE controls only one specific aspect of the locale, it either should not be used at all, or used only as the last resort when locale cannot be determined from LANG or LANGUAGE. I think that the current search order envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE') is wrong I really agree with you. Except for LC_ALL and LANG (and LANGUAGE, but this is non-standart for C; it seem to have been pushed forward by the GNU people and is documented by Python, however) nothing should be part of the evaluation of a getdefaultlocale(). (I am personally not so sure about that getdefaultlocale() at all. That is, whereas i *may* understand the existence of a locale.getpreferredencoding() (but with different semantics as in #11022 but that's not of interest here), because you need to setup your I/O layer so that it works in the system's environment anyway, i personally think that getdefaultlocale() is too much. I.e. getdefaultlocale() behaves as if setlocale() has been used but without setlocale() being used yet. This is a fine hint for an application that wants to use the users locale settings without using the users locale settings! Just do a grep(1) on Lib/ ...) Thanks once again for your kindness! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6981 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2142] difflib.unified_diff(...) produces invalid patches
Éric Araujo mer...@netwok.org added the comment: Patch does not look bad. I re-read the discussion on python-dev, where it was suggested to add a keyword argument to get the old behavior. Have you considered it? -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10461] Use with statement throughout the docs
Roundup Robot devnull@devnull added the comment: New changeset cebaf1bdaf78 by Éric Araujo in branch 'default': Fix example in atexit doc: Both open and read could raise the IOError (#10461 follow-up). http://hg.python.org/cpython/rev/cebaf1bdaf78 -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10461 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10461] Use with statement throughout the docs
Éric Araujo mer...@netwok.org added the comment: Thanks for the catch! I was so used to the idiom where opening the file doesn’t fail but you protect the read or write that I didn’t think about the issue here. -- stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10461 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11468] Improve unittest basic example in the doc
Éric Araujo mer...@netwok.org added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9856] Change object.__format__(s) where s is non-empty to a DeprecationWarning
Roundup Robot devnull@devnull added the comment: New changeset ee259a4f3eee by Eric V. Smith in branch 'default': Issue 9856: Change object.__format__ with a non-empty format string from a PendingDeprecationWarning to a DeprecationWarning. http://hg.python.org/cpython/rev/ee259a4f3eee -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9856 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9856] Change object.__format__(s) where s is non-empty to a TypeError
Eric Smith e...@trueblade.com added the comment: Next step is to make it a TypeError in 3.4. -- priority: normal - release blocker title: Change object.__format__(s) where s is non-empty to a DeprecationWarning - Change object.__format__(s) where s is non-empty to a TypeError versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9856 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2142] difflib.unified_diff(...) produces invalid patches
Ray.Allen ysj@gmail.com added the comment: I re-read the discussion on python-dev, where it was suggested to add a keyword argument to get the old behavior. Have you considered it? IIUC, at the time of that discusstion, 3.2 is pre-beta so the suitable option is to add \No newline etc by default and add a keyword to get the old behavior, but now it is for 3.3. I wonder if 3.3 is a chance to totally get rid of the *OLD WRONG* behavior. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11474] url2pathname() handling of '/C|/' on Windows
New submission from Bastian Kleineidam cal...@users.sourceforge.net: Python 2.7 on Windows converts the URL path '/C|/' to a naked drive letter 'C:'. C:\srcc:\Python27\python.exe -c import urllib;print urllib.url2pathname('/C|/') C: C:\src Expected and I believe the correct output would be C:\, not C:. Reason is that a naked drive letter C: means current directory in drive C:, whereas C:\ means root directory in drive C:. So if you happen to start your application in C:\src for example, the output C: is interpreted as C:\src, not as C:\. -- components: Library (Lib) messages: 130684 nosy: calvin priority: normal severity: normal status: open title: url2pathname() handling of '/C|/' on Windows versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11474 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11466] getpass.getpass doesn't close tty file
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: This patch makes getpass.getpass() comply with the documented behaviour and fixes #11466. It will require no further adjustments for #11236 (except what valhallasw's patch does, of course). It applies cleanly to: 16:32 ~/src/cpython $ hg identify ee259a4f3eee tip -- Added file: http://bugs.python.org/file21093/11466.3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11466 ___diff --git a/Lib/getpass.py b/Lib/getpass.py --- a/Lib/getpass.py +++ b/Lib/getpass.py @@ -38,27 +38,28 @@ Always restores terminal settings before returning. -fd = None tty = None -try: -# Always try reading and writing directly on the tty first. -fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) -tty = os.fdopen(fd, 'w+', 1) -input = tty -if not stream: -stream = tty -except EnvironmentError as e: -# If that fails, see if stdin can be controlled. +exinst = None +passwd = None +# Something to break off if an error happens +while 1: try: -fd = sys.stdin.fileno() -except (AttributeError, ValueError): -passwd = fallback_getpass(prompt, stream) -input = sys.stdin -if not stream: -stream = sys.stderr +# Always try reading and writing directly on the tty first. +fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) +input = tty = os.fdopen(fd, 'w+', 1) +if not stream: +stream = tty +except EnvironmentError as e: +# If that fails, see if stdin can be controlled. +try: +fd = sys.stdin.fileno() +except: +# We need to use the generic fallback implementation +break +if not stream: +stream = sys.stderr +input = sys.stdin -if fd is not None: -passwd = None try: old = termios.tcgetattr(fd) # a copy to save new = old[:] @@ -69,20 +70,28 @@ try: termios.tcsetattr(fd, tcsetattr_flags, new) passwd = _raw_input(prompt, stream, input=input) -finally: -termios.tcsetattr(fd, tcsetattr_flags, old) -stream.flush() # issue7208 +except Exception as e: +exinst = e +termios.tcsetattr(fd, tcsetattr_flags, old) except termios.error as e: if passwd is not None: # _raw_input succeeded. The final tcsetattr failed. Reraise # instead of leaving the terminal in an unknown state. -raise -# We can't control the tty or stdin. Give up and use normal IO. -# fallback_getpass() raises an appropriate warning. -del input, tty # clean up unused file objects before blocking -passwd = fallback_getpass(prompt, stream) +exinst = e +break -stream.write('\n') +if not exinst and passwd is None: +# We can't control the tty or stdin. Give up and use normal IO. +# fallback_getpass() raises an appropriate warning. +passwd = fallback_getpass(prompt, stream) + +if stream: +stream.write('\n') +stream.flush() # issue7208, 7246 +if tty: +tty.close() +if exinst: +raise exinst return passwd ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
saffroy saff...@gmail.com added the comment: I could spend some time on a small patch. Here are the changes I would consider: - netrc.authenticators() could return the first entry matching a given host (now it returns the last) - it could also accept an extra parameter (with default=None), a login to select the right account/password for a given host - it could also return a list of entries (tuples) matching the supplied host (now it always returns only one tuple), or a new method could do that IMHO the last change would make the overall behaviour more consistent (BTW note the plural for authenticators), but it could also break existing apps. Comments? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1099] Mac compile fails with pydebug and framework enabled
Ronald Oussoren ronaldousso...@mac.com added the comment: Good catch, and that would also allow dropping the change to configure.in (which would only ensure that -isysroot gets defined correctly). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1099 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11464] Call Mac API Crash via ctypes
Ronald Oussoren ronaldousso...@mac.com added the comment: yufun, you better ask on python-list or the pythonmac-sig e-mail list (http://www.python.org/community/sigs/current/pythonmac-sig/). The added bonus is that you'll get into contact with other users of Python on OSX. The ctypes API is explained here: http://docs.python.org/library/ctypes.html. This page also explains how to specify the function signature for the function you try to call. -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11464 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11475] trunc in documentation of numbers.Real should math.trunc
New submission from MATSUI Tetsushi m...@users.sourceforge.net: In the documentation of numbers.Real: In short, those are: a conversion to float, trunc(), round(), math.floor(), math.ceil(), divmod(), //, %, , =, , and =. where only trunc is not linked if we look at it in html pages. This is because the function trunc is not in built-in namespace, but in math module. So we should call it math.trunc similarly to math.floor, etc. -- assignee: docs@python components: Documentation messages: 130690 nosy: docs@python, mft priority: normal severity: normal status: open title: trunc in documentation of numbers.Real should math.trunc versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11476] StreamHandler code broken by change of parameter name
New submission from follower bugs.python@rancidbacon.com: The following change broke pre-existing code that used strm as the parameter name (as documented http://docs.python.org/release/2.6.6/library/logging.html#streamhandler): http://hg.python.org/cpython/diff/7391436d8a74/Lib/logging/__init__.py The parameter name was changed with no documentation note that it had changed in 2.7: http://docs.python.org/library/logging.html#stream-handler This breaks existing code with the error: TypeError: __init__() got an unexpected keyword argument 'strm' I encountered it in pyres but it broke Ubuntu bug reporting too: https://bugs.launchpad.net/ubuntu/+source/launchpad-integration/+bug/702455 -- assignee: docs@python components: Documentation, Library (Lib) messages: 130691 nosy: docs@python, follower priority: normal severity: normal status: open title: StreamHandler code broken by change of parameter name type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11476 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11475] trunc in documentation of numbers.Real should math.trunc
Benjamin Peterson benja...@python.org added the comment: 7fd06773c3c2 -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3132] implement PEP 3118 struct changes
Meador Inge mead...@gmail.com added the comment: Is there still any interest in this work? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3132] implement PEP 3118 struct changes
Mark Dickinson dicki...@gmail.com added the comment: Yes, there's interest (at least here). I've just been really short on Python-time recently, so haven't found time to review your patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3132] implement PEP 3118 struct changes
Mark Dickinson dicki...@gmail.com added the comment: I'm going to unassign for now; I still hope to look at this at some point, but can't see a time in the near future when it's going to happen. -- assignee: mark.dickinson - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11329] PyEval_InitThreads() not safe before Py_Initialize()
Gediminas Liktaras glikta...@gmail.com added the comment: I have attached a patch that fixes this issue. Please let me know if there are any problems. -- keywords: +patch nosy: +gliktaras Added file: http://bugs.python.org/file21094/issue11329-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11329 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11477] Bug in code dispatching based on internal slots
New submission from Terry J. Reedy tjre...@udel.edu: Example (which can serve as testcase with buggy output corrected). class C(object): def __iter__(self): yield 'yes!' def __radd__(self, other): other.append('bug!') return other def __rmul__(self, other): other *= 2 return other def __index__(self): return 3 class L(list): def __iadd__(self, other): list.__iadd__(self,other) return self def __mul__(self, other): return L(list.__imul__(self,other)) z1, z2, c = [], L(), C() z1 += c z2 += c print(z1, z2, [1]*c, L([1])*c) ['bug!'] ['yes!'] [1, 1] [1, 1, 1] # PyPy prints ['yes!'], [1, 1, 1] Cause was diagnosed by Greg Price in http://codespeak.net/pipermail/pypy-dev/2011q1/006958.html as checking forward and reverse numeric slots before checking sequence slots for C-coded classes. Such a difference does not exist in Python itself. In About raising NotPortableWarning for CPython specific code pydev thread starting at http://codespeak.net/pipermail/pypy-dev/2011q1/006958.html Nick Coghlin identified the fix as When a given operation has multiple C level slots, shouldn't we be checking all the LHS slots before checking any of the RHS slots? Guido replied Yeah, indeed, on everything you said. The code dispatching based on internal slots is horribly ad-hoc and likely wrong in subtle ways. I personally think fix should be backported to 2.7 and 3.2, but did not select them because that may be controversial. -- components: Interpreter Core messages: 130698 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Bug in code dispatching based on internal slots type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11477] Bug in code dispatching based on internal slots
Changes by Andreas Stührk andy-pyt...@hammerhartes.de: -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10665] Expand unicodedata module documentation
Ezio Melotti ezio.melo...@gmail.com added the comment: I think Georg said that non-ascii chars shouldn't be used directly in the rst files, and one of the reasons is that they break `make pdf` (I haven't tried though). I added him to the nosy. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11426] CSV examples can't close their files
Ezio Melotti ezio.melo...@gmail.com added the comment: This should be now fixed in 3.x, but not on 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11426 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11477] Bug in code dispatching based on internal slots
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11476] StreamHandler code broken by change of parameter name
Roundup Robot devnull@devnull added the comment: New changeset 6d56d2c63a04 by Vinay Sajip in branch '2.7': Fixes issue #11476: StreamHandler parameter name change documented. http://hg.python.org/cpython/rev/6d56d2c63a04 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11476 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11476] StreamHandler code broken by change of parameter name
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- assignee: docs@python - vinay.sajip nosy: +vinay.sajip resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11476 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue670664] HTMLParser.py - more robust SCRIPT tag parsing
Ezio Melotti ezio.melo...@gmail.com added the comment: Thanks for the patch, however it would be better if you could get a clone of the CPython repo and make a patch against it. The patch should also include tests. You can check http://docs.python.org/devguide/ for more information. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue670664 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables
Ronald Oussoren ronaldousso...@mac.com added the comment: IMHO the change to 'bits' is bogus, it is supposed to return the bit-size of the executable, not that of the currently running executable. I'd return all executable bitsizes in bits as '32bit', '64bit' or '32bit,64bit' (as appropriate) and only include the machine architectures in the linkage result. And finally the executable file format is 'Mach-O', not 'Mach'. I can provide an updated patch if Marc-Andre agrees that this would be a usefull change. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10735 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3493] No Backslash (\) in IDLE 1.2.2
Ronald Oussoren ronaldousso...@mac.com added the comment: Do I understand it correctly when I write that you normally use Option+Slash to enter a backslash on your keyboard? That would explain why updating the keyboard bindings makes it possible to type a backslash. I'm not sure how we could fix this issue in a way that wouldn't break existing bindings for folks with an english keyboard (as just updating the default keybindings would likely upset those people). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3493 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5154] OSX broken poll testing doesn't work
Ronald Oussoren ronaldousso...@mac.com added the comment: Florent: I don't understand why the traceback you show is related to this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5154 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11312] Confusing sentence in file.readline() doc
Benjamin Peterson benja...@python.org added the comment: c017695acf19 -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11312 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2771] Test issue
Changes by Antoine Pitrou pit...@free.fr: -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2771 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2771] Test issue
Roundup Robot devnull@devnull added the comment: New changeset 93a15af3a8ce by Antoine Pitrou in branch 'default': fixes #2771 http://hg.python.org/test/rev/93a15af3a8ce -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2771 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2771] Test issue
Roundup Robot devnull@devnull added the comment: New changeset acd842ea10e6 by Antoine Pitrou in branch 'default': closes #2771 http://hg.python.org/test/rev/acd842ea10e6 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2771 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8933] Invalid detection of metadata version
Filip Gruszczyński grusz...@gmail.com added the comment: Here is patch for distutils2. Or maybe you would prefer a patch made by hg export? -- Added file: http://bugs.python.org/file21095/disutils2_8933.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8933 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11406] There is no os.listdir() equivalent returning generator instead of list
Torsten Landschoff t.landsch...@gmx.net added the comment: I would regard this as Type: resource usage, instead of performance. Given enough RAM, loading the whole directory at once will likely be faster. The downsides of os.listdir: a) You can't get a peek at the files so far, it's all or nothing. I only wanted to know if a directory is empty and I have to read the whole thing just to throw it away (maybe I missed another library function?) b) Using it in a GUI basically requires you to use threads if you may run into a dir with many files. Especially on a slow filesystem (network). Because you won't regain control until the whole thing is read. I would like to have an iterator version as well, but I also dislike another function (especially the x prefix). How about adding a keyword argument to select iterator behaviour? -- nosy: +torsten ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11406 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11406] There is no os.listdir() equivalent returning generator instead of list
Antoine Pitrou pit...@free.fr added the comment: I would like to have an iterator version as well, but I also dislike another function (especially the x prefix). How about adding a keyword argument to select iterator behaviour? Changing the return type based on an argument is generally frown upon so, if anything, I think it would be better to have a separate function (whatever its name). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11406 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11406] There is no os.listdir() equivalent returning generator instead of list
Martin v. Löwis mar...@v.loewis.de added the comment: The downsides of os.listdir: a) You can't get a peek at the files so far, it's all or nothing. I only wanted to know if a directory is empty and I have to read the whole thing just to throw it away (maybe I missed another library function?) This depends somewhat on the operating system. On Unix, doing os.stat on the directory, then looking on st_nlink, will tell you whether the directory is empty (st_nlink is 2 on an empty directory). b) Using it in a GUI basically requires you to use threads if you may run into a dir with many files. Especially on a slow filesystem (network). Because you won't regain control until the whole thing is read. Hmm. In a GUI, you would typically want to sort the file names by some criterion, which typically requires you to read all files (even if you then only display some of them). I would like to have an iterator version as well, but I also dislike another function (especially the x prefix). How about adding a keyword argument to select iterator behaviour? I still would like to see a demonstrable improvement in a real-world application. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11406 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11282] 3.3 unittest document not kept consist with code
Ezio Melotti ezio.melo...@gmail.com added the comment: Michael, what's the status of this? Do you think some of the removed methods should be added back even if they are marked as removed in 3.3 in the 3.2 doc? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11282 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11478] Docs list nonexistant PyObject_CopyToData function
New submission from Thomas Wouters tho...@python.org: The buffer docs on http://docs.python.org/c-api/buffer.html list PyObject_CopyToData, but no such function seems to exist. -- assignee: docs@python components: Documentation messages: 130717 nosy: docs@python, twouters priority: normal severity: normal status: open title: Docs list nonexistant PyObject_CopyToData function ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11478 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11478] Docs list nonexistant PyObject_CopyToData function
Thomas Wouters tho...@python.org added the comment: Eh, I mean PyObject_CopyToObject. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11478 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11478] Docs list nonexistant PyObject_CopyToObject function
Changes by Thomas Wouters tho...@python.org: -- title: Docs list nonexistant PyObject_CopyToData function - Docs list nonexistant PyObject_CopyToObject function ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11478 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2650] re.escape should not escape underscore
SilentGhost ghost@gmail.com added the comment: Here is the latest patch for test_re incorporating review suggestions by Ezio and some improvements along the way. -- Added file: http://bugs.python.org/file21096/test_re.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2650 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11479] Add discussion of trailing slash in raw string to tutorial
New submission from R. David Murray rdmur...@bitdance.com: Here is a proposed addition to the tutorial noting the problem with using raw strings for windows paths and how to work around it. -- assignee: docs@python components: Documentation files: tutorial-raw-string.patch keywords: patch messages: 130720 nosy: QuantumTim, docs@python, facundobatista, georg.brandl, gwideman, r.david.murray, v+python priority: normal severity: normal stage: patch review status: open title: Add discussion of trailing slash in raw string to tutorial type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file21097/tutorial-raw-string.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11479 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1271] Raw string parsing fails with backslash as last character
R. David Murray rdmur...@bitdance.com added the comment: I've opened issue 11479 with a proposed patch to the tutorial along the lines suggested by Graham. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1271 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7391] Re-title the Using Backslash to Continue Statements anti-idiom
Roundup Robot devnull@devnull added the comment: New changeset e34b09c69dd3 by Raymond Hettinger in branch 'default': Issue #7391: Remove outdated HOWTO with permission of its author. http://hg.python.org/cpython/rev/e34b09c69dd3 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7391 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1271] Raw string parsing fails with backslash as last character
Glenn Linderman v+pyt...@g.nevcal.com added the comment: On 3/12/2011 7:11 PM, R. David Murray wrote: R. David Murrayrdmur...@bitdance.com added the comment: I've opened issue 11479 with a proposed patch to the tutorial along the lines suggested by Graham. Which is good, for people that use the tutorial. I jump straight to the reference guide, usually, because of so many years of experience with other languages. But I was surprised you used .strip() instead of [:-1] which is shorter and I would expect it to be more efficient also. -- Added file: http://bugs.python.org/file21098/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1271 ___!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta content=text/html; charset=UTF-8 http-equiv=Content-Type /head body text=#330033 bgcolor=#ff On 3/12/2011 7:11 PM, R. David Murray wrote: blockquote cite=mid:1299985866.81.0.0395618916066.issue1...@psf.upfronthosting.co.za type=cite pre wrap= R. David Murray a class=moz-txt-link-rfc2396E href=mailto:rdmur...@bitdance.com;lt;rdmur...@bitdance.comgt;/a added the comment: I've opened issue 11479 with a proposed patch to the tutorial along the lines suggested by Graham. /pre /blockquote br Which is good, for people that use the tutorial. I jump straight to the reference guide, usually, because of so many years of experience with other languages. But I was surprised you used .strip() instead of [:-1] which is shorter and I would expect it to be more efficient also.br /body /html ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7391] Re-title the Using Backslash to Continue Statements anti-idiom
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I discussed this with Moshe today and he agreed that the document is out-of-date and should be removed. -- nosy: +moshez resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7391 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3493] No Backslash (\) in IDLE 1.2.2
Peter Nielsen peter.ev...@gmail.com added the comment: Yes, that is correct . Well, thanks for replying, anyway. I guess I'll have to use linux instead. On Sun, Mar 13, 2011 at 12:00 AM, Ronald Oussoren rep...@bugs.python.orgwrote: Ronald Oussoren ronaldousso...@mac.com added the comment: Do I understand it correctly when I write that you normally use Option+Slash to enter a backslash on your keyboard? That would explain why updating the keyboard bindings makes it possible to type a backslash. I'm not sure how we could fix this issue in a way that wouldn't break existing bindings for folks with an english keyboard (as just updating the default keybindings would likely upset those people). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3493 ___ -- Added file: http://bugs.python.org/file21099/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3493 ___Yes, that is correct .divbr/divdivWell, thanks for replying, anyway. I guess I#39;ll have to use linux instead./divdivbr/divdivbrbrdiv class=gmail_quoteOn Sun, Mar 13, 2011 at 12:00 AM, Ronald Oussoren span dir=ltrlt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span wrote:br blockquote class=gmail_quote style=margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;br Ronald Oussoren lt;a href=mailto:ronaldousso...@mac.com;ronaldousso...@mac.com/agt; added the comment:br br Do I understand it correctly when I write that you normally use quot;Option+Slashquot; to enter a backslash on your keyboard?br br That would explain why updating the keyboard bindings makes it possible to type a backslash.br br I#39;m not sure how we could fix this issue in a way that wouldn#39;t break existing bindings for folks with an english keyboard (as just updating the default keybindings would likely upset those people).br br --br divdiv/divdiv class=h5br ___br Python tracker lt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br lt;a href=http://bugs.python.org/issue3493; target=_blankhttp://bugs.python.org/issue3493/agt;br ___br /div/div/blockquote/divbr/div ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11426] CSV examples can't close their files
Roundup Robot devnull@devnull added the comment: New changeset 52e1ad467edd by Eli Bendersky in branch '2.7': Issue #11426: use 'with' statements on open files in CSV examples http://hg.python.org/cpython/rev/52e1ad467edd -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11426 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11426] CSV examples can't close their files
Changes by Eli Bendersky eli...@gmail.com: -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11426 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11479] Add discussion of trailing slash in raw string to tutorial
Eli Bendersky eli...@gmail.com added the comment: Would it not be better to just recommend Windows users not to put that last backslash in at all? IIUC it's only needed to later append file names to directory names, but that's better achieved with os.path.join -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11479 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11477] Bug in code dispatching based on internal slots
Terry J. Reedy tjre...@udel.edu added the comment: Second link to pydev should be http://mail.python.org/pipermail/python-dev/2011-March/109130.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1635741] Interpreter seems to leak references after finalization
Ray.Allen ysj@gmail.com added the comment: Does the title of this issue accurately reflect the current status of the Python interpreter? Yes, here is the running result on current 3.3 latest code: [37182 refs] [39415 refs] [41607 refs] [43799 refs] [45991 refs] [48183 refs] [50375 refs] This seems to be a known bug that Py_Finalize() doesn't free all objects according doc http://docs.python.org/dev/c-api/init.html?highlight=py_finalize#Py_Finalize -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1635741 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables
Ned Deily n...@acm.org added the comment: IMHO the change to 'bits' is bogus, it is supposed to return the bit-size of the executable, not that of the currently running executable. Perhaps but (1) the code currently does return the bit-size of the currently running executable if it can't parse the output from 'file'. More importantly, (2) not surprisingly, platform.architecture was not designed to deal with the somewhat unusual case presented by OS X multi-architecture files that have multiple bit-sizes. I'd return all executable bitsizes in bits as '32bit', '64bit' or '32bit,64bit' (as appropriate) and only include the machine architectures in the linkage result. That's another way to do it. My thought was that, while the return values of bits and linkage are deliberately not specified in the documentation, bits is likely the more useful and used of the two and it would be useful to return upwardly compatible values while also providing the current bits of the running interpreter. That's what most programs are really interested in since, AFAIK, in all other platforms and cases except OS X 64-/32- universal binaries, there can be no difference between the value for the interpreter and the executable file. To me, adding the full set of values possible makes more sense to be returned in the linkage string rather than in bits. And I still think it makes sense to have 'platform.architecture' be an officially blessed API to determine interpreter execution bit size, rather that the unintuitive sys.maxsize or struct.calcsize('P') tests. What led me to write this patch in the first place was that, on more than one occasion in support groups, I found people recommending testing platform.architecture(bits) to determine 32-bit vs 64-bit and it was clear that it was giving the wrong results in this case. And finally the executable file format is 'Mach-O', not 'Mach'. As is, the patch returns MachO. The reason for doing that was to make parsing (both human and machine) of the platform string easier; it currently uses '-' as a separator for the various fields: $ python3.2 -m platform Darwin-10.6.0-i386-64bit Dropping the '-' in 'Mach-O' was an easy and unambiguous way to continue to differentiate the fields without introducing any incompatibilities. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10735 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com