[issue21861] io class name are hardcoded in reprs

2015-03-23 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset bb27dff7f83f by Raymond Hettinger in branch 'default': Issue 23744: Minor speed-up for deque.__bool__(). https://hg.python.org/cpython/rev/bb27dff7f83f -- nosy: +python-dev ___ Python tracker

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for taking a look. IMO, the cost of this one is near zero and there is a modest benefit. It is simple enough that I don't feel any angst about applying it. I'm doing several little touch-ups to the module, individually nothing, but collectively m

[issue22208] tarfile can't add in memory files (reopened)

2015-03-23 Thread Martin Panter
Martin Panter added the comment: If you read the documentation it is clear that gettarfile() requires an OS file, so won’t work with an internal Python-only file object. Maybe the documentation could be tweaked, but I don’t think the gettarfile() implementation should be changed. To me the who

[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.

2015-03-23 Thread Davin Potts
Changes by Davin Potts : -- versions: +Python 2.7, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.

2015-03-23 Thread Davin Potts
Davin Potts added the comment: Since the time of its introduction in 2.6, a call to multiprocessing.Lock.release on an already unlocked lock resulted in behavior that did not match that of threading.Lock.release (which raised a thread.error as far back as 2.4 and probably longer than that hist

[issue15945] memoryview + bytes fails

2015-03-23 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: On further checking, this probably gives slightly greater benefit to deque than it would for list, tuple, dict, etc., only because PyObject_IsTrue checks for mapping before sequence; deque is a pure sequence, no mapping, so it has to fail an extra test before

[issue23750] Clarify difference between os.system/subprocess.call in section "Replacing os.system()"

2015-03-23 Thread Martin Panter
Martin Panter added the comment: Another difference is that (at least POSIX) system() blocks SIGINT and SIGQUIT while the child is running. Compare: $ python3 -c 'print("Waiting"); import os; print("Returned", os.system("sleep 3 && exit 3"))' Sleeping Returned 768 $ python3 -c 'print("Sleeping

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Is it worth the definition of tp_as_number and maintaining another method for a micro-optimization? Presumably every collection in Python would benefit slightly from this (say, defaultdict in the same file, list, tuple, etc.), but none of them bother. Why woul

[issue9232] Allow trailing comma in any function argument list.

2015-03-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: .. and a couple more -1's on the tracker: msg123851 - Martin v. Löwis msg123848 - Brett Cannon It looks like a round on python-ideas is needed before this can move forward. -- ___ Python tracker

[issue9232] Allow trailing comma in any function argument list.

2015-03-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It looks like if it was not for Raymond's mild dissent, [1], we would have a consensus last time this was raised on python-dev, [2-7]. [1] -? Raymond Hettinger https://mail.python.org/pipermail/python-dev/2010-December/106782.html [2] +0 Guido van Rossum

[issue23755] tempfile.NamedTemporaryFile should be able to toggle "delete"

2015-03-23 Thread Stephen Gallagher
Stephen Gallagher added the comment: Oops, the temporary code I sent indicated that I was overriding the unlink() function (which I also tried, just in case __del__ was somehow protected). Neither monkeypatching unlink nor __del__ actually worked. -- __

[issue23755] tempfile.NamedTemporaryFile should be able to toggle "delete"

2015-03-23 Thread Stephen Gallagher
New submission from Stephen Gallagher: Currently, NamedTemporaryFile takes an attribute at initialization that allows it to remove the temporary file on going out of scope or else leave it around. However, it's not possible to change this after the fact. It would be a much more sensible patter

[issue9232] Allow trailing comma in any function argument list.

2015-03-23 Thread Martin Panter
Martin Panter added the comment: See also Issue 22942 about existing problems with the language documentation. I would like to see trailing commas supported consistently, especially in function calls. (I think the patch here only does function definitions?) I like to use them when writing argu

[issue22942] Language Reference - optional comma

2015-03-23 Thread Martin Panter
Martin Panter added the comment: See also Issue 9232, about adding support for trailing commas in all cases of function calls and definitions. -- nosy: +vadmium ___ Python tracker _

[issue23754] Add a new os.read_into() function to avoid memory copies

2015-03-23 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue23058] argparse silently ignores arguments

2015-03-23 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +nailor, r.david.murray versions: +Python 3.4, Python 3.5 ___ Python tracker ___ ___ Python-bug

[issue23752] Cleanup io.FileIO

2015-03-23 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue23754] Add a new os.read_into() function to avoid memory copies

2015-03-23 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue23754] Add a new os.read_into() function to avoid memory copies

2015-03-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why do you want to optimize the pure Python FileIO? -- nosy: +pitrou ___ Python tracker ___ ___ Pyth

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread Charles-François Natali
Charles-François Natali added the comment: > Serhiy Storchaka added the comment: > > See also issue12082. Yes, but I don't think we want to clutter the code to support exotic niche platforms. -- ___ Python tracker

[issue23058] argparse silently ignores arguments

2015-03-23 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23731] Implement PEP 488

2015-03-23 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23648] PEP 475 meta issue

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: fstat_not_eintr.py: run this script from a NFS share and unplug the network cable, wait, replug. Spoiler: fstat() hangs until the network is back, CTRL+c or setitimer() don't interrupt it. By the way, it looks like the itimer is interrupted during fstat! Extr

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue12082. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread Charles-François Natali
Charles-François Natali added the comment: +1 from me, fstat() has always been par of POSIX. It's really likely Python won't build anyway on such systems. -- ___ Python tracker _

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: There's actually a bug in the pre-3.5 script beyond the "does the directory exist" check. The code is if hasattr(site, "USER_SITE"): userpath = site.USER_SITE.replace(appdata, "%APPDATA%") userscripts = os.path.join(userpath, "Scripts") which s

[issue23648] PEP 475 meta issue

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: > Well, all the syscalls which can blocki can fail with EINTR, so all > I:O related one. This is also what I expect, but how do you explain that I'm unable to see os.stat() failing with EINTR? I'm testing on ext4 file system. May it occur with other file syste

[issue23754] Add a new os.read_into() function to avoid memory copies

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: os.read_into() may be used by the following functions. subprocess.Popen._execute_child(): # Wait for exec to fail or succeed; possibly raising an # exception (limited in size) errpipe_data = bytearray() while True: part = os.read(errpipe

[issue23752] Cleanup io.FileIO

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: See also issue #21861: "io class name are hardcoded in reprs". In my review of _pyio.FileIO, I asked if it would be possible to use __qualname__ in __getstate__(). -- ___ Python tracker

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: New issue #23754: "Add a new os.read_into() function to avoid memory copies". -- ___ Python tracker ___

[issue23754] Add a new os.read_into() function to avoid memory copies

2015-03-23 Thread STINNER Victor
New submission from STINNER Victor: Sockets have a recv_into() method, io.IOBase has a readinto() method, but there is no os.read_into() function. It would avoid memory copies. It would benefit to the Python implementation FileIO (readall() and readinto() methods), see the issue #21859. -

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: My changes only *removes* code and so make it simpler ;-) $ diffstat stat.patch Include/fileutils.h |6 -- Include/pyport.h | 22 -- Modules/_io/fileio.c | 20 Modules/mmapmodule.c |4 Python/f

[issue22623] Missing guards for some POSIX functions

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: > Many POSIX functions aren’t available on every system, especially embedded > ones. What do you call "embedded systems"? I worked on set top boxes (the box to watch television) between 2011 and 2013 and we had a regular Linux kernel with all POSIX functions.

[issue23752] Cleanup io.FileIO

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: The previous change related to fstat() is the changeset 3b5279b5bfd1 from the issue #21679. The changeset introduces the private _blksize attribute. The strange thing is that the changelog is: "Issue #21679: Prevent extraneous fstat() calls during open(). Patc

[issue22623] Missing guards for some POSIX functions

2015-03-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Personally, I'd rather answer that it's not our problem if some systems are not POSIX-compliant. Maintainers of such systems can always maintain a patch to disable the missing functionality. Adding conditionals everywhere has a non-trivial maintenance cost. -

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue22623 for moving in opposite direction. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue23752] Cleanup io.FileIO

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: fileio_drop_dup_fstat.patch: Remove the duplicate call to fstat() in fileio.c. Tests pass, invalid FD are still detected since there is a second call to fstat() which also raises OSError(EBADF) if fstat(fd) fails. -- keywords: +patch Added file: http:/

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: One further thought. This is a change in behaviour (albeit to a script in Tools), so I'm inclined to say it's a new feature for 3.5, rather than a bugfix to be backported to 2.7 and 3.4. For users of 2.7/3.4, the workaround is simply to rerun the script - it doesn

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: stat.patch: Stop pretending that Python works without stat() nor fstat(), consider that these functions are always available. -- keywords: +patch Added file: http://bugs.python.org/file38660/stat.patch ___ Python tra

[issue23654] infinite loop in faulthandler._stack_overflow

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: Thanks for your contribution Matt! -- resolution: -> fixed status: open -> closed versions: -Python 3.6 ___ Python tracker ___ ___

[issue23654] infinite loop in faulthandler._stack_overflow

2015-03-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset d6003de8ecc8 by Victor Stinner in branch '3.4': Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC) https://hg.python.org/cpython/rev/d6003de8ecc8 -- nosy: +python-dev ___ Pyth

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Cool. I'll try to set up a test (it's not covered by the testsuite AFAICT) on a VM or something, just to confirm I haven't broken anything. -- ___ Python tracker _

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Steve Dower
Steve Dower added the comment: Ah, you're right, it was fixed. Guess I misread my local copy (or I was looking at 3.4). That patch looks good to me. It'll help cover the case where someone does something to create the directory. -- ___ Python track

[issue23602] Implement __format__ for Fraction

2015-03-23 Thread Stefan Behnel
Stefan Behnel added the comment: Absolutely. Fractions are all about exact calculations, much more so than Decimals. So the formatting output should be as accurate as requested or possible (well, excluding infinity). -- nosy: +scoder ___ Python trac

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Here is a patch to fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file38659/addpath.patch ___ Python tracker ___

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: One further thought - the installer can't create the user scripts directory if you're doing an all-users install, that's sort of the point of "all users". It could do so for a per-user install, but then there would be an inconsistency that I don't think is a good

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: I think the problem here is that as the OP mentioned, win_add2path.py doesn't add the directory if it doesn't exist, so if you run it immediately after install, it won't add the directories that don't exist yet. And because it's setting the registry entries to mak

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: ... because I think it does do that (see http://bugs.python.org/file38085/userscripts.patch which updates this file) -- ___ Python tracker ___

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Steve - is it the fact that it's not using the versioned user-site directory that you're referring to? -- ___ Python tracker ___ __

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Steve Dower
Steve Dower added the comment: This script adds them to PATH. As I said, the original issue is not a bug, but it has drawn attention to something we apparently missed a while ago. -- ___ Python tracker ___

[issue23654] infinite loop in faulthandler._stack_overflow

2015-03-23 Thread Matt Frank
Matt Frank added the comment: This is a patch that turns off the Intel Compiler's optimization for the stack_overflow() function. It turns out that icc doesn't support gcc's __attribute__((optimize("no-optimize-sibling-calls"))). Instead I used an ifdef'd intel-specific pragma that turns off

[issue23602] Implement __format__ for Fraction

2015-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: [Eric] > I'm not sure it needs fixing... Hmm. We've gone to some lengths to make sure that we get correctly-rounded results for formatting of Decimal and float types, as well as to make sure that operations like converting a Fraction to a float are correctly

[issue23753] Drop HAVE_FSTAT: require fstat() to compile/use Python

2015-03-23 Thread STINNER Victor
New submission from STINNER Victor: Topic previously discussed at: https://mail.python.org/pipermail/python-dev/2013-May/126285.html Related issue: http://bugs.python.org/issue12082 Antoine Pitrou wrote in the issue: "I would personally like to remove HAVE_FSTAT and make Python unconditionally

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: I opened the issue #23752: "Cleanup io.FileIO". -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue23752] Cleanup io.FileIO

2015-03-23 Thread STINNER Victor
New submission from STINNER Victor: While reviewing a Python implementation of io.FileIO (_pyio.FileIO) in the issue #21859, many issues were found in the C implementation. I open an issue to fix them. We may fix them before or after the Python implementation is merged. -- components:

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Pip and/or setuptools will add the Scripts directory when needed, so it's not a big deal that the installer doesn't create it. In 2.7.9 and later, and 3.4 onwards, the Scripts directory is created as part of the ensurepip step of the install, so it's pretty much a

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Steve Dower
Steve Dower added the comment: It looks like the script hasn't been updated for the moved user scripts directory (under %APPDATA%), but otherwise this is not a bug and can be closed. -- nosy: +paul.moore ___ Python tracker

[issue23699] Add a macro to ease writing rich comparisons

2015-03-23 Thread Petr Viktorin
Petr Viktorin added the comment: Changed the macro to Py_RETURN_RICHCOMPARE. This is not an expression, allowing the use of a switch statement. On the other hand, it's even larger macro than before now. >From the discussion it seems that doing this correctly is tricky to do this >correctly -

[issue14260] re.groupindex is available for modification and continues to work, having incorrect data inside it

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What approach looks better, a copy or a read-only proxy? -- ___ Python tracker ___ ___ Python-bugs

[issue23751] Allow reverse lookup (value-to-member) for Enum sublcasses decorated with @enum.unique

2015-03-23 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue23751] Allow reverse lookup (value-to-member) for Enum sublcasses decorated with @enum.unique

2015-03-23 Thread Mohith
Mohith added the comment: Doh! That works. And it was in the documentation too. Silly me. Apologies for opening an issue, and thanks for showing me the way! -- resolution: -> works for me status: open -> closed ___ Python tracker

[issue23751] Allow reverse lookup (value-to-member) for Enum sublcasses decorated with @enum.unique

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use DayOfWeek(today_value). -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list

[issue23751] Allow reverse lookup (value-to-member) for Enum sublcasses decorated with @enum.unique

2015-03-23 Thread Mohith
New submission from Mohith: Addendum to issue 18042. I've had a use case where I wanted to allow reverse lookups (i.e. value-to-member lookup) for my enum.Enum that was decorated via @enum.unique. In such a case, I would add my own class method that performs the logic. E.g. an unoptimized cop

[issue22560] New SSL implementation based on ssl.MemoryBIO

2015-03-23 Thread Berker Peksag
Changes by Berker Peksag : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I think I saw that you committed this also to the 2.7 branch, I committed only working tests and a fix from issue21560. -- ___ Python tracker _

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Wolfgang Maier
Wolfgang Maier added the comment: I see now that it is just issue21560 that went into 2.7 and that's fine. As I said: sorry for the noise -- ___ Python tracker ___ __

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: -hynek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: OK, so left it as is if nobody complains. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Wolfgang Maier
Wolfgang Maier added the comment: Serhiy: I think I saw that you committed this also to the 2.7 branch, but that would not work since memoryviews do not have the nbytes attribute (they do not seem to have cast either). One would have to calculate the length instead from other properties. Test

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Stefan Krah
Stefan Krah added the comment: I just see that non-contiguous arrays didn't work in 2.7 either, so that was probably the original intention. -- ___ Python tracker ___ ___

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Stefan Krah
Stefan Krah added the comment: > In a sense, the old behavior was an artefact of silently copying the > memoryview to bytes. It likely wasn't intentional, but tobytes() *is* used to serialize weird arrays to their C-contiguous representation (following the logical structure of the array rather

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that restores support on non-contiguous memoryviews. It would be better to drop support of non-contiguous data, because it worked only by accident. Needed support of only bytes-like memoryviews written by BufferedWriter. -- Added fil

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Wolfgang Maier
Wolfgang Maier added the comment: something like: def write(self,data): self._check_closed() if self.mode != WRITE: import errno raise OSError(errno.EBADF, "write() on read-only GzipFile object") if self.fileobj is None: raise Val

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Wolfgang Maier
Wolfgang Maier added the comment: to preserve compatibility: there is the memoryview.c_contiguous flag. Maybe we should just check it and if it is False fall back to the old copying behavior ? -- ___ Python tracker

[issue23750] Clarify difference between os.system/subprocess.call in section "Replacing os.system()"

2015-03-23 Thread Andreas Sommer
New submission from Andreas Sommer: Reading over the section "Replacing os.system()" (https://docs.python.org/2/library/subprocess.html#replacing-os-system), one might assume that the return value of os.system and subprocess.call are equivalent. status = os.system("mycmd" + " myarg")

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Wolfgang Maier
Wolfgang Maier added the comment: ouch. haven't thought of this. OTOH, just plain io with your example: with open('xy', 'wb') as f: f.write(y) Traceback (most recent call last): File "", line 2, in f.write(y) BufferError: memoryview: underlying buffer is not C-contiguous fails too

[issue23749] asyncio missing wrap_socket

2015-03-23 Thread Giovanni Cannata
Giovanni Cannata added the comment: Thanks, I will look to the new implementation of ssl in 3.5, and try to adapt it for my project (sldap3). I'd like to help, but I'm not skilled in asynchronous programming so I'm not sure if I succeed. Bye, Giovanni -- _

[issue21062] Evalute all import-related modules for best practices

2015-03-23 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Stefan Krah
Stefan Krah added the comment: Sure: import gzip x = memoryview(b'x' * 10) y = x[::-1] with gzip.GzipFile("x", 'w') as f: f.write(y) -- ___ Python tracker ___ __

[issue23738] Clarify documentation of positional-only default values

2015-03-23 Thread Brett Cannon
Brett Cannon added the comment: I say switch to what Argument Clinic uses, else there's a disconnect syntactically between help() and the docs. -- ___ Python tracker ___ ___

[issue23740] http.client request and send method have some datatype issues

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that for file-like objects we have also the same issue as issue22468. Content-Length is not determined correctly for GzipFile and like. -- ___ Python tracker __

[issue23749] asyncio missing wrap_socket

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: Yes, it's not supported yet. It was already requested in this issue: https://code.google.com/p/tulip/issues/detail?id=79 asyncio got a new SSL implementation which makes possible to implement STARTTLS. Are you interested to implement it? -- __

[issue23749] asyncio missing wrap_socket

2015-03-23 Thread Giovanni Cannata
New submission from Giovanni Cannata: It's not possible to wrap a socket in tls. The StreamWriter object should have an option to start a tls negotiation using the SSLContext of the server. This is needed for protocols the have a "start_tls" feature, for example the ldap protocol. In a non as

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide an example? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Stefan Krah
Stefan Krah added the comment: I think there's a behavior change: Before you could gzip non-contiguous views directly, now that operation raises BufferError. -- nosy: +skrah ___ Python tracker _

[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, currently UnicodeTranslateError is not used in the stdlib in 3.x. But it is documented and supported by some error handlers. I think it should be wider used in text-to-text translations similar to proposed in issue18814. -- assignee: -> serhiy.s

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tests are taken from issue23688. Thanks for your contribution Wolfgang. -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka resolution: -> fixed stage: test needed -> resolved status: open -> closed ___ Pytho

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4dc69e5124f8 by Serhiy Storchaka in branch 'default': Issue #23688: Added support of arbitrary bytes-like objects and avoided https://hg.python.org/cpython/rev/4dc69e5124f8 -- nosy: +python-dev ___ Python

[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2015-03-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4dfe0634d11a by Serhiy Storchaka in branch '2.7': Issue #21560: An attempt to write a data of wrong type no longer cause https://hg.python.org/cpython/rev/4dfe0634d11a New changeset 6eb48b22ff5c by Serhiy Storchaka in branch '3.4': Issue #21560: An

[issue19610] setup.py does not allow a tuple for classifiers

2015-03-23 Thread Berker Peksag
Berker Peksag added the comment: Here is a new patch. I didn't touched provides, requires and obsoletes fields since they are not used much in the setuptools era. Distribution.finalize_options() already converts string types to lists for platforms and keywords fields. I didn't changed that beh

[issue23310] Mock constructor configuration fails for magic methods

2015-03-23 Thread Anand Reddy Pandikunta
Anand Reddy Pandikunta added the comment: mock itself fails -- nosy: +Anand Reddy Pandikunta title: MagicMock constructor configuration fails for magic methods -> Mock constructor configuration fails for magic methods Added file: http://bugs.python.org/file38654/test_mock.py __

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Restored first os.fstat() (however it now is redundant) and addressed most other Victor's comments. In general I prefer EAFP over BDFL, and often "except AttributeError" looks better to me than getattr(). -- Added file: http://bugs.python.org/file38

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: > Hmmm... dear sir - what prevents you from adding an __all__ to the module > with these cache variables excluded ? You didn't understand the general philosophy, we are not hidding internals. For the specific case of platform._uname_cache, it uses the "_" pre

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Closing is an easy fix, bet on my word this would appear as a different bug, thanks for your quickie fix! -- ___ Python tracker ___ ___

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Hmmm... dear sir - what prevents you from adding an __all__ to the module with these cache variables excluded ? -- ___ Python tracker ___

  1   2   >