[issue14212] Segfault when using re.finditer over mmap

2012-03-06 Thread Matthew Barnett
Matthew Barnett added the comment: It segfaults because it attempts to access the buffer of an mmap that has been closed. It would be certainly be more friendly if it checked whether the mmap was still open and, if not, raised an exception instead. -- nosy: +mrabarnett

[issue14212] Segfault when using re.finditer over mmap

2012-03-07 Thread Matthew Barnett
Matthew Barnett added the comment: In the function "getstring" in _sre.c, the code obtains a pointer to the characters of the buffer and then releases the buffer. There's a comment before the release: /* Release the buffer immediately --- possibly dangerous but

[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-09 Thread Matthew Barnett
Matthew Barnett added the comment: Within a character set \A and \Z should behave like, say, \C; in other words, they should be the literals "A" and "Z". -- ___ Python tracker <http://bug

[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-09 Thread Matthew Barnett
Matthew Barnett added the comment: \s matches a character, whereas \A and \Z don't. Within a character set \s makes sense, but \A and \Z don't, so they should be treated as literals. -- ___ Python tracker <http://bugs.python.o

[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it

2012-03-12 Thread Matthew Barnett
Matthew Barnett added the comment: The re module creates the dict purely for the benefit of the user, and as it's a normal dict, it's mutable. An alternative would to use an immutable dict or dict-like object, but Python doesn't have such a class, and it's probably not wo

[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it

2012-03-12 Thread Matthew Barnett
Matthew Barnett added the comment: It appears I was wrong. :-( The simplest solution in that case is for it to return a _copy_ of the dict. -- ___ Python tracker <http://bugs.python.org/issue14

[issue1519638] Unmatched Group issue - workaround

2012-03-15 Thread Matthew Barnett
Matthew Barnett added the comment: The replacement can be a callable, so you could do this: re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$', lambda m: m.group(1) or '', 'avatar (special edition)') -- ___ Python tracker <ht

[issue14342] In re's examples the example with recursion doesn't work

2012-03-16 Thread Matthew Barnett
Matthew Barnett added the comment: As far as I can tell, back in 2003, changes were made to replace the recursive scheme which used stack allocation with a non-recursive scheme which used heap allocation in order to the improve the behaviour. To me it looks like an oversight and that the

[issue14343] In re's examples the example with re.split() shadows builtin input()

2012-03-16 Thread Matthew Barnett
Changes by Matthew Barnett : -- title: In re's examples the example with re.split() overlaps builtin input() -> In re's examples the example with re.split() shadows builtin input() ___ Python tracker <http://bugs.pytho

[issue14498] Python 3.x distutils.util.get_platform returns incorrect value using Mac OSX 10.7

2012-04-04 Thread Matthew Scott
New submission from Matthew Scott : Using Python 3.2.2 and Python 3.3.0a2 (installed via 64-bit installers in official DMGs on python.org), 'distutils.util.get_platform()' returns an incorrect OS version when running on Mac OSX 10.7. Using Python 2.6.7, and Python 2.7.1 (the version

[issue14498] Python 3.x distutils.util.get_platform returns incorrect value using Mac OSX 10.7

2012-04-04 Thread Matthew Scott
Matthew Scott added the comment: In the cases of both Python 3.x and 2.x, get_platform() is deriving information about the version of OSX from the 'MACOSX_DEPLOYMENT_TARGET' dictionary returned by distutils.sysconfig.get_config_vars(). Using Python 3.2.2: In [1]: import distutils

[issue14498] Python 3.x distutils.util.get_platform returns incorrect value using Mac OSX 10.7

2012-04-04 Thread Matthew Scott
Matthew Scott added the comment: Interestingly, the 2.x series allowed an os.environ override for the MACOSX_DEPLOYMENT_TARGET value, while the 3.x series did away with that, as a result of http://bugs.python.org/issue9516 > for version in 2.6 2.7 3.2 3.3; do MACOSX_DEPLOYMENT_TARGET=10

[issue14499] Extension module builds fail with Xcode 4.3 on OS X 10.7 due to SDK move

2012-04-04 Thread Matthew Scott
Changes by Matthew Scott : -- nosy: +Matthew.Scott ___ Python tracker <http://bugs.python.org/issue14499> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14510] Regular Expression "+" perform wrong repeat

2012-04-05 Thread Matthew Barnett
Matthew Barnett added the comment: If a capture group is repeated, as in r'(\$.)+', only its last match is returned. -- ___ Python tracker <http://bugs.python.o

[issue37235] urljoin behavior unclear/not following RFC 3986

2019-06-11 Thread Matthew Kenigsberg
New submission from Matthew Kenigsberg : Was trying to figure out the exact behavior of urljoin. As far as I can tell (see https://bugs.python.org/issue22118) it should follow RFC 3986. According to the algorithm in 5.2.2, I think this is wrong: >>> urljoin("ftp://netloc"

[issue37299] RuntimeWarning is NOT raised

2019-06-17 Thread Matthew Cowles
Matthew Cowles added the comment: I disagree with the decision not to fix this bug. If a RuntimeWarning is warranted when a temporary variable is used, it's warranted when the value is used directly, without a temporary variable. -- nosy: +mdc

[issue37327] python re bug

2019-06-18 Thread Matthew Barnett
Matthew Barnett added the comment: The problem is the "(?:[^<]+|<(?!/head>))*?". If I simplify it a little I get "(?:[^<]+)*?", which is a repeat within a repeat. There are many ways in which it could match, and if what follows fails to match (it doesn't because there's no "

[issue37687] Invalid regexp should rise exception

2019-07-25 Thread Matthew Barnett
Matthew Barnett added the comment: For historical reasons, if it isn't valid as a repeat then it's a literal. This is true in other regex implementations, and is by no means unique to the re module. -- resolution: -> not a bug stage: -> resolved status

[issue37712] Exception frames from unittest.TestCase.fail dependent on nesting

2019-07-29 Thread Matthew Roeschke
New submission from Matthew Roeschke : With this toy example: import unittest def this_fails(): a = 1 + None class TestExample(unittest.TestCase): def test_this(self): try: this_fails() except Exception: self.fail('Fail') i

[issue37723] important performance regression on regular expression parsing

2019-07-31 Thread Matthew Barnett
Matthew Barnett added the comment: I've just had a look at _uniq, and the code surprises me. The obvious way to detect duplicates is with a set, but that requires the items to be hashable. Are they? Well, the first line of the function uses 'set', so they are. Why, then, i

[issue37823] Telnet documentation: fix the link to open()

2019-08-12 Thread Matthew Bruggeman
Matthew Bruggeman added the comment: I can take a look -- nosy: +Matthew Bruggeman ___ Python tracker <https://bugs.python.org/issue37823> ___ ___ Python-bug

[issue30736] Support Unicode 10.0

2017-06-22 Thread Matthew Barnett
Matthew Barnett added the comment: @Steven: Python 3.6 supports Unicode 9. Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> i

[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2017-06-25 Thread Matthew Woodcraft
New submission from Matthew Woodcraft: I have a system where the default locale is C.UTF-8, and en_US.UTF-8 is not installed. But locale.normalize() unhelpfully converts "C.UTF-8" to "en_US.UTF-8". So the following crashes for me: python3.6 -c "import locale;local

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-06-25 Thread Matthew Woodcraft
Matthew Woodcraft added the comment: That alias (C.UTF-8 to en_US.UTF-8) is surely a bug in itself nowadays. I've filed #30755 . -- nosy: +mattheww ___ Python tracker <http://bugs.python.org/is

[issue30772] If I make an attribute "[a unicode version of B]", it gets assigned to "[ascii B]", and so on.

2017-06-26 Thread Matthew Barnett
Matthew Barnett added the comment: See PEP 3131 -- Supporting Non-ASCII Identifiers It says: """All identifiers are converted into the normal form NFKC while parsing; comparison of identifiers is based on NFKC.""" >>> import unicodedata >>> un

[issue30802] datetime.datetime.strptime('200722', '%Y%U')

2017-06-29 Thread Matthew Barnett
Matthew Barnett added the comment: Expected result is datetime.datetime(2017, 6, 25, 0, 0). -- nosy: +mrabarnett ___ Python tracker <http://bugs.python.org/issue30

[issue30838] re \w does not match some valid Unicode characters

2017-07-03 Thread Matthew Barnett
Matthew Barnett added the comment: In Unicode 9.0.0, U+1885 and U+1886 changed from being General_Category=Other_Letter (Lo) to General_Category=Nonspacing_Mark (Mn). U+2118 is General_Category=Math_Symbol (Sm) and U+212E is General_Category=Other_Symbol (So). \w doesn't include Mn, Sm

[issue30838] re \w does not match some valid Unicode characters

2017-07-05 Thread Matthew Barnett
Matthew Barnett added the comment: Python identifiers match the regex: [_\p{XID_Start}]\p{XID_Continue}* The standard re module doesn't support \p{...}, but the third-party "regex" module does. -- ___ Python tracker <http

[issue30927] re.sub() does not work correctly on '.' pattern and \n

2017-07-13 Thread Matthew Barnett
Matthew Barnett added the comment: The 4th parameter is the count, not the flags: sub(pattern, repl, string, count=0, flags=0) >>> re.sub(r'X.', '+', '-X\n-', flags=re.DOTALL) '-+-' -- resolution: ->

[issue30973] Regular expression "hangs" interpreter

2017-07-20 Thread Matthew Barnett
Matthew Barnett added the comment: The regex module is much better in this respect, but it's not foolproof. With this particular example it completes quickly. -- ___ Python tracker <http://bugs.python.org/is

[issue30802] datetime.datetime.strptime('200722', '%Y%U')

2017-07-25 Thread Matthew Barnett
Matthew Barnett added the comment: I think the relevant standard is ISO 8601: https://en.wikipedia.org/wiki/ISO_8601 The first day of the week is Monday. Note particularly the examples it gives: Monday 29 December 2008 is written "2009-W01-1" Sunday 3 January 2010 is wri

[issue31193] re.IGNORECASE strips combining character from lower case of LATIN CAPITAL LETTER I WITH DOT ABOVE

2017-08-14 Thread Matthew Barnett
Matthew Barnett added the comment: The re module works with codepoints, it doesn't understand canonical equivalence. For example, it doesn't recognise that "\N{LATIN CAPITAL LETTER E}\N{COMBINING ACUTE ACCENT}" is equivalent to "\N{LATIN CAPITAL LETTER E WITH ACUTE}&q

[issue35538] splitext does not seems to handle filepath ending in .

2018-12-19 Thread Matthew Barnett
Matthew Barnett added the comment: It always returns the dot. For example: >>> posixpath.splitext('.blah.txt') ('.blah', '.txt') If there's no extension (no dot): >>> posixpath.splitext('blah') ('blah', 

[issue35546] String formatting produces incorrect result with left-aligned zero-padded format

2018-12-20 Thread Matthew Barnett
Matthew Barnett added the comment: A similar issue exists with centring: >>> format(42, '^020') '0420' -- nosy: +mrabarnett ___ Python tracker <ht

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-22 Thread Matthew McCormick
Matthew McCormick added the comment: > What current 3.x versions have this issue? This issue was opened against 2.7. Yes, this is just for 2.7. -- versions: -Python 3.8 __ Python tracker <https://bugs.python.org/issu

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-24 Thread Matthew McCormick
Change by Matthew McCormick : -- pull_requests: +10529 ___ Python tracker <https://bugs.python.org/issue11566> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35645] Alarm usage

2019-01-03 Thread Matthew Barnett
Matthew Barnett added the comment: @Steven: The complaint is that the BEL character ('\a') doesn't result in a beep when printed. @Siva: These days, you shouldn't be relying on '\a' because it's not always supported. If you want to make a beep, do so with

[issue35653] All regular expression match groups are the empty string

2019-01-03 Thread Matthew Barnett
Matthew Barnett added the comment: Look at the spans of the groups: >>> import re >>> re.search(r'^(?:(\d*)(\D*))*$', "42AZ").span(1) (4, 4) >>> re.search(r'^(?:(\d*)(\D*))*$', "42AZ").span(2) (4, 4) They're telling you

[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Matthew Barnett
Matthew Barnett added the comment: It looks like a bug in re to me. -- ___ Python tracker <https://bugs.python.org/issue35859> ___ ___ Python-bugs-list mailin

[issue28494] is_zipfile false positives

2019-01-30 Thread Matthew Ryan
Change by Matthew Ryan : -- nosy: +mryan1539 ___ Python tracker <https://bugs.python.org/issue28494> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Matthew Barnett
Matthew Barnett added the comment: It matches, and the span is (0, 2). The only way that it can match like that is for the capture group to match the 'a', and the final 'b' to match the 'b'. Therefore, re.search(r'(ab|a)*b', 'ab').groups() s

[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-02-12 Thread Matthew Barnett
Matthew Barnett added the comment: You could italicise the "protocol" part using asterisks, like this: *protocol*_request or this: *protocol*\ _request depending on the implementation of the rst software. -- nosy: +mrabarnett ___ Pyth

[issue17441] Do not cache re.compile

2017-03-07 Thread Matthew Barnett
Matthew Barnett added the comment: If we were doing it today, maybe we wouldn't cache them, but, as you say, it's been like that for a long time. (The regex module also caches them, because the re module does.) Unless someone can demonstrate that it's a problem, I'd say ju

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2017-03-28 Thread Matthew McCormick
Changes by Matthew McCormick : -- pull_requests: +780 ___ Python tracker <http://bugs.python.org/issue11566> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2017-03-28 Thread Matthew McCormick
Matthew McCormick added the comment: I have created a pull request for this issue, https://github.com/python/cpython/pull/880 that addresses extension builds for both MinGWPy and the Microsoft Visual C++ Compiler for Python 2.7. -- nosy: +thewtex

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Matthew Barnett
Matthew Barnett added the comment: A slightly shorter form: /\*(?:(?!\*/).)*\*/ Basically it's: match start while not match end: consume character match end If the "match end" is a single character, you can use a negated character set, for exa

[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Matthew Barnett
Matthew Barnett added the comment: Yes, the second argument is a replacement template, not a literal. This issue does point out a different problem, though: re.escape will add backslashes that will then be treated as literals in the template, for example: >>> re.sub(r'a', r

[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Matthew Barnett
Matthew Barnett added the comment: The function solution does have a larger overhead than a literal. Could the template be made more accepting of backslashes without breaking anything? (There's also issue29995 "re.escape() escapes too much", wh

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-22 Thread Matthew Cowles
Matthew Cowles added the comment: This bug should be fixed urgently. Over at python-help we just got another Python beginner who was using IDLE and then started to get the "IDLE's subprocess didn't make connection" error. The problem was that the user had named one of thei

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-23 Thread Matthew Cowles
Matthew Cowles added the comment: > Do you have access to IDLE on any system other than Windows? I don't have a Windows machine at all. For what it's worth, here's the behavior I'm talking about, albeit with an old version of Python: $ mkdir testidle $ cd testidle

[issue30148] Pathological regex behaviour

2017-04-23 Thread Matthew Barnett
Matthew Barnett added the comment: If 'ignores' is '', you get this: (?:\b(?:extern|G_INLINE_FUNC|%s)\s*) which can match an empty string, and it's tried repeatedly. That's inadvisable. There's also: (?:\s+|\*)+ which can match whitespace in mul

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread Matthew Barnett
Matthew Barnett added the comment: There are 4 patterns. They try to determine the delimiter and quote by looking for matches. Each pattern supposedly covers one of 4 cases: 1. Delimiter, quote, value, quote, delimiter. 2. Start of line/text, quote, value, quote, delimiter. 3. Delimiter

[issue30209] some UTF8 symbols

2017-04-29 Thread Matthew Barnett
Matthew Barnett added the comment: IDLE uses tkinter, which wraps tcl/tk. Versions up to tcl/tk 8.6 can't handle 'astral' codepoints. See also: Issue #30019: IDLE freezes when opening a file with astral characters Issue #21084: IDLE can't deal with characters above the

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-12 Thread Matthew Gilson
Matthew Gilson added the comment: I think that works to solve the problem that I pointed out. In my stack overflow question (http://stackoverflow.com/a/43926058/748858) it has been pointed out that there are other opportunities for weirdness here. Specifically, if if I skip processing 2

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-12 Thread Matthew Gilson
Matthew Gilson added the comment: Oops. You don't need to pass `self.currvalue` to `_grouper`. I didn't end up using it in there... -- ___ Python tracker <http://bugs.python.o

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-12 Thread Matthew Gilson
Matthew Gilson added the comment: Tracking which group the grouper _should_ be on using an incrementing integer seems to work pretty well. In additional to the tests in `test_itertools.py`, I've gotten the following tests to pass: class TestGroupBy(unittest.TestCase): def test_unpa

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-05-15 Thread Matthew Cowles
Matthew Cowles added the comment: I'm very willing to believe that I'm missing something critical here, but wouldn't it be satisfactory to just move "" from the beginning to the end of sys.path in IDLE? I can imagine that it might cause a few problems for users,

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-05-15 Thread Matthew Cowles
Matthew Cowles added the comment: > a) for IDLE to run without stumbling over user files > b) for user code to see the same sys.path when executing under IDLE as when > executed directly with the same cpython binary in the same mode. If you can achieve that, no one will be more impre

[issue36158] Regex search behaves differently in list comprehension

2019-03-01 Thread Matthew Drago
New submission from Matthew Drago : Say for example i want to apply a regex on a list of strings. Using list comprehension as such results in the group method not being found. ``` name_regex = compile(r'\[\"([a-zA-Z\s]*)\"{1}') named_entities = [name_regex.match(entity.t

[issue36397] re.split() incorrectly splitting on zero-width pattern

2019-03-21 Thread Matthew Barnett
Matthew Barnett added the comment: >From the docs: """If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list.""" The pattern does contain a capture, so that's why

[issue36397] re.split() incorrectly splitting on zero-width pattern

2019-03-23 Thread Matthew Barnett
Matthew Barnett added the comment: The list alternates between substrings (s, between the splits) and captures (c): ['1', '1', '2', '2', '11'] -s- -c- -s- -c- -s-- You can use slicing to extract the substrings: >>> re.split

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Matthew Barnett
Matthew Barnett added the comment: It's now consistent with Perl, PCRE and .Net (C#), as well as re.split(), re.sub(), re.findall() and re.finditer(). -- ___ Python tracker <https://bugs.python.org/is

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-12 Thread Matthew Barnett
Matthew Barnett added the comment: Consider re.findall(r'.{0,2}', 'abcde'). It finds 'ab', then continues where it left off to find 'cd', then 'e'. It can also find ''; re.match(r'.*', '') does match, aft

[issue36653] Dictionary Key is without ' ' quotes

2019-04-17 Thread Matthew Barnett
Matthew Barnett added the comment: That should be: def __repr__(self): return repr(self.name) Not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue36812] posix_spawnp returns error when used with file_actions

2019-05-06 Thread Matthew Tanous
New submission from Matthew Tanous : Ran into this on macOS while trying to play around with the new posix_spawn bindings. It appears to me that the file_actions path is not what is being used by file_actions here. It may be that I am misunderstanding something, but I thought I would bring

[issue36814] posix_spawn explicit file_actions=None throws error

2019-05-06 Thread Matthew Tanous
New submission from Matthew Tanous : Allowing posix_spawn file_actions to default to None works, but explicitly setting it throws a TypeError: Python 3.8.0a3 (v3.8.0a3:9a448855b5, Mar 25 2019, 17:05:20) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", &

[issue36812] posix_spawnp returns error when used with file_actions

2019-05-06 Thread Matthew Tanous
Matthew Tanous added the comment: I have some updated information. This works as expected when I set the permissions properly using an octal number 0o777. The issue appears to be that when the permissions don't exist as specified, the PermissionError reports the process name, not the

[issue36812] posix_spawnp returns error when used with file_actions

2019-05-07 Thread Matthew Tanous
Matthew Tanous added the comment: Your example is an attempt to use Popen to run a file you don't have execute permissions for. In my example, it is not `whoami` that it is failing to create/open, but '.tmp/temp_file'. I would expect a `PermissionError: [Errno 13] Permission

[issue36897] shlex doesn't differentiate escaped characters in output

2019-05-12 Thread Matthew Gamble
New submission from Matthew Gamble : The output of the following invocations are exactly the same: list(shlex.shlex('a ; b', posix=True, punctuation_chars=True)) list(shlex.shlex('a \; b', posix=True, punctuation_chars=True)) They both output the following: ['a&#

[issue36897] shlex doesn't differentiate escaped characters in output

2019-05-13 Thread Matthew Gamble
Matthew Gamble added the comment: The point is that it's not possible to use the output of shlex.shlex to try to match the behaviour of a POSIX-compliant shell by reliably splitting up a user's input into multiple commands. In the first case I presented (no escape character)

[issue36897] shlex doesn't differentiate escaped characters in output

2019-05-13 Thread Matthew Gamble
Matthew Gamble added the comment: My apologies, I didn't realise you were talking about the invalid escape sequence. Thanks for letting me know about the fact that it's deprecated, I'll definitely be keeping that in mind going forward. In a bash shell with the find command

[issue36468] Treeview: wrong color change

2019-05-16 Thread Matthew Barnett
Matthew Barnett added the comment: I've just come across the same problem. For future reference, adding the following code before using a Treeview widget will fix the problem: def fixed_map(option): # Fix for setting text colour for Tkinter 8.6.9 # From: https://core.tcl.tk/tk

[issue32982] Parse out invisible Unicode characters?

2018-03-02 Thread Matthew Barnett
Matthew Barnett added the comment: For the record, '\u200e' is '\N{LEFT-TO-RIGHT MARK}'. -- nosy: +mrabarnett ___ Python tracker <https://bug

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matthew Rocklin
Matthew Rocklin added the comment: I agree that this is a common issue. We see it both when people use batch schedulers as well as when people use Docker containers. I don't have enough experience with batch schedulers to verify that NCPUS is commonly set. I would encourage people to

[issue33302] The search for pyvenv.cfg doesn't match PEP 405

2018-04-17 Thread Matthew Woodcraft
New submission from Matthew Woodcraft : PEP 405 says that the pyvenv.cfg file is found as follows: « a pyvenv.cfg file is found either adjacent to the Python executable or one directory above it (if the executable is a symlink, it is not dereferenced), » But in cpython if the executable is a

[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2017-09-25 Thread Matthew Woodcraft
Matthew Woodcraft added the comment: I've investigated a bit more. First, I've tried with Python 3.7.0a1 . As you'd expect, PEP 537 means this behaviour now also occurs when no locale environment variables at all are set. Second, I've looked through locale.py a bit. I b

[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2017-09-25 Thread Matthew Woodcraft
Matthew Woodcraft added the comment: (For PEP 537 please read PEP 538, sorry) -- ___ Python tracker <https://bugs.python.org/issue30755> ___ ___ Python-bugs-list m

[issue30767] logging must check exc_info correctly

2017-10-04 Thread Matthew Patton
Change by Matthew Patton : -- keywords: +patch pull_requests: +3863 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue30767> ___ ___ Py

[issue31763] Add TRACE level to the logging module

2017-10-11 Thread Matthew Patton
New submission from Matthew Patton : This was inspired by 31732. The logging module has 5 log levels: CRITICAL, ERROR, WARNING, INFO, DEBUG per https://docs.python.org/dev/library/logging.html#logging-levels However syslog(3) has for decades defined NOTICE and I can't think of a good r

[issue31763] Add NOTICE level to the logging module

2017-10-11 Thread Matthew Patton
Change by Matthew Patton : -- keywords: +patch pull_requests: +3932 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31763> ___ ___ Py

[issue30767] logging must check exc_info correctly

2017-10-11 Thread Matthew Patton
Change by Matthew Patton : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue30767> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30767] logging must check exc_info correctly

2017-10-11 Thread Matthew Patton
Change by Matthew Patton : -- nosy: +mp5023 ___ Python tracker <https://bugs.python.org/issue30767> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31759] re wont recover nor fail on runaway regular expression

2017-10-11 Thread Matthew Barnett
Matthew Barnett added the comment: You shouldn't assume that just because it takes a long time on one implementation that it'll take a long time on all of the others, because it's sometimes possible to include additional checks to reduce the problem. (I doubt you could elimin

[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton
Matthew Patton added the comment: "exc_info which, if it does not evaluate as false", so we provide '1' or 'True'. The IF passes and immediately the formatter tries to dereference it blindly assuming it's Tuple and throws an Exception. Either the Formatter

[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton
Matthew Patton added the comment: Additionally (probably should have separate PR) the _checkLevel was full of holes. First, it's allowing any Integer which if you're claiming to "check" things is rather silly. At least bounds-check it to GE to NOTSET and LE to CRITICAL (

[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton
Matthew Patton added the comment: And the reason to stomp on the "Level " is because by not doing so the message that is a single field (regex/awk) has been converted non-deterministically into two. This is very bad behavior. If emitting the string/int as-is looks wrong then &q

[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton
Matthew Patton added the comment: I believe this diff addresses the failure of formatException() to check it's parameter's datatype. I still maintain this should be re-opened since it's guaranteed to raise an exception when someone sets 'exc_info=TruthyValue' in k

[issue31763] Add NOTICE level to the logging module

2017-10-12 Thread Matthew Patton
Matthew Patton added the comment: syslog(3) is cited in the code as inspiration and has been the goto definition for logging levels for 40 years across many, many projects. NOTICE is incredibly useful especially to those of us who are sysadmins. Why would Python not implement the full suite

[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton
Change by Matthew Patton : -- pull_requests: +3950 ___ Python tracker <https://bugs.python.org/issue30767> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30767] logging must check exc_info correctly

2017-10-13 Thread Matthew Patton
Matthew Patton added the comment: I've triggered it which is why I looked for the problem and offered the defensive patch. As API writers you can NEVER assume your parameters are what you think they should be and just blindly pr

[issue31759] re wont recover nor fail on runaway regular expression

2017-10-13 Thread Matthew Barnett
Matthew Barnett added the comment: @Tim: the regex module includes some extra checks to reduce the chance of excessive backtracking. In the case of the OP's example, they seem to be working. However, it's difficult to know when adding such checks will help, and your example is one

[issue31308] forkserver process isn't re-launched if it died

2017-10-16 Thread Matthew Rocklin
Matthew Rocklin added the comment: >From a user's perspective I would definitely appreciate forkserver being >protected from SIGINT. This bug affects me in practice. If the forkserver >goes down I personally have no objection to it restarting automatically, >though I appre

[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Matthew Barnett
Matthew Barnett added the comment: @Victor: True, people often ignore DeprecationWarning anyway, but that's their problem, at least you can say "well, you were warned". They might not have read the documentation on it recently because they have not felt the need to read

[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Matthew Barnett
Matthew Barnett added the comment: Your verbose examples put the pattern into raw triple-quoted strings, which is OK, but their first character is a backslash, which makes the next character (a newline) an escaped literal whitespace character. Escaped whitespace is significant in a verbose

[issue31969] re.groups() is not checking the arguments

2017-11-08 Thread Matthew Barnett
Matthew Barnett added the comment: @Narendra: The argument, if provided, is merely a default. Checking whether it _could_ be used would not be straightforward, and raising an exception if it would never be used would have little, if any, benefit. It's not a bug, and it's not wort

[issue25054] Capturing start of line '^'

2017-12-02 Thread Matthew Barnett
Matthew Barnett added the comment: The pattern: \b|:+ will match a word boundary (zero-width) before colons, so if there's a word followed by colons, finditer will find the boundary and then the colons. You _can_ get a zero-width match (ZWM) joined to the start of a nonzero-width

[issue25054] Capturing start of line '^'

2017-12-02 Thread Matthew Barnett
Matthew Barnett added the comment: findall() and finditer() consist of multiple uses of search(), basically, as do sub() and split(), so we want the same rule to apply to them all. -- ___ Python tracker <https://bugs.python.org/issue25

[issue32224] socket.creaet_connection needs to support full IPv6 argument

2017-12-05 Thread Matthew Stoltenberg
New submission from Matthew Stoltenberg : The following causes a ValueError in the create_connection convenience function import socket sock1 = socket.create_connection(('::1', '80')) sock2 = socket.create_connection(sock1.getpeername()) -- components: Library (L

[issue32224] socket.create_connection needs to support full IPv6 argument

2017-12-05 Thread Matthew Stoltenberg
Change by Matthew Stoltenberg : -- title: socket.creaet_connection needs to support full IPv6 argument -> socket.create_connection needs to support full IPv6 argument ___ Python tracker <https://bugs.python.org/issu

[issue32224] socket.create_connection needs to support full IPv6 argument

2017-12-06 Thread Matthew Stoltenberg
Matthew Stoltenberg added the comment: The naive change is to have the host, port tuple assignment use only the first two values from address. I can open a PR with that change (and update the docstring for the function) if that's the right change. For reference, the python socke

<    1   2   3   4   5   6   7   8   9   >