[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Classes are normally named with CamelCase. Also, "walk_result" or "WalkResult" seems like an odd name that doesn't really fit. DirEntry or DirInfo is a better match (see the OP's example, "for dir_entry in walk_it: ...") The "versionchanged" should be a

[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-27 Thread Martin Panter
Martin Panter added the comment: I am realizing that many people like to use find_library() as a way of converting a portable name like “magic” (from building with -lmagic) into a platform-specific name (libmagic.so.1, libmagic.dylib, magic.dll, etc), and then pass this to LoadLibrary() or equ

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: >From the source code (get from apt-get source) of openssl-1.0.2g, I find SSL_CTX_clear_options(ctx, op): op &= ~SSL_OP_NO_SSLv3 return (ctx->options &= ~op) SSL_CTX_set_options(ctx, op): op |= SSL_OP_NO_SSLv3 return (ctx->options |= op) which differs from

[issue26873] xmlrpclib raises when trying to convert an int to string when unicode is available

2016-04-27 Thread Nathan Williams
Nathan Williams added the comment: I have attached the response. As it is coming from our UMS, I had to redact a few values, but that shouldn't matter. For reference, they were the host name of my email address, and the hashes of passwords etc. Our UMS is a bit too chatty! -- Added fi

[issue18551] child_exec() doesn't check return value of fcntl()

2016-04-27 Thread Berker Peksag
Berker Peksag added the comment: There is one fcntl call in Modules/_posixsubprocess.c now and its return value is checked local_max_fd = fcntl(0, F_MAXFD); if (local_max_fd >= 0) Closing this as 'out of date'. -- nosy: +berker.peksag resolution: -> out of date stage: needs p

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: After some test, I think the reason causing this error is due to SSL_CTX_clear_options. With OPENSSL_VERSION_NUMBER 268443775, SSL_CTX_clear_options(self->ctx, 2248147967) returns 33554432, where SSL_CTX_get_options returns 2248147967. From the manpage of SSL_C

[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-27 Thread Richard PALO
Richard PALO added the comment: [fingers not yet warmed up] that is '/opt/local/lib/libmagic.so' -- ___ Python tracker ___ ___ Python-

[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-27 Thread Richard PALO
Richard PALO added the comment: An example: richard@omnis:/home/richard$ python2.7 Python 2.7.11 (default, Apr 27 2016, 04:35:25) [GCC 4.9.3] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> from ctypes.util import find_library >>> fi

[issue1145257] shutil.copystat() may fail...

2016-04-27 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: accepted -> out of date stage: test needed -> resolved status: open -> closed ___ Python tracker ___ _

[issue26873] xmlrpclib raises when trying to convert an int to string when unicode is available

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide a response of your server (pass verbose=True to ServerProxy)? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2016-04-27 Thread Luiz Poleto
Luiz Poleto added the comment: The change to os.rst is already committed so I modified the patch to remove it and keep only the change to os.py, which looks good and ready to be committed. -- Added file: http://bugs.python.org/file42635/issue25461.patch

[issue20453] json.load() error message changed in 3.4

2016-04-27 Thread Berker Peksag
Berker Peksag added the comment: 3.4 is in security-fix-only mode and 3.5+ has better error messages thanks to JSONDecodeError (07af9847dbec). Closing this as 'out of date'. -- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _

[issue20447] doctest.debug_script: insecure use of /tmp

2016-04-27 Thread Berker Peksag
Berker Peksag added the comment: 3.1 is now EOL: https://docs.python.org/devguide/index.html#status-of-python-branches -- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue26873] xmlrpclib raises when trying to convert an int to string when unicode is available

2016-04-27 Thread Nathan Williams
New submission from Nathan Williams: I am using xmlrpclib against an internal xmlrpc server. One of the responses returns integer values, and it raises an exception in "_stringify" The code for _stringify is (xmlrpclib.py:180 in python2.7): if unicode: def _stringify(string): # con

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread Martin Panter
Martin Panter added the comment: I don’t know anything about AIX specific stuff, but I left some general comments in the code review. Is there any chance that AIX people would be relying on the current behaviour that I understand uses _findSoname_ldconfig() and _findLib_gcc()? Is this new fun

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file42634/python.Lib.ctypes.160317.patch ___ Python tracker ___ ___ Python-bugs-

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file42633/python.Lib.ctypes.160309.patch ___ Python tracker ___ ___ Python-bug

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread Martin Panter
Martin Panter added the comment: I notice the patch is against Python 2, and uses Python 2 specific syntax. I am unsure if this kind of change is acceptable for 2.7, or if it would have to only go into 3.6. Hopefully this version of the patch will notify the review system that it is against Py

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Stefan Krah
Stefan Krah added the comment: It seems that the patch also introduces a segfault if PyLong_FromSsize_t() returns NULL. -- nosy: +skrah ___ Python tracker ___ __

[issue26872] Default ConfigParser in python is not able to load values habing percent in them

2016-04-27 Thread sorin
sorin added the comment: Here is one example of failure caused by this https://gist.github.com/ssbarnea/b373062dd45de92735c7482b2735c5fb -- ___ Python tracker ___ __

[issue26872] Default ConfigParser in python is not able to load values habing percent in them

2016-04-27 Thread sorin
New submission from sorin: The ConfigParser issue with % (percent) is taking huge proportions because it does have serious implications downstream. One such example is the fact that in breaks virtualenv in such way the if you create a virtual env in a path that contains percent at some point y

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed with some changes. Thank you for your contribution Joseph. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker __

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8ab8f5259f09 by Serhiy Storchaka in branch 'default': Issue #25788: fileinput.hook_encoded() now supports an "errors" argument https://hg.python.org/cpython/rev/8ab8f5259f09 -- nosy: +python-dev ___ Pytho

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Dan McCombs
Dan McCombs added the comment: Thanks Brett. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Brett Cannon
Brett Cannon added the comment: I'll revert the two commits then and close both this and #26664 when I have a chance. -- ___ Python tracker ___ _

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Dan McCombs
Dan McCombs added the comment: Yes, reverting cfc66e37eb8e and 0f1ac94d2f98 should resolve #26664. -- ___ Python tracker ___ ___ Pytho

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Brett Cannon
Brett Cannon added the comment: So just to be clear, cfc66e37eb8e and 0f1ac94d2f98 should be reverted? No other changes? And will this fix issue #26664 or affect it in any way? -- assignee: -> brett.cannon status: closed -> open ___ Python tracker

[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-27 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Dan McCombs
Dan McCombs added the comment: I somehow missed the comment on 2016-04-01, I apologize for being late to look at this. Xiang is right, this patch should be reverted. It looks like the issue reported was originally brought on by an activate.fish being used from a Python after the patch in comm

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: -skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Stefan Krah
Stefan Krah added the comment: Your definition of correctness is very odd. The "leaks" you are talking about are single references in case of a module initialization failure, in which case you are likely to have much bigger problems. Please take _decimal out of this patch, it's a waste of time.

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Idiomatic code is if (PyModule_AddObject(module, "name", create_new_object()) < 0) goto error; If you already have a reference and need to use it later: obj = create_new_object(); ... /* use obj */ Py_INCREF(); if (PyModule_AddObj

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread David Edelsohn
David Edelsohn added the comment: The most recent patch seems to follow AIX semantics correctly. -- ___ Python tracker ___ ___ Python-

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-27 Thread Michael Felt
Michael Felt added the comment: These are very different issues. However, this patch may resolve both! ldconfig (-p if I recall) lists where (shared) libraries have been installed (imho, this is a GNU tool approach) - whereas AIX would use dump -H to find library paths embedded in a program an

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Though come to think of it, the issue you raised with using "from" in the method name wouldn't apply here, since the static method is on the bool class, and the method does return bool. -- ___ Python tracker

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Actually, looks like the version of the patch I attached did use the name `bool.from_config_str`, sorry about that -- I'll attach a new patch renaming this to `bool.parse_config_str` if there is interest in further consideration. -- __

[issue26868] Incorrect check for return value of PyModule_AddObject in _csv.c

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As for Modules/_csv.c, I think it is better to change the behavior of PyModule_AddObject() (issue26871). This will fix similar issues in all modules. -- dependencies: +Change weird behavior of PyModule_AddObject()

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Hi Raymond, I'm a bit confused by your comment. The patch I attached to my previous message adds the static method `bool.parse_config_str`. So there's no need to `import configparser` to use this, and "from" is no longer included in the proposed method name. C

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Stefan Krah
Stefan Krah added the comment: I think the current behavior is good for error handling by goto, which is common for module initialization. Please don't change this. -- nosy: +skrah ___ Python tracker _

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: The original behaviour is right. __VENV_PROMPT__ is meant to be a placeholder, not a variable interpreted by shell. I think this patch should be reverted. Related issue is #26664. -- nosy: +xiang.zhang ___ Python track

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: PyModule_AddObject() has weird and counterintuitive behavior. It steals a reference only on success. The caller is responsible to decref it on error. This behavior was not documented and inconsistent with the behavior of other functions stealing a referenc

[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: The patch introduced by issue26348 should be reverted. The __VENV_PROMPT__ is meant to be a placeholder. For example, when you create a virtual environment named venv-test, the __VENV_PROPMT__ will be replace by (venv-test). If the patch is applied, it will be $(

[issue26869] unittest longMessage docs

2016-04-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Replace existing description with "This class attribute determines what happens when a custom failure message is passed as the msg argument to an assertXYY call that fails. If True, the default, the custom message is appended to the end of the standard failur

[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-27 Thread Tom Middleton
Tom Middleton added the comment: I agree with your assessment Steve. I don't see there being a good fix to this. I also think it would be a bad idea to have the launcher change the current working directory. Example: c:\foo\> python d:\scripts\bar.py myfile (where myfile is in c:\foo\) A kludg

[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-27 Thread Steve Dower
Steve Dower added the comment: Wouldn't be surprised to see differences between Win7 and Win10 - the "current working directory" concept has essentially been deprecated in Windows for a while (at least through the GUI). Registering a system file association is something we could do for the la

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-27 Thread Joseph Hackman
Joseph Hackman added the comment: Updated documentation in fileinput.rst, Doc/whatsnew/3.6.rst, Misc/NEWS and Misc/ACKS. Thank you so much Serhiy for taking the time to review! -- Added file: http://bugs.python.org/file42631/issue25788-3.patch ___ P

[issue26870] Unexpected call to readline's add_history in call_readline

2016-04-27 Thread Tyler Crompton
Tyler Crompton added the comment: I agree about the documentation. It would only take a few minutes to do. In regard to your inquiry about the second solution, more or less, yes. I left that one a bit ambiguous since there are many ways to skin that cat. But in retrospect, I probably shouldn't

[issue26855] add platform.android_ver() for android

2016-04-27 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I have a WIP patch. [1] It's based on Shiz's patch [2]. [1] https://github.com/yan12125/python3-android/blob/cpython-hg/mk/python/android-misc.patch [2] https://github.com/rave-engine/python3-android/blob/9bb6420317922c07df405315eea040f9301f7eca/mk/python/3.4.3

[issue26855] add platform.android_ver() for android

2016-04-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Some screenshots showing different file contents: * http://www1-lw.xda-cdn.com/files/2013/12/tweak-your-samsung-galaxy-s3s-performance-with-these-build-prop-android-hacks.w654.jpg * http://media.apcmag.com/wp-content/uploads/sites/20/2014/04/buildprop-te

[issue26868] Incorrect check for return value of PyModule_AddObject in _csv.c

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26855] add platform.android_ver() for android

2016-04-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: If the file is guaranteed to exist on most modern Android platforms, this sounds like a good approach. Perhaps you could add support to fallback to running getprop instead, if the file doesn't exist or cannot be parsed ?! -- nosy: +lemburg __

[issue26855] add platform.android_ver() for android

2016-04-27 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Isn't this macro used in compile time? I thought android_ver() aims to check runtime versions. -- ___ Python tracker ___ ___

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Martin Panter
Martin Panter added the comment: This version looks okay to me, thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-27 Thread Martin Panter
Martin Panter added the comment: FYI Martin Panter and vadmium are both me :) I’m not a big fan or expert on configure.ac and Autoconf, but I guess in this case it is the simplest solution. Maybe look at some of the existing AC_CHECK_DECL and AC_COMPILE_IFELSE invocations. I guess you need to

[issue16353] add function to os module for getting path to default shell

2016-04-27 Thread Roman Evstifeev
Changes by Roman Evstifeev : -- nosy: +Roman.Evstifeev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-04-27 Thread Roman Evstifeev
Changes by Roman Evstifeev : -- nosy: +Roman.Evstifeev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue17905] Add check for locale.h

2016-04-27 Thread Roman Evstifeev
Changes by Roman Evstifeev : -- nosy: +Roman.Evstifeev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-27 Thread Roman Evstifeev
Changes by Roman Evstifeev : -- nosy: +Roman.Evstifeev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue26870] Unexpected call to readline's add_history in call_readline

2016-04-27 Thread Martin Panter
Martin Panter added the comment: Solution 3 (documentation) can easily be done for existing versions of Python. Any other fix I think would have to be done in the next Python version (3.6). By solution 2 (dynamically swap histories), do you mean add an API to save and load the entire history l

[issue26855] add platform.android_ver() for android

2016-04-27 Thread Xavier de Gaye
Xavier de Gaye added the comment: The android/api-level.h header exists at all the android API levels and define __ANDROID_API__ as, for example at level 21: #define __ANDROID_API__ 21 So it is possible to get the sdk version from here, and maybe forget about the release version. ---

[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-27 Thread Eryk Sun
Eryk Sun added the comment: Generally the directory that an application needs for its configuration files and data is either the script directory or an %AppData% or %LocalAppData% subdirectory. If the initial working directory matters for some reason (e.g. for writing output files), the parent

[issue26868] Incorrect check for return value of PyModule_AddObject in _csv.c

2016-04-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the write-up, Serhiy. It looks like "... == -1" is more popular in the codebase (for PyModule_AddObject, "... < 0" is the most popular style). Here is a patch to document the current behavior of PyModule_AddObject. -- Added file: http://bug

[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-27 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch taking into account Gregory's comments. API level 19 is the last to have a sys/linux-syscalls.h header. All levels have a android/api-level.h header that define __ANDROID_API__. There is no API level 20, and SYS_getdents64 is defined at API level 21. -

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-27 Thread Marcos Dione
Marcos Dione added the comment: Updated the patch withe most of Martin Panter's and all vadium's comments. -- Added file: http://bugs.python.org/file42628/copy_file_range.diff ___ Python tracker ___

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your comment martin. Using re.escape is really a good advise. -- Added file: http://bugs.python.org/file42627/issue26864_v5.patch ___ Python tracker ___

[issue26481] unittest discovery process not working without .py source files

2016-04-27 Thread Martin Panter
Martin Panter added the comment: Please see Issue 26859; I think it is describing the same problem, and a fix is proposed (although no regression test) -- nosy: +martin.panter resolution: -> duplicate status: open -> closed superseder: -> unittest fails with "Start directory is not im

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-27 Thread Marcos Dione
Marcos Dione added the comment: > I didn’t see any changes to the configure script in your patches. Did you > make that change to define HAVE_COPY_FILE_RANGE yet? I'm not really sure how to make the test for configure.ac. Other functions are checked differently (availability of header files),

[issue26870] Unexpected call to readline's add_history in call_readline

2016-04-27 Thread Tyler Crompton
Changes by Tyler Crompton : -- nosy: +twouters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue26859] unittest fails with "Start directory is not importable"

2016-04-27 Thread Xavier de Gaye
Xavier de Gaye added the comment: It seems to be the same bug. Source-less distributions are useful on mobile devices where space is sparse. -- ___ Python tracker ___ __

[issue26870] Unexpected call to readline's add_history in call_readline

2016-04-27 Thread Tyler Crompton
New submission from Tyler Crompton: I was implementing a REPL using the readline module and noticed that there are extraneous calls to readline's add_history function in call_readline[1]. This was a problem because there were some lines, that, based on their compositions, I might not want in t

[issue26869] unittest longMessage docs

2016-04-27 Thread Thomas Guettler
New submission from Thomas Guettler: The first message of the longMessage docs is confusing: https://docs.python.org/3/library/unittest.html#unittest.TestCase.longMessage > If set to True then This reads between the lines, that the default is False. But that was long ago in Python2. In P

[issue26868] Incorrect check for return value of PyModule_AddObject in _csv.c

2016-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Testing returned value of PyModule_AddObject() is correct. This is a matter of style what to use: `if (...)`, `if (... == -1)` or `if (... < 0)`. But the problem with a leak is more general. I have opened a discussion on Python-Dev: http://comments.gmane.org