[issue25395] SIGSEGV using json.tool: highly nested OrderedDict

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

Here is a patch that seems to fix the problem for me. Can someone who knows 
more about tp_dealloc() methods and the Py_TRASHCAN_SAFE stuff have a look? All 
I know is that the body of the trashcan stuff can be deferred until an outer 
nested body is finished, so I though it might be best to defer that 
PyDict_Type.tp_dealloc() call as well.

Is it worth packaging up my simplified code in a test case, perhaps in an 
assert_python_ok() child process?

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40804/odict-trashcan.patch

___
Python tracker 

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



[issue7352] pythonx.y-config --ldflags out of /usr and missing -L

2015-10-18 Thread koobs

koobs added the comment:

The attached patch courtesy of Jan Beich @ FreeBSD minimally mimics (in the 
python version), the --ldflags output of the shell version of 
python-config(.sh).

The ideal scenario of course would be to use the shell script across all 
versions, as per revision c0370730b364 from #16235, so that two different 
versions of python-config no longer need to be maintained (as doko suggested in 
msg173710) and a whole bunch of now divergent code can be relegated to the 
depths.

@doko - can we please get this in for at least 2.7 and 3.4 please, downstreams 
can at least then manage backports themselves for 3.3 and below if necessary. 
This *is* a bug.

--
Added file: http://bugs.python.org/file40805/patch-issue7352.txt

___
Python tracker 

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



[issue7352] pythonx.y-config --ldflags out of /usr and missing -L

2015-10-18 Thread koobs

koobs added the comment:

To clarify, the bug remains in all branches including default, but only 3.4+ 
use the .sh script, leaving 3.3, 3.2, 2.7 using the python implementation.

--
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



[issue25395] SIGSEGV using json.tool: highly nested OrderedDict

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think there is no need to run the test in a subprocess. You can trigger the 
crash by "del obj".

from collections import OrderedDict
obj = None
for _ in range(1000):
obj = OrderedDict([(None, obj)])

del obj
support.gc_collect()

Unfortunately this test is crashed with the patch.

Fatal Python error: Objects/odictobject.c:1443 object at 0xb749ddfc has 
negative ref count -1

Current thread 0xb7580700 (most recent call first):
  File "", line 1 in 
Aborted (core dumped)

--

___
Python tracker 

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



[issue25410] Clean up and fix OrderedDict

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that makes both implementations to use type(self) instead of 
self.__class__ in __repr__(), __reduce__() and copy().

There is a difference between current implementations. Python implementation 
uses self.__class__ in copy(), C implementation uses type(self).

--
Added file: http://bugs.python.org/file40806/odict_type.patch

___
Python tracker 

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



[issue25395] SIGSEGV using json.tool: highly nested OrderedDict

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

Here is a new patch which uses Py_CLEAR() rather than Py_XDECREF(), which seems 
to cure the negative reference count problem. This change was only a guess 
based on looking at namespaceobject.c and the Py_CLEAR() documentation, so it 
would be good for someone else to carefully review it.

--
Added file: http://bugs.python.org/file40807/odict-trashcan.v2.patch

___
Python tracker 

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



[issue25395] SIGSEGV using json.tool: highly nested OrderedDict

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Using Py_CLEAR() fixes symptoms in this test, but the real issue is that 
deallocating code is executed twice for some objects (for every 25th 
OrderedDict).

PyDict_Type.tp_dealloc() can deposit an object in the _PyTrash_delete_later 
list if trash_delete_nesting exceeds PyTrash_UNWIND_LEVEL. Later Py_TYPE(op)-
>tp_dealloc is called for objects in the _PyTrash_delete_later list. But this 
is odict_dealloc that already was called.

One of ways to avoid repeated deallocation is to change the type of the object 
before calling PyDict_Type.tp_dealloc(). This looks as a hack, but correct 
hack. May be there is more straightforward solution.

--
Added file: http://bugs.python.org/file40808/odict-trashcan.v3.patch

___
Python tracker 

___diff -r 741ef17e9b86 Lib/test/test_collections.py
--- a/Lib/test/test_collections.py  Sun Oct 18 09:54:42 2015 +0300
+++ b/Lib/test/test_collections.py  Sun Oct 18 13:28:41 2015 +0300
@@ -2033,6 +2033,14 @@ class OrderedDictTests:
 items = [('a', 1), ('c', 3), ('b', 2)]
 self.assertEqual(list(MyOD(items).items()), items)
 
+def test_highly_nested(self):
+# Issue 25395: crashes during garbage collection
+obj = None
+for _ in range(1000):
+obj = self.module.OrderedDict([(None, obj)])
+del obj
+support.gc_collect()
+
 
 class PurePythonOrderedDictTests(OrderedDictTests, unittest.TestCase):
 
diff -r 741ef17e9b86 Misc/NEWS
--- a/Misc/NEWS Sun Oct 18 09:54:42 2015 +0300
+++ b/Misc/NEWS Sun Oct 18 13:28:41 2015 +0300
@@ -10,6 +10,9 @@ Release date: -XX-XX
 Core and Builtins
 -
 
+- Issue #25395: Fix crash when highly nested OrderedDict structures were
+  garbage collected.
+
 - Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now
   between 2x and 3.5x faster.
 
diff -r 741ef17e9b86 Objects/odictobject.c
--- a/Objects/odictobject.c Sun Oct 18 09:54:42 2015 +0300
+++ b/Objects/odictobject.c Sun Oct 18 13:28:41 2015 +0300
@@ -1438,16 +1438,19 @@ static void
 odict_dealloc(PyODictObject *self)
 {
 PyObject_GC_UnTrack(self);
-Py_TRASHCAN_SAFE_BEGIN(self);
+Py_TRASHCAN_SAFE_BEGIN(self)
+
 Py_XDECREF(self->od_inst_dict);
 if (self->od_weakreflist != NULL)
 PyObject_ClearWeakRefs((PyObject *)self);
 
 _odict_clear_nodes(self);
-Py_TRASHCAN_SAFE_END(self);
 
 /* must be last */
+Py_TYPE(self) = &PyDict_Type;
 PyDict_Type.tp_dealloc((PyObject *)self);
+
+Py_TRASHCAN_SAFE_END(self)
 };
 
 /* tp_repr */
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25433] whitespace in strip()/lstrip()/rstrip()

2015-10-18 Thread Dimitri Papadopoulos Orfanos

New submission from Dimitri Papadopoulos Orfanos:

The documentation of strip() / lstrip() / rstrip() should define "whitespace" 
more precisely.

The Python 3 documentation refers to "ASCII whitespace" for bytes.strip() / 
bytes.lstrip() / bytes.rstrip() and "whitespace" for str.strip() / str.lstrip() 
/ str.rstrip(). I suggest the following improvements:
* add a link from "ASCII whitespace" to string.whitespace or bytes.isspace(),
* define plain "whitespace" more precisely (possibly with a link to 
str.isspace()).

The Python 2 documentation refers to plain "whitespace". As far as I know 
strip() removes ASCII whitespaces only. If so, please:
* add a link to string.whitespace or str.isspace(),
* improve the string.whitespace documentation and explain that it is 
locale-dependent (see documentation of str.isspace()).

--
assignee: docs@python
components: Documentation
messages: 253152
nosy: Dimitri Papadopoulos Orfanos, docs@python
priority: normal
severity: normal
status: open
title: whitespace in strip()/lstrip()/rstrip()
type: enhancement
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



[issue25432] isinstance documentation doesn't explain what happens when type is tuple

2015-10-18 Thread Georg Brandl

Georg Brandl added the comment:

But without using the word "disjunctive".

--
nosy: +georg.brandl

___
Python tracker 

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



[issue15999] Using new 'bool' format character

2015-10-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file40810/accept_bool.patch

___
Python tracker 

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



[issue15999] Using new 'bool' format character

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, it is orthogonal to Argument Clinic. Usually converting to Argument Clinic 
didn't change semantic. However these changes conflicted with proposed patch.

Rebased patch is splitted on two patches.

bool_cleanup.patch. It almost doesn't change the behavior. It uses the "p" 
format unit instead of manually called PyObject_IsTrue(), passes boolean value 
instead 0/1 integers to functions that needs boolean, and made some arguments 
("flush" in print(), "strict", "sort_keys" and "skipkeys" in json module) to be 
converted to boolean only once.

accept_bool.patch. It makes a number of functions to accept arbitrary objects 
in boolean context, not just False/True and ints representable as C int. But I 
prefer first to commit the patch for issue24037.

--
Added file: http://bugs.python.org/file40809/bool_cleanup.patch

___
Python tracker 

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



[issue25434] Fix typo in whatsnew/3.5

2015-10-18 Thread Louis Sautier

New submission from Louis Sautier:

Hi,
I noticed a typo in the doc for What’s New In Python 3.5, here's a patch.

--
assignee: docs@python
components: Documentation
files: fixtypo.patch
keywords: patch
messages: 253155
nosy: docs@python, omelette
priority: normal
severity: normal
status: open
title: Fix typo in whatsnew/3.5
versions: Python 3.5
Added file: http://bugs.python.org/file40811/fixtypo.patch

___
Python tracker 

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



[issue25434] Fix typo in whatsnew/3.5

2015-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 04ce28b11467 by Berker Peksag in branch '3.5':
Issue #25434: Fix typo in whatsnew/3.5rst
https://hg.python.org/cpython/rev/04ce28b11467

New changeset 93a1b79d0b19 by Berker Peksag in branch 'default':
Issue #25434: Fix typo in whatsnew/3.5rst
https://hg.python.org/cpython/rev/93a1b79d0b19

--
nosy: +python-dev

___
Python tracker 

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



[issue25434] Fix typo in whatsnew/3.5

2015-10-18 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Louis.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue25434] Fix typo in whatsnew/3.5

2015-10-18 Thread SilentGhost

SilentGhost added the comment:

Shouldn't the line above read "now accepts" rather than "how accepts"?

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2015-10-18 Thread David Becher

New submission from David Becher:

Since Python 3 removed unbound methods, I found some references using the old 
terminology in this HowTo about descriptors 
(https://docs.python.org/3/howto/descriptor.html). Also, since unbound methods 
have been removed, the function call types.MethodType now only takes two 
arguments, namely the function to bind and the object to bind to. In the 
current documentation, however, the old function call with three arguments is 
still being used.

I made a pull request on github, then I realized that it is just a mirror repo. 
Attached you will see a patch file with some of the obvious changes that could 
me made to the document

--
assignee: docs@python
components: Documentation
files: 21.diff.txt
messages: 253159
nosy: David Becher, docs@python
priority: normal
severity: normal
status: open
title: Wrong function calls and referring to not removed concepts in descriptor 
HowTo (documentation)
versions: Python 3.6
Added file: http://bugs.python.org/file40812/21.diff.txt

___
Python tracker 

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



[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2015-10-18 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +rhettinger

___
Python tracker 

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



[issue25436] argparse.ArgumentError missing error message in __repr__

2015-10-18 Thread Daniel Fortunov

New submission from Daniel Fortunov:

ArgumentError's __init__() fails to call super(), meaning
that the base exception doesn’t get a message, and thus repr() always
returns “argparse.ArgumentError()” with no message.

Not very helpful if that repr gets logged, or included in another error message 
:-(

I've attached a patch that fixes this, and adds corresponding tests.

--
components: Library (Lib)
files: cpython_ArgumentError_repr.patch
keywords: patch
messages: 253160
nosy: dfortunov
priority: normal
severity: normal
status: open
title: argparse.ArgumentError missing error message in __repr__
Added file: http://bugs.python.org/file40813/cpython_ArgumentError_repr.patch

___
Python tracker 

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



[issue25437] Issue with ftplib.FTP_TLS and server forcing SSL connection reuse

2015-10-18 Thread Daniel Waites

New submission from Daniel Waites:

There is an issue with the python FTPS module in the standard library which 
appears to be related to SSL session reuse. I noticed when I updated to a 
recent version of Pure-FTPd (1.0.42), python's FTPS library client stopped 
working and generated an error in the ssl unwrap call when a data connection is 
opened after prot_p() is used. Checking the change log on that version of 
Pure-FTPd, there is this note:

- The ONLY_ACCEPT_REUSED_SSL_SESSIONS switch (introduced in Pure-FTPd
1.0.22 circa 2009, but disabled back then due to client compatibility
concerns) is now on by default, except in broken clients compatibility mode.

Turning on the broken clients compatibility mode in pure-ftpd makes the Python 
client work again, so I'm surmising this is related to pure-ftpd forcing SSL 
session reuse. My question is, is this something the Python standard library 
should detect, or is it a problem lower in the stack (i.e., libssl?) 
Incidentally, I can reproduce this behavior on Python 2.7 as well.


Steps to reproduce:

import ftplib
ftp = ftplib.FTP_TLS(ftphost, ftpuser, ftppass)
ftp.prot_p()
ftp.retrbinary('RETR ' + cmofile, infile.write)

Traceback (most recent call last): 
File "/home/dwaites/bin/mysqlload.py", line 212, in 
main() 
File "/home/dwaites/bin/mysqlload.py", line 155, in main 
site.retrbinary('RETR ' + cmofile, infile.write) 
File "/usr/lib/python3.4/ftplib.py", line 449, in retrbinary 
conn.unwrap() 
File "/usr/lib/python3.4/ssl.py", line 788, in unwrap 
s = self._sslobj.shutdown() 
OSError: [Errno 0] Error

--
components: Library (Lib)
messages: 253161
nosy: dwaites
priority: normal
severity: normal
status: open
title: Issue with ftplib.FTP_TLS and server forcing SSL connection reuse
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25437] Issue with ftplib.FTP_TLS and server forcing SSL connection reuse

2015-10-18 Thread Daniel Waites

Daniel Waites added the comment:

Incidentally, there appears to be an old bug report with a similar error 
message, although the error is encountered in a different context. 
http://bugs.python.org/issue10808 . Evidently, errors encountered in libssl 
aren't necessarily being propagated up to python.

--

___
Python tracker 

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



[issue25436] argparse.ArgumentError missing error message in __repr__

2015-10-18 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
type:  -> behavior
versions: +Python 3.4, 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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2015-10-18 Thread STINNER Victor

STINNER Victor added the comment:

"The RNG is seeded from os.urandom, which as of python 3.5 uses the potentially 
blocking getrandom() call."

Hum ok, so your issue is specific to Linux.

"This causes problems e.g. on our build VMs that don't have true entropy, so 
getrandom() blocks forever"

Hum, the problem was already fixed some months/years ago: you must attach a RNG 
virtio device to your VM. Python is just one example, a lot of applications 
need entropy.

"A possible workaround is to monkeypatch os.urandom (in this particular case, 
to return a string of zeroes and remove randomness entirely to get reproducible 
builds)"

An unsafe *workaround* is to install haveged, a daemon generating entropy using 
the CPU.

--
nosy: +haypo
title: "import random" blocks on entropy collection -> "import random" blocks 
on entropy collection on Linux with low entropy

___
Python tracker 

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



[issue25434] Fix typo in whatsnew/3.5

2015-10-18 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, fixed in 530846c3ebb4 and f020a27b5391. Thanks SilentGhost.

--

___
Python tracker 

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



[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patch. I left a few comments on the code review. I think the 
class is meant to represent a real function object, not a wrapper. And it would 
be good to update the following paragraphs about unbound methods.

Also, it looks like the rest of that page could do with some other updates. 
E.g. no need for explicit Function(object) base class, no need to mention that 
a method exists in Python 2.3, code could use @classmethod decorator syntax. 
But these are a slightly separate issues.

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 3.4, Python 3.5

___
Python tracker 

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



[issue13195] subprocess: args with shell=True is not documented on Windows

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

I think the documentation changes made for Issue 16115 should address your 
first question (shell=False). For shell=True, see the discussion at Issue 
20344. Perhaps you can review my patch.

--
dependencies: +test the executable arg to Popen() and improve related docs
nosy: +martin.panter
resolution:  -> duplicate
status: open -> closed
superseder:  -> subprocess.check_output() docs misrepresent what shell=True does

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

Current patch for Issue 25435 addresses the code example. Changes to the text 
are also needed though.

--
dependencies: +Wrong function calls and referring to not removed concepts in 
descriptor HowTo (documentation)
nosy: +martin.panter

___
Python tracker 

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



[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

Also further up the page, “unbound methods . . . are . . . based on the 
descriptor protocol” is probably not really correct or useful. Issue 23702 is 
already open about mentioning unbound methods.

--

___
Python tracker 

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



[issue16785] Document the fact that constructing OSError with erron returns subclass if possible

2015-10-18 Thread Martin Panter

Martin Panter added the comment:

My proposed patch at Issue 23391 addresses this

--
dependencies: +Documentation of EnvironmentError (OSError) arguments disappeared
nosy: +martin.panter

___
Python tracker 

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps you missed my comments to previous patch on Rietveld. Besides this the 
patch LGTM.

May be we should change weird behavior for 6+ arguments. But this is different 
issue.

--

___
Python tracker 

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg253170

___
Python tracker 

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM. We should handle the problem with extra arguments in separate 
issue.

--

___
Python tracker 

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> martin.panter
stage: patch review -> commit review

___
Python tracker 

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



[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2015-10-18 Thread Gregory P. Smith

New submission from Gregory P. Smith:

https://docs.python.org/3/c-api/structures.html#c.PyMemberDef

T_STRING members are turned into str objects in Python.  The documentation 
needs updating to mention which codec the char * bytes are treated as.

Solving this issue involves code inspection and leaving pointers to that code 
here in the issue, then updating the docs to mention the requirements for the 
char * member data as well as what happens upon assignment for non-READONLY 
T_STRING data (a different restriction?  or encoding to the same codec?)

My _guess_ would be UTF-8 or ASCII but I'll let someone else dive in and find 
out.  This is a Python 3 specific documentation clarification.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 253172
nosy: docs@python, gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: document what codec PyMemberDef T_STRING decodes the char * as
type: behavior
versions: Python 3.4, 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