[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12022 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12026] Support more of MSI api by exposing handles
Mark Mc Mahon mtnbikingm...@gmail.com added the comment: You can pass it to any function in the MSI SDK through ctypes. e.g. def ReadStream(record, field): buf = (ctypes.c_char * 2048)() orig_size = ctypes.sizeof(buf) status = 0 res = [] while status == 0: size = ctypes.c_long(ctypes.sizeof(buf)) status = msidll.MsiRecordReadStream( record.hanlde, field, ctypes.byref(buf), ctypes.byref(size)) res.append(buf.raw) if size.value != orig_size: break data = .join(res) return data or any of the other functions not currently implemented in _msi.c Some of the other important ones (to me at least) are: - MsiDatabaseGetPrimaryKeys - MsiDatabaseExport - MsiDatabaseImport If the whole MSI SDK is wrapped - then exposing the handles would have no use :). The alternative I have so far is to re-write _msi.c using ctypes (already done), but I thought it would be better if not all of _msi.c had to be re-implemented. One alternative patch is to include those extra functions in _msi.c (though I am not sure I have the C skills to achieve that easily - and it may still miss functionality, and it may have even less chance of being accepted) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12026 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Ronald Oussoren ronaldousso...@mac.com added the comment: Steffen, I don't understand your comment about auto. Declaring variables as auto is not necessary in C code and not used anywhere else in Python's source code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] ABC registration of Exceptions
New submission from andrew cooke and...@acooke.org: Hi, In general, registering a class with an ABC is equivalent to making it a subclass (isinstance and issubclass are patched through ABCMeta). However, this does not work for exceptions (see example below, where exception is not caught). This doesn't seem terribly surprising to me - I imagine that checking would slow down exception handling - but I couldn't find any documentation (and posting on c.l.p didn't turn up anything either). So I thought I would raise it here - perhaps there is a possible fix (my obscure use case is that I have a backtracking search; backtracking occurs when a certain exception is encountered; making that exception an ABC and allowing existing exceptions to be registered with it allows the search to work with existing code without a wrapper that catches and translates exceptions that should trigger a backtrack). Or perhaps the docs could be extended. Or perhaps I've misunderstood something... Cheers, Andrew Python 3.2 (r32:88445, Feb 27 2011, 13:00:05) [GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2 Type help, copyright, credits or license for more information. from abc import ABCMeta class RootException(Exception,metaclass=ABCMeta): pass ... class MyException(Exception): pass ... RootException.register(MyException) try: ... raise MyException ... except RootException: ... print('caught') ... Traceback (most recent call last): File stdin, line 2, in module __main__.MyException -- components: Interpreter Core messages: 135521 nosy: acooke priority: normal severity: normal status: open title: ABC registration of Exceptions type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] ABC registration of Exceptions
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] ABC registration of Exceptions
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11375] urllib2 over SOCKS doesn't use proxy for DNS
Antoine Pitrou pit...@free.fr added the comment: Looks like a bug in the third-party socks module rather than in urllib. You should report it there. -- nosy: +pitrou resolution: - invalid status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11375 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11164] xml shouldn't use _xmlplus
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: I have verified that xml.dom.minidom.Node from neither stdlib (at least 2.6, 2.7, 3.1, 3.2 and 3.3) nor PyXML 0.8.4 has 'allnodes' attribute. If you install PyXML 0.8.4 for Python 2.7 and change 'pass' in MinidomTest.tearDown() into 'raise', then the following commands will print the same exceptions in MinidomTest.tearDown(): # With PyXML # FAILED (failures=8, errors=111) $ python2.7 -m test.test_minidom # Without PyXML # FAILED (errors=110) $ python2.7 -S -m test.test_minidom -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11164 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10713] re module doesn't describe string boundaries for \b
Ralph Corderoy ralph-pythonb...@inputplus.co.uk added the comment: Examining the source of Ubuntu's python2.6 2.6.6-5ubuntu1 package suggests beyond the limits of the string is considered \W, like Perl. Modules/_sre.c: 336 LOCAL(int) 337 SRE_AT(SRE_STATE* state, SRE_CHAR* ptr, SRE_CODE at) 338 { 339 /* check if pointer is at given position */ 340 341 Py_ssize_t thisp, thatp; ... 365 case SRE_AT_BOUNDARY: 366 if (state-beginning == state-end) 367 return 0; 368 thatp = ((void*) ptr state-beginning) ? 369 SRE_IS_WORD((int) ptr[-1]) : 0; 370 thisp = ((void*) ptr state-end) ? 371 SRE_IS_WORD((int) ptr[0]) : 0; 372 return thisp != thatp; SRE_IS_WORD() returns 16 for the 63 \w characters, 0 otherwise. This is born out by tests. Note, 366 above confirms it's never true for an empty string. The documentation states that \B is just the opposite of \b yet re.match(r'\b', '') returns None and so does \B so \B isn't the opposite of \b in all cases. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12030] Roundup Refused Update with No text/plain
New submission from Ralph Corderoy ralph-pythonb...@inputplus.co.uk: I tried to reply to the email I was sent when eric.araujo added a comment to #10713. The email I sent was plain text but wasn't a MIME email. It was rejected, Failed issue tracker submission, Roundup requires the submission to be plain text. The message parser could not find a text/plain part to use. I understand why it looks for plain/text parts of a MIME email, but shouldn't it be happy with a non-MIME email that by definition is plain text and has only one part? I've attached the rejected email. -- components: None files: nonmime.txt messages: 135525 nosy: ralph.corderoy priority: normal severity: normal status: open title: Roundup Refused Update with No text/plain versions: 3rd party Added file: http://bugs.python.org/file21933/nonmime.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12030 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12030] Roundup Refused Update with No text/plain
Benjamin Peterson benja...@python.org added the comment: This belongs on http://psf.upfronthosting.co.za/roundup/meta/. -- nosy: +benjamin.peterson resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12030 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11164] xml shouldn't use _xmlplus
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: I suggest to remove dead code in test_minidom in Python 2.7 to avoid confusion. -- Added file: http://bugs.python.org/file21934/python-2.7-test_minidom-remove_dead_code.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11164 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
Antoine Pitrou pit...@free.fr added the comment: The trade-off of accommodating a small buffer size (by buffering behind the scenes anyways) would likely slow the more common cases which use a decent buffer size. I am wondering if an effort to accommodate both uses would be appropriate. Possibly by not double-buffering if readinto(b): len(b) buffer_size/2 (arbitrary but seems feasible), and copying directly as the patch does now. Otherwise, fill the buffer up for subsequent reads and copy len(b) to user buffer. There is probably a good equilibrium for when it makes more/less sense to bypass the internal buffer. Yes, it sounds reasonable. I think the best thing to do is to experiment and run some measurements. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8809] smtplib should support SSL contexts
Antoine Pitrou pit...@free.fr added the comment: Thank you, the patch looks good. A simple test could probably be added to test_smtpnet, along the lines of the existing tests, do you want to tackle that? -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12031] subprocess module does not accept file twice
New submission from marko kreen mark...@gmail.com: I want to pass /dev/null as stdin and stderr. This works from python 2.4 .. 3.2a3 It fails in final 3.2 with 'Bad file descriptor': Traceback (most recent call last): File test.py, line 11, in module Popen(['cat', 'file.txt'], stdout = PIPE, stdin = _in, stderr = _err) File /opt/apps/python320/lib/python3.2/subprocess.py, line 736, in __init__ restore_signals, start_new_session) File /opt/apps/python320/lib/python3.2/subprocess.py, line 1330, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 9] Bad file descriptor -- components: Library (Lib) files: test.py messages: 135530 nosy: zmk priority: normal severity: normal status: open title: subprocess module does not accept file twice type: crash versions: Python 3.2 Added file: http://bugs.python.org/file21935/test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12031 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12032] Tools/Scripts/crlv.py needs updating for python 3+
New submission from Stephen Ferg zuuli...@ferg.org: I think this is a consequence of the new Unicode support in Python 3+ Here is code copied from C:\Python32\Tools\Scripts\crlf.py (on windows) == for filename in os.listdir(.): if os.path.isdir(filename): print(filename, Directory!) continue data = open(filename, rb).read() if '\0' in data: print(filename, Binary!) continue newdata = data.replace(\r\n, \n) if newdata != data: print(filename) === When run, it produces this (run under the PyCharm debugger) === C:\Python32\python.exe C:/pydev/zob/zobtest.py Traceback (most recent call last): File C:/pydev/zob/zobtest.py, line 134, in module x() File C:/pydev/zob/zobtest.py, line 126, in x if '\0' in data: TypeError: Type str doesn't support the buffer API Process finished with exit code 1 === Removing the test for \0 produces this: === C:\Python32\python.exe C:/pydev/zob/zobtest.py Traceback (most recent call last): File C:/pydev/zob/zobtest.py, line 131, in module x() File C:/pydev/zob/zobtest.py, line 126, in x newdata = data.replace(\r\n, \n) TypeError: expected an object with the buffer interface Process finished with exit code 1 === -- components: Demos and Tools messages: 135531 nosy: stephen_ferg priority: normal severity: normal status: open title: Tools/Scripts/crlv.py needs updating for python 3+ type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12031] subprocess module does not accept file twice
Catalin Iacob iacobcata...@gmail.com added the comment: I can reproduce this on 3.2 final but not on the tip of the 3.2 branch so it seems to have been fixed. -- nosy: +catalin.iacob ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12031 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12033] AttributeError: 'module' object has no attribute 'scipy'
New submission from Alex Lai alex_...@scotiacapital.com: Hi experts, I'm new to Python. I've just successfully compiled and installed NumPy and SciPy. When I run the tests, Numpy shows no issues: # python3 -c import numpy; numpy.test() Running unit tests for numpy NumPy version 1.5.1 NumPy is installed in /usr/local/lib/python3.1/site-packages/numpy Python version 3.1.2 (r312:79147, Mar 23 2010, 02:42:06) [GCC 3.4.6] nose version 1.0.0 -- Ran 0 tests in 0.027s However, test for Scipy gave the following error: # python3 -c import numpy; import scipy; numpy.scipy() Traceback (most recent call last): File string, line 1, in module AttributeError: 'module' object has no attribute 'scipy' Any idea what might be missing here? Thanks in advance, Alex -- components: Tests messages: 135533 nosy: alex_lai priority: normal severity: normal status: open title: AttributeError: 'module' object has no attribute 'scipy' type: behavior versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12033 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12031] subprocess module does not accept file twice
Charles-François Natali neolo...@free.fr added the comment: It's a duplicate of issue #11432: http://bugs.python.org/issue11432 -- nosy: +neologix resolution: - out of date status: open - closed superseder: - webbrowser.open on unix fails. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12031 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12033] AttributeError: 'module' object has no attribute 'scipy'
Alex Gaynor alex.gay...@gmail.com added the comment: This bug tracker is for filing bugs in Python itself, for support with 3rd party libraries you should try their mailing lists or IRC channels. -- nosy: +alex resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12033 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10581] Review and document string format accepted in numeric data type constructors
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sat, May 7, 2011 at 11:25 AM, Éric Araujo rep...@bugs.python.org wrote: .. On one hand, I tend to agree that mixing Hindi/Arab numerals with Bengali does not make sense; on the other hand, rejecting it means that the int code does know about Unicode, which you argued against. In order to flag use of mixed scripts in numerals, the code does not require access to any additional unicode data. Since Unicode 6.0.0, programmers can rely on the following stability promise: Characters with the property value Numeric_Type=de (Decimal) only occur in contiguous ranges of 10 characters, with ascending numeric values from 0 to 9 (Numeric_Value=0..9). -- http://www.unicode.org/policies/stability_policy.html Therefore, the validation code can simply check that for all digits in the number, ord(d) - unicodedata.numeric(d) is the same. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Ezio Melotti ezio.melo...@gmail.com added the comment: Attached a patch that fixes import_fresh_module to return None when _heapq is missing and skips the C test when _heapq is missing. I also added an additional test to verify that the functions in c_heapq are really C functions and the ones in py_heapq are really Python functions. -- Added file: http://bugs.python.org/file21936/issue11910.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Ezio Melotti ezio.melo...@gmail.com added the comment: BTW, if the fix for import_fresh_module is OK, it should be committed separately. The tests I added to check that the C functions are really C functions could stay in test_heapq or they could be moved to test_test_support (see #11049), possibly together with tests for other modules like json/_json. These tests are making sure that import_fresh_module works correctly but on the other hand they are also a precondition for a meaningful run of the following heapq tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose signalfd(2) and pthread_sigmask in the signal module
STINNER Victor victor.stin...@haypocalc.com added the comment: New changeset f8c49a930015 by Victor Stinner in branch 'default': Issue #8407: The signal handler writes the signal number as a single byte Wakeup test using two pending signals fails on FreeBSD 6.4 buildbot: == FAIL: test_signum (test.test_signal.WakeupSignalTests) -- Traceback (most recent call last): File /usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py, line 266, in test_signum self.check_signum(signal.SIGUSR1, signal.SIGALRM) File /usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py, line 232, in check_signum self.assertSequenceEqual(raised, signals) AssertionError: Sequences differ: (14,) != (30, 14) Wakeup file only contains SIGALRM, not (SIGUSR1, SIGALRM), whereas SIGUSR1 is raised before SIGALRM. Code of the test: def check_signum(self, *signals): data = os.read(self.read, len(signals)+1) raised = struct.unpack('%uB' % len(data), data) self.assertSequenceEqual(raised, signals) def test_signum(self): old_handler = signal.signal(signal.SIGUSR1, lambda x,y:None) self.addCleanup(signal.signal, signal.SIGUSR1, old_handler) os.kill(os.getpid(), signal.SIGUSR1) os.kill(os.getpid(), signal.SIGALRM) self.check_signum(signal.SIGUSR1, signal.SIGALRM) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12034] check_GetFinalPathNameByHandle() suboptimal
New submission from Antoine Pitrou pit...@free.fr: The code for check_GetFinalPathNameByHandle() goes like this: static int has_GetFinalPathNameByHandle = 0; [...] static int check_GetFinalPathNameByHandle() { HINSTANCE hKernel32; /* only recheck */ if (!has_GetFinalPathNameByHandle) { [...] has_GetFinalPathNameByHandle = Py_GetFinalPathNameByHandleA Py_GetFinalPathNameByHandleW; } return has_GetFinalPathNameByHandle; } It means that if the computed value is 0 (system doesn't have GetFinalPathNameByHandle*), the value will be re-computed each time the function is called. has_GetFinalPathNameByHandle should probably be tri-state instead (0, 1, unknown). -- components: Extension Modules keywords: easy messages: 135540 nosy: brian.curtin, pitrou priority: low severity: normal status: open title: check_GetFinalPathNameByHandle() suboptimal type: performance versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12034 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6721] Locks in python standard library should be sanitized on fork
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file21875/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6721 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11983] Inconsistent hash and comparison for code objects
Eugene Toder elto...@gmail.com added the comment: It appears that * co_name was added to hash and cmp in this check-in by Guido: http://hg.python.org/cpython-fullhistory/diff/525b2358721e/Python/compile.c I think the reason was to preserve function name when defining multiple functions with the same code in one function or module. (By default function gets it's name from code, but only one code object will be preserved, since all constants in a function are stored in a dict during compilation). * co_firstlineno was added to cmp (but not hash) in this check-in by Brett: http://hg.python.org/cpython-fullhistory/rev/8127a55a57cb In an attempt to fix this bug: http://www.mail-archive.com/python-bugs-list@python.org/msg02440.html It doesn't actually fix the bug and makes hash inconsistent with cmp. I'm not convinced that the bug is valid -- why would you care if identical lambdas share or not share the code? Both changes seem come from a tension between code object's original intention to compare functionally equivalent codes equal and side-effects of constants de-duplication in a function (loss of function name, broken breakpoints and line numbers in a debugger). I can think of 2 ways to address this. Change hash/cmp back to ignore co_name and co_firstlineno and then: 1) Never dedup codes, or only dedup codes with the same co_firstlineno (can compare co_name too, but I can't think of a way to create 2 named funcs on the same line). This is pretty much what the current code does. 2) Separate debug information (co_filename, co_name, co_firstlineno, co_lnotab) from code object into a separate object. Construct a function from both objects. Allow de-duplication of both. This will always preserve all information in a function, but allows to share code object between identical functions. This is a much more intrusive change, though, e.g. frame will need a reference to debug information. -- nosy: +Jeremy.Hylton, brett.cannon, ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11983 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11983] Inconsistent hash and comparison for code objects
Eugene Toder elto...@gmail.com added the comment: Btw, disabling dedup for codes won't be the first exception -- we already avoid coalescing -0.0 with 0.0 for float and complex, even though they compare equal. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11983 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6721] Locks in python standard library should be sanitized on fork
Antoine Pitrou pit...@free.fr added the comment: Thanks for the explanations. This sounds like an interesting path. Each thread implementation (thread_pthread.h, thread_nt.h) would provide a new PyThread_reinit_lock function that would do the right thing (pthread_mutex_destroy/init, sem_destroy/init, etc). Modules/threadmodule.c would provide a new PyThread_ReInitLocks that would walk through the linked list and call PyThread_reinit_lock for each lock. Actually, I think the issue is POSIX-specific: Windows has no fork(), and we don't care about other platforms anymore (they are, are being, or will be soon deprecated). It means only the POSIX implementation needs to register its locks in a linked list. But this wouldn't allow a lock's state to be inherited across fork for the main thread (but like I said, I don't think that this makes much sense anyway, and to my knowledge no implementation makes such a guarantee - and definitely not POSIX). Well, the big difference between Python locks and POSIX mutexes is that Python locks can be released from another thread. They're a kind of trivial semaphore really, and this makes them usable for other purpose than mutual exclusion (you can e.g. use a lock as a simple event by blocking on a second acquire() until another thread calls release()). But even though we might not be fixing arbitrary Python code automatically, fixing the interpreter's internal locks (especially the IO locks) would be great already. (we could also imagine that the creator of the lock decides whether it should get reinitialized after fork) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6721 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly
Antoine Pitrou pit...@free.fr added the comment: Ok, here's a patch for the new approach. CancelIoEx is loaded dynamically and, if unavailable, CancelIo is used instead. I take care to cancel or complete the I/O in the same method call where it is initiated, meaning there's no thread-specificity issues. (of course, all this is a lot of code just to have the desired WaitForMultipleObjects() semantics on a named pipe. Thank you, Windows) -- Added file: http://bugs.python.org/file21937/sentinels4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
STINNER Victor victor.stin...@haypocalc.com added the comment: Updated patch. Note: I tried to keep the same enum values for py_ssl_version, it's maybe useless and so =1 can be removed. -- Added file: http://bugs.python.org/file21938/nosslv2-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file21902/nosslv2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Antoine Pitrou pit...@free.fr added the comment: Updated patch. Note: I tried to keep the same enum values for py_ssl_version, it's maybe useless and so =1 can be removed. Thank you! PROTOCOL_NAMES should stay private and therefore be named _PROTOCOL_NAMES, IMHO. Keeping the same enum values is worthwhile, I think. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Roundup Robot devnull@devnull added the comment: New changeset 5296c3e2f166 by Victor Stinner in branch 'default': Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional http://hg.python.org/cpython/rev/5296c3e2f166 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Antoine Pitrou pit...@free.fr added the comment: New changeset 5296c3e2f166 by Victor Stinner in branch 'default': Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional http://hg.python.org/cpython/rev/5296c3e2f166 Since it's a bugfix, it should probably go into all branches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: fixed - status: closed - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11888] Add C99's log2() function to the math library
Roundup Robot devnull@devnull added the comment: New changeset 6d1cbfcee45a by Victor Stinner in branch 'default': Issue #11888: Add log2 function to math module. Patch written by Mark http://hg.python.org/cpython/rev/6d1cbfcee45a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11888 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError
STINNER Victor victor.stin...@haypocalc.com added the comment: Patch: signal.signal() and signal.siginterrupt() raise an OSError, instead of a RuntimeError: OSError has an errno attribute. -- keywords: +patch Added file: http://bugs.python.org/file21939/signal_oserror.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12011 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10496] import site failed when Python can't find home directory (sysconfig._getuserbase)
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file21640/sysconfig_getuserbase.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10496] import site failed when Python can't find home directory (sysconfig._getuserbase)
STINNER Victor victor.stin...@haypocalc.com added the comment: @eric.araujo, @tarek: do you prefer nonexistent_user.patch? I removed sysconfig_getuserbase.patch, because I agree that an expanded path containing ~ is a bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
John O'Connor tehj...@gmail.com added the comment: I experimented with a bunch of different options. All benchmarks performed with: $ for i in 1 4 128 256 1024 2048 4069 8192; do echo -n buffer_size=${i} ; ./python -m timeit -s f=open('LICENSE','rb');b=bytearray(${i}) \ f.seek(0) while f.readinto(b): pass; done with io.DEFAULT_BUFFER_SIZE = 8192 Before patch buffer_size=1 100 loops, best of 3: 10.4 msec per loop buffer_size=4 100 loops, best of 3: 2.67 msec per loop buffer_size=128 1 loops, best of 3: 102 usec per loop buffer_size=256 1 loops, best of 3: 54.9 usec per loop buffer_size=1024 1 loops, best of 3: 26.9 usec per loop buffer_size=2048 1 loops, best of 3: 20.3 usec per loop buffer_size=4069 10 loops, best of 3: 16.3 usec per loop buffer_size=8192 10 loops, best of 3: 11.1 usec per loop Always read into caller's buffer buffer_size=1 100 loops, best of 3: 14 msec per loop buffer_size=4 100 loops, best of 3: 4.02 msec per loop buffer_size=128 1 loops, best of 3: 114 usec per loop buffer_size=256 1 loops, best of 3: 63.7 usec per loop buffer_size=1024 10 loops, best of 3: 19.4 usec per loop buffer_size=2048 10 loops, best of 3: 11.2 usec per loop * buffer_size=4069 10 loops, best of 3: 8.12 usec per loop * buffer_size=8192 10 loops, best of 3: 5.79 usec per loop Read into caller's buffer if java-like bound of internal buffer size is smaller buffer_size=1 100 loops, best of 3: 5.01 msec per loop buffer_size=4 1000 loops, best of 3: 1.27 msec per loop buffer_size=128 1 loops, best of 3: 46.9 usec per loop buffer_size=256 1 loops, best of 3: 29.5 usec per loop buffer_size=1024 10 loops, best of 3: 12.9 usec per loop buffer_size=2048 10 loops, best of 3: 10.8 usec per loop buffer_size=4069 10 loops, best of 3: 9.06 usec per loop * buffer_size=8192 10 loops, best of 3: 5.78 usec per loop Using bound = buffer_size / 2 buffer_size=1 100 loops, best of 3: 6.04 msec per loop buffer_size=4 1000 loops, best of 3: 1.34 msec per loop buffer_size=128 1 loops, best of 3: 49.4 usec per loop buffer_size=256 1 loops, best of 3: 29.5 usec per loop buffer_size=1024 10 loops, best of 3: 13.2 usec per loop buffer_size=2048 10 loops, best of 3: 10.7 usec per loop * buffer_size=4069 10 loops, best of 3: 8.66 usec per loop buffer_size=8192 10 loops, best of 3: 6.1 usec per loop Using bound = buffer_size / 4 buffer_size=1 100 loops, best of 3: 5.45 msec per loop buffer_size=4 1000 loops, best of 3: 1.34 msec per loop buffer_size=128 1 loops, best of 3: 49.6 usec per loop buffer_size=256 1 loops, best of 3: 28.8 usec per loop buffer_size=1024 10 loops, best of 3: 13.1 usec per loop buffer_size=2048 10 loops, best of 3: 12.8 usec per loop buffer_size=4069 10 loops, best of 3: 8.42 usec per loop buffer_size=8192 10 loops, best of 3: 5.93 usec per loop Always use internal buffer * buffer_size=1 100 loops, best of 3: 4.53 msec per loop * buffer_size=4 1000 loops, best of 3: 1.14 msec per loop * buffer_size=128 1 loops, best of 3: 45 usec per loop * buffer_size=256 1 loops, best of 3: 26.9 usec per loop * buffer_size=1024 10 loops, best of 3: 12.9 usec per loop * buffer_size=2048 10 loops, best of 3: 10.2 usec per loop buffer_size=4069 10 loops, best of 3: 9.15 usec per loop buffer_size=8192 10 loops, best of 3: 8.42 usec per loop Use read() instead $ for i in 1 4 128 256 1024 2048 4069 8192; do echo -n size=${i} ; ./python -m timeit -s f=open('LICENSE','rb'); f.seek(0) \ while f.read(${i}): pass; done * size=1 100 loops, best of 3: 2.56 msec per loop * size=4 1000 loops, best of 3: 709 usec per loop * size=128 1 loops, best of 3: 29.7 usec per loop * size=256 10 loops, best of 3: 18.6 usec per loop size=1024 10 loops, best of 3: 13.3 usec per loop size=2048 10 loops, best of 3: 10.8 usec per loop size=4069 10 loops, best of 3: 10.1 usec per loop size=8192 10 loops, best of 3: 6.41 usec per loop Based on the above I think you are right about using the internal buffer regardless (revision attached). You pay a price with larger buffer sizes but on balance it seems to be a much better general purpose solution. The java-like solution is decent as well, it is only slightly slower for small reads and optimal
[issue9971] Optimize BufferedReader.readinto
Changes by John O'Connor tehj...@gmail.com: Added file: http://bugs.python.org/file21941/issue9971-like-java.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
STINNER Victor victor.stin...@haypocalc.com added the comment: It would be nice if you can also patch _pyio. I read sometimes _pyio to check how _io is implemented. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
Antoine Pitrou pit...@free.fr added the comment: It would be nice if you can also patch _pyio. I read sometimes _pyio to check how _io is implemented. Well, _pyio implements the same APIs but it doesn't necessarily use the same algorithms. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12032] Tools/Scripts/crlv.py needs updating for python 3+
Roundup Robot devnull@devnull added the comment: New changeset f94d74c85dcb by Victor Stinner in branch 'default': Close #12032: Fix scripts/crlf.py for Python 3 http://hg.python.org/cpython/rev/f94d74c85dcb -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12025] strangely missing separator in resource table
Ezio Melotti ezio.melo...@gmail.com added the comment: If I zoom out (Ctrl+-) with FF4 one of the lines (the one between 9 and 10 for me) disappear. Try Ctrl+0 to fix it. -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12025 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9923] mailcap module may not work on non-POSIX platforms if MAILCAPS env variable is set
Gregory Nofi crackityjones200...@yahoo.com added the comment: It's just theoretical. A web search shows that a few Windows programs, like PC Pine, can use $MAILCAPS. But none of those tools look recent, like you said. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9923 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose signalfd(2) and pthread_sigmask in the signal module
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9584] Allow curly brace expansion
Mathieu Bridon boche...@fedoraproject.org added the comment: Is anybody still reading this? :-/ Could somebody commit the patch, reject it, or tell me what else I need to do? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12025] strangely missing separator in resource table
Jesús Cea Avión j...@jcea.es added the comment: Cntl+0 fixes it. I was not aware of having set a zoom level for python website. Sorry for wasting your time. PS: FF should no drop details like that. Whatever :). -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12025 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Roundup Robot devnull@devnull added the comment: New changeset c1a12a308c5b by Ezio Melotti in branch '2.7': #11910: change import_fresh_module to return None when one of the fresh modules can not be imported. http://hg.python.org/cpython/rev/c1a12a308c5b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8809] smtplib should support SSL contexts
Kasun Herath kasun...@gmail.com added the comment: Yes, I would like to have a try at it -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Roundup Robot devnull@devnull added the comment: New changeset 3ab1eb027856 by Ezio Melotti in branch '3.1': #11910: change import_fresh_module to return None when one of the fresh modules can not be imported. http://hg.python.org/cpython/rev/3ab1eb027856 New changeset 754bafe8db5f by Ezio Melotti in branch '3.2': #11910: merge with 3.1. http://hg.python.org/cpython/rev/754bafe8db5f New changeset 3e8f0111feed by Ezio Melotti in branch 'default': #11910: merge with 3.2. http://hg.python.org/cpython/rev/3e8f0111feed -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Roundup Robot devnull@devnull added the comment: New changeset 3cbbb2a7c56d by Ezio Melotti in branch '2.7': #11910: Fix test_heapq to skip the C tests when _heapq is missing. http://hg.python.org/cpython/rev/3cbbb2a7c56d New changeset 677ee366c9f5 by Ezio Melotti in branch '3.1': #11910: Fix test_heapq to skip the C tests when _heapq is missing. http://hg.python.org/cpython/rev/677ee366c9f5 New changeset 4f3f67a595fb by Ezio Melotti in branch '3.2': #11910: merge with 3.1. http://hg.python.org/cpython/rev/4f3f67a595fb New changeset 3449406fd04a by Ezio Melotti in branch 'default': #11910: merge with 3.2. http://hg.python.org/cpython/rev/3449406fd04a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11347] libpython3.so: Broken soname and linking
Roundup Robot devnull@devnull added the comment: New changeset 749686064642 by Martin v. Löwis in branch '3.2': Use --as-needed when linking libpython3.so. Closes #11347. http://hg.python.org/cpython/rev/749686064642 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11347 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12026] Support more of MSI api by exposing handles
Martin v. Löwis mar...@v.loewis.de added the comment: I'd rather expose the missing functions, than supporting a mix of this module with a ctypes one; this patch sounds hackish. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12026 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11910] test_heapq C tests are not skipped when _heapq is missing
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com