[issue27945] Various segfaults with dict

2016-09-11 Thread Tim Mitchell
Tim Mitchell added the comment: Here is my patch for parts 3 and 4. Core issue for part 4 appears to be dk_lookup calling arbitrary python code may free the key. dk_lookup is also used in _PyDict_LoadGlobal not sure if this bug can occur here. -- nosy: +Tim Mitchell Added file: http

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: Verified problem. Added patch to keep reference to dict in PyDict_GetItem. -- keywords: +patch nosy: +Tim Mitchell Added file: http://bugs.python.org/file44605/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: see also similar dict issue 27945 -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailin

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: see also similar dict issue 27945 -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailin

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Changes by Tim Mitchell : Added file: http://bugs.python.org/file44611/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch ___ Python tracker <http://bugs.python.org/issue27

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: Added test to patch -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Changes by Tim Mitchell : Removed file: http://bugs.python.org/file44605/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch ___ Python tracker <http://bugs.python.org/issue27

[issue27806] 2.7 32-bit builds fail on future releases of OS X due to dependency on deleted header file

2016-09-14 Thread Tim Smith
Changes by Tim Smith : -- nosy: +tdsmith ___ Python tracker <http://bugs.python.org/issue27806> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22493] Deprecate the use of flags not at the start of regular expression

2016-09-15 Thread Tim Graham
Tim Graham added the comment: Could we include the offending pattern in the deprecation message? I'm attaching a proposed patch. With that patch I can more easily find the offending pattern, whereas before I had no idea: django/django/urls/resolvers.py:101: DeprecationWarning: Flags n

[issue22493] Deprecate the use of flags not at the start of regular expression

2016-09-15 Thread Tim Graham
Tim Graham added the comment: And on further investigation, I'm not sure how to fix the deprecation warnings in Django. We have a urlpattern like this: url(r'^(?i)CaseInsensitive/(\w+)', empty_view, name="insensitive"), The regex string r'^(?i)CaseInsensitive/

[issue22493] Deprecate the use of flags not at the start of regular expression

2016-09-15 Thread Tim Graham
Tim Graham added the comment: Looks like we could remove the '^', but it doesn't resolve the deprecation warnings. The inline flags in `pattern` still need to be moved before `_prefix`. -- ___ Python tracker <http://bugs.pyt

[issue28128] Improve the warning message for invalid escape sequences

2016-09-15 Thread Tim Graham
Tim Graham added the comment: I hope the message can be improved for Python 3.6 as the warnings I see when running Django's test suite are rather useless to help find and fix the issues: cpython/Lib/importlib/_bootstrap.py:205: DeprecationWarning: invalid escape sequence '\:'

[issue22493] Deprecate the use of flags not at the start of regular expression

2016-09-15 Thread Tim Graham
Tim Graham added the comment: Adding an updated patch. I guess the (?i:CaseInsensitive) syntax isn't merged yet? I tried it but it didn't work. It might be premature to proceed with this deprecation if that alternative isn't already present. Is there an issue for it? --

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Tim Graham
Tim Graham added the comment: Eric, your patch was good enough to allow me to easily identify and fix all the warnings in Django: https://github.com/django/django/pull/7254. Thanks! -- ___ Python tracker <http://bugs.python.org/issue28

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Mark, the code I showed in roots.py is somewhat more accurate and highly significantly faster than the code you just posted. It's not complicated at all: it just uses Decimal to do a single Newton correction with extended precision. Since it doesn'

[issue22493] Deprecate the use of flags not at the start of regular expression

2016-09-16 Thread Tim Graham
Tim Graham added the comment: Yes, I found that Django needs an update to support that syntax in URLpatterns. Thanks. -- ___ Python tracker <http://bugs.python.org/issue22

[issue16902] Add OSS module support for Solaris

2016-09-16 Thread Tim Mooney
Tim Mooney added the comment: Sooo It's been 3 years. Brian's patch has bit-rotted a bit, but it's easy to update for recent Python. What are the hold-ups to getting this applied? -- ___ Python tracker <http://bugs.pyt

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Mark, thanks for the counterexample! I think I can fairly accuse you of thinking ;-) I expect the same approach would be zippy for scaling x by 2**e, provided that the scaled value doesn't exceed the dynamic range of the decimal context. Like so: def ero

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Oops! The `D2**e` in that code should be `pow(D2, e)`, to make it use the correct decimal context. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Let me give complete code for the last idea, also forcing the scaling multiplication to use the correct context: import decimal c = decimal.DefaultContext.copy() c.prec = 25 c.Emax = decimal.MAX_EMAX c.Emin = decimal.MIN_EMIN def erootn(x

[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Tim Peters
Tim Peters added the comment: I see nothing wrong with combinatorial generators materializing their inputs before generation. Perhaps it should be documented clearly. It's certainly not limited to `product()`. For example, >>> for i in itertools.combinations(iterto

[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Tim Peters
Tim Peters added the comment: Lucas, I largely agree, but it is documented that the various combinatorial generators emit items in a particular lexicographic order. So that is documented, and programs definitely rely on it. That's why, in an earlier comment, Terry suggested that pe

[issue27761] Private _nth_root function loses accuracy

2016-09-17 Thread Tim Peters
Tim Peters added the comment: Let me clarify something about the extended algorithm: the starting guess is no longer the most significant source of error. It's the `mul(D(x), pow(D2, e))` part. `D(x)` is exact, but `pow(D2, e)` may not be exactly representable with 26 decimal digits

[issue28201] dict: perturb shift should be done when first conflict

2016-09-18 Thread Tim Peters
Tim Peters added the comment: Good catch! I agree - and I wrote this code to begin with, so my opinion should count ;-) -- nosy: +tim.peters ___ Python tracker <http://bugs.python.org/issue28

[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-20 Thread Tim Graham
New submission from Tim Graham: As requested by Nick [0], this is a usability issue against CPython 3.6 to provide a better chained TypeError in this case: class _TokenType(tuple): parent = None def __getattr__(self, name): new = _TokenType(self + (name,)) setattr(self

[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-20 Thread Tim Graham
Tim Graham added the comment: The behavior change is from #10424. Do you believe the new behavior is incorrect? -- nosy: +Tim.Graham ___ Python tracker <http://bugs.python.org/issue28

[issue22431] Change format of test runner output

2016-09-20 Thread Tim Graham
Tim Graham added the comment: Is there opposition to changing the default output as outlined in the first comment? If so, then I think this ticket should be closed or retitled to reflect the intent. -- nosy: +Tim.Graham ___ Python tracker <h

[issue22431] Change format of test runner output

2016-09-20 Thread Tim Graham
Tim Graham added the comment: Here's the patch if we make the change in Django instead: https://github.com/cjerdonek/django/commit/9c8d162f3f616e9d9768659a06fcf27bb389214b -- ___ Python tracker <http://bugs.python.org/is

[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-21 Thread Tim Graham
Tim Graham added the comment: Based on the usage output, it looks like the subcommand is required, but I'm not sure if there are cases where a subcommand could be optional. David, can you advise? usage: test_argparse.py [-h] command ... -- nosy: +r.david.m

[issue19398] test_trace fails with -S

2016-10-03 Thread Tim Smith
Changes by Tim Smith : -- nosy: +tdsmith versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue19398> ___ ___ Python-bugs-list mailing list Unsub

[issue28365] 3.5.2 syntax issue

2016-10-05 Thread Tim Golden
Tim Golden added the comment: This sometimes happens when someone copies from a book or a tutorial and includes as though code the banner header which is only meant to illustrate the context. -- ___ Python tracker <http://bugs.python.org/issue28

[issue28201] dict: perturb shift should be done when first conflict

2016-10-05 Thread Tim Peters
Tim Peters added the comment: LGTM! Ship it :-) -- ___ Python tracker <http://bugs.python.org/issue28201> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-07 Thread Tim Graham
Tim Graham added the comment: As far as I can tell, this isn't an issue on Python 3. Can this be closed since Python 2 is only receiving bug fixes now? -- nosy: +Tim.Graham ___ Python tracker <http://bugs.python.org/is

[issue28423] list.insert(-1,value) is wrong!

2016-10-12 Thread Tim Peters
Tim Peters added the comment: It's fine. Read the docs. "s.insert(i, x) inserts x into s at the index given by i (same as s[i:i] = [x])" Note that: >>> fred[-1:] [4] So the empty slice s[-1:-1] is _between_ 3 and 4 in `fred`. If you're not surprised by >&

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Tim Mitchell
Tim Mitchell added the comment: Have stripped down the module __doc__ to a list of contents. I chose to indent the descriptions of each argument to Popen. I know this is non-standard but it is such a long ramble otherwise. Changed true -> :const:`True` in subprocess.rst. -- keywo

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell
Tim Mitchell added the comment: hg patch with changes forthcoming -- ___ Python tracker <http://bugs.python.org/issue26240> ___ ___ Python-bugs-list mailin

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell
Tim Mitchell added the comment: Am now working from tip of default in mercurial (Python 3.6). * Removed all changes to subprocess.rst. subprocess.__doc__ * Trimmed down even further - removed function signatures. * added note to see Python docs for complete description. Exception docs * just

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-20 Thread Tim Mitchell
Tim Mitchell added the comment: Changes as per Martins review. -- Added file: http://bugs.python.org/file45159/subprocess3.patch ___ Python tracker <http://bugs.python.org/issue26

[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2016-10-20 Thread Tim Peters
Tim Peters added the comment: I think Raymond will have to chime in. I assume this is due to the `letter_range` portion of the test suffering hash randomization dealing it a bad hand - but the underlying string hash is "supposed to be" strong regardless of seed. The self.ass

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Tim Peters
Tim Peters added the comment: This has nothing to do with the _values_ you're passing - it has to do with the length of the pickle string: def _send_bytes(self, buf): n = len(buf) # For wire compatibility with 3.2 and lower header = struct.pack("!i&

[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Tim Peters
Tim Peters added the comment: This won't be changed - it's a near-universally mandated behavior across relevant standards. Many years ago it wasn't, but Knuth changed minds when he wrote: """ We must define x^0=1 for all x, if the binomial theorem is to be valid

[issue28128] Improve the warning message for invalid escape sequences

2016-10-31 Thread Tim Graham
Tim Graham added the comment: The patch is working well to identify warnings when running Django's test suite. Thanks! -- ___ Python tracker <http://bugs.python.org/is

[issue28579] nan != nan

2016-11-01 Thread Tim Peters
Tim Peters added the comment: Yes, it's both intended and annoying ;-) The standard specifies that, by default, comparisons involving NANs are "unordered": a NAN is _none_ of "less than", "equal to", or "greater than" any other float, i

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-14 Thread Tim Graham
Tim Graham added the comment: Hi, this broke a couple tests with Django because it's passing number as a float rather than an integer. For example: == ERROR: test_localized_fo

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-14 Thread Tim Graham
Tim Graham added the comment: Thanks, that does fix that first test. There is one more that still fails: $ python -Wall tests/runtests.py humanize_tests.tests.HumanizeTests.test_i18n_intword Testing against Django installed in '/home/tim/code/django/django' with up to 3 processe

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-14 Thread Tim Graham
Tim Graham added the comment: Yes, that fixes the second test. Current warning (with stacklevel=3): /home/tim/code/cpython/Lib/gettext.py:454: DeprecationWarning: Plural value must be an integer, got 1.29 tmsg = self._catalog[(msgid1, self.plural(n))] Possibly the stacklevel should instead

<    19   20   21   22   23   24