[issue16587] Py_Initialize breaks wprintf on Windows
Markus Kettunen added the comment: It's quite common to use wide character strings to support Unicode in C and C++. In C++ this often means using std::wstring and std::wcout. Maybe these are more common than wprintf? In any case the console output breaks as Py_Initialize hijacks the host application's standard output streams which sounds quite illegitimate to me. I understand that Python isn't designed for embedding and it would be a lot of work to fix it, but I would still encourage everyone to take a look at this bug. For me, this was one of the reasons I ultimately had to decide against using Python as my application's scripting language, which is a shame. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16587 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16587] Py_Initialize breaks wprintf on Windows
STINNER Victor added the comment: In C++ this often means using std::wstring and std::wcout. Maybe these are more common than wprintf? In any case the console output breaks as Py_Initialize hijacks the host application's standard output streams which sounds quite illegitimate to me. On Linux, std::wcout doesn't use wprintf(). Do you mean that std::wcout also depends on the mode of stdout (_setmode)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16587 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16587] Py_Initialize breaks wprintf on Windows
Markus Kettunen added the comment: On Linux, std::wcout doesn't use wprintf(). Do you mean that std::wcout also depends on the mode of stdout (_setmode)? Yes, exactly. I originally noticed this bug by using std::wcout on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16587 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21807] SysLogHandler closes TCP connection after first message
Vinay Sajip added the comment: The default for syslog-ng's so_keepalive() option is No (don't keep the socket open). Since you haven't responded with more information, I'll assume that you're using this default setting, and that syslog-ng is terminating the connection. Reopen if you have information to the contrary. -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21807 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21828] added/corrected containment relationship for networks in lib ipaddress
New submission from Nicolas Limage: The current version of the ipaddress library implements containment relationship in a way that a network is never contained in another network : from ipaddress import IPv4Network,IPv4Address IPv4Network(u'192.168.22.0/24') in IPv4Network(u'192.168.0.0/16') False I think it would be better to define the containment relationship between networks as such : - if network A contains all the ip addresses of network B, then B in A is True - by extension of this rule, A in A is True It is useful to quickly determine if a network is a subnet of another -- components: Library (Lib) files: ipaddress-network-containment.diff keywords: patch messages: 221350 nosy: Nicolas.Limage priority: normal severity: normal status: open title: added/corrected containment relationship for networks in lib ipaddress type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file35737/ipaddress-network-containment.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21828 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21828] added/corrected containment relationship for networks in lib ipaddress
Changes by Nicolas Limage nicolas.lim...@gmail.com: -- nosy: -Nicolas.Limage resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21828 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21829] Wrong test in ctypes
New submission from Claudiu Popa: There's a problem with ctypes.test.test_values on Windows. First, the test is wrong because it uses the following: if __debug__: self.assertEqual(opt, 0) elif ValuesTestCase.__doc__ is not None: self.assertEqual(opt, 1) ValuesTestCase doesn't have a docstring and the check always fails when running the test suite with -O or -OO. Second, running the test suite with -O and afterwards with -OO, will lead to the following failure: == FAIL: test_optimizeflag (ctypes.test.test_values.Win_ValuesTestCase) -- Traceback (most recent call last): File D:\Projects\cpython\lib\ctypes\test\test_values.py, line 50, in test_optimizeflag self.assertEqual(opt, 1) AssertionError: 2 != 1 -- That's because the .pyo file for test_values already exist when rerunning with -OO and the docstring will be there. Now, I don't know why the file is not rebuilt and the documentation regarding -OO and -O is pretty scarce. The attached file tries a different approach, regenerate a test class each time the test is run in order to obtain its docstring. If run with -OO, it will be dropped properly. -- components: Tests, ctypes files: ctypes.patch keywords: patch messages: 221351 nosy: Claudiu.Popa priority: normal severity: normal stage: patch review status: open title: Wrong test in ctypes type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file35738/ctypes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21829] Wrong test in ctypes
Changes by Claudiu Popa pcmantic...@gmail.com: -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17888] docs: more information on documentation team
Terry Chia added the comment: Hello, I have attached a patch that should resolve this issue. Do let me know if anything needs fixing as this is my first contribution. -- keywords: +patch nosy: +terry.chia Added file: http://bugs.python.org/file35739/issue17888.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17888 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12750] datetime.strftime('%s') should respect tzinfo
Alexander Belopolsky added the comment: I would like to hear from others on this feature. One concern that I have is whether it is wise to truncate the fractional seconds part in '%s'. Also, if we support '%s' in strftime we should probably support it in strptime as well. -- nosy: +haypo, tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12750 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21800] Implement RFC 6855 (IMAP Support for UTF-8) in imaplib.
Changes by Jim Jewett jimjjew...@gmail.com: -- stage: - needs patch type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21030] pip usable only by administrators on Windows and SELinux
Christian Ullrich added the comment: Actually, this appears to be fixed in pip 1.5.6 (and 1.5.5, commit 79408cbc6fa5d61b74b046105aee61f12311adc9, AFAICT), which is included in 3.4.1; I cannot reproduce the problem in 3.4.1. That makes this bug obsolete. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21820] unittest: unhelpful truncating of long strings.
Nick Coghlan added the comment: It's ultimately up to Michael as the module maintainer, but the class attribute approach would match the way maxDiff works. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21820 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21820] unittest: unhelpful truncating of long strings.
Nick Coghlan added the comment: Oh, one point - the don't trigger on non-strings could likely go in a bug fix release for 3.4, but the flag to turn it off entirely would be a new feature for 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21820 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21829] Wrong test in ctypes
R. David Murray added the comment: There is an issue open for the -O/-OO and .pyo file issue. Or maybe we closed it won't fix, I forget. -O/-OO have problems. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21717] Exclusive mode for ZipFile and TarFile
Berker Peksag added the comment: Here's a patch for tarfile. -- keywords: +patch nosy: +berker.peksag, lars.gustaebel, serhiy.storchaka stage: - patch review type: - enhancement versions: -Python 3.4 Added file: http://bugs.python.org/file35740/issue21717_tarfile.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19259] Provide Python implementation of operator.compare_digest()
STINNER Victor added the comment: Ping? -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19259 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse
Aivar Annamaa added the comment: Just found out that ast.Attribute in Python 3.4 has similar problem -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express
Changes by Boris Dayma koush...@gmail.com: -- nosy: +Borisd13 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21820] unittest: unhelpful truncating of long strings.
Michael Foord added the comment: I agree that it looks like a bug that this behaviour is triggering for non-strings. There is separate code (which uses maxDiff) for comparing collections. Switching off the behaviour for 3.4 / 2.7 and a new class attribute for 3.5 is a good approach. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21820 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17570] Improve devguide Windows instructions
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +zach.ware stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17570 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17570] Improve devguide Windows instructions
Zachary Ware added the comment: What about adding a new Platform Quirks page listing all the known differences in usage between the three major platforms? Then in places where the instructions are a bit different per platform, like: ./python.exe -m test -j3 write something like python -m test -j3 and add a link to the relevant part of the Quirks page. On the other hand, are there enough such quirks (meaning things that really are the same, just different invocations/etc.) to warrant a new page? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17570 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17570] Improve devguide Windows instructions
Zachary Ware added the comment: As previously pointed out, the current patches are not adequate. -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17570 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Steve Dower added the comment: The difference may be the ALLUSERS=1 option. Windows Installer is supposed to auto-detect this when an installer is run as an admin, but maybe something in our authoring is preventing this detection? When I get a chance I'll try both and see if the logs show whether this is the case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21030] pip usable only by administrators on Windows and SELinux
Donald Stufft added the comment: I believe in pip 1.5.6 we switched from shutil.move to shutil.copytree which I believe will reset the permissions/SELinux context? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21821] The function cygwinccompiler.is_cygwingcc leads to FileNotFoundError under Windows 7
Changes by Aaron Meurer asmeu...@gmail.com: -- nosy: +Aaron.Meurer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21821 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7982] extend captured_output to simulate different stdout.encoding
Berker Peksag added the comment: Here's a patch to add an optional encoding parameter to captured_stdout. -- keywords: +patch nosy: +berker.peksag stage: needs patch - patch review Added file: http://bugs.python.org/file35741/issue7982.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21684] inspect.signature bind doesn't include defaults or empty tuple/dicts
Yury Selivanov added the comment: Ryan, Can you explain the use case for it? What's the problem you're trying to solve? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21684 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21801] inspect.signature doesn't always return a signature
Yury Selivanov added the comment: Fixed in 3.4 and 3.5. Thanks for the bug report! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21801] inspect.signature doesn't always return a signature
Roundup Robot added the comment: New changeset cc0f5d6ccb70 by Yury Selivanov in branch '3.4': inspect: Validate that __signature__ is None or an instance of Signature. http://hg.python.org/cpython/rev/cc0f5d6ccb70 New changeset fa5b985f0920 by Yury Selivanov in branch 'default': inspect: Validate that __signature__ is None or an instance of Signature. http://hg.python.org/cpython/rev/fa5b985f0920 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21030] pip usable only by administrators on Windows and SELinux
Martin v. Löwis added the comment: Christian: thanks for the update. It's actually that the bug is fixed, not obsolete :-) -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Martin v. Löwis added the comment: Steve: how is the auto-detection supposed to work, and what is the rationale? Shouldn't it be possible that even someone with administrator privileges still might want to install just for me? And how would they then specify that on the command line, given that ALLUSERS can only be set, not reset? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2213] build_tkinter.py does not handle paths with spaces
Changes by Martin v. Löwis mar...@v.loewis.de: -- resolution: accepted - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2213 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Steve Dower added the comment: It's described at http://msdn.microsoft.com/en-us/library/aa367559(v=vs.85).aspx, and frankly it is incredibly confusing. It is possible to reset ALLUSERS on the command line by specifying ALLUSERS= -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21830] ssl.wrap_socket fails on Windows 7 when specifying ca_certs
New submission from David M Noriega: When trying to use python3-ldap package on Windows 7, found I could not get a TLS connection to work and traced it to its use of ssl.wrap_socket. Trying out the following simple socket test fails import socket import ssl sock = socket.socket() sock.connect((host.name, 636)) ssl = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=rC:path\to\cert\file) Traceback (most recent call last): File pyshell#4, line 1, in module sock = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=rF:\Downloads\csbc-cacert.pem) File C:\Python34\lib\ssl.py, line 888, in wrap_socket ciphers=ciphers) File C:\Python34\lib\ssl.py, line 511, in __init__ self._context.load_verify_locations(ca_certs) ssl.SSLError: unknown error (_ssl.c:2734) This code works on Windows XP(and of course linux) and I'm able to use getpeercert() A workaround I was able to figure out was to use ssl.SSLContext in conjunction with Windows central certificate store. By first loading my CA cert into the trusted root cert store, I could use SSLContext.load_default_certs() to create an ssl socket. -- components: Windows messages: 221373 nosy: David.M.Noriega priority: normal severity: normal status: open title: ssl.wrap_socket fails on Windows 7 when specifying ca_certs versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21830 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14013] tarfile should expose supported formats
Berker Peksag added the comment: I've updated Éric's patch. Minor changes: - Updated versionadded directive - A couple of cosmetic changes (e.g. removed brackets in the list comprehension) -- assignee: docs@python - components: -Documentation nosy: +berker.peksag versions: +Python 3.5 -Python 3.3 Added file: http://bugs.python.org/file35742/issue14013.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14013 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21830] ssl.wrap_socket fails on Windows 7 when specifying ca_certs
Changes by Ned Deily n...@acm.org: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21830 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21163] asyncio doesn't warn if a task is destroyed during its execution
STINNER Victor added the comment: @Guido, @Yury: What do you think of log_destroyed_pending_task.patch? Does it sound correct? Or would you prefer to automatically keep a strong reference somewhere and then break the strong reference when the task is done? Such approach sounds to be error prone :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21163 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Martin v. Löwis added the comment: Much of the text refers to Installer 5.0. msi.py currently targets installer 2.0. Does the auto-detection also work on such installers? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15599] test_threaded_import fails sporadically on Windows and FreeBSD
David Bolen added the comment: I've been experimenting with setting up a Windows 8.1 buildbot, and found this ticket after finding a problem with test_threaded_import, testing against the 3.4 branch. I seem to be have a low syscheckinterval issue similar to that discussed here on some platforms, though I run into it sooner than 0.1. If I change the syscheckinterval adjustment to 0.001 the tests run in about 4s. Just slightly below that, 0.0009, it can take well over an hour when run manually, always getting killed due to a timeout when running the buildbot test batch file. Each use of check_module_parallel_init in the test takes 20-30 minutes. During this time the CPU remains pegged at 100%. I don't see any additional slow-down between 0.0009 and the default of 0.1, so it feels more like crossing a threshold somewhere around 1ms than scaling equally around and through that point. While the machine is not tremendously powerful (it's an Azure VM - single core ~2GHz), everything else is working well and build times and the remainder of the full test suite run in a reasonable time. -- David -- nosy: +db3l ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15599 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Steve Dower added the comment: No idea, TBH, though I'd guess that the behaviour comes from the installed version of Windows Installer and the database schema comes from the authored version. Nonetheless, if the solution is to add ALLUSERS=1 to the command line when doing silent all-user installs, I'm okay with documenting that as being the fix for 2.7 and 3.4. For Python 3.5, Windows Vista is the earliest supported platform, and so we can assume Windows Installer 4.0 or later (not that there's any need to take advantage of it) ref: http://msdn.microsoft.com/en-us/library/cc185688(v=vs.85).aspx -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error
Mark Lawrence added the comment: @Giampaolo can you add anything to this? -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12378 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15993] Windows: 3.3.0-rc2.msi: test_buffer fails
Steve Dower added the comment: This has been confirmed as a bug in VC14 (and earlier) and there'll be a fix going in soon. For those interested, here's a brief rundown of the root cause: * the switch in build_filter_spec() switches on a 64-bit value * one case is 0x4001 and the rest are =0x21 * PGO detects that 0x4001 is the hot case (bug starts here) * PGO detects that the cold cases are 32-bits or less and so enables an optimisation to skip comparing the high DWORD * PGO adds check for the hot case, but using the 32-bit optimisation - it checks for 0x1 rather than the full value (bug ends here) * PGO adds checks for cold cases The fix will be to check both hot and cold cases to see whether the 32-bit optimisation can be used. A workaround (that I wouldn't dream of using, but it illustrates the issue) would be to add a dead case that requires 64-bits. This would show up in the list of cold cases and prevent the 32-bit optimisation from being used. No indication of when the fix will go in, but it should be in the next public release, and I'll certainly be able to test it in advance of that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15993] Windows: 3.3.0-rc2.msi: test_buffer fails
Martin v. Löwis added the comment: Thanks a lot for this investigation; I'm glad you are working on this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15993] Windows: 3.3.0-rc2.msi: test_buffer fails
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +tim.golden, zach.ware -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15993] Windows: 3.3.0-rc2.msi: test_buffer fails
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18032] Optimization for set/frozenset.issubset()
Josh Rosenberg added the comment: Patch needs some work. See comments on patch. -- nosy: +josh.rosenberg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error
brian morrow added the comment: Not sure if this is still relevant, but I've supplied a python2.7 patch for this issue. All regression tests still pass and the underlying socket connection is closed: bmorrow@xorange:~/cpython$ ./python -m smtpd -n -c DebuggingServer localhost:2525 import smtplib s = smtplib.SMTP_SSL(localhost, 2525) [...] ssl.SSLError: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol bmorrow@xorange:~/cpython$ ps -ef | grep ./python bmorrow 19052 19742 0 19:08 pts/17 00:00:00 ./python bmorrow@xorange:~/cpython$ lsof -P -p 19052 | grep 2525 bmorrow@xorange:~/cpython$ bmorrow@xorange:~/cpython$ lsof -P -p 19742 | grep 2525 bmorrow@xorange:~/cpython$ -- keywords: +patch nosy: +bhm Added file: http://bugs.python.org/file35743/issue12378_py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12378 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21030] pip usable only by administrators on Windows and SELinux
Nick Coghlan added the comment: A little additional explanation of why the switch to copytree would have fixed this, at least in the SELinux case: under SELinux, files typically get labelled with a context based on where they're created. Copying creates a *new* file at the destination with the correct context for that location (based on system policy), but moving an *existing* file will retain its *original* context - you then have to call restorecon to adjust the context for the new location. I assume Windows NTFS ACLs are similar, being set based on the parent directory at creation and then preserved when moved. Moral of the story? These days, if you're relocating files to a different directory, copying and then deleting the original will be significantly more consistent across different environments. OS level move operations are best avoided in cross platform code, unless it's within the same directory, or you really need the speed and are prepared to sort out the relevant access control tweaks afterwards. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12750] datetime.strftime('%s') should respect tzinfo
akira added the comment: *If* the support for %s strftime format code is added then it should keep backward compatibility on Linux, OSX: it should produce an integer string with the correct rounding. Currently, datetime.strftime delegates to a platform strftime(3) for format specifiers that are not described explicitly [1]: The full set of format codes supported varies across platforms, because Python calls the platform C library’s strftime() function, and platform variations are common. To see the full set of format codes supported on your platform, consult the strftime(3) documentation. [1]: https://docs.python.org/3.4/library/datetime.html#strftime-strptime-behavior %s is not defined in C, POSIX but is already defined on Linux, BSD [2] where `datetime.now().strftime('%s')` can print an integer timestamp. %sis replaced by the number of seconds since the Epoch, UTC (see mktime(3)). [2]: http://www.openbsd.org/cgi-bin/man.cgi?query=strftime Unsupported format code is *undefined behavior* (crash, launch a missile is a valid behavior) otherwise. Support for additional codes on some platforms is explicitly mentioned in datetime docs therefore %s behavior shouldn't change if it is well-defined on a given platform i.e., `datetime.now().strftime('%s')` should keep producing an integer string on Linux, BSD. - old code: `aware_dt.astimezone().strftime('%s')` - proposed code: `aware_dt.strftime('%s')` (all platforms) '%d' produces the wrong rounding on my machine: from datetime import datetime, timezone dt = datetime(1969, 1, 1, 0,0,0, 60, tzinfo=timezone.utc) '%d' % dt.timestamp() '-31535999' dt.astimezone().strftime('%s') '-31536000' `math.floor` could be used instead: '%d' % math.floor(dt.timestamp()) '-31536000' There is no issue with the round-trip via a float timestamp for datetime.min...datetime.max range on my machine. `calendar.timegm` could be used to avoid floats if desired: import calendar calendar.timegm(dt.astimezone(timezone.utc).timetuple()) -31536000 Note: dt.utctimetuple() is not used to avoid producing the wrong result silently if dt is a naive datetime object; an exception is raised instead. The result is equivalent to `time.strftime('%s', dt.astimezone().timetuple())` (+/- date/time range issues). --- It is not clear what the returned value for %s strptime should be: naive or timezone-aware datetime object and what timezone e.g., - old code: `datetime.fromtimestamp(int('-31536000'), timezone.utc)` - proposed code: `datetime.strptime('-31536000', '%s')` The result is an aware datetime object in UTC timezone. -- nosy: +akira ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12750 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12750] datetime.strftime('%s') should respect tzinfo
Alexander Belopolsky added the comment: It is not clear what the returned value for %s strptime should be: I would start conservatively and require %z to be used with %s. In this case, we can easily produce aware datetime objects. I suspect that in the absence of %z, the most useful option would be to return naive datetime in the local timezone, but that can be added later. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12750 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21163] asyncio doesn't warn if a task is destroyed during its execution
Yury Selivanov added the comment: @Guido, @Yury: What do you think of log_destroyed_pending_task.patch? Does it sound correct? Premature task garbage collection is indeed hard to debug. But at least, with your patch, one gets an exception and has a chance to track the bug down. So I'm +1 for the patch. As for having strong references to tasks: it may have its own downsides, such as hard to debug memory leaks. I'd rather prefer my program to crash and/or having your patch report me the problem, than to search for an obscure code that eats all server memory once a week. I think we need to collect more evidence that the problem is common annoying, before making any decisions on this topic, as that's something that will be hard to revert. Hence I'm -1 for strong references. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21163 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11974] Class definition gotcha.. should this be documented somewhere?
Roundup Robot added the comment: New changeset 8e0b7393e921 by Raymond Hettinger in branch '2.7': Issue #11974: Add tutorial section on class and instance variables http://hg.python.org/cpython/rev/8e0b7393e921 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21830] ssl.wrap_socket fails on Windows 7 when specifying ca_certs
Josh Rosenberg added the comment: Are you 100% sure your CA files is in the precise PEM format required by Python for CA certs, as described in https://docs.python.org/3/library/ssl.html#ssl-certificates ? The most likely cause of your failure and success would be if you were using some other cert format that Windows could load that wasn't PEM. Also, side-note, you messed up your path when you attempted to anonymize it (you omitted the backslash after C:). Of course, you didn't anonymize it in the error output, so I can tell the original path was not messed up. -- nosy: +josh.rosenberg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21830 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11974] Class definition gotcha.. should this be documented somewhere?
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- versions: +Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11974] Class definition gotcha.. should this be documented somewhere?
Raymond Hettinger added the comment: I'll load this into 3.4 and 3.5 shortly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5888] mmap enhancement - resize with sequence notation
Changes by Josh Rosenberg shadowranger+pyt...@gmail.com: -- title: mmap ehancement - resize with sequence notation - mmap enhancement - resize with sequence notation ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5888 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12066] Empty ('') xmlns attribute is not properly handled by xml.dom.minidom
Mark Lawrence added the comment: This works perfectly for me using 3.4.1. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12066 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None)
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +loewis, steve.dower versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12239 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12639] msilib Directory.start_component() fails if keyfile is not None
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +loewis, steve.dower versions: +Python 3.5 -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12639 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21831] integer overflow in 'buffer' type allows reading memory
New submission from Benjamin Peterson: Reported by Chris Foster on the security list: $ ./python Python 2.7.7+ (2.7:8e0b7393e921, Jun 24 2014, 03:01:40) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. a = bytearray('hola mundo') b = buffer(a, 0x7fff, 0x7fff) print repr(b[:0x100]) \x00\x08\x11\x00\x00\x00\x00\x00\x00\x00\xa00_\xf7\x10\x00\x00\x00i\x03\x00\x00\x02\x00\x00\x00\xa0\xd1\x18\x08I\x03\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00Directory tree walk with callback function.\n\nFor each directory in the directory tree rooted at top (including top\nitself, but excluding '.' and '..'), call func(arg, dirname, fnames).\ndirname is the na -- components: Interpreter Core messages: 221392 nosy: benjamin.peterson priority: release blocker severity: normal status: open title: integer overflow in 'buffer' type allows reading memory type: security versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21831] integer overflow in 'buffer' type allows reading memory
Roundup Robot added the comment: New changeset 8d963c7db507 by Benjamin Peterson in branch '2.7': avoid overflow with large buffer sizes and/or offsets (closes #21831) http://hg.python.org/cpython/rev/8d963c7db507 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21832] collections.namedtuple does questionable things when passed questionable arguments
New submission from Kevin Norris: Code such as this: class Foo: def __str__(self): # Perhaps this value comes from user input, or # some other unsafe source return something_untrusted def isidentifier(self): # Perhaps it returns false in some esoteric case # which we don't care about. Assume developer # did not know about str.isidentifier() and # the name clash is accidental. return True collections.namedtuple(Foo(), ()) ...may result in arbitrary code execution. Since the collections documentation does not say that such things can happen, this could result in highly obscure security vulnerabilities. The easiest fix is to simply call str() on the typename argument to namedtuple(), as is currently done with the field_names argument. But IMHO this is like cleaning up an SQL injection with string sanitizing, instead of just switching to prepared statements. The switch to prepared statements route is conveniently available as a rejected patch for issue 3974. The above code will not work as such in Python 2.7, but more elaborate shenanigans can fool the sanitizing in that version as well. This issue was originally reported on secur...@python.org, where I was advised to file a bug report normally. -- components: Library (Lib) messages: 221394 nosy: Kevin.Norris priority: normal severity: normal status: open title: collections.namedtuple does questionable things when passed questionable arguments versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21832] collections.namedtuple does questionable things when passed questionable arguments
Changes by Benjamin Peterson benja...@python.org: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19915] int.bit_at(n) - Accessing a single bit in O(1)
anon added the comment: I think the case where i is negative can be handled by bits_at(i, pos, width) = bits_at(~i, pos, width) ^ ((1 width) - 1) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18643] implement socketpair() on Windows
Changes by pturing ptur...@gmail.com: -- nosy: +pturing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3423] DeprecationWarning message applies to wrong context with exec()
Terry J. Reedy added the comment: Rereading this, I see interlocked behavior (implementation bug) and enhancement (design bug) issues. I have been focused on just the former. Consider the exception traceback in msg107441: there are *two* filename, line# pairs. Now consider this warning for tem.py --- from os import listdir from warnings import simplefilter simplefilter('always', DeprecationWarning) s = a = 2\nlistdir(b'.')\n exec(s) --- Warning (from warnings module): File C:\Programs\Python34\tem.py, line 2 from os import listdir DeprecationWarning: The Windows bytes API has been deprecated, use Unicode filenames instead --- There is only *one* filename, line# pair. If we accept that limitation, what should the filename be? An actual filename (if possible) or string? Considered in isolation, I think the first (the current choice) is better, because it is essential for fixing the warning (as stated in msg107441). Hence I rejected Greg's first 'solution'. Similarly, what should the line# be? The line number of the exec statement or the line number in the string of the statement that caused the warning? Considered in isolation, the second (the current choice) seems better; the string s could have hundreds of lines and it would be really helpful for eliminating the warning to know which one generated the warning. I presume the author of exec had a reason such as this. Hence I rejected Greg's second solution. The two isolated answeres make for an inconsistent pair. The could be manageable, but... The third question is what line, if any, should be printed. If possible, the line in the string that caused the problem seems best. (But note that this line is missing from the exception traceback.) Second best is the line of the exec call (which *is* in the exception traceback). The current behavior, resulting from warnings not knowing that the filename and lineno it gets do not form a pair, is worse than nothing and I agree that it is a bug. I am not sure what to do. The exception/traceback/warning system was not designed for exec. -- stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3423 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17229] unable to discover preferred HTTPConnection class
Changes by Demian Brecht demianbre...@gmail.com: -- nosy: +dbrecht ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17229 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com