[issue7940] re.finditer and re.findall should support negative end positions

2013-05-23 Thread Matthew Barnett
Matthew Barnett added the comment: Yes. As msg99456 suggests, I fixed it the my source code before posting. Compare re in Python 3.3.2: >>> re.compile('x').findall('', 1, 3) ['x', 'x'] >>> re.compile('x').findall('x

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

2014-10-09 Thread Matthew Barnett
Matthew Barnett added the comment: I think the simplest and clearest approach from the user's point of view is just to deprecate inline flags that are not at the start of the pattern. In practice, they almost invariably occur at the start anyway, although I do remember once seeing a pa

[issue22645] Unable to install Python 3.4.2 amd64 on Windows 8.1 Update 1

2014-10-16 Thread Matthew Barnett
Matthew Barnett added the comment: I've just come across the same problem. I uninstalled Python 3.4.1 amd64. There were other things installed in that version, so some stuff remained. I then tried to install Python 3.4.2 amd64, but it failed (same problem as Zac). I ran the Python

[issue22645] Unable to install Python 3.4.2 amd64 on Windows 8.1 Update 1

2014-10-18 Thread Matthew Barnett
Matthew Barnett added the comment: @Terry: Just to clarify, I didn't have a problem installing over Python 3.4.1, only with uninstalling Python 3.4.1 (with other stuff installed there) and then installing Python 3.4.2. -- ___ Python tracker

[issue2636] Adding a new regex module (compatible with re)

2014-11-13 Thread Matthew Barnett
Matthew Barnett added the comment: @Mateon1: "I hope it's fixed"? Did you report it? -- ___ Python tracker <http://bugs.python.org/issue2636> ___ ___

[issue2636] Adding a new regex module (compatible with re)

2014-11-14 Thread Matthew Barnett
Matthew Barnett added the comment: The page on PyPI says where the project's homepage is located: Home Page: https://code.google.com/p/mrab-regex-hg/ The bug was fixed in the last release. -- ___ Python tracker <http://bugs.python.org/i

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: I notice that it puts the inline flags at the end. It would be better to put them at the start. -- ___ Python tracker <http://bugs.python.org/issue22

[issue20413] Errors in documentation of standard codec error handlers

2015-02-06 Thread Matthew Barnett
Matthew Barnett added the comment: The docs for Python 3.5.0a0 still say "Unicode Private Use Area". -- nosy: +mrabarnett versions: +Python 3.5 ___ Python tracker <http://bugs.python.o

[issue22364] Improve some re error messages using regex for hints

2015-02-18 Thread Matthew Barnett
Matthew Barnett added the comment: Some error messages use the indefinite article: "expected a bytes-like object, %.200s found" "cannot use a bytes pattern on a string-like object" "cannot use a string pattern on a bytes-like object" but others don

[issue24385] libpython27.a in python-2.7.10 i386 (windows msi release) contains 64-bit objects

2015-06-04 Thread Matthew Barnett
Matthew Barnett added the comment: Here's how I can build the regex module on Windows 8.1, 64-bit, using only MinGW64. For Python 3.5, I can link against "python35.dll", but for earlier versions, including Python 2.7, I need "libpython??.a". I have built regex

[issue24385] libpython27.a in python-2.7.10 i386 (windows msi release) contains 64-bit objects

2015-06-08 Thread Matthew Barnett
Matthew Barnett added the comment: @steve.dower: Yes. For Python 35, it appears that it'll link to libpython??.a or python??.dll, whichever it finds in the given folder, so it doesn't actually need libpython??.a anymore. Whi

[issue24454] Improve the usability of the match object named group API

2015-06-15 Thread Matthew Barnett
Matthew Barnett added the comment: I agree that it would be nice if len(mo) == len(mo.groups()), but Serhiy has explained why that's not the case in the regex module. The regex module does support mo[name], so: print('Located coordinate at (%(row)s, %(col)s)' % mo)

[issue24555] Python logic error when deal with re and muti-threading

2015-07-03 Thread Matthew Barnett
Matthew Barnett added the comment: Your regex is a pathological case: it suffers from catastrophic backtracking and can take a long time to finish. The other problem is that the re module never releases the GIL, so while it's performing the search in the low-level C code, other Python th

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Matthew Barnett
Matthew Barnett added the comment: "not" has a lower priority than unary "-"; this: not a < b is parsed as: not (a < b) How would you parse: 0 + not 0 + 0 ? Would it be parsed as: 0 + not (0 + 0) ? Similar remarks could apply to "yield&qu

[issue24636] re.search not respecting anchor markers in or-ed construction

2015-07-15 Thread Matthew Barnett
Matthew Barnett added the comment: The or-ed patterns aren't between the anchors. The ^ is at the start of the first alternative and the $ is at the end of the last alternative. -- ___ Python tracker <http://bugs.python.org/is

[issue24642] Will there be an MSI installer?

2015-07-16 Thread Matthew Barnett
Matthew Barnett added the comment: There's an "executable installer"; it's a .exe instead of a .msi. -- nosy: +mrabarnett ___ Python tracker <http://bug

[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread Matthew Barnett
New submission from Matthew Barnett: I'm unable to import tkinter in Python 3.5.0rc1. The console says: C:\Python35>python Python 3.5.0rc1 (v3.5.0rc1:1a58b1227501, Aug 10 2015, 05:18:45) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits&q

[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread Matthew Barnett
Matthew Barnett added the comment: Yes, I can confirm that that works for me. -- ___ Python tracker <http://bugs.python.org/issue24847> ___ ___ Python-bugs-list m

[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-15 Thread Matthew Barnett
Matthew Barnett added the comment: On running the installer, Windows reports: """Windows SmartScreen prevented an unrecognised application from starting. Running this application might put your PC at risk. Application: Python-24847-2.exe Publisher: Unknown Publisher"

[issue25054] Capturing start of line '^'

2015-09-10 Thread Matthew Barnett
Matthew Barnett added the comment: After matching '^', it advances so that it won't find the same match again (and again and again...). Unfortunately, that means that it sometimes misses some matches. It's a known issue. -- __

[issue25054] Capturing start of line '^'

2015-09-10 Thread Matthew Barnett
Matthew Barnett added the comment: Just to confirm, it _is_ a bug. It tries to avoid getting stuck, but the way it does that causes it to skip a character, sometimes missing a match it should have found. -- ___ Python tracker <h

[issue25581] Python -U raises error during site import

2015-11-07 Thread Matthew Barnett
Matthew Barnett added the comment: So, you write a string literal without a 'u' (or 'b') prefix, and there's no 'from __future__ import unicode_literals' in the module, so you expect it to be a bytestring, but it's not, it's a Unicode str

[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Matthew Barnett
Matthew Barnett added the comment: I'm going to have to agree with ThiefMaster. String literals don't truncate like that, nor do lists, nor tuples. Are there any similar cases of truncation elsewhere in the standard library? -- ___ Pyth

[issue26354] re.I does not work as expected

2016-02-12 Thread Matthew Barnett
Matthew Barnett added the comment: The 4th argument of re.sub is the count, not the flags. Not a bug. -- ___ Python tracker <http://bugs.python.org/issue26

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The pattern '\', which is the same as '', matches the string '', and that is replaced with ''. -- ___ Python tra

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The 3rd argument is the count (the maximum number of replacements, although 0 means no limit, not no replacements). You're passing in the flag re.I instead. re.I happens to have the numeric value 2, so you're telling it to do no more than 2 re

[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Matthew Barnett
Changes by Matthew Barnett : -- nosy: -mrabarnett ___ Python tracker <http://bugs.python.org/issue24557> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Matthew Barnett
Matthew Barnett added the comment: @Mark is correct, it's not a bug. In the first example: It tries to match each alternative at position 0. Failure. It tries to match each alternative at position 1. Failure. It tries to match each alternative at position 2. Failure. It tries to match

[issue23532] add example of 'first match wins' to regex "|" documentation?

2015-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: Not quite all. POSIX regexes will always look for the longest match, so the order of the alternatives doesn't matter, i.e. x|xy would give the same result as xy|x. -- ___ Python tracker <http://bugs.py

[issue23541] Re module's match() fails to halt on a particular input

2015-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: The problem is with the "(\w+\s*)+". \s* can match an empty string, so when matching a word it's like "(\w+)+". If you have n letters, there are 2**n ways it could match, and if what follows never matches, it'll try all of them.

[issue24071] Python 2.7.8, 2.7.9 re.MULTILINE failure

2015-04-28 Thread Matthew Barnett
Matthew Barnett added the comment: The 4th argument of re.sub is the maximum count (0 means unlimited). >>> help(re.sub) Help on function sub in module re: sub(pattern, repl, string, count=0, flags=0) Return the string obtained by replacing the leftmost non-overlapping occur

[issue16991] Add OrderedDict written in C

2015-05-21 Thread Matthew Barnett
Matthew Barnett added the comment: FTR, in "_odict_resize" there's this: size_t i = _odict_get_index(od, _odictnode_KEY(node)); if (i < 0) { Note that "i" is declared as unsigned and then tested whether it's negati

[issue16991] Add OrderedDict written in C

2015-05-23 Thread Matthew Barnett
Matthew Barnett added the comment: In "odict_new", if "_odict_initialize" fails, will the dict pointed to by "od_inst_dict" be deallocated? In "odictiter_new", there's "Py_INCREF(od);".

[issue16991] Add OrderedDict written in C

2015-05-24 Thread Matthew Barnett
Matthew Barnett added the comment: First some background: when you put a new entry into a dict, it looks for an empty slot, the key's hash determining the initial choice, but if that slot's occupied, it picks another, etc, so the key might not be in the slot of first c

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

2016-09-15 Thread Matthew Barnett
Matthew Barnett added the comment: @Tim: Why are you using re.search with '^'? Does the pattern that's passed in ever contain '(?m)'? If not, re.match without '^' is better. -- ___ Python tracker

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

2016-09-15 Thread Matthew Barnett
Matthew Barnett added the comment: I downloaded Python 3.6.0b1 not long after it was released and it works for me: >>> re.match('(?i:CaseInsensitive)', 'caseinsensitive') <_sre.SRE_Match object; span=(0, 15), match='caseinsensitive'> -- _

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Matthew Barnett
Matthew Barnett added the comment: I'd prefer an explicit suppression to changing a long-standing behaviour. -- ___ Python tracker <http://bugs.python.org/is

[issue26656] Documentation for re.compile is a bit outdated

2016-10-23 Thread Matthew Barnett
Matthew Barnett added the comment: @Sworddragon: Your post says that it should be more generic or complete the list, but it doesn't make a suggestion as to what it should _actually_ say. Example: "Compile a regular expression pattern into a regular expression object, which can b

[issue28642] csv reader loosing rows with big files and tab delimiter

2016-11-08 Thread Matthew Barnett
Matthew Barnett added the comment: I split the file into sections, each containing no more 1000 lines, and tried reading each section. Attached is a zip file of those that didn't return the expected number of rows. The problem appears to be due to unclosed quotes, which cause following

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Matthew Barnett
Matthew Barnett added the comment: I hope you make it clear what you mean by 'equal', i.e. that it's comparing the pattern and the flags (AFAICT), so re.compile('(?x)a') != re.compile('(?x) a '). -- ___ Pyth

[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-11-22 Thread Matthew Barnett
Matthew Barnett added the comment: @Barry: repl already supports some escapes, e.g. \g for named groups, although not \xXX et al, so deprecating unknown escapes like in the pattern makes sense to me. BTW, the regex module already supports \xXX, \N{XXX}, etc

<    1   2   3   4   5   6