[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.

[issue6818] remove/delete method for zipfile/tarfile objects

2015-04-09 Thread Matthew Gamble
Matthew Gamble added the comment: Hi, I've recently been working on a Python module for the Adobe universal container format (UCF) which extends the zip specification - as part of this I wanted to be able to remove and rename files in an archive. I discovered this issue when writin

[issue6818] remove/delete method for zipfile/tarfile objects

2015-04-09 Thread Matthew Gamble
Changes by Matthew Gamble : Added file: http://bugs.python.org/file38879/zip_hiddenfiles.zip ___ Python tracker <http://bugs.python.org/issue6818> ___ ___ Python-bug

[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

[issue24231] os.makedirs('/', exist_ok=True) fails on Darwin

2015-05-18 Thread Matthew Wedgwood
New submission from Matthew Wedgwood: On Darwin, os.mkdir('/') raises IsADirectory. On Linux, the same call raises FileExistsError. The implementation for os.makedirs() in Python 3.2+ checks only for the latter when evaluating the exists_ok parameter. This causes os.makedirs(&#x

[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

[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2016-09-09 Thread Matthew Jacobi
Matthew Jacobi added the comment: Is there a workaround for this for people on python2? Would installing https://pypi.python.org/pypi/email/6.0.0a1 fix it? > testing release of email6 > This is a standalone version of the version of email package that will ship > with Python

[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

[issue46220] imaplib.py "select" mailbox names containing spaces.

2022-01-01 Thread Matthew H. McKenzie
New submission from Matthew H. McKenzie : A mailbox (folder) need not be for a recipient and need not be the private part of an RFC2822 address. Passing a value of "000 Bookings" to select() results in validation issues when the tokens are parsed as arguments and there are too

[issue6407] multiprocessing Pool should allow custom task queue

2010-10-24 Thread Matthew Leon Grinshpun
Matthew Leon Grinshpun added the comment: I should be able to do this in November. For the moment I'm a bit busy. -- ___ Python tracker <http://bugs.python.org/i

[issue11153] urllib2 basic auth parser handle unquoted realm in WWW-Authenticate header

2011-02-08 Thread Matthew M. Boedicker
New submission from Matthew M. Boedicker : I am working with a web server that does not quote the realm in the WWW-Authenticate header. This patch will make the realm parsing handle unquoted realm as well as some other invalid variations. I tried doing it by modifying the regex only but

[issue11153] urllib2 basic auth parser handle unquoted realm in WWW-Authenticate header

2011-02-08 Thread Matthew M. Boedicker
Changes by Matthew M. Boedicker : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue11153> ___ ___ Python-bugs-list mailing list Unsubscri

[issue39658] Include user scripts folder to PATH on Windows

2021-07-26 Thread Matthew Morrissette Vance
Change by Matthew Morrissette Vance : -- nosy: +yinzara ___ Python tracker <https://bugs.python.org/issue39658> ___ ___ Python-bugs-list mailing list Unsub

[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines

2021-11-07 Thread Matthew H. McKenzie
New submission from Matthew H. McKenzie : Lib/ftplib.py function retrlines Inspired by documentation the following writes a file without line-endings: from ftplib import FTP ftp=FTP() ftp.connect('hostname') ftp.login('user','') ftp.sendcmd('pasv&#

[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines

2021-11-07 Thread Matthew H. McKenzie
Matthew H. McKenzie added the comment: On the face of it it is my mistake for using the write method for my file. But read on. your write_line() adds an EOL, OK, because it wraps print(). So the retrlines() function strips them in anticipation? The error is arguably in my own code as I

[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines

2021-11-07 Thread Matthew H. McKenzie
Matthew H. McKenzie added the comment: To answer your original questions : Linux Host and Client, amd MVS (EBCDIC records) to Linux. hacks to overcome (in libftp): def print_line(line): '''Default retrlines callback to print a line.''' print(line, end

[issue6407] multiprocessing Pool should allow custom task queue

2009-07-03 Thread Matthew Leon Grinshpun
New submission from Matthew Leon Grinshpun : Multiprocessing's Pool class __init__ method is written in a way that makes it very difficult for a subclass to modify self._taskqueue. There are very good reasons for wanting to do this - ie, making the taskqueue block when it reaches a certain

[issue6407] multiprocessing Pool should allow custom task queue

2009-07-03 Thread Matthew Leon Grinshpun
Matthew Leon Grinshpun added the comment: I have attached a patch. All I did was shift the one line from __init__ to _setup_queues. That's it. You could take advantage of the change in the following way: class BlockingPool(pool.Pool): def _setup_queues(self): pool

[issue28244] Incorrect Example in itertools.product description

2016-09-21 Thread Matthew Ekstrand-Abueg
New submission from Matthew Ekstrand-Abueg: Documentation states: # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 But: >>> list(itertools.product('ABCD','xy')) [(

<    4   5   6   7   8   9