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

2015-03-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23688 ___

[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

[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

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

[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

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

[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 ___ Python

[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 _ prefix

[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 rep...@bugs.python.org http://bugs.python.org/issue23748

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

[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 rep...@bugs.python.org http://bugs.python.org/issue23748

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: we are all consenting adults here. Why do you modify a private attribute? I am changing the type to security as I dont think this is a behaviour issue. I don't understand why do you consider that it is a security vulnerability? import hack_uname # Someone

[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

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

2015-03-23 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23751 ___ ___ Python-bugs-list

[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 rep...@bugs.python.org http://bugs.python.org/issue14260 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23688 ___ ___

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread Hynek Schlawack
Changes by Hynek Schlawack h...@ox.cx: -- nosy: -hynek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21859 ___ ___ Python-bugs-list mailing list

[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 rep...@bugs.python.org http://bugs.python.org/issue23688

[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 rep...@bugs.python.org http://bugs.python.org/issue23688

[issue22560] New SSL implementation based on ssl.MemoryBIO

2015-03-23 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22560 ___ ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23751 ___

[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

[issue23745] Exception when parsing an email using email.parser.BytesParser

2015-03-23 Thread Elmer
New submission from Elmer: I am working with a large dataset of emails and loading one of them resulted in an exception: TypeError: unorderable types: ValueTerminal() CFWSList() I have attached the (anonymised and minimised) email source of the email that triggered the exception. $ python

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Similarly for mac_ver, java_ver etc. platform.mac_ver() ('', ('', '', ''), '') platform.java_ver() ('', '', ('', '', ''), ('', '', '')) Maybe it is okay if these functions are present, but can't they raise an exception or return None instead of returning

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: On second thoughts, why have such a function if it works correctly only when executed from source Cpython folder using source CPython executable and not otherwise ? Cuz if I am calling it like that I already KNOW that I am in such an environment. Possibly

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

[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 rep...@bugs.python.org

[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

[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 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 rep...@bugs.python.org http://bugs.python.org/issue23688

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

[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

[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 rep...@bugs.python.org

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

[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 pyshell#29, line 2, in module f.write(y) BufferError: memoryview: underlying buffer is not

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

[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 rep...@bugs.python.org http://bugs.python.org/issue23688

[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 rep...@bugs.python.org http://bugs.python.org/issue23688 ___ ___ Python-bugs-list

[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 rep...@bugs.python.org http://bugs.python.org/issue23688

[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 rep...@bugs.python.org http://bugs.python.org/issue23738

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

2015-03-23 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21062 ___ ___

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

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Added file: http://bugs.python.org/file38645/timings_deque_bool.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23744 ___

[issue23744] Speed-up deque.__bool__

2015-03-23 Thread Raymond Hettinger
New submission from Raymond Hettinger: The __bool__ method is a little faster than __len__. Timings attached. -- assignee: rhettinger components: Library (Lib) files: deque_bool1.diff keywords: patch messages: 238983 nosy: rhettinger priority: normal severity: normal status: open title:

[issue23378] argparse.add_argument action parameter should allow value extend

2015-03-23 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: - needs patch versions: -Python 3.4, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23378 ___

[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

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

[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

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

[issue23731] Implement PEP 488

2015-03-23 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23731 ___ ___

[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 rep...@bugs.python.org

[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 rep...@bugs.python.org http://bugs.python.org/issue16328

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

[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

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

[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 rep...@bugs.python.org http://bugs.python.org/issue21859 ___ ___

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue16328

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

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue16328

[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 rep...@bugs.python.org http://bugs.python.org/issue23654

[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 rep...@bugs.python.org http://bugs.python.org/issue16328

[issue23742] expandvars removes single quotes ( ' )

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- assignee: - serhiy.storchaka components: +Library (Lib) keywords: +patch stage: needs patch - patch review versions: +Python 2.7 Added file: http://bugs.python.org/file38646/issue23742.patch

[issue21526] Support new booleans in Tkinter

2015-03-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21526 ___

[issue23252] Add support of writing to unseekable file in zipfile

2015-03-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23252 ___

[issue23647] imaplib.py MAXLINE value is too low for gmail

2015-03-23 Thread Arnt Gulbrandsen
Arnt Gulbrandsen added the comment: You're entirely right. I should've reread 2683 too (a decade has passed since I read that). The danger with accepting the unlimited line length is that batch scripts might accept an infinitely large batch. Which is a matter of python culture, really. (This

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread Anand B Pillai
New submission from Anand B Pillai: On Python 3.5.0a1+ built from source, import sysconfig sysconfig.is_python_build() False sysconfig.is_python_build(True) False sysconfig._PROJECT_BASE '/opt/bin' import sys sys._home The problem is, when sys._home is None, this function uses

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: Why is this function even exposed on Linux? It is a deliberate design choice of the platform module. mac_ver(), win32_ver() and linux_distribution() are available on all platforms. mac_ver() says entries which cannot be determined are set to ''. All tuple

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: On second thoughts, why have such a function if it works correctly only when executed from source Cpython folder using source CPython executable and not otherwise ? It's useful to know such information. Python behaves a little bit differently when run

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Lib/test/test_asdl_parser.py:12:if not sysconfig.is_python_build(): As I guessed - it is used internally by unit tests and possibly has no other significan audience. It is best to document this clearly. -- ___

[issue23062] test_argparse --version test cases

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I should agree with you. Then the patch LGTM. -- assignee: - berker.peksag stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23062

[issue16314] Support xz compression in distutils

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Addressed Berker's comments. Added versionchanged directives and a whatsnews entry. -- Added file: http://bugs.python.org/file38648/distutils-lzma_3.patch ___ Python tracker rep...@bugs.python.org

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: Maybe it is okay if these functions are present, but can't they raise an exception or return None instead of returning these funny tuples when empty strings ? It would break the backward compatibility. Again, it's a delibarate choice. --

[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___

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

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general the patch LGTM. -- assignee: - serhiy.storchaka stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23688 ___

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: I am changing the type to security as I dont think this is a behaviour issue. -- type: behavior - security ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23748

[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other occurrences of %X in the code. Do you want provide a patch for them Martin? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread Anand B Pillai
Changes by Anand B Pillai abpil...@gmail.com: Added file: http://bugs.python.org/file38649/sysconfig_test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23746 ___

[issue22516] Windows Installer won't - even when using just for meoption

2015-03-23 Thread Nick Coghlan
Nick Coghlan added the comment: I think we learned our lesson re making decisions at the language summit (rather than focusing on bringing folks up to speed on a problem area) after needing to later reverse engineer the rationale for some of the decisions made at the first couple :)

[issue23722] During metaclass.__init__, super() of the constructed class does not work

2015-03-23 Thread Martin Teichmann
Martin Teichmann added the comment: A note on the implementation: The compiler leaves a __cell__ entry in the class' namespace, which is then filled by type.__new__, and removed from the namespace by the latter. This is the same way it is done for __qualname__. As the patch tampers with the

[issue23748] platform._uname_cache is writeable

2015-03-23 Thread Anand B Pillai
New submission from Anand B Pillai: import platform print 'Actual =',platform.uname() Actual = ('Linux', 'toshiba-laptop', '3.13.0-24-generic', '#47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014', 'x86_64', 'x86_64') import hack_uname # Someone imports my module unaware of the hack (see attached

[issue21859] Add Python implementation of FileIO

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated to the tip (added the closefd attribute in repr). os.fstat() is now called only once in the constructor. -- Added file: http://bugs.python.org/file38651/pyio_fileio_7.patch ___ Python tracker

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

2015-03-23 Thread Wolfgang Maier
Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de: Added file: http://bugs.python.org/file38650/write_bytes_like_objects_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23688

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: IMO it's more a documentation issue than a bug. sysconfig.is_python_build() returns True when Python is run from its source code directory. For example, I compiled Python in ~/prog/python/default. ~/prog/python/default/python returns True. I installed python

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread Anand B Pillai
New submission from Anand B Pillai: import platform platform.system() 'Linux' platform.win32_ver() ('', '', '', '') Why is this function even exposed on Linux ? It should be conditionally exposed only on win32 platforms. Funny that this is coming from the module named platform itself :)

[issue23746] sysconfg.is_python_build() is buggy

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Thanks. From current documentation it isn't clear. Agree to make this a doc bug then. It should also be made clear this would work only for the executable built in the source directory. As in, (Running from the source folder using source Python executable).

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-03-23 Thread Michael Foord
Michael Foord added the comment: I like the first variant suggested by Ezio as more concise. I'll try and look at the substance of the patch today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15836

[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 rep...@bugs.python.org

[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 rep...@bugs.python.org http://bugs.python.org/issue21859 ___

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue23753 ___

[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().

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

[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 rep...@bugs.python.org http://bugs.python.org/issue23753

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

[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

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

2015-03-23 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23753 ___ ___

  1   2   >