[issue18262] ZipInfo.external_attr are not documented

2013-06-19 Thread anatoly techtonik
anatoly techtonik added the comment: Here is the doc - http://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/6297838#6297838 -- ___ Python tracker

[issue18202] Minor fixes for test_coding

2013-06-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 410ea970866e by Serhiy Storchaka in branch '3.3': Issue #18202: Fix minor bugs and cleanup test_coding.py. http://hg.python.org/cpython/rev/410ea970866e New changeset 959f4ce4d590 by Serhiy Storchaka in branch 'default': Issue #18202: Fix minor bugs

[issue18202] Minor fixes for test_coding

2013-06-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not all other changes are cleanups and enhancements. Some of them also fix minor bugs. Thank you for review Victor. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed

[issue1159] os.getenv() not updated after external module uses C putenv()

2013-06-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: FYI, PyPy recently got bitten by this: https://bugs.pypy.org/issue1518 A posix.libc_getenv() function could be a solution. -- nosy: +amaury.forgeotdarc ___ Python tracker

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-19 Thread Edward Catmur
Edward Catmur added the comment: Łukasz, thanks. When the most-derived class virtual-inherits two related ABCs U, V: object / | \ A W V | .` .` B` U` | .` C` The secondary `for` loop is necessary to ensure U and V are ordered correctly. I'l

[issue18262] ZipInfo.external_attr are not documented

2013-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'd be +1 on extending the zipfile API in 3.4 (with a documentation update in older releases as suggested by anatoly): * Add a method or property to ZipInfo for (un)packing the external_attr field * Add an keyword argument to Zipfile.extract and Zipfile.ex

[issue18262] ZipInfo.external_attr are not documented

2013-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: See also #15795 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue18262] ZipInfo.external_attr are not documented

2013-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: Closing this as a duplicate of #15795 (which already has a patch) -- resolution: -> duplicate superseder: -> Zipfile.extractall does not preserve file permissions ___ Python tracker

[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: On first glance the patch looks good. I haven't tested it with the current trunk though. -- nosy: +ronaldoussoren ___ Python tracker ___ _

[issue17894] Edits to descriptor howto

2013-06-19 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Nick Coghlan
Nick Coghlan added the comment: OK, I've satisfied myself that the current behaviour is reasonable, and it's specifically the subclassing behaviour of the status quo that works for me. 1. You have to specifically access the "x.value" attribute of a default enum member to see it. "str(x)" shows

[issue13483] Use VirtualAlloc to allocate memory arenas

2013-06-19 Thread STINNER Victor
STINNER Victor added the comment: > Ah ok. I guess tuples.py then indeed demonstrates a saving. I'll apply the > patch. According to my test, the memory usage is a little bit better with the patch. So Martin:,do you plan to commit the patch? Or is a benchmark required? Or should check first c

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- dependencies: +API for setting the memory allocator used by Python ___ Python tracker ___ ___ Python-bu

[issue18259] Declare sethostname in socketmodule.c for AIX

2013-06-19 Thread Berker Peksag
Changes by Berker Peksag : -- versions: -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Eli Bendersky
Eli Bendersky added the comment: Nicely done summary, Ethan. I think it would be worthwhile to add the reasoning of "why from 1 and not from 0" into the documentation and maybe the PEP too. I think the "falsiness" answer is reasonable, and since it's a common FAQ it's good to state it explicit

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Jakub Wilk
New submission from Jakub Wilk: The -b and -X options are not documented in Misc/python.man. -- assignee: docs@python components: Documentation messages: 191463 nosy: docs@python, jwilk priority: normal severity: normal status: open title: python.man: no documentation for -b, -X ___

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Eli Bendersky
Eli Bendersky added the comment: > The fact "str(x)" returns the fully qualified name for IntEnum worries me a > bit, but if there's a real backwards compatibility problem there (rather than > a theoretical one), hopefully we'll see it once we start converting socket > and errno. What is the

[issue17121] SSH upload for distutils

2013-06-19 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:00 PM, Eli Bendersky wrote: >What is the theoretical problem here? I though that it's an explicit design >goal of enums? Which RED - Color.RED, or MeatReadiness.RED? For sockets: > class SocketType(IntEnum): >... SOCK_STREAM = 1 >.

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 19, 2013, at 06:45 AM, Ethan Furman wrote: >To sum up: the name is already available in the name, no need to have it be >the value as well. I am open to changing the start value to zero instead of >one (which is what I do in my customization of Enum in

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Nick Coghlan
New submission from Nick Coghlan: Replacing an integer constant with the current incarnation of enum.IntEnum breaks JSON serialisation: >>> from enum import Enum >>> from enum import Enum, IntEnum >>> class Example(IntEnum): ... x = 1 ... >>> import json >>> json.dumps(1) '1' >>> json.load

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Nick Coghlan
Nick Coghlan added the comment: I created issue 18264 after I tried it and found my theoretical concern wasn't theoretical at all: swapping a true integer for the current incarnation of enum.IntEnum breaks (at least) JSON serialisation, which means we can't use it in its current form to replac

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:48 PM, Nick Coghlan wrote: >I created issue 18264 after I tried it and found my theoretical concern >wasn't theoretical at all: swapping a true integer for the current >incarnation of enum.IntEnum breaks (at least) JSON serialisation, whi

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:45 PM, Nick Coghlan wrote: >Allowing __str__ to be inherited from Enum rather than from the concrete type >will similarly break any serialisation protocol that relies on str() to >handle integers. The float case is even trickier, since fa

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Eric Snow
Eric Snow added the comment: It's for times like this that I wonder if a simple serialization protocol might be worth it--something separate from __str__() but much simpler than the pickle protocol. __str__() could be the fallback. In the end, though, I always conclude that it's not worth ad

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > JSON has to be taught how to serialize enums. Of course, it also has > to be > taught how to serialize datetimes, timedeltas, and other common data > types. How so? The point of IntEnum was that it derived from int, and therefore would avoid any need for spec

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: in encoder.py: ... elif instance(value, int): yield buf + str(value) ... What if we use int(str(value)) instead? -- nosy: +amaury.forgeotdarc ___ Python tracker

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Eric Snow
Eric Snow added the comment: > Serialization isn't the only issue - you have to know how > to deserialize as well. +1 > (TBH, I wish the json module had better hooks for extending > both serialization and deserialization of non-basic types.) +1 There's at least one stdlib module that does thi

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Nick, in your example it looks like json is using the __str__ for int, but the __repr__ for float -- is this correct? -- assignee: -> ethan.furman nosy: +eli.bendersky, ethan.furman ___ Python tracker

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 19, 2013, at 02:09 PM, Eric Snow wrote: >There's at least one stdlib module that does this pretty well (sqlite3, I >think). This is where a simple serialization (and deserialization of course) >protocol would come in handy. Yeah, my database layer also

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > What if we use int(str(value)) instead? You mean str(int(value)). Sounds good to me. -- nosy: +pitrou ___ Python tracker ___

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Serialization isn't the only issue - you have to know how to > deserialize as well. I think this is pretty much besides the point. IntEnums are meant to be substitutible with plain ints, so you can deserialize as a plain int. Moreoven, JSON doesn't fill the

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Nick Coghlan
Nick Coghlan added the comment: While I agree with forcing int subclasses to true integers in the JSON module, that may not be enough - the problem will affect third party serialisers as well. Whiel the debugging gains won't be as high, we may need to override __str__() in enum.IntEnum to give

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: I have no problem with leaving __str__ as the inherited type's, and just keeping the __repr__ as the enum add-on; this could be one of the differences between a pure Enum and a hybrid Enum. Is it safe to change the json behaviour back to using __str__ for floats

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Eric, The pickle support is solely in Enum. No changes were made to pickles. -- ___ Python tracker ___ _

[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2013-06-19 Thread Christian Heimes
Christian Heimes added the comment: > Shouldn't you try to make the permission removal atomic? Otherwise there's a > window of opportunity to exploit the suid bit. Permissions bits are copied from the source file *after* all data has been copied to the destination file. copy() calls copyfile()

[issue18265] typedef lookupfunc defined by not used

2013-06-19 Thread David Edelsohn
New submission from David Edelsohn: Objects/setobject.c:217:25: warning: typedef 'lookupfunc' locally defined but not used [-Wunused-local-typedefs] This was fixed in trunk (changeset 84208:626a8e49f2a9) and should be backported to 3.3 branch. This is a warning found by GCC 4.8. -- co

[issue18248] fficonfig.py.in wrong for AIX

2013-06-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 00082406e13f by Benjamin Peterson in branch '3.3': fix libffi build on AIX (closes #18248) http://hg.python.org/cpython/rev/00082406e13f New changeset 974d4844d5a7 by Benjamin Peterson in branch 'default': merge 3.3 (#18248) http://hg.python.org/cpy

[issue18248] fficonfig.py.in wrong for AIX

2013-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread R. David Murray
R. David Murray added the comment: I think we tend to forget that that page exists. Patches welcome. -- keywords: +easy nosy: +r.david.murray stage: -> needs patch type: -> behavior ___ Python tracker __

[issue11016] stat module in C

2013-06-19 Thread Christian Heimes
Changes by Christian Heimes : Removed file: http://bugs.python.org/file30147/statmodule.c ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11016] stat module in C

2013-06-19 Thread Christian Heimes
Christian Heimes added the comment: New patch with extensive tests for the stat module. The tests are testing both the new C module and the old stat.py module. -- Added file: http://bugs.python.org/file30648/statmodule2.patch ___ Python tracker

[issue16748] Make CPython test package discoverable

2013-06-19 Thread Zachary Ware
Zachary Ware added the comment: So many things have been fixed since I last made a list of failing modules that it seemed like time to make a new one. First, failing modules that already have open issues with patches: - test_codecmaps* (issue18258) - test_concurrent_futures (issue16968) - tes

[issue16662] load_tests not invoked in package/__init__.py

2013-06-19 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue18262] ZipInfo.external_attr are not documented

2013-06-19 Thread anatoly techtonik
anatoly techtonik added the comment: 3.4+ feature is not a replacement for proper documentation for 2.7-3.4 -- resolution: duplicate -> ___ Python tracker ___ __

[issue935117] pkgutil doesn't understand case-senseless filesystems

2013-06-19 Thread Ankur Ankan
Changes by Ankur Ankan : -- nosy: +Ankur.Ankan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue3354] Improve error reporting for the argument parsing C API

2013-06-19 Thread Ankur Ankan
Changes by Ankur Ankan : -- nosy: +Ankur.Ankan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Corey Brune
Corey Brune added the comment: Hello, I added the two options requested in python.man in the patch file created from "hg diff > python.man.patch". -- keywords: +patch nosy: +cbrune Added file: http://bugs.python.org/file30649/python.man.patch ___ Pyt

[issue18265] typedef lookupfunc defined by not used

2013-06-19 Thread David Edelsohn
David Edelsohn added the comment: Will not fix in Python 3.3. -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ __

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: I was unable to find any references to previous problems with json and floats. A quick-n-dirty patch yields the following: --> from json import dumps, loads --> from enum import Enum --> class FE(float, Enum): ... pass ... --> class Test(FE): ... one = 1.0

[issue11016] Re-implementation of the stat module in C

2013-06-19 Thread Christian Heimes
Christian Heimes added the comment: The latest patch comes with more comments and documentation updates. The C implementation defines all existing constants to the hard coded values from stat.py if the platform doesn't provide them. The approach keeps maximum backward compatibility with the ol

[issue16499] CLI option for isolated mode

2013-06-19 Thread Christian Heimes
Christian Heimes added the comment: I'm catching up on some old patches. What shall I do about this patch? Does anybody want to review or intervene it? -- ___ Python tracker ___

[issue18266] Fix test discovery for test_largefile.py

2013-06-19 Thread Zachary Ware
New submission from Zachary Ware: This one is another inheritance issue. The patch removes unittest.TestCase as a base for LargeFileTest and converts test_main into setUpModule, load_tests, and tearDownModule. This seems like the way to go due to the fact that the order of test execution mat

[issue18267] xmlrpc.client documentation multicall example missleading for division behaviour of python3

2013-06-19 Thread Bernhard Reiter
New submission from Bernhard Reiter: http://docs.python.org/3.4/library/xmlrpc.client.html as of 2013-06-19 20:35 UTC has a divide example and the output can misslead the learning reader towards the new behaviour of python3 with the '/' binary operator for division. server code: def divide(x,

[issue11193] test_subprocess error on AIX

2013-06-19 Thread David Edelsohn
Changes by David Edelsohn : -- components: +Interpreter Core nosy: +David.Edelsohn type: -> behavior ___ Python tracker ___ ___ Pytho

[issue18140] urlparse.urlsplit confused to fragment when password include #

2013-06-19 Thread Madison May
Madison May added the comment: Here's a potential patch for the issue, should we decide it's worth fixing. All current tests pass with the update version of _splitnetloc(), and I've added a test to test_urlparse to check that urls with '#' or '?' in the password field are treated properly. --

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread Brendan O'Connor
New submission from Brendan O'Connor: (This is Python 2.7 so I'm using string vs unicode terminology.) When I use ElementTree.fromstring(), and use the .text field on nodes, the value is usually a string object, but in rare cases it's a unicode object. I'm parsing many XML documents of newspa

[issue11185] test_wait4 error on AIX

2013-06-19 Thread David Edelsohn
Changes by David Edelsohn : -- nosy: +David.Edelsohn type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue11188] test_time error on AIX

2013-06-19 Thread David Edelsohn
Changes by David Edelsohn : -- components: +Extension Modules type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue11188] test_time error on AIX

2013-06-19 Thread David Edelsohn
Changes by David Edelsohn : -- nosy: +David.Edelsohn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ezio.melotti, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Here's the relevant routine from _json.c: - static PyObject * encoder_encode_float(PyEncoderObject *s, PyObject *obj) { /* Return the JSON representation of a PyFloat */ double i = PyFloat_AS_DOUBLE(obj); if (!Py

[issue18233] SSLSocket.getpeercertchain()

2013-06-19 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks for the patch. Committed these changes in: changeset dfead0696a71 changeset e26b00adb7ba -- nosy: +orsenthil resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 3.3, Python 3.4 ___

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread R. David Murray
R. David Murray added the comment: This kind of thing is why python3 exists. Presumably some bit of the elementree code is successfully converting non-ascii into unicode, and then when that is mixed with the result it is returning, you end up with unicode. But that is just a guess; you'll ha

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread R. David Murray
Changes by R. David Murray : -- nosy: +eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread Brendan O'Connor
Brendan O'Connor added the comment: By "non-deterministic" I just mean that the conversion happens for some data but not other data. I should try to find examples that causes it to happen. -- ___ Python tracker _

[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-19 Thread anatoly techtonik
New submission from anatoly techtonik: (, '0755') (, '0644') Traceback (most recent call last): File "./tools/bootstrap.py", line 185, in extract_zip os.fchmod(outfile, unixperm) TypeError: an integer is required Here the integer that is required is not `unixperm`, but `outfile`. ---