[issue10941] imaplib: Internaldate2tuple produces wrong result if date is near a DST change
Joe Peterson j...@skyrush.com added the comment: OK, fixed patch to apply cleanly to current code. BTW, this is only for python3. Is it still appropriate to patch python2? And if so, what is the correct code repo to check out for that? -- versions: +Python 3.4 Added file: http://bugs.python.org/file25285/issue10941_python3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14628] Clarify import statement documentation regarding what gets bound
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14628 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14624] Faster utf-16 decoder
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count
Serhiy Storchaka storch...@gmail.com added the comment: Thank you, Larry. I was going to do it, but got stuck with other things. The main objective of this proposal is to get rid of litter os module by dozen rarely popular and non-portable functions (introduced by issue4761). Moreover, the descriptions are given in alphabetical order and related functions are located far from each other. So I'd spell those dir_fd, src_dir_fd (etc), remove_dir, and follow_symlinks. I follow the common style. `followlinks` is already used in other functions. No--it'll just be part of a release, and you'll check which version of Python 3 you have before using it. Presence of function depends not only on the version, but also from the platform. Benjamin, therefore I believe it is critically important to do this work before the release of Python 3.3. To people and have not started to use the new features. Otherwise, get rid of them will be more difficult. But I have nothing against to put at-functions in a separate submodule (os.posix?). David, let lstat remains. fstatat include functionality both stat and lstat (but has a different interface). I suggest to unite fstatat and stat, while maintaining backward compatibility and using a more user-friendly interface. In the C extension of the functions is impossible, that is why were introduced new functions with other names. -- components: +Library (Lib) versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14626 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14625] Faster utf-32 decoder
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14625 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14614] PyTuple_SET_ITEM could check bounds in debug mode
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14614 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14428] Implementation of the PEP 418
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14428 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14617] confusing docs with regard to __hash__
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14617 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Mark Dickinson dicki...@gmail.com added the comment: Because pfval in this example doesn't exist but is merely a temporary, there is no aliasing. Maybe aliasing wasn't the right word to use, then. The exact rule being violated is C99 6.5, para. 7 (or C11 6.5 para. 7 if you prefer): An object shall have its stored value accessed only by an lvalue expression that has one of the following types: ... In any case, I don't think it's relevant whether the values involved are named variables or temporaries. I don't think we could have our own floating point formatting library if we didn't make that assumption There are configure-time checks that determine whether that floating-point formatting library is used or not, including (amongst some other things) whether the underlying floating-point type is IEEE 754. Officially, Python shouldn't assume IEEE 754 floating-point anywhere---the core should build fine without it, and there's lots of code in the core to deal with non-IEEE 754 platforms. And should such a platform be found, it is easy enough to disable this code for it. I think that's the wrong way around: the code should only be enabled in the first place when we're sure that the platform is IEEE 754. That shouldn't be hard to build into the patch, since the checks for IEEE 754 are already all over the place for other purposes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2377] Replace __import__ w/ importlib.__import__
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14618] remove modules_reloading from the interpreter state
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14618 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count
Serhiy Storchaka storch...@gmail.com added the comment: Before starting to code, it is necessary to solve the problem of interface. With the majority of the functions all is good, but the `link` and `rename` have two `dirfd` parameters (even with different names). So I suggest two more alternatives. One is the filename and dirfd are combined in a tuple. Instead of a tuple, you can specify only the name. link ((srcpath, srcdirfd), (dstpath, dstdirfd), *, followlinks=True) The other -- `dirfd`s are combined in a tuple. You can specify a number, then `dirfd` is the same for both filenames. link (srcpath, dstpath, *, followlinks=True, dirfd=(srcdirfd, dstdirfd)) Which of these options (or the original, with different keywords) is preferable? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14626 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count
Larry Hastings la...@hastings.org added the comment: It's true that, for example, dir_fd parameters won't work on Windows. The solution is to always accept the parameters and throw NotImplementedError on platforms where the functionality isn't available. Here are my thoughts on the interface for link(). Since the two dir_fd parameters are independent--you might specify none, one, or both--I think the dir_fd=(src,dst) form would be obnoxious. And polymorphic parameters (accept a string or a tuple of string and fd) are nearly always a bad idea; the % operator on strings is a good example of what can go wrong. So I think you should stick with the original interface, with independent explicit keyword arguments. I'd prefer that we did this everywhere it made sense, including adding a follow_symlinks parameter to stat(). But obviously you should prioritize places where we want to get rid of functions that are only in trunk (3.3) so far. I suppose there's precedent for followlinks; it's very old, predating PEP 8. Personally I'd overlook it if I were doing the implementation and spell the new parameters follow_symlinks--or at least I'd try it and see what the community thought. Anyway, there's no established precedent for dir_fd and remove_dir. So I'd certainly prefer PEP 8 spellings for those. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14626 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
New submission from Brecht Machiels bre...@mos6581.org: I have subclassed int to add an extra attribute: class Integer(int): def __new__(cls, value, base=10, indirect=False): try: obj = int.__new__(cls, value, base) except TypeError: obj = int.__new__(cls, value) return obj def __init__(self, value, base=10, indirect=False): self.indirect = indirect Using this class in my application, int(Integer(b'0')) sometimes returns a value of 48 (= ord('0')!) or 192, instead of the correct value 0. str(Integer(b'0')) always returns '0'. This seems to only occur for the value 0. First decoding b'0' to a string, or passing int(b'0') to Integer makes no difference. The problem lies with converting an Integer(0) to an int with int(). Furthermore, this occurs in a random way. Subsequent runs will produce 48 or 192 at different points in the application (a parser). Both Python 3.2.2 and 3.2.3 behave the same (32-bit, Windows XP). Apparently, the 64-bit Windows Python 3.2.3 does not show this behavior [2]. I haven't tested on other operating systems. I cannot seem to reproduce this in a simple test program. The following produces no output: for i in range(10): integer = int(Integer(b'0')) if integer 0: print(integer) Checking for the condition int(Integer()) 0 in my application (when I know the argument to Integer is b'0') and conditionally printing int(Integer(b'0')) a number of times, the results 48 and 192 do show up now and then. As I can't reproduce the problem in a short test program, I have attached the relevant code. It is basically a PDF parser. The output for this [2] PDF file is, for example: b'0' 0 Integer(0) 192 0 b'0' 16853712 b'0' 0 Integer(0) 48 0 b'0' 16938088 b'0' 0 Integer(0) 192 0 b'0' 17421696 b'0' 0 Integer(0) 48 0 b'0' 23144888 b'0' 0 Integer(0) 48 0 b'0' 23185408 b'0' 0 Integer(0) 48 0 b'0' 23323272 Search for print function calls in the code to see what this represents. [1] http://stackoverflow.com/questions/10230604/non-deterministic-behavior-of-int-subclass#comment13156508_10230604 [2] http://www.gust.org.pl/projects/e-foundry/math-support/vieth2008.pdf -- components: None files: pdf.py messages: 158803 nosy: brechtm priority: normal severity: normal status: open title: non-deterministic behavior of int subclass type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file25286/pdf.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c
STINNER Victor victor.stin...@gmail.com added the comment: OK, so what's your point? =) In Python 3.3, CTRL+c at startup fails with Traceback: ..., not with a fatal error. A fatal error may dump a core dump and open a popup on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Marc-Andre Lemburg m...@egenix.com added the comment: Ned Deily wrote: Ned Deily n...@acm.org added the comment: That's unfortunate. But the documented location for customize_compiler is and, AFAIK, had always been in distutils.sysconfig. It was an inadvertent consequence of the bad revert during the 2.7 development cycle that a second copy was made available in distutils.ccompiler. That change was not supposed to be released in 2.7 and was never documented. So I don't think there is anything that can or needs to be done as this point in Python itself. Other opinions? Excuse me, Ned, but that's not how we do approach dot releases in Python. Regardless of whether the documentation was fixed or not, you cannot simply remove a non-private function without making sure that at least the import continues to work. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Changes by Marc-Andre Lemburg m...@egenix.com: -- resolution: fixed - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Marc-Andre Lemburg m...@egenix.com added the comment: Ned Deily wrote: And to recap the history here, there was a change in direction for Distutils during the 2.7 development cycle, as decided at the 2010 language summit, in particular to revert feature changes in Distutils for 2.7 to its 2.6.x state and, going forward, Distutils in Python will be feature-frozen. http://mail.python.org/pipermail/python-dev/2010-March/098135.html I know that distutils development was stopped (even though I don't consider that a good thing), but since the code changes were let into the wild, we have to deal with it properly now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Marc-Andre Lemburg m...@egenix.com added the comment: Marc-Andre Lemburg wrote: Ned Deily n...@acm.org added the comment: That's unfortunate. But the documented location for customize_compiler is and, AFAIK, had always been in distutils.sysconfig. It was an inadvertent consequence of the bad revert during the 2.7 development cycle that a second copy was made available in distutils.ccompiler. That change was not supposed to be released in 2.7 and was never documented. So I don't think there is anything that can or needs to be done as this point in Python itself. Other opinions? Excuse me, Ned, but that's not how we do approach dot releases in Python. Regardless of whether the documentation was fixed or not, you cannot simply remove a non-private function without making sure that at least the import continues to work. Turns out, the fix broke all our packages for Python 2.7.3 and I can hardly believe we're the only ones affected by this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. I declare that this rule does not apply here since the code is a deliberate hack: We are pretending that a certain address points to integers and checking those integers. If you insist on following the standard, you could do double cmp = 0; return mcmcmp(cmp, fval, sizeof(fval)) == 0; but on all real machines this is the same as: PY_LONG_LONG cmp = 0; return mcmcmp(cmp, fval, sizeof(fval)) == 0; Which again is the same as return *(PY_LONG_LONG*)fval == 0; technically speaking, even if the standard doesn't agree. You could implement this with in-line assembly and so cheerfully sidestep the standard. When you're hacking, your're hacking and the standard isn't your friend :) Anyway, this proposal has been rejected due to lack of interest or some misguided idea of performance, so the point is moot. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- Removed message: http://bugs.python.org/msg158808 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. I declare that this rule does not apply here since the code is a deliberate hack: We are pretending that a certain address points to integers and checking those integers. If you insist on following the standard, you could do double cmp = 0; return mcmcmp(cmp, fval, sizeof(fval)) == 0; but on all real machines this is the same as: PY_LONG_LONG cmp = 0; return mcmcmp(cmp, fval, sizeof(fval)) == 0; Which again is the same as return *(PY_LONG_LONG*)fval == 0; technically speaking, even if the standard doesn't agree. You could implement this with in-line assembly and so cheerfully sidestep the standard. When you're hacking, your're hacking and the standard isn't your friend :) As for IEEE, sure, anyway that thing is oriented is fine, although in this day and age, I find it rather amusing that the logic thinks of IEEE support as the exception, rather than the rule. Anyway, this proposal has been rejected due to lack of interest or some misguided idea of performance, so the point is moot. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Martin v. Löwis mar...@v.loewis.de added the comment: [moving from Rietveld back to Roundup] On 2012/04/20 11:15:48, storchaka wrote: The `aligned_end` may point outside unicode object, if the unicode object was reallocated. How so? The aligned_end *never* points into the unicode object: q = (unsigned char *)s; e = q + size - 1; aligned_end = (const unsigned char *) ((size_t) e ~LONG_PTR_MASK); So aligned_end points into s, not into the unicode object. So this adjustment is necessary because the *input* may change in the callback, not because the output may change. So the comment in decode_utf8_errors seems just as wrong. Why this is relevant to this issue, is unclear to me, though: the ignore handler doesn't modify the input object. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Mark Dickinson dicki...@gmail.com added the comment: I declare that this rule does not apply here ... Clearly the gcc developers disagree. :-) iwasawa:~ mdickinson$ cat test2.c int is_positive_zero(double f) { return *(long long*)f == 0; } iwasawa:~ mdickinson$ gcc -fstrict-aliasing -O3 -Wall -Wextra -Wstrict-aliasing -c test2.c test2.c: In function ‘is_positive_zero’: test2.c:2: warning: dereferencing type-punned pointer will break strict-aliasing rules -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: I can reproduce this on a 32-bit OS X build of the default branch, so it doesn't seem to be Windows specific (though it may be 32-bit specific). Brecht, if you can find a way to reduce the size of your example at all that would be really helpful. -- priority: normal - high versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10142] Support for SEEK_HOLE/SEEK_DATA
Jesús Cea Avión j...@jcea.es added the comment: I am going to integrate next week Please, review. -- assignee: - jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Antoine Pitrou pit...@free.fr added the comment: Reproduced under 32-bit Linux. The problem seems to be that Py_SIZE(x) == 0 when x is Integer(0), but ob_digit[0] is still supposed to be significant. There's probably some overwriting with the trailing attributes. By forcing Py_SIZE(x) == 1, the bug disappears, but it probably breaks lots of other stuff in longobject.c. -- nosy: +pitrou, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: If we're accessing ob_digit[0] when Py_SIZE(x) == 0, that sounds like a bug to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Antoine Pitrou pit...@free.fr added the comment: If we're accessing ob_digit[0] when Py_SIZE(x) == 0, that sounds like a bug to me. _PyLong_Copy does. It's ok as long as the object is int(0), because it's part of the small ints and its allocated size is one digit. The following hack seems to fix the issue here. Perhaps we can simply fix _PyLong_Copy, but I wonder how many other parts of longobject.c rely on accessing ob_digit[0]. diff --git a/Objects/longobject.c b/Objects/longobject.c --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -4194,6 +4194,8 @@ long_subtype_new(PyTypeObject *type, PyO n = Py_SIZE(tmp); if (n 0) n = -n; +if (n == 0) +n = 1; newobj = (PyLongObject *)type-tp_alloc(type, n); if (newobj == NULL) { Py_DECREF(tmp); diff --git a/Objects/object.c b/Objects/object.c --- a/Objects/object.c +++ b/Objects/object.c @@ -1010,6 +1010,8 @@ PyObject ** tsize = ((PyVarObject *)obj)-ob_size; if (tsize 0) tsize = -tsize; +if (tsize == 0 PyLong_Check(obj)) +tsize = 1; size = _PyObject_VAR_SIZE(tp, tsize); dictoffset += (long)size; @@ -1090,6 +1092,8 @@ PyObject * tsize = ((PyVarObject *)obj)-ob_size; if (tsize 0) tsize = -tsize; +if (tsize == 0 PyLong_Check(obj)) +tsize = 1; size = _PyObject_VAR_SIZE(tp, tsize); dictoffset += (long)size; -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: _PyLong_Copy does. Grr. So it does. That at least should be fixed, but I agree that it would be good to have the added protection of ensuring that we always allocate space for at least one limb. We should also check whether 2.7 is susceptible. -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Serhiy Storchaka storch...@gmail.com added the comment: So this adjustment is necessary because the *input* may change in the callback, not because the output may change. So the comment in decode_utf8_errors seems just as wrong. You're right, and my eyes in a lather. Now I saw it. What you have to offer any comment? If someone would correct a comment for decode_utf8_errors, I just copied it. Why this is relevant to this issue, is unclear to me, though: the ignore handler doesn't modify the input object. I first got the crash using a custom handler, and then I saw that ignore handler is enough. Even if the ignore handler does not have to change the input object, other handlers can do it and this is the reason for the crash remains. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: Self-contained example that fails for me on 32-bit OS X. class Integer(int): def __new__(cls, value, base=10, indirect=False): try: obj = int.__new__(cls, value, base) except TypeError: obj = int.__new__(cls, value) return obj def __init__(self, value, base=10, indirect=False): self.indirect = indirect integers = [] for i in range(1000): integer = Integer(b'0') integers.append(integer) for integer in integers: assert int(integer) == 0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Ned Deily n...@acm.org added the comment: I agree that we should always try very hard not to break anything in point releases. But I think it is fair to say that this is an unusual case. Looking at the commit logs (and Tarek can correct me if I misread them), it appears the change that, among other things, moved customize_compiler was committed on 2010-01-23, in time for 2.7alpha3. The language summit decision followed soon thereafter and the faulty partial revert happened on 2010-03-05, in time for 2.7alpha4. So, if the revert had been completed as intended, the moved module should have only been in the wild for a little over a month. Clearly you had a vested interest in making the change to your code base but it seems unlikely that anyone else would have gone to the trouble of changing their code since existing (2.6) code would have only been broken for that one small alpha window, 2.7 alpha3. And considering that customize_compiler is probably not used by all that many packages to begin with it, I would think it is not unlikely that you *are* the only ones affected by it. Nevertheless, what are the alternatives? We could add a wrapper function into distutils.ccompiler that just calls the distutils.sysconfig version. Here's a patch that attempts to do so. That should fix that breakage for the eGenix packages. It would be great if you could test it. It's up to the 2.7 release manager to decide what action to take, i.e. whether the patch is needed and, if so, how quickly to schedule a new release. As a practical matter, regardless of whether the patch is applied in Python or not, I would assume that a faster solution for your end users would be to ship a version of the eGenix packages that reverts the changes(s) there. By the way, it looks like you'll need to eventually do that anyway since the code in mxSetup.py incorrectly assumes that the corresponding changes were also made to Python 3.2. -- priority: normal - release blocker stage: committed/rejected - patch review Added file: http://bugs.python.org/file25287/issue13994_compat.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Martin v. Löwis mar...@v.loewis.de added the comment: You're right, and my eyes in a lather. Now I saw it. What you have to offer any comment? If someone would correct a comment for decode_utf8_errors, I just copied it. might have changed the input object Why this is relevant to this issue, is unclear to me, though: the ignore handler doesn't modify the input object. I first got the crash using a custom handler, and then I saw that ignore handler is enough. Even if the ignore handler does not have to change the input object, other handlers can do it and this is the reason for the crash remains. I agree that the change is necessary. It just does not explain why it fixes this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Antoine Pitrou pit...@free.fr added the comment: The fix for _PyLong_Copy is the following: diff --git a/Objects/longobject.c b/Objects/longobject.c --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -156,7 +156,7 @@ PyObject * if (i 0) i = -(i); if (i 2) { -sdigit ival = src-ob_digit[0]; +sdigit ival = (i == 0) ? 0 : src-ob_digit[0]; if (Py_SIZE(src) 0) ival = -ival; CHECK_SMALL_INT(ival); -- assignee: mark.dickinson - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Changes by Antoine Pitrou pit...@free.fr: -- components: +Interpreter Core -None stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: Using MEDIUM_VALUE also works. I'll cook up a patch tonight, after work. diff -r 6762b943ee59 Objects/longobject.c --- a/Objects/longobject.c Tue Apr 17 21:42:07 2012 -0400 +++ b/Objects/longobject.c Fri Apr 20 13:18:01 2012 +0100 @@ -156,9 +156,7 @@ if (i 0) i = -(i); if (i 2) { -sdigit ival = src-ob_digit[0]; -if (Py_SIZE(src) 0) -ival = -ival; +sdigit ival = MEDIUM_VALUE(src); CHECK_SMALL_INT(ival); } result = _PyLong_New(i); -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b07488490001 by Martin v. Löwis in branch '3.2': Issue #14629: Raise SyntaxError in tokenizer.detect_encoding http://hg.python.org/cpython/rev/b07488490001 New changeset 98a6a57c5876 by Martin v. Löwis in branch 'default': merge 3.2: issue 14629 http://hg.python.org/cpython/rev/98a6a57c5876 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Martin v. Löwis mar...@v.loewis.de added the comment: Thanks for the report. This is now fixed in 3.2 and default. Notice that your usage tokenize is incorrect: you need to open the file in binary mode. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Marc-Andre Lemburg m...@egenix.com added the comment: ink it is not unlikely that you *are* the only ones affected by it. With in the wild I'm referring to the function being released in the ccompiler not only in alpha releases but also in the beta releases, the 2.7, 2.7.1 and 2.7.2 release - in every release since early in 2010. We were unaware of the reversal of the changes by Tarek and the way we coded things in mxSetup.py did not show that things were removed again, simply because we support more than just Python 2.7 and have proper fallback solutions for most things. Only in this particular case, we were using different strategies based on the Python version number and so there is no fallback. Nevertheless, what are the alternatives? We could add a wrapper function into distutils.ccompiler that just calls the distutils.sysconfig version. Here's a patch that attempts to do so. That should fix that breakage for the eGenix packages. It would be great if you could test it. The fix is easy: simply import the customize_compiler() API in the ccompiler module to maintain compatibility with what had already been release. No need to add a wrapper function, a single from distutils.sysconfig import customize_compiler() in ccompile.py will do just fine. It's up to the 2.7 release manager to decide what action to take, i.e. whether the patch is needed and, if so, how quickly to schedule a new release. As a practical matter, regardless of whether the patch is applied in Python or not, I would assume that a faster solution for your end users would be to ship a version of the eGenix packages that reverts the changes(s) there. By the way, it looks like you'll need to eventually do that anyway since the code in mxSetup.py incorrectly assumes that the corresponding changes were also made to Python 3.2. We don't support Python 3.x yet, so that's a non-issue at the moment. But yes, we will have to release new patch level releases for all our packages to get this fixed for our users. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14381] Intern certain integral floats for memory savings and performance
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Dang. I yield! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14631] Instance methods and WeakRefs don't mix.
New submission from Sundance sunda...@ierne.eu.org: SUMMARY === The behavior of instance methods makes it impossible to keep a weakref on them. The reference dies instantly even if the instance and the method still exist. EXAMPLE === import weakref callbacks = weakref.WeakSet() def callback1(): ... print In callback1. class SomeClass: ... def callback2(self): ... print In callback2. some_instance = SomeClass() callbacks.add( callback1 ) callbacks.add( some_instance.callback2 ) for callback in callbacks: ... callback() In callback1. ## callback2 is never called! ANALYSIS The WeakSet in the example above, and the weakref.ref() it employs, actually behave as specified. It's the particular nature of bound methods that causes the unexpected behavior. From what I understand, instance methods are bound dynamically when looked up on the instance. A new object of type instancemethod is created each time: t1 = some_instance.callback t2 = some_instance.callback t1 is t2 False So when a program calls weakref.ref(some_instance.callback), a new instancemethod object is created on the fly, a weakref to that object is created... and the instancemethod object dies, because its refcount is 0. This fundamental difference between instance methods and other callables makes it painful to implement weakly referencing callback registries. PROPOSED SOLUTION = Changing the fundamental nature of instance methods to accommodate one single corner case doesn't seem worthwhile. Similarly, changing the behavior of weakref.ref(), which does work as specified, is probably not a good idea. My approach is thus to provide a new helper, WeakCallableRef, that behaves like weakref.ref(), but is safe to use on callables and does what you would naturally expect with instance methods. It works by binding the lifetime of the ref to that of 1/ the instance bearing the method, and 2/ the unbound method itself. It is also safe to use on other function types beside instance methods, so implementations of callback registries don't have to special case depending on the callable type. The unexpected behavior should also be mentioned somewhere in the weakref documentation, by the way. See attached file for a proposed implementation. -- components: Library (Lib) files: WeakCallableRef.py messages: 158828 nosy: Sundance priority: normal severity: normal status: open title: Instance methods and WeakRefs don't mix. type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file25288/WeakCallableRef.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14631 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14632] Race condition in WatchedFileHandler leads to unhandled exception
New submission from JohnM phlogistonj...@asynchrono.us: The (very handy) logging.handlers.WatchedFileHandler appears to be susceptible to a race condition that causes occasional OSErrors during the normal course of operations: Traceback (most recent call last): File test.py, line 58, in test_race log.warning('Foo bar %d', ii) File /usr/lib64/python2.7/logging/__init__.py, line 1144, in warning self._log(WARNING, msg, args, **kwargs) File /usr/lib64/python2.7/logging/__init__.py, line 1250, in _log self.handle(record) File /usr/lib64/python2.7/logging/__init__.py, line 1260, in handle self.callHandlers(record) File /usr/lib64/python2.7/logging/__init__.py, line 1300, in callHandlers hdlr.handle(record) File /usr/lib64/python2.7/logging/__init__.py, line 744, in handle self.emit(record) File /usr/lib64/python2.7/logging/handlers.py, line 412, in emit stat = os.stat(self.baseFilename) OSError: [Errno 2] No such file or directory: '/tmp/tmpG6_luRTestRaceWatchedFileHandler' Looking at the implementation of the handler's emit function, I've commented on where I think the race can occur. Logrotate (or some similar application) is deleting/unlinking the logfile between the first os.path.exists and os.stat calls: def emit(self, record): Emit a record. First check if the underlying file has changed, and if it has, close the old stream and reopen the file to get the current stream. if not os.path.exists(self.baseFilename): # ^^^ race occurs between here stat = None changed = 1 else: stat = os.stat(self.baseFilename) # ^^^ and this stat call changed = (stat[ST_DEV] != self.dev) or (stat[ST_INO] != self.ino) if changed and self.stream is not None: self.stream.flush() self.stream.close() self.stream = self._open() if stat is None: stat = os.stat(self.baseFilename) self.dev, self.ino = stat[ST_DEV], stat[ST_INO] logging.FileHandler.emit(self, record) I've attached a test script that attempts to recreate the issue. On my Linux system running the script is able to trigger the issue about every 7 of 10 runs. -- components: Library (Lib) files: test.py messages: 158829 nosy: phlogistonjohn priority: normal severity: normal status: open title: Race condition in WatchedFileHandler leads to unhandled exception type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file25289/test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14632 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1079] decode_header does not follow RFC 2047
Changes by Patrick Hahn ph...@janestreet.com: -- nosy: +phahn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1079 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11618] Locks broken wrt timeouts on Windows
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Two runs with standard locks: D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.746 usec per loop D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.749 usec per loop Two runs with CV locks (emulated) D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.278 usec per loop D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.279 usec per loop Two runs with CV locks targeted for Vista: D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.272 usec per loop D:\pydev\hg\cpython2pcbuild\amd64\python.exe -m timeit -s import _thread; l = _thread.allocate_lock() l.acquire();l.release() 100 loops, best of 3: 0.272 usec per loop You can see the big win from not doing kernel switches all the time. shedding 60% of the time. Once in user space, moving from CriticalSection objects to SRWLock objects is less beneficial, being overshadowed by Python overhead. Still, 2% overall is not to be frowned upon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11618 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Eric Snow ericsnowcurren...@gmail.com added the comment: Thanks, Martin! That did the trick. -- versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14632] Race condition in WatchedFileHandler leads to unhandled exception
JohnM phlogistonj...@asynchrono.us added the comment: I'm attaching a patch of an emit function implementation that reduces the number of stats and uses fstat were we can. Using fstat should also prevent any races between opening the new file and stating the path in the file system. Using this patch or something along these lines should avoid the time of check to time of use issues with the current version with repeated stat calls. -- keywords: +patch Added file: http://bugs.python.org/file25290/watchedfilehandler.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14632 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14628] Clarify import statement documentation regarding what gets bound
Brett Cannon br...@python.org added the comment: So I think the sentence is saying exactly what is going on, but you want clarification that the module object is originating from sys.modules specifically. So you could change the sentence to The first form of import statement binds the module name in the local namespace to the module object as found in sys.modules. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14628 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14631] Instance methods and WeakRefs don't mix.
Mark Dickinson dicki...@gmail.com added the comment: I quite like the WeakCallableRef idea, having had to work around this problem myself in the past (using a similar mechanism). This looks like a feature request rather than a bug report, though; changing Type and Versions accordingly. -- nosy: +mark.dickinson stage: - patch review type: behavior - enhancement versions: +Python 3.3 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14631 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c
Brett Cannon br...@python.org added the comment: Welcome to Python code running during startup. =) As I said, the only thing I can think of is raising the exception instead of catching it and immediately triggering the fatal exception, but that specific fatal error was not introduced by me so this is just a side-effect of having Python code running during startup. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8885] markupbase declaration errors aren't recoverable
Mark Nottingham m...@mnot.net added the comment: Why remove 2.7? It'd be an easy bug fix if j is incremented. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8885 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14633] test_find_module_encoding should test for a less specific message (or
New submission from Eric Snow ericsnowcurren...@gmail.com: test_find_module_encoding (in Lib/test/test_imp.py), has the following check: self.assertRaisesRegex(SyntaxError, rNon-UTF-8 code starting with '\\xf6' r in file .*badsyntax_pep3120.py, imp.find_module, 'badsyntax_pep3120', path) It may be worth changing to something like this (aligning with the changes in issue14629): self.assertRaisesRegex(SyntaxError, rinvalid or missing encoding declaration, imp.find_module, 'badsyntax_pep3120', path) -- messages: 158837 nosy: brett.cannon, eric.snow priority: normal severity: normal status: open title: test_find_module_encoding should test for a less specific message (or ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14633] test_find_module_encoding should test for a less specific message
Changes by Eric Snow ericsnowcurren...@gmail.com: -- components: +Tests title: test_find_module_encoding should test for a less specific message (or - test_find_module_encoding should test for a less specific message versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14633] test_find_module_encoding should test for a less specific message
Eric Snow ericsnowcurren...@gmail.com added the comment: or even _not_ check the message string? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Eric Snow ericsnowcurren...@gmail.com added the comment: Apparently the message string contained by the SyntaxError is different between the two. I noticed due to the hard-coded check in test_find_module_encoding (in Lib/test/test_imp.py). I've brought up the specific issue of that hard-coded message check in issue14633. However, in case it otherwise matters that the message string be the same between the two, I've brought it up here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c
Stefan Krah stefan-use...@bytereef.org added the comment: Hmm, I've managed to produce the error with 3.1: $ python3.1 Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File /usr/lib/python3.1/io.py, line 60, in module import _io File /usr/lib/python3.1/os.py, line 380, in module from _abcoll import MutableMapping # Can't use collections (bootstrap) File /usr/lib/python3.1/encodings/iso8859_15.py, line 14, in decode def decode(self,input,errors='strict'): KeyboardInterrupt Aborted -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14628] Clarify import statement documentation regarding what gets bound
Eric Snow ericsnowcurren...@gmail.com added the comment: Sounds mostly right. sys.modules[name] won't necessarily contain a module object, as Benjamin brought up in issue14609. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14628 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler
Éric Araujo mer...@netwok.org added the comment: [MAL] I know that distutils development was stopped (even though I don't consider that a good thing) This is OT, but could you tell a bit more? The freeze appears to me to have been a necessary decision due to the impossibility of making non-trivial changes without breaking setup scripts or projects such as mxSetup. but since the code changes were let into the wild, we have to deal with it properly now. This I agree with. Saturday or Sunday I will have the time to commit a fix and test. -- assignee: ned.deily - eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14628] Clarify import statement documentation regarding what gets bound
Brett Cannon br...@python.org added the comment: OK, so you say to the object found in sys.modules. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14628 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c
Brett Cannon br...@python.org added the comment: So importlib just increased the window of vulnerability for this kind of thing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c
Stefan Krah stefan-use...@bytereef.org added the comment: The funny thing is, in 3.3 I can't reproduce it (i.e. I only get the KeyboardInterrupt). So I'm not sure if this happens more often now. ^CTraceback (most recent call last): File frozen importlib._bootstrap, line 989, in _find_and_load File frozen importlib._bootstrap, line 571, in load_module File frozen importlib._bootstrap, line 228, in module_for_loader_wrapper File frozen importlib._bootstrap, line 456, in _load_module File /home/stefan/pydev/cpython/Lib/site.py, line 537, in module main() [...] File /home/stefan/pydev/cpython/Lib/collections/__init__.py, line 322, in namedtuple field_names = list(map(str, field_names)) KeyboardInterrupt -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14517] Recompilation of sources with Distutils
Éric Araujo mer...@netwok.org added the comment: I think this is done on purpose; I’ll dig up the changeset and bug report later. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14517 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Martin v. Löwis mar...@v.loewis.de added the comment: IMO, the test is flawed testing for the specific error message. OTOH, the original message is better than the tokenize message in that it mentions the file name. However, tokenize does not have the file name available, so it can't possibly report it. I have no idea how to resolve this. Contributions are welcome. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14581] Support case-insensitive file extensions on Windows in importlib
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset a32be109bd86 by Brett Cannon in branch 'default': Issue #14581: Windows users are allowed to import modules w/o taking http://hg.python.org/cpython/rev/a32be109bd86 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset a281a6622714 by Brett Cannon in branch 'default': Issue #14633: Simplify imp.find_modue() test after fixes from issue http://hg.python.org/cpython/rev/a281a6622714 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14633] test_find_module_encoding should test for a less specific message
Brett Cannon br...@python.org added the comment: Committed in http://hg.python.org/cpython/rev/a281a6622714 (I think our issue detection algorithm grabs the last issue in a commit message instead of the first one). -- assignee: - brett.cannon resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10142] Support for SEEK_HOLE/SEEK_DATA
Terry J. Reedy tjre...@udel.edu added the comment: Is there a reason to say (several times) 'can support' instead of just 'support'? Do the OSes in question just optionally support rather than always support? The first version added: change 'depend of' to 'depend on'. In several functions you delete error checks: -if not (0 = whence = 2): -raise ValueError(invalid whence value) (or C equivalent). What happens with patch if invalid whence value is passed? Error from deeper in the call stack? Silently pass error, with no message? Could import of io create set of valid_whences for system? Then check would be if whence not in valid_whences: (or C equivalent). In 3.3, unittest has new mock submodule. Perhaps that would help testing. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8885] markupbase declaration errors aren't recoverable
Ezio Melotti ezio.melo...@gmail.com added the comment: Because even on 2.7 the parser is now able to handle broken markup, so error won't be called anymore. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8885 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: Here's the patch. I searched through the rest of Objects/longobject.c for other occurrences of [0], and found nothing else that looked suspicious, so I'm reasonably confident that this was an isolated case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Changes by Mark Dickinson dicki...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file25291/issue14630.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1b57de8a8383 by Brett Cannon in branch 'default': Issue #14629: Mention the filename in SyntaxError exceptions from http://hg.python.org/cpython/rev/1b57de8a8383 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10142] Support for SEEK_HOLE/SEEK_DATA
Jesús Cea Avión j...@jcea.es added the comment: Terry, yes, skiping the test in the code will raise an error anyway when doing the real seek() OS syscall. Is there a reason to say (several times) 'can support' instead of just 'support'? Do the OSes in question just optionally support rather than always support? Sometimes depends of the concrete filesystem used, or the concrete OS version. The first version added: change 'depend of' to 'depend on'. Done in my repository. Thanks. Could import of io create set of valid_whences for system? Then check would be if whence not in valid_whences: (or C equivalent). This is far from trivial and I don't see the point if OS seek() is going to give an error anyway. The only point would to provide a maybe more useful error message. In 3.3, unittest has new mock submodule. Perhaps that would help testing. This is a very thin layer over the OS. Thanks for the feedback. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14633] test_find_module_encoding should test for a less specific message
Eric Snow ericsnowcurren...@gmail.com added the comment: thanks, Brett! That did the trick. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()
Eric Snow ericsnowcurren...@gmail.com added the comment: Looks good. Thanks for the help, Martin and Brett. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14581] Support case-insensitive file extensions on Windows in importlib
Brett Cannon br...@python.org added the comment: http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.x/builds/98/steps/test/logs/stdio suggests this fix worked. -- assignee: - brett.cannon resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14621] Hash function is not randomized properly
Vlado Boza us...@ksp.sk added the comment: One possible fix: Look for StringHasher in google v8 code (http://code.google.com/p/v8/source/search?q=stringhasherorigq=stringhasherbtnG=Search+Trunk). Main loop looks like this: raw_running_hash_ += c; raw_running_hash_ += (raw_running_hash_ 10); raw_running_hash_ ^= (raw_running_hash_ 6); It seems not to have same collisions with many different hash seeds. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14599] Windows test_import failure thanks to ImportError.path
Changes by Brett Cannon br...@python.org: -- title: Windows test_import failure - Windows test_import failure thanks to ImportError.path ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14599 ___ ___ Python-bugs-list mailing list Unsubscribe: http://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 Mark Dickinson dicki...@gmail.com: -- nosy: -mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13344] closed sockets don't raise EBADF anymore
Changes by Colin Marc colinm...@gmail.com: -- nosy: +colinmarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Mark Dickinson dicki...@gmail.com added the comment: Also, Python 2.7 looks safe here. -- versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Changes by Mark Dickinson dicki...@gmail.com: -- stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14596] struct.unpack memory leak
Mark Dickinson dicki...@gmail.com added the comment: IMO, the struct module does what it's intended to do just fine here. I don't a big need for any change. I'd propose closing this as won't fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14596 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14630] non-deterministic behavior of int subclass
Antoine Pitrou pit...@free.fr added the comment: The patch works fine here, and the test exercises the issue correctly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10156] Initialization of globals in unicodeobject.c
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: -mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10156 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14634] Mock cannot autospec functions with keyword-only arguments.
New submission from R. David Murray rdmur...@bitdance.com: The following code: def foo(a, *, b=None): pass unittest.mock.create_autospec(foo) fails with this traceback: Traceback (most recent call last): File temp.py, line 6, in module unittest.mock.create_autospec(foo) File /home/rdmurray/python/p33/Lib/unittest/mock.py, line 2026, in create_autospec mock = _set_signature(mock, spec) File /home/rdmurray/python/p33/Lib/unittest/mock.py, line 162, in _set_signature result = _getsignature(original, skipfirst, instance) File /home/rdmurray/python/p33/Lib/unittest/mock.py, line 81, in _getsignature regargs, varargs, varkwargs, defaults = inspect.getargspec(func) File /home/rdmurray/python/p33/Lib/inspect.py, line 808, in getargspec raise ValueError(Function has keyword-only arguments or annotations ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them -- keywords: easy messages: 158864 nosy: michael.foord, r.david.murray priority: normal severity: normal status: open title: Mock cannot autospec functions with keyword-only arguments. type: enhancement versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14634 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: Stan, anybody working in SystemTap support, could you possibly create a new issue in the tracker to track specifically stap support?. You can depend on this bug, and coordinate effort. Clone my repository and use it as base. Thanks!. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14634] Mock cannot autospec functions with keyword-only arguments.
Changes by Ezio Melotti ezio.melo...@gmail.com: -- components: +Library (Lib) nosy: +ezio.melotti stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14634 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14588] PEP 3115 compliant dynamic class creation
Daniel Urban urban.dani...@gmail.com added the comment: I've attached the third patch with the eval_body - exec_body change; explicitly passing the default (None) now also allowed. I also fixed a refleak (I think). -- Added file: http://bugs.python.org/file25292/operator_build_class_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14588 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Frank Ch. Eigler f...@elastic.org added the comment: Stan, anybody working in SystemTap support, could you possibly create a new issue in the tracker to track specifically stap support?. You can depend on this bug, and coordinate effort. Clone my repository and use it as base. I believe the only remotely-systemtap-specific stuff we suggested would be useful would be the addition of that PyEval_GetFrame() value as an extra argument for function entry/exit sdt.h calls. I believe your patch already apprx. works against systemtap (and in fact many dtrace idiosyncracies like asm(nop) are unnecessary here), except for the inclusion of the /usr/bin/dtrace -G-generated header file, as mentioned in http://bugs.python.org/issue13405#msg149054. Do you think it is necessary to track that in a separate bug? - FChE -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: Frank, if somebody provides a diff I can test under Ubuntu 10.04, I can try it myself. This patch MUST be differential from my current patch (to be applied OVER it) and must cover EVERYTHING, from ./configure to the test execution. Anyway, issues in the tracker are free, and I rather prefer to have a separate issue, actually. You can copy the nosy list. The nop issue seems to be related to SPARC branch slot. I don't have SPARC hardware to try, anymore :-(. Trying with friends, but it is moving slowly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file25293/utf16_error_handling-3.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Serhiy Storchaka storch...@gmail.com added the comment: Here is a minimal patch that corrects all bugs for 3.2. As a side effect, decoding is accelerated by 4-8%. -- Added file: http://bugs.python.org/file25294/utf16_error_handling-3.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14606] Memory leak subprocess on Windows
Terry J. Reedy tjre...@udel.edu added the comment: Does your last message mean that this issue should be closed here? -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14606 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file25293/utf16_error_handling-3.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com