[issue26358] mmap.mmap.__iter__ is broken (yields bytes instead of ints)

2016-04-28 Thread Xiang Zhang
Xiang Zhang added the comment: I tried to write a patch to make mmap behave like bytearray more. Making iteration returns int is easy. But I am trapped in the contains operation. To support operation like b'aa' in b'aabbcc', we have to do a str in str search. I don't find any portable way

[issue10436] tarfile.extractfile in "r|" stream mode fails with filenames or members from getmembers()

2016-04-28 Thread Martin Panter
Martin Panter added the comment: David, if you are still interested, I think specific suggestions or patches would be welcome (even if Lars assigned this to himself five years ago). I also like the idea of separate low-level and random access layers (I also thought of this). One other

[issue23453] Clarify bytes vs text with non-seeking tarfile stream

2016-04-28 Thread Martin Panter
Martin Panter added the comment: Looks like the _Stream docstring needs a similar fix regarding stdin and stdout. Also, it wouldn’t hurt to specify that the read() and write() methods should work with bytes, not text. -- title: Opening a stream with tarfile.open() triggers a

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

2016-04-28 Thread Martin Panter
Martin Panter added the comment: The obvious (but easy to fix) problem I forsee with Python 3 is the print() calls. If you use print("") and print(arg), that will work with both 2 and 3. There may be more complications with bytes vs text stdout if we change the os.popen() calls to use

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Martin Panter
Martin Panter added the comment: Yes, having a high-level version of copy_file_range() that falls back to copyfileobj() should be okay. I’m not sure if it should be a public API of shutil, or just an internal detail. I am wondering if it would be nice to rearrange the os.copy_file_range()

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid I can't quite see what the problem is. If you're passing your own globs argument, can't you deepcopy it yourself? Could you show a minimal, short example demonstrating the issue please? -- nosy: +steven.daprano versions: +Python 3.6

[issue26879] Spam

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: -Rogi title: new message -> Spam ___ Python tracker ___

[issue26879] Spam

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- Removed message: http://bugs.python.org/msg264455 ___ Python tracker ___

[issue26879] new message

2016-04-28 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue26879] new message

2016-04-28 Thread Rogi
New submission from Rogi: Hello! You have a new message, please read r...@linuxmail.org -- messages: 264455 nosy: Rogi priority: normal severity: normal status: open title: new message ___ Python tracker

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Марк Коренберг
Марк Коренберг added the comment: The same in tarfile.copyfileobj() -- ___ Python tracker ___ ___

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
DqASe added the comment: Alternatively, add an option like deepglobs={...} . The dictionary argument would be deep-copied at each test and added to the environment. -- ___ Python tracker

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
Changes by DqASe : -- components: +Tests -Library (Lib) ___ Python tracker ___ ___

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
New submission from DqASe: Currently doctest makes shallow copies of the environment or globs argument. This is somewhat un-symmetrical: on the one hand, a test cannot see variables created by another, but on the other, it can alter mutable objects. This is inconvenient e.g. when

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +lars.gustaebel ___ Python tracker ___ ___

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

2016-04-28 Thread Michael Felt
Michael Felt added the comment: I have not looked specifically, at least not that I remember, for differences in util/ctypes in python2 and python3. Will do so tomorrow. I did just look briefly at the library, rather archive, built by default as libpython2.7.a - it is static members only,

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Марк Коренберг
New submission from Марк Коренберг: tarfile.py: _FileInFile(): (near line 687) b = self.fileobj.read(length) if len(b) != length: raise ReadError("unexpected end of data") every read() API does not guarantee that it will read `length` bytes. So, if fileobj reads less than requestedm that

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Steve Dower
Steve Dower added the comment: I'm neutral about applying it to 2.7, though I can see the value in doing so. For 3.5 it definitely has to modify _msvccompiler - the other two modules are just left behind to distract people apparently :) (but actually in case someone accidentally(?) too a

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: I can't seem to get the patch to apply, could you please regenerate it against a fresh checkout of https://hg.python.org/cpython#default (or 'master' of github.com/python/cpython)? This looks fairly straightforward, but I'm far from an expert on distutils :).

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +christopher.hogan ___ Python tracker ___ ___

[issue22477] GCD in Fractions

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is there something to do with this issue? -- nosy: +serhiy.storchaka status: open -> pending ___ Python tracker ___

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the report and patch! -- nosy: +zach.ware versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c8e1b98dc3f by Zachary Ware in branch '3.5': Issue #26875: Fix mmap example https://hg.python.org/cpython/rev/5c8e1b98dc3f New changeset aaf2ad84ae1c by Zachary Ware in branch 'default': Closes #26875: Merge with 3.5

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

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes xmlrpc unmarshaller to be more strong and raise ValueError instead of returning incorrect value when encounters with unsupported value type. The unmarshaller still skips unknown tags silently if they are occurred outside of the "value"

[issue26874] Docstring error in divmod function

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5a578ec4b3b3 by Zachary Ware in branch '2.7': Issue #26874: Simplify the divmod docstring. https://hg.python.org/cpython/rev/5a578ec4b3b3 New changeset 3edf8aa1ed97 by Zachary Ware in branch '3.5': Issue #26874: Simplify the divmod docstring

[issue26874] Docstring error in divmod function

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: If only I had reloaded the page before pushing... Btw, this was first reported in issue1209411, but only the docs were changed, not the docstring. -- nosy: +zach.ware resolution: fixed -> stage: resolved -> status: closed -> open

[issue26874] Docstring error in divmod function

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb49082a75d1 by Zachary Ware in branch '2.7': Issue #26874: Make divmod docstring and full doc match https://hg.python.org/cpython/rev/fb49082a75d1 New changeset ef193be5c3cd by Zachary Ware in branch '3.5': Issue #26874: Fix divmod docstring

[issue26874] Docstring error in divmod function

2016-04-28 Thread Mark Dickinson
Mark Dickinson added the comment: > I think it should be ((x-x%y)//y, x%y) where an integer division is used. How about simply (x//y, x%y)? -- ___ Python tracker

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Rohit Jamuar
New submission from Rohit Jamuar: The UnixCompiler class respects flags (CC, LD, AR, CFLAGS and LDFLAGS) set to the environment, whereas MSVCCompiler class does not. This change allows building CPython and any module that invokes distutils to utilize flags and executables that have been set

[issue26874] Docstring error in divmod function

2016-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +eric.smith, lemburg, mark.dickinson, stutzbach ___ Python tracker ___

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Xiang Zhang
New submission from Xiang Zhang: The code given in mmap doc import mmap with mmap.mmap(-1, 13) as mm: mm.write("Hello world!") should be mm.write(b"Hello world!") The *b* is left out and then causes exception. -- assignee: docs@python components: Documentation files:

[issue26874] Docstring error in divmod function

2016-04-28 Thread mbarao
mbarao added the comment: See divmod.__doc__ -- ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Minimal reproducer: >>> xmlrpclib.loads('ab') (({'a': 'b'},), None) The workaround for your particular case, Nathan: xmlrpclib.Unmarshaller.dispatch['ex:nil'] = xmlrpclib.Unmarshaller.dispatch['nil'] -- ___

[issue26874] Docstring error in divmod function

2016-04-28 Thread Emanuel Barry
Emanuel Barry added the comment: The documentation looks fine to me. Are you seeing any other place that I'm missing? https://docs.python.org/3/library/functions.html#divmod -- nosy: +ebarry ___ Python tracker

[issue26874] Docstring error in divmod function

2016-04-28 Thread mbarao
New submission from mbarao: The documentation of the divmod function says that a tuple ((x-x%y)/y, x%y) is returned, but this is not correct anymore for python3. I think it should be ((x-x%y)//y, x%y) where an integer division is used. -- assignee: docs@python components: Documentation

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I managed to modify the congigure.ac file so it includes the proper test. after I run autoconf it generated the proper configure script, but I also needed to run autoheaders (both run by make autoconf). This last command modified a generated file that's in the

[issue26868] Document PyModule_AddObject's behavior on error

2016-04-28 Thread Berker Peksag
Changes by Berker Peksag : -- title: Incorrect check for return value of PyModule_AddObject in _csv.c -> Document PyModule_AddObject's behavior on error ___ Python tracker

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Removed changes in _decimal.c and deprecation. Used Py_XDECREF in _PyModule_AddObject(). -- Added file: http://bugs.python.org/file42639/pymodule_addobject_2.patch ___ Python tracker

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

2016-04-28 Thread Robert Collins
Robert Collins added the comment: Could you please add a test case. -- nosy: +rbcollins stage: patch review -> test needed ___ Python tracker ___

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I'll do the copyfile() part once I'm convinced it doesn't break anything else. -- title: Expose new copy_file_range() syscal in os module and use it to improve shutils.copy() -> Expose new copy_file_range() syscal in os module.

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

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: > About changing copyfileobj(), here are some test cases which may help explain > the compatibility problems: I see, I was expecting something like that after reading https://bugs.python.org/issue25063 's conclusions. I removed that part. > Perhaps we could

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-28 Thread Meador Inge
Meador Inge added the comment: Xiang's patch LGTM. Given that Kees has verified it, I will apply today. -- assignee: -> meador.inge stage: needs patch -> commit review ___ Python tracker

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-28 Thread Antti Haapala
Antti Haapala added the comment: I do not believe there is code that would depend on `urlparse(urlstring={})` *not* throwing an error, since `{}` obviously is neither a URL, nor a string. Further down the documentation explicitly states that > The URL parsing functions were originally

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-28 Thread Kees Bos
Kees Bos added the comment: It's not entirely theoretical to me. I inherited some solaris boxes that cannot be properly maintained anymore and that have a clre program that dumps core. Hence no valid output and running into uninitialized 'paths'. The patch from Xiang Zhang will fix that.

[issue24434] ItemsView.__contains__ does not mimic dict_items

2016-04-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue26358] mmap.mmap.__iter__ is broken (yields bytes instead of ints)

2016-04-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-28 Thread Xiang Zhang
Xiang Zhang added the comment: Simply add one line to make the function theoretically more robust. -- nosy: +xiang.zhang Added file: http://bugs.python.org/file42637/issue24114.patch ___ Python tracker

[issue26869] unittest longMessage docs

2016-04-28 Thread Thomas Guettler
Thomas Guettler added the comment: Thank you for understanding my concern. > The standard failure message for each *assert method* contains useful > information about the objects involved. For example the message from > assertEqual shows the repr of the two unequal objects. It is usually

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It seems that the patch also introduces a segfault if PyLong_FromSsize_t() > returns NULL. Good catch Stefan! Py_XDECREF ahould be used instead of Py_DECREF in _PyModule_AddObject(). -- ___ Python tracker

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

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, but I disagree with Raymond in many points. > 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

[issue26853] missing symbols in curses and readline modules on android

2016-04-28 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Chi Hsuan Yen and Stefan. Indeed the --with-termlib configure option documentation states: "When building the ncurses library, organize this as two parts: the curses library (libncurses) and the low-level terminfo library (libtinfo)". Using

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

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you. Your server produces a response containing nonstandard type tag "ex:nil" [1]. authorityROLE_USER fromDate userId15 xmlrpclib is unable to handle this tag, and error handling is poor. xmlrpclib can handle only standard types and "nil"

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

2016-04-28 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-28 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