[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2016-03-21 Thread Martin Panter
Martin Panter added the comment: Patch v3 is an update taking into account Ned’s comments, and my own now deeper understanding: * Reworked the --with-readline handling. Suggested options are --with-readline=editline, and --without-readline. The current behaviour (use -lreadline if possible)

[issue17167] python man page contains $Date$ in page footer

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed85850499bd by Benjamin Peterson in branch '3.4': remove useless $ keyword (closes #17167) https://hg.python.org/cpython/rev/ed85850499bd New changeset 86355b610d7c by Benjamin Peterson in branch '2.7': remove useless $ keyword (closes #17167)

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Steve Dower
Steve Dower added the comment: I used the python35.dll in the embeddable install, along with the python35.zip included in there. I linked against python.h and python35.lib from a full install, but put the resulting exe in the directory with the embeddable install so it uses that instead of

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Zachary Ware
Zachary Ware added the comment: I am also unable to reproduce. I've attached the exact code I used, and built it with: cl /I "C:\Program Files\Python35\include" embtest.c /link /libpath:"C:\Program Files\Python35\libs" Output is the expected result of 'import ctypes;print(dir(ctypes))'.

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Simon
Simon added the comment: I have tried with the zip file in both the exe alongside the zip and not alongside it, (mine was not). And I get the same error in both cases. I am using Windows 10, VS2015. I compile the Python35.dll directly and my config is default, I don't change anything

[issue15699] PEP 3121, 384 Refactoring applied to readline module

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset b5279feb22f1 by Martin Panter in branch '3.5': Issue #15699: Reunite comment with variable https://hg.python.org/cpython/rev/b5279feb22f1 New changeset 5c6a5b3bb6eb by Martin Panter in branch 'default': Issue #15699: Merge readline fixup from 3.5

[issue26607] Rename a parameter in the function PyFile_FromFile

2016-03-21 Thread Mansour Moufid
New submission from Mansour Moufid: Hi, The last parameter of the function PyFile_FromFile is named 'close', but is a pointer to a function with the prototype of the 'fclose' function in libc. The mismatch causes confusion for some static analysis tools. This patch renames the parameter to

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread nickeubank
nickeubank added the comment: Seems like existence of a method in the stdlib (or at least in the pathlib part of the stdlib) suggests issues with text encoding can be overcome. IMHO I would suggest most people have no idea about that method (I've been doing python for years and this has

[issue25251] Unknown MS Compiler version 1900

2016-03-21 Thread Jonathan Hanba
Jonathan Hanba added the comment: I just ran across this bug in Python 3.5.1 while trying to build pycrypto using MinGW. I patched the cygwincompiler.py with the attached patch.diff file, and that got me part of the way there. With the additions made by patch.diff, the MinGW linker then

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-03-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- hgrepos: +335 ___ Python tracker ___ ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: About memory alignment, _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro uses pointer dereference. It may be replaced with _Py_HASHTABLE_ENTRY_READ_DATA() to use memcpy() and avoid memory alignment issue. -- ___ Python

[issue23749] asyncio missing wrap_socket (starttls)

2016-03-21 Thread Robert Siemer
Changes by Robert Siemer : -- nosy: +siemer ___ Python tracker ___ ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Hum, an assertion fails in set_reentrant(), helper function to set a TLS (Thread Local Storage), but I'm unable to reproduce the bug on my Fedora 23 (AMD64). http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3316/steps/test/logs/stdio

[issue26606] logging.baseConfig is missing the encoding parameter

2016-03-21 Thread Jānis Šlapiņš
New submission from Jānis Šlapiņš: Hi! Log files are only saved using the system default encoding. On Windows, this means that the current ANSI code page is used. This may lead to a disaster (exceptions may be thrown due to unmappable characters) if you want to log particular text strings in a

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 98a1c8cb882f by Victor Stinner in branch 'default': Issue #26588: Fix compilation warning on Windows https://hg.python.org/cpython/rev/98a1c8cb882f -- ___ Python tracker

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset aca4e9af1ca6 by Victor Stinner in branch 'default': hashtable.h now supports keys of any size https://hg.python.org/cpython/rev/aca4e9af1ca6 -- nosy: +python-dev ___ Python tracker

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Steve Dower
Steve Dower added the comment: I can't reproduce this - I used almost exactly your code and it worked fine. The one change I made was to use either L"python35.zip" alone (as my exe was alongside the zip) or a full path to the zip file. Both of these worked. If the zip file is not found,

[issue17446] doctest test finder doesnt find line numbers of properties

2016-03-21 Thread Michael Cuthbert
Michael Cuthbert added the comment: Here's a rather obscure bug that I was able to catch before we put this into action: doctests inside the __doc__ for namedtuples (and perhaps all namedtuples?) are instances of property, have .fget, but do not have .fget.__code__. Thus one more check is

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Hum, the patch is really too hard to review. So I extract to the "key_size" part: hashtable_key_size.patch. I added new macros to get the key, wrapper to memcpy() with an assert to check the key size in debug mode. -- Added file:

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Such function already exists in the stdlib! But with different order of arguments. See pathlib.Path.write_text(). Personally I'm very skeptical about usefulness of similar functions in the stdlib. -- nosy: +serhiy.storchaka

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Oh. I wasn't aware of these pathlib methods. https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_bytes https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_text -- ___ Python tracker

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: It's easy to implement such function in a module and upload such module to PyPI (ex: "to_file" module :-)). It's not easy to guess user expectations on such function: text encoding, buffering, etc. Adding a method to the builtin str type which writes into a

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread nickeubank
New submission from nickeubank: As a social scientists trying to help other social scientists move from language like R, Stata, and Matlab into Python, one of the behaviors I've found unnecessarily difficult to explain is the "file.open()/file.close()" idiom (or, alternatively, context

[issue26582] asyncio documentation links to wrong CancelledError

2016-03-21 Thread SilentGhost
SilentGhost added the comment: In fact most of the :exc: reference are pointing explicitly to concurrent.futures.CancelledError (and those that don't probably should). It is interesting that you weren't able to make use of that exception, because in Lib/asyncio/futures.py#L23 it's clearly

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset a97d317dec85 by Victor Stinner in branch 'default': Fix test_ssl.test_refcycle() https://hg.python.org/cpython/rev/a97d317dec85 -- ___ Python tracker

[issue26604] Add optional source parameter to warnings.warn()

2016-03-21 Thread STINNER Victor
New submission from STINNER Victor: Follow-up of the issue #26567 which added PyErr_ResourceWarning() (C API), attached patch adds a new source parameter to the warnings.warn() function (Python API). source is the destroyed object which emits a ResourceWarning. The source is used to show the

[issue26604] Add optional source parameter to warnings.warn()

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: For asyncio, it should help to fix the ResourceWarning warnings on AIX (which has a broken ssl module): http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/4700/steps/test/logs/stdio test_create_server_ssl_verify_failed

[issue26603] os.scandir: implement finalizer (for ResourceWarning)

2016-03-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +benhoyt ___ Python tracker ___ ___

[issue26603] os.scandir: implement finalizer (for ResourceWarning)

2016-03-21 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file42235/scandir_finalizer.patch ___ Python tracker

[issue26603] os.scandir: implement finalizer (for ResourceWarning)

2016-03-21 Thread STINNER Victor
New submission from STINNER Victor: Attached patch implements a finalizer for os.scandir() iterator type. The patch also calls the new PyErr_ResourceWarning() function to be able to display in the warning where the iterator was created (allocated) when tracemalloc is enabled. While it makes

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Thanks for the review. I pushed my change. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5: * add hashtable_compare_pointer_t() which compares pointer_t fields (ptr and domain) rather using _Py_hashtable_compare_direct() which causes issues with padding * hashtable_hash_pointer_t() now uses memcpy() to get the pointer_t value

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 46329eec5515 by Victor Stinner in branch 'default': Add socket finalizer https://hg.python.org/cpython/rev/46329eec5515 -- nosy: +python-dev ___ Python tracker

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: What about compilers that don't support "__attribute__((packed))"? Instead you could use a compare func that compares struct fields... -- ___ Python tracker

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: > What about alignment issues on strict platforms? (SPARC?) Which kind of alignment issue do you expect? I added "__attribute__((packed))" to frame_t. I expected SIGBUS because of that (it's even documented in a comment ;-)), but I practice nobdy complained,

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Instead of filling pointer_t padding with zeros, I changed the size of the > key (key_size) in the hashtable to exclude padding. What about alignment issues on strict platforms? (SPARC?) -- ___ Python tracker

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, it looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: > Oh, I see. Perhaps add a comment then? Sure, done. Does it look better now? -- Added file: http://bugs.python.org/file42233/sock_finalize-3.patch ___ Python tracker

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-03-21 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Updated patch taking Antoine's comments in account. Instead of filling pointer_t padding with zeros, I changed the size of the key (key_size) in the hashtable to exclude padding. -- Added file: http://bugs.python.org/file42232/tracemalloc-4.patch

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh, I see. Perhaps add a comment then? -- ___ Python tracker ___ ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Crap. I pushed tracemalloc-3.patch by mistake. I just reverted my mistake. At least, it helped to find first bugs using buildbots: http://buildbot.python.org/all/builders/PPC64%20Fedora%203.x/builds/676/steps/test/logs/stdio [230/400/3] test_tracemalloc

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: On the review, Antoine wrote: "You should put this line earlier, as outputting a warning can release the GIL..." I disagree. It's a deliberate choice to keep the socket open while logging the ResourceWarning. Example: --- import socket import warnings def

[issue17167] python man page contains $Date$ in page footer

2016-03-21 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: What do you think about just removing the keyword? -- keywords: +patch nosy: +cstratak Added file: http://bugs.python.org/file42231/issue17167.patch ___ Python tracker

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue26591] datetime datetime.time to datetime.time comparison does nothing

2016-03-21 Thread SilentGhost
SilentGhost added the comment: Jason, could you provide an actual paste of interactive interpreter session, so that any one could try to reproduce the issue. -- nosy: +SilentGhost stage: -> test needed type: -> behavior ___ Python tracker

[issue26602] argparse doc introduction is inappropriately targeted

2016-03-21 Thread Daniel Stone
New submission from Daniel Stone: The argparse documentation starts off, after a couple of sentences, by spending several paragraphs (and a couple of sentences) explaining this gem: import argparse parser = argparse.ArgumentParser(description='Process some integers.')

[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Are you aware of unused memory in the heap memory? The pymalloc memory allocator uses munmap() to release a wgole arena as soon as the last memory block of an arena is freed. -- ___ Python tracker

[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-03-21 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +neologix ___ Python tracker ___ ___ Python-bugs-list

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread Ezio Melotti
Ezio Melotti added the comment: > Note: Ezio, do you prefer format(value, 'x') for '{:x}'.format(value)? While formatting a single value the former is better/shorter, but the latter is perhaps more common since you usually have something else in the string too. The latter can also be used to

[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-03-21 Thread SilentGhost
Changes by SilentGhost : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: > Now that there is a safe finalizer, I wonder if it should release the GIL, as > in sock_close(). Ah yes, good idea. I updated my patch. I also changed the change to begin by setting the sock_fd attribute to -1, before closing the socket (since the GIL is

[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-03-21 Thread Marcos Dione
New submission from Marcos Dione: Linux kernel's new madvise() MADV_FREE[1] could be used in the memory allocator to signal unused parts of the private heap as such, allowing the kernel use those pages for resolving lowmem pressure situations. From a LWN article[2]: [...] Rather than

[issue17167] python man page contains $Date$ in page footer

2016-03-21 Thread Charalampos Stratakis
Changes by Charalampos Stratakis : -- versions: +Python 3.6 ___ Python tracker ___ ___

[issue26600] MagickMock __str__ sometimes returns MagickMock instead of str

2016-03-21 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord, pitrou versions: +Python 3.6 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue26590] socket destructor: implement finalizer

2016-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Now that there is a safe finalizer, I wonder if it should release the GIL, as in sock_close(). -- ___ Python tracker

[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: > Is it worth to optimize this pretty rare special case? There was a TODO in the code, so I guess that the author wanted to write specialized code for 1-char replacement. Since the patch is short (adds 8 lines of C code), I consider that it's ok to optimize

[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is it worth to optimize this pretty rare special case? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: I pushed my latest patches, thanks for your contribution Josh. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 62e3b7af0697 by Victor Stinner in branch 'default': Optimize bytes.replace(b'', b'.') https://hg.python.org/cpython/rev/62e3b7af0697 -- nosy: +python-dev ___ Python tracker

[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: I wrote a microbenchmark with my benchmark.py tool. The patch always make bytes.replace(b'', char) and bytearray.replace(b'', char) faster even for strings of 10 bytes, the speedup on string of 1000 bytes or more is very interesting, even I never used this

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Ezio Melotti added the comment: > I can think of 3 possible solutions: > > 1) keep the examples but condense them so that they don't take so much space: n = 255 f'{n:#x}', format(n, '#x'), '%#x' % n > ('0xff', '0xff', '0xff') f'{n:x}', format(n,

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread Ezio Melotti
Ezio Melotti added the comment: > The documentation for hex() doesn't look the bests place for examples > of using string formatting. I think it is enough to add short > references to corresponding formatting codes. I think those examples take too much space compared to the actual docs of the

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: > The documentation for hex() doesn't look the bests place for examples of > using string formatting. I think it is enough to add short references to > corresponding formatting codes. I like Manvi B's patch with many examples. It's hard to

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread Manvi B
Manvi B added the comment: Modified the patch with '%x' % value. -- Added file: http://bugs.python.org/file42228/issue26506.diff ___ Python tracker ___

[issue11874] argparse assertion failure with brackets in metavars

2016-03-21 Thread Matt Pr
Matt Pr added the comment: Same AssertionError is also caused by having certain "choices". Python 2.7.10 global_options.add_argument('--field-sep', choices=[',',';','|','\t'], required=True, help='Field separator that separates columns in a row.') Removing required=True or removing the tab

[issue26506] hex() documentation: mention "%x" % int

2016-03-21 Thread Manvi B
Manvi B added the comment: Removed hex()[:2] from the patch. -- Added file: http://bugs.python.org/file42227/issue26506.diff ___ Python tracker ___

[issue26600] MagickMock __str__ sometimes returns MagickMock instead of str

2016-03-21 Thread Uosiu
New submission from Stanisław Skonieczny (Uosiu): This bug results in raising TypeError: __str__ returned non-string (type MagicMock) Following program can reproduce it: ``` from threading import Thread from mock.mock import MagicMock def main(): mocks = [MagicMock() for _ in

[issue26599] segfault at 24 error 6 in python

2016-03-21 Thread SilentGhost
SilentGhost added the comment: This very much looks like a sentry problem. I'd suggest reporting it on their bug tracker. -- nosy: +SilentGhost resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue26599] segfault at 24 error 6 in python

2016-03-21 Thread Hưng Nguyễn Việt
New submission from Hưng Nguyễn Việt: I'm running Python 2.7.6-8ubuntu0.2 amd64 on Ubuntu 14.04 with kernel 3.13.0-52-generic and got this segfault errors every time I ran /usr/local/sentry/bin/sentry cleanup from sentry 7.4.1 (https://github.com/getsentry/sentry/tree/7.4.1)

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Simon
Changes by Simon : -- components: +Interpreter Core, Windows ___ Python tracker ___ ___