[issue26554] PC\bdist_wininst\install.c: Missing call to fclose()

2016-03-20 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Missing fclose -> PC\bdist_wininst\install.c: Missing call to fclose()

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13601] sys.stderr should always be line-buffered

2016-03-20 Thread Nick Coghlan

Nick Coghlan added the comment:

This question came up today in the context of the final line of a traceback 
output potentially being missing from stderr if the closing flush of the 
standard streams is missed for any reason.

That's not going to be a common scenario (as far as I know it was an entirely 
hypothetical discussion), but the last line of a traceback is the one with the 
actual error message, so it's likely to be annoyingly cryptic if it does happen.

--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26593] silly typo in logging cookbook

2016-03-20 Thread Andrew Szeto

New submission from Andrew Szeto:

In all versions of https://docs.python.org/3/howto/logging-cookbook.html, there 
is a very silly typo. It bothered me, and I wanted to get a taste of the 
patching workflow for contribution to Python, so I figured I'd write a patch.

--
assignee: docs@python
components: Documentation
files: doc-logging-cookbook-capitalization.patch
keywords: patch
messages: 262060
nosy: Andrew Szeto, docs@python
priority: normal
severity: normal
status: open
title: silly typo in logging cookbook
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file42219/doc-logging-cookbook-capitalization.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread Martin Panter

Martin Panter added the comment:

Quoting Ned: “The current behavior is: enable building readline with GNU 
readline if found on the search paths, . . . and, if not found and on OS X, use 
editline if found on the search paths.  Some build scripts depend on that 
behavior.”

Can you point out any logic (e.g. in configure.ac) that handles this? I suspect 
you might be mistaken. My understanding is that we always include 
 and always link against -lreadline, regardless of 
platform. My guess is that on OS X, the include file and library are actually 
pointers to Editline code, rather than Gnu code.

This is in contrast to my situation on Arch Linux, where I can install both the 
Gnu “readline” and the “libedit” packages without conflict. Gnu Readline is 
accessible via  and -lreadline, and Editline’s Readline 
compatibility is accessible via  and -ledit.

So I suspect there is no special on-OS-X condition to change or remove (if we 
ignore those #ifdef __APPLE__ bug workarounds for the moment). Maybe I should 
drop that DEFAULT_LIBREADLINE business from the patch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for the reviews. I have updated the patch.

--
Added file: http://bugs.python.org/file42220/_quote_html_to_html_escape_v5.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-03-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Ping.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages

2016-03-20 Thread Eric Snow

Eric Snow added the comment:

Hmm. These two should be equivalent:

  if spec.loader.is_package(fullmodule):
  dict['__path__'] = [os.path.dirname(fname)]

  if spec.submodule_search_locations is not None:
  dict['__path__'] = spec.submodule_search_locations

Do you mean that "python -m pyclbr XXX" doesn't work for packages?  I'm 
guessing you mean something else because I was able to run it successfully for 
both "os" (sort of a package) and "importlib".

Also, I noticed that if I run pyclbr on the "test" package or "test.regrtest" I 
get back no output, not an error.  I'd expect to get output though.  Perhaps 
that's related?

If you are getting an error, what is the traceback you are getting?

Note that pyclbr fails with the following if you try to run it on a file or 
module that doesn't exist:

  AttributeError: 'NoneType' object has no attribute 'loader'

--
nosy: +eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 18/03/2016 22:39, STINNER Victor a écrit :
> 
> In the issue #26530, it was proposed (required?) to support multiple
addresses spaces to be able to use tracemalloc in numpy.

Only proposed :-) Numpy itself only works on the CPU, however Nathaniel
may have other use cases of his own. Also, Numba allows use of the Numpy
API (part thereof, anyway) on GPUs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty

2016-03-20 Thread Steve Dower

Steve Dower added the comment:

Thanks! Fixed for 3.6, 3.5 and 2.7.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-20 Thread STINNER Victor

STINNER Victor added the comment:

Instead of having to change the API for tracking GPU memory, I suggest to
try a hack. Memory allocations use an alignement. For pymalloc, it's 8
bytes for example. On a GPU I expect at least 2 bytes or more likey
something much bigger like 16 bytes. For malloc, I also expect at least 2
bytes.

If it's the minimum is 2 bytes, good. Use the lowest bit as a "GPU" flag!
pointer|1.

Tracemalloc doesn't give access to pointers in its API, so it shouldn't
matter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed your patch on Rietveld (you should get an email notification).

--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26545] os.walk is limited by python's recursion limit

2016-03-20 Thread Elena Oat

Elena Oat added the comment:

I've actually tried to test the recursion limit on my Mac OS X. It seems that I 
cannot create any subdirectories after around 500 subdir depth. I guess it's 
related to the allowed path length (<1024 chars?).

--
nosy: +Elena.Oat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26575] lambda not closed on specific value in comprehension

2016-03-20 Thread David Goffredo

New submission from David Goffredo:

A series of lambdas referring to a variable in a comprehension do not hold 
distinct values, while conventional higher order function do.

PS C:\Users\David\Desktop> python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Caller:
... def __init__(self, f):
... self._f = f
... def start(self):
... print(self._f())
...
>>> def asFunc(boundValue):
... def func():
... return boundValue
... return func
...
>>> for caller in [Caller(asFunc(x)) for x in range(5)]:
... caller.start()
...
0
1
2
3
4
>>> for caller in [Caller(lambda: x) for x in range(5)]:
... caller.start()
...
4
4
4
4
4
>>>

--
messages: 261885
nosy: David Goffredo
priority: normal
severity: normal
status: open
title: lambda not closed on specific value in comprehension
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26593] silly typo in logging cookbook

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d41ce2cde18 by Berker Peksag in branch '3.5':
Issue #26593: Fix typo in logging HOWTO
https://hg.python.org/cpython/rev/8d41ce2cde18

New changeset 8b85df50d906 by Berker Peksag in branch 'default':
Issue #26593: Fix typo in logging HOWTO
https://hg.python.org/cpython/rev/8b85df50d906

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26593] silly typo in logging cookbook

2016-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Andrew.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode

2016-03-20 Thread STINNER Victor

STINNER Victor added the comment:

Buildbots are happy, I close the issue.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26583] test_timestamp_overflow fails

2016-03-20 Thread Peter Inglesby

New submission from Peter Inglesby:

I get the following test failure against changeset 100576 on OSX 10.9.5:

$ ./python.exe -m test test_import
[1/1] test_import
test test_import failed -- Traceback (most recent call last):
  File "/Users/peteringlesby/src/cpython/Lib/test/test_import/__init__.py", 
line 301, in test_timestamp_overflow
os.stat(compiled)
FileNotFoundError: [Errno 2] No such file or directory: 
'__pycache__/@test_68937_tmp.cpython-36.pyc'

1 test failed:
test_import

--
messages: 261919
nosy: inglesp
priority: normal
severity: normal
status: open
title: test_timestamp_overflow fails
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread Manvi B

Manvi B added the comment:

Modified documentation for the functions bin(), hex() and oct() as mentioned in 
the comments. Submitted the patch.

--
keywords: +patch
nosy: +Manvi B
Added file: http://bugs.python.org/file42221/issue26506.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-20 Thread STINNER Victor

STINNER Victor added the comment:

Cool, test_warnings, test_logging, etc. pass again on Windows buildbots. I 
close the issue.

As I wrote, I opened a second issue for socket & os.scandir.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Elena Oat

Elena Oat added the comment:

I tested the patch and it seems fine. Also ran tests for uuid.py and it they 
passed.

--
nosy: +Elena.Oat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26466] could not build python 2.7.11 on AIX

2016-03-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
resolution:  -> fixed
stage:  -> resolved
type:  -> compile error

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's

2016-03-20 Thread SilentGhost

SilentGhost added the comment:

Thanks for this, Mandeep. I don't think it is entirely the same issue that 
Wolfgang is describing. He's particularly concerned about the clash of .zip 
files from the sys.path with ones coming from .pth files for example. And while 
the proposed fix would resolve the issue, I don't feel it would be entirely 
correct. For the record, I'm not even sure sys.path is guaranteed to be contain 
no duplicates, at least I wasn't able to find a statement to that effect in the 
docs. In any case, I'm adding Brett here who was seemingly the last one to 
touch that bit of code.

I'm also attaching a path with what I think is a more appropriate and smaller 
fix.

--
keywords: +patch
nosy: +brett.cannon
stage: test needed -> patch review
Added file: http://bugs.python.org/file4/issue26587.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23857] Make default HTTPS certificate verification setting configurable

2016-03-20 Thread Nick Coghlan

Nick Coghlan added the comment:

As Robert suggested, I tweaked the envvar tests to be more self-explanatory:

https_is_verified = """import ssl, sys; \
status = "Error: _create_default_https_context does not verify 
certs" \
   if ssl._create_default_https_context is \
  ssl._create_unverified_context \
 else None; \
sys.exit(status)"""
https_is_not_verified = """import ssl, sys; \
status = "Error: _create_default_https_context verifies certs" \
   if ssl._create_default_https_context is \
  ssl.create_default_context \
 else None; \
sys.exit(status)"""

I'm going to check this in as is and mark the PEP as Final. If anyone spots any 
minor cleanup issues, feel free to comment on them here, otherwise I'd suggest 
either opening a new issue or reopening this one for any larger concerns.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 700ae1bfc453 by Victor Stinner in branch '3.5':
Fix pyclbr to support importing packages
https://hg.python.org/cpython/rev/700ae1bfc453

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2016-03-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set

2016-03-20 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: larry -> ned.deily
nosy:  -larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23857] Make default HTTPS certificate verification setting configurable

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a9c9368d79e by Nick Coghlan in branch '2.7':
Issue #23857: Implement PEP 493
https://hg.python.org/cpython/rev/7a9c9368d79e

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26594] Tutorial example IndentationError?

2016-03-20 Thread Erwin Berkouwer

New submission from Erwin Berkouwer:

being totally new to Python, I tried actually doing the examples from the 
beginners guide (real RTFM ;-)

however I fail at the first example, with an error message that I don't 
understand. please clarify. attached file is screenprint from documentation, 
below what's on my screen (note I keyed in the example, no copy/paste, but I 
think correctly)

Also adding spaces or a tab doesn't get rid of the error.


C:\Users\erwin>python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> the_world_is_flat = True
>>> if the_world_is_flat:
... print("be careful not to fall off!")
  File "", line 2
print("be careful not to fall off!")
^
IndentationError: expected an indented block

--
assignee: docs@python
components: Documentation
files: IndentationError.jpg
messages: 262072
nosy: Erwin Berkouwer, docs@python
priority: normal
severity: normal
status: open
title: Tutorial example IndentationError?
versions: Python 3.5
Added file: http://bugs.python.org/file42223/IndentationError.jpg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23857] Make default HTTPS certificate verification setting configurable

2016-03-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
versions: +Python 2.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-03-20 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Android NDK provides an "android-support" package [1]. There is no 
documentation other than README in its git repository, I guess it's a 
'compatibility layer' between applications targetting a complete C library and 
Android's BioniC. With my patchset [2], Python builds and runs on my ASUS 
Zenfone 2 (Android 5.0.2). Patches proposed in this issue are no longer 
necessary.

[1] 
https://android.googlesource.com/platform/ndk.git/+/master/sources/android/support/
[2] https://github.com/yan12125/python3-android, see commit 
82c971a96021e8f8006755b6963ac39f8a5fa412 and 
73c2889c19c0bf259021fcc52a3baf5613b1e075

--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26546] Provide translated french translation on docs.python.org

2016-03-20 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-03-20 Thread Stefan Krah

Stefan Krah added the comment:

Thank you, this is excellent!  Does that mean that all locale patches are no 
longer needed? Here is one left (perhaps accidentally):

https://github.com/yan12125/python3-android/blob/cpython-hg/mk/ncurses/android-locale-fixes.patch

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2bf6d1e018e by Brett Cannon in branch 'default':
Merge for issue #26095
https://hg.python.org/cpython/rev/a2bf6d1e018e

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26594] Tutorial example IndentationError?

2016-03-20 Thread SilentGhost

SilentGhost added the comment:

Erwin, you could clearly see in the screenshot that the print call is indented, 
i.e. it starts in the 5th column, under letter "h" of the_world_is_flat. In 
what you've typed here one can clearly see that "p" of print is under "i" of if 
(the 1st column) and is therefore not indented. Indentation is an important 
part of Python syntax.

To properly copy this example from documentation into interpreter you could 
click on button in the top right corner of the code block - it's cut off in 
your screenshot, but it looks like a python prompt (>>>).

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26595] Segfault on Pointer operation

2016-03-20 Thread Emin Ghuliev

New submission from Emin Ghuliev:

I'm trying use a pointer on python script but when executing the following code 
getting error. (Segmentation fault)


dmr@debian:~$ python test.py
Segmentation fault


self.mem  = c_char_p(mem)

pointer(self.binning())[0] = 0x41414141


output: 
[--registers---]
EAX: 0x0 
EBX: 0xb7aee000 --> 0x21e4c 
ECX: 0x1 
EDX: 0x41414141 ('')
ESI: 0x41414141 ('')
EDI: 0x41414141 ('')
EBP: 0xb7b0eb3c --> 0xc ('\x0c')
ESP: 0xbfffeb74 --> 0x0 
EIP: 0xb7dfc4b6 (<__strlen_sse2_bsf+22>:movdqu xmm1,XMMWORD PTR [edi])
EFLAGS: 0x10287 (CARRY PARITY adjust zero SIGN trap INTERRUPT direction 
overflow)
[-code-]
   0xb7dfc4ad <__strlen_sse2_bsf+13>:   pxor   xmm0,xmm0
   0xb7dfc4b1 <__strlen_sse2_bsf+17>:   cmpecx,0x30
   0xb7dfc4b4 <__strlen_sse2_bsf+20>:   ja 0xb7dfc4cd <__strlen_sse2_bsf+45>
=> 0xb7dfc4b6 <__strlen_sse2_bsf+22>:   movdqu xmm1,XMMWORD PTR [edi]
   0xb7dfc4ba <__strlen_sse2_bsf+26>:   pcmpeqb xmm0,xmm1
   0xb7dfc4be <__strlen_sse2_bsf+30>:   pmovmskb edx,xmm0
   0xb7dfc4c2 <__strlen_sse2_bsf+34>:   test   edx,edx
   0xb7dfc4c4 <__strlen_sse2_bsf+36>:   jne0xb7dfc539 
<__strlen_sse2_bsf+153>
[stack-]


BUG on ctypes module 

.//source/cfield.c:1328

static PyObject *
z_get(void *ptr, unsigned size)
{
/* XXX What about invalid pointers ??? */
if (*(void **)ptr) {
#if defined(MS_WIN32) && !defined(_WIN32_WCE)
if (IsBadStringPtrA(*(char **)ptr, -1)) {
PyErr_Format(PyExc_ValueError,
 "invalid string pointer %p",
 *(char **)ptr);
return NULL;
}
#endif
return PyString_FromString(*(char **)ptr); < === passing 
pointer as argument
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
./Objects/stringobject.c:
PyObject *
PyString_FromString(const char *str = this value assigned to 0x41414141 address)
{
register size_t size;
register PyStringObject *op;

assert(str != NULL);
size = strlen(str); < argument address 0x41414141

--
files: alloc.py
messages: 262077
nosy: Emin Ghuliev
priority: normal
severity: normal
status: open
title: Segfault on Pointer operation
Added file: http://bugs.python.org/file42224/alloc.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's

2016-03-20 Thread Wolfgang Langner

Wolfgang Langner added the comment:

Extended unit test for the issue and patch for site.py.

--
Added file: http://bugs.python.org/file42225/site.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26595] Segfault on Pointer operation

2016-03-20 Thread Emin Ghuliev

Changes by Emin Ghuliev :


--
components: +ctypes
type:  -> crash
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26595] Segfault on Pointer operation

2016-03-20 Thread Emin Ghuliev

Changes by Emin Ghuliev :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26267] UUID docs should say how to get "standard form"

2016-03-20 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f736aea929c2 by Berker Peksag in branch '3.5':
Issue #19164: Improve exception message of uuid.UUID()
https://hg.python.org/cpython/rev/f736aea929c2

New changeset e59b799df6e2 by Berker Peksag in branch 'default':
Issue #19164: Improve exception message of uuid.UUID()
https://hg.python.org/cpython/rev/e59b799df6e2

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26267] UUID docs should say how to get "standard form"

2016-03-20 Thread SilentGhost

Changes by SilentGhost :


--
nosy:  -SilentGhost

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12813] uuid4 is not tested if a uuid4 system routine isn't present

2016-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Since 756d040aa8e8, uuid.uuid4() no longer depends on ctypes. I'll remove the 
'requires ctypes' condition from test_uuid4.

--
nosy: +berker.peksag
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12813] uuid4 is not tested if a uuid4 system routine isn't present

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9301ebef8d8 by Berker Peksag in branch '3.5':
Issue #12813: uuid.uuid4() no longer depends on ctypes
https://hg.python.org/cpython/rev/d9301ebef8d8

New changeset 462be0479f11 by Berker Peksag in branch 'default':
Issue #12813: uuid.uuid4() no longer depends on ctypes
https://hg.python.org/cpython/rev/462be0479f11

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12813] uuid4 is not tested if a uuid4 system routine isn't present

2016-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Matt!

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread STINNER Victor

STINNER Victor added the comment:

You misunderstood the whole purpose of my issue! You must not write
hex()[:2] (it's inefficent)! Please remove it from your patch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




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

2016-03-20 Thread Serhiy Storchaka

Serhiy Storchaka 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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18048] Merging test_pep263.py and test_coding.py

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 776e9b8bdd96 by Serhiy Storchaka in branch '2.7':
Issue #18048: Rename test_pep263.py to test_source_encoding.py.
https://hg.python.org/cpython/rev/776e9b8bdd96

New changeset deadfb03dec0 by Serhiy Storchaka in branch '2.7':
Issue #18048: Rename test_coding.py to test_source_encoding.py.
https://hg.python.org/cpython/rev/deadfb03dec0

New changeset c42d743779bd by Serhiy Storchaka in branch '2.7':
Issue #18048: Merge test_pep263.py and test_coding.py into 
test_source_encoding.py.
https://hg.python.org/cpython/rev/c42d743779bd

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18048] Merging test_pep263.py and test_coding.py

2016-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Backported to 2.7 for the sake of easier backporting new tests.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-03-20 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

curses was broken and now it's fixed. Yes - Android's locale patch is no longer 
necessary in _curses either. However, there are runtime errors:

shell@ASUS_Z00E_2:/data/local/tmp $ python3.6 -c 'import curses; 
curses.initscr()'   
Traceback (most recent call last):
  File "", line 1, in 
  File "/data/local/tmp/python3/lib/python3.6/curses/__init__.py", line 30, in 
initscr
fd=_sys.__stdout__.fileno())
_curses.error: setupterm: could not find terminfo database

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26581] Double coding cookie

2016-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, I made a mistake! In 2.7 the first coding on the same line wins. And that 
behavior was from start. Regression was unintentionally introduced in 
issue18470.

Thus *there is* a bug in Python 3. PEP 263 doesn't need more changes, but 
Python tokenizer and related tools do.

Sorry for misleading.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26581] Double coding cookie

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23a7481eafd4 by Serhiy Storchaka in branch 'default':
Issues #25643, #26581: Added new tests for detecting Python source code 
encoding.
https://hg.python.org/cpython/rev/23a7481eafd4

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25643] Python tokenizer rewriting

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23a7481eafd4 by Serhiy Storchaka in branch 'default':
Issues #25643, #26581: Added new tests for detecting Python source code 
encoding.
https://hg.python.org/cpython/rev/23a7481eafd4

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26581] Double coding cookie

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c44cea2ea8f by Serhiy Storchaka in branch '3.5':
Issue #26581: Use the first coding cookie on a line, not the last one.
https://hg.python.org/cpython/rev/1c44cea2ea8f

New changeset 8506d127d482 by Serhiy Storchaka in branch '2.7':
Issue #26581: Use the first coding cookie on a line, not the last one.
https://hg.python.org/cpython/rev/8506d127d482

New changeset e86cd4a872b8 by Serhiy Storchaka in branch 'default':
Issue #26581: Use the first coding cookie on a line, not the last one.
https://hg.python.org/cpython/rev/e86cd4a872b8

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26581] Double coding cookie

2016-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26596] numpy.all np.all .all

2016-03-20 Thread Jose

New submission from Jose:

the numpy.all function does not work.
I created 
A = np.random.random((10,1))
np.all(A)<1 gives me False, which is wrong!
and
B = 2 * A
np.all(B)<2 gives me True, which is correct!

also np.sum(A) < 10, gives me True, which is correct!

--
components: Macintosh
files: Screen Shot 2016-03-20 at 4.33.22 PM.png
messages: 262093
nosy: JoseLight, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: numpy.all np.all .all
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42226/Screen Shot 2016-03-20 at 4.33.22 
PM.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26596] numpy.all np.all .all

2016-03-20 Thread Eryk Sun

Eryk Sun added the comment:

NumPy is not part of Python's standard library, so this is a 3rd party problem. 
However, please don't waste the time of the NumPy developers with this. You 
either haven't read the documentation or have misread it. numpy.all [1] is an 
AND reduction over the specified dimension or all dimensions of an array.

>>> import numpy as np
>>> A = np.random.random((10, 1))
>>> np.all(A)
True
>>> True < 1
False
>>> isinstance(True, int)
True
>>> int(True)
1

The following checks whether all values are less than 1:

>>> A < 1
array([[ True],
   [ True],
   [ True],
   [ True],
   [ True],
   [ True],
   [ True],
   [ True],
   [ True],
   [ True]], dtype=bool)
>>> np.all(A < 1)
True

[1]: http://docs.scipy.org/doc/numpy/reference/generated/numpy.all.html

--
nosy: +eryksun
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26596] numpy.all np.all .all

2016-03-20 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This is not a bug, but behaving correctly. You have:

py> A = np.random.random((10,1))
py> np.all(A)
True
py> np.all(A) < 1  # is True less than 1?
False

which is correct: True is *not* less than 1. But True *is* less than 2:

py> True < 2
True
py> np.all(2*A)
True


Also, for future reference, please do not post screen shoots unless you 
absolutely have to. Screenshots make it impossible to copy the code from your 
example, and make it difficult for anyone who is visually impaired and using a 
screen-reader to contribute. Instead, copy and paste the text from your 
interpreter. Thank you.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26597] Document how to cite Python

2016-03-20 Thread Steven D'Aprano

New submission from Steven D'Aprano:

Add either a FAQ or a new page under "Meta Information" in the documentation 
for how to formally cite Python in scientific papers or other academic 
situations.

See thread on Python-Ideas here for justification and further discussion:

https://mail.python.org/pipermail/python-ideas/2016-March/038816.html

--
assignee: docs@python
components: Documentation
messages: 262096
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Document how to cite Python
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

You example says to left justify '1'
>>> format(1, '<2')
'1 '
and then pad with '0' instead of ' '.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset de669512df97 by Terry Jan Reedy in branch '2.7':
Issue #15660: Further clarify 0 prefix for width specifier in formats.
https://hg.python.org/cpython/rev/de669512df97

New changeset 34cbc5d8a173 by Terry Jan Reedy in branch '3.5':
Issue #15660: Further clarify 0 prefix for width specifier in formats.
https://hg.python.org/cpython/rev/34cbc5d8a173

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26525] Documentation of ord(c) easy to misread

2016-03-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: docs@python -> terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26525] Documentation of ord(c) easy to misread

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7071c9b8c33 by Terry Jan Reedy in branch '3.5':
Issue #26525: Change ord example from nu to more easily recognized Euro sign.
https://hg.python.org/cpython/rev/c7071c9b8c33

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26525] Documentation of ord(c) easy to misread

2016-03-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26597] Document how to cite Python

2016-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Either a new page under 'Meta' or combined with 'Copyright'.

For future reference, sys has multiple information constants and functions.  
Indeed, 'copyright' is an alias for sys.copyright, added by the site module.  
Sys would, I think, be the best place to put a citation() function, should you 
propose one.  It would then be indexed, but not intrusive on startup.

--
nosy: +terry.reedy
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread Simon

New submission from Simon:

I downloaded the Embeddable zip file from the Python site, 
(https://www.python.org/downloads/release/python-351/) and rand the code below.

When I run the code below certain modules are not imported while others are 
imported fine.
The modules that are not imported seem to be the ones sub-directories within 
the zip file.

(omitted obvious code, error checking and some cleanup)

...
int main()
{
  // ... 
  Py_SetProgramName(L"A"); 
  Py_SetPath(L"path\\to\\python35.zip"); // embeddable from the python 
site. 
  Py_Initialize(); 
  PyThreadState *mainstate = PyThreadState_Get(); 
  PyInterpreterState* mainInterpreterState = mainstate->interp; 
  
  PyObject *main_module = PyImport_AddModule("__main__"); 
  PyObject *main_dict = PyModule_GetDict(main_module); 
  PyObject *local_dic = PyDict_New(); 

  const char* s = "import ctypes\n"; 
  PyObject * PyRes = PyRun_String(s, Py_file_input, main_dict, local_dic); 
  PyObject* ex = PyErr_Occurred(); 
  if (NULL != ex) 
  { 
//  didn't work, import error. 
  } 
}

The exact same code above manages to import other modules as long as they are 
located inside the root of the zip file.

modules like json/ctypes and so on are not imported as they are in a sub 
directory.

--
messages: 262101
nosy: SimonG, amaury.forgeotdarc, belopolsky, meador.inge, paul.moore, 
steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Embbedable zip does not import modules in (zip)subdirectory
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-03-20 Thread Simon

Changes by Simon :


--
components: +Interpreter Core, Windows

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com