[issue22817] re.split fails with lookahead/behind

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is possible to change this behavior (see example patch). With this patch: >>> re.split(r'(?<=CA)(?=GCTG)', 'ACGTCAGCTGAAAAGCTGACGTACGT') ['ACGTCA', 'GCTGAAAA', 'GCTGACGTACGT'] >>> re.split(r'\b', "the quick, brown fox") ['', 'the', ' ', 'quick', ',

[issue22789] Compress the marshalled data in PYC files

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Compressing pyc files one by one wouldn't save much space because disk space is allocated by blocks (up to 32 KiB on FAT32). If the size of pyc file is less than block size, we will not gain anything. ZIP file has advantage due more compact packing of files.

[issue22817] re.split fails with lookahead/behind

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Previous attempts to solve this issue: issue852532, issue988761, issue3262. -- ___ Python tracker ___

[issue22789] Compress the marshalled data in PYC files

2014-11-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 08.11.2014 10:28, Serhiy Storchaka wrote: > Compressing pyc files one by one wouldn't save much space because disk space > is allocated by blocks (up to 32 KiB on FAT32). If the size of pyc file is > less than block size, we will not gain anything. ZIP f

[issue22818] Deprecate splitting on possible zero-width re patterns

2014-11-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now re.split doesn't split with zero-width regex. There are a number of issues for this (issue852532, issue988761, issue3262, issue22817). This is definitely a bug, but fixing this bug will likely break existing code which use regular expressions which

[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Edward K. Ream
New submission from Edward K. Ream: In Python3.2 xml.sax.saxutils.XMLGenerator.__init__ succeeds if the "out" keyword argument is not given and sys.stdout is None, which will typically be the case when using pythonw.exe. Alas, on Python3.4, the ctor throws an exception in this case. This is a

[issue22820] RESTART line with no output

2014-11-08 Thread Edward Alexander
New submission from Edward Alexander: Whenever i run my code on Python IDLE editor, the output is as follows: == RESTART I am a newbie,it seems i cannot move from this point . This is my code: def convert_to_celsius(fahrenheit): re

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

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is my (slowly implemented) plan: 0. Recommend regex as advanced replacement of re (issue22594). 1. Fix all obvious bugs in the re module if this doesn't break backward compatibility (issue12728, issue14260, and many already closed issues). 2. Deprecate

[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In any case XMLGenerator is not usable if the "out" keyword argument is not given and sys.stdout is None. Just the exception will be raised later. I consider early failure as a feature, not a bug. -- nosy: +serhiy.storchaka _

[issue3511] Incorrect charset range handling with ignore case flag?

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed in issue17381 (which has more realistic example than [9-A]). -- nosy: +serhiy.storchaka resolution: wont fix -> duplicate superseder: -> IGNORECASE breaks unicode literal range matching ___ Python tracker

[issue433028] SRE: (?flag:...) is not supported

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that they'd be nice. The regex module is too advanced and need much work and some transitional period for including in the stdlib, but this feature can be implemented right now. -- assignee: effbot -> serhiy.storchaka nosy: +serhiy.storchaka

[issue433027] SRE: (?-flag) is not supported.

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think issue433028 supersedes this and looks more preferable. No need to implement several ways to do same things. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue433024] SRE: (?flag) isn't properly scoped

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue22493. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list maili

[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread R. David Murray
R. David Murray added the comment: Agreed. I was going to ask what it was that 3.2 did that was useful. -- nosy: +r.david.murray ___ Python tracker ___ _

[issue22820] RESTART line with no output

2014-11-08 Thread R. David Murray
R. David Murray added the comment: Your code doesn't produce any output (ie: there are no print calls). I don't use Idle myself, but I'm guessing that is why you don't see anything after the restart line. If that is the case, do you see a place in whatever help or documentation you have read

[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: FYI the code was changed in issue1470548. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue1282] re module needs to support bytes / memoryview well

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually non-hashable patterns are not supported. >>> re.match(bytearray(b'.'), b'x') Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/re.py", line 163, in match return _compile(pattern, flags).match(string) F

[issue1708652] Exact matching

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Was implemented as fullmatch() in issue16203. -- nosy: +serhiy.storchaka resolution: rejected -> duplicate superseder: -> Proposal: add re.fullmatch() method ___ Python tracker

[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-11-08 Thread Brett Cannon
Brett Cannon added the comment: So I disagree that the code needs to be tweaked before converting to Argument Clinic. If the Clinic conversion is not adding to the problem then the code churn is just going to make applying this patch that much harder. Thanks for the code review regardless, tho

[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If first convert to Argument Clinic then fixing bugs will be much harder. -- ___ Python tracker ___ __

[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: About argument names. You have changed argument names and docstrings in any case (e.g. was "op", now "code"). Why not conform with standard documentation? This wouldn't add additional code churn if change it now. But will add if change it later. --

[issue1610654] cgi.py multipart/form-data

2014-11-08 Thread Rishi
Rishi added the comment: Hi, I have created a new patch with a small design change. The change is that in situations where I don't find the boundary instead of keeping the last x bytes in the buffer I simply drain the whole data and call a readline(). This seems like the right thing to do also

[issue22821] Argument of wrong type is passed to fcntl()

2014-11-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Arguments of wrong type is passed to C function fcntl() in the fcntl module. Third argument of fcntl() should be either pointer to binary structure or C int. But C long is passed instead. All works on platforms where sizeof(long) == sizeof(int) or on littl

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

2014-11-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here is my (slowly implemented) plan: Exciting. Perhaps you should post your plan on python-dev. In any case, huge thanks for your work on the re module. -- ___ Python tracker _

[issue22821] Argument of wrong type is passed to fcntl()

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. It is much easier than I expected. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file37150/fcntl_arg_type.patch ___ Python tracker

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be atomic grouping or possessive quantifiers (issue433030) will help with this issue. -- ___ Python tracker ___ _

[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask

2014-11-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.5 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22434] Use named constants internally in the re module

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please make a review of any patch Antoine? This would help me to debug re engine. It doesn't matter which patch apply, with good chance all this will be changed before 3.5 release and may be not once. -- ___

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

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Exciting. Perhaps you should post your plan on python-dev. Thank you Antoine. I think all interested core developers are already aware about this issue. A disadvantage of posting on python-dev is that this would require manually copy links and may be title

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

2014-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: So you are suggesting to fix bugs in re to make it closer to regex, and then replace re with a forked subset of regex that doesn't include advanced features, or just to fix/improve re until it matches the behavior of regex? If you are suggesting the former, I wou

[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask

2014-11-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: The doc is unhelpful on this, but looking at the implementation and tests, only a prefix length is allowed, not an expanded netmask. This would therefore be a feature request. -- type: behavior -> enhancement versions: -Python 3.4 ___

[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask

2014-11-08 Thread Chris PeBenito
Chris PeBenito added the comment: That's unfortunate. The library provides factory functions so v4 and v6 addresses/networks are easily handled together, and yet it seems to have been overlooked that you can do this: ipaddress.ip_network('192.168.1.0/255.255.255.0') but not this: ipaddress.

[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask

2014-11-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't know enough about IPv6 to give more insight (perhaps Peter Moody can answer), but the tests have this comment: # We only support CIDR for IPv6, because expanded netmasks are not # standard notation. -- ___

[issue22822] IPv6Network constructor docs incorrect about valid input

2014-11-08 Thread Chris PeBenito
New submission from Chris PeBenito: Here: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network In the constructor documentation, item 1 says: """ A string consisting of an IP address and an optional mask, separated by a slash (/). The IP address is the network address, and t

[issue1282] re module needs to support bytes / memoryview well

2014-11-08 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I don't see a reason why the *pattern* should be a bytearray or memoryview, only the string it is searching. But if you fixed it by casting it to bytes I won't stop you. :-) -- ___ Python tracker

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

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > So you are suggesting to fix bugs in re to make it closer to regex, and then > replace re with a forked subset of regex that doesn't include advanced > features, or just to fix/improve re until it matches the behavior of regex? Depends on what will be easier

[issue1282] re module needs to support bytes / memoryview well

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is easy to fix with small (but non zero) cost, but I don't see a reason too. So I don't reopen this issue. -- ___ Python tracker ___ __

[issue22695] open() declared deprecated in python 3 docs

2014-11-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9001298e3094 by Berker Peksag in branch '3.4': Issue #22695: Fix rendering of the deprecated-removed role in HTML. https://hg.python.org/cpython/rev/9001298e3094 New changeset ec81edc30221 by Berker Peksag in branch 'default': Issue #22695: Fix rend

[issue22695] open() declared deprecated in python 3 docs

2014-11-08 Thread Berker Peksag
Berker Peksag added the comment: Fixed. Thanks for the reviews. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ __

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

2014-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: Ok, regardless of what will happen, increasing test coverage is a worthy goal. We might start by looking at the regex test suite to see if we can import some tests from there. -- ___ Python tracker

[issue22434] Use named constants internally in the re module

2014-11-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I reviewed re_named_consts.patch and it looks great (I especially like the removal of superfluous OPCODES dictionary lookups and improved repr for the integer codes). Since the op codes are singletons, you can use identity tests instead of equality checks

[issue22434] Use named constants internally in the re module

2014-11-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +effbot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue22823] Use set literals instead of creating a set from a list

2014-11-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: There are many places where the old-style of creating a set from a list still persists. The literal notation is idiomatic, cleaner looking, and faster. Here's a typical change: diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py --- a/Lib/sre_compi

[issue22824] Update reprlib to use set literals

2014-11-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: Currently reprlib outputs: >>> reprlib.repr(set('supercalifragilisticexpialidocious')) "set(['a', 'c', 'd', 'e', 'f', 'g', ...])" This should be: "{'a', 'c', 'd', 'e', 'f', 'g', ...}" -- keywords: easy messages: 230880 nosy: rhettinge

[issue22824] Update reprlib to use set literals

2014-11-08 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue22824] Update reprlib to use set literals

2014-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Library (Lib) nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-b

[issue22823] Use set literals instead of creating a set from a list

2014-11-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note, to keep the tests stable, nothing in Lib/tests should be changed. Any update should target the rest of Lib and Doc. -- ___ Python tracker ___

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-08 Thread Akira Li
Akira Li added the comment: >>> from datetime import datetime, timezone >>> datetime.fromtimestamp(0, timezone.utc) datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc) already works and it is documented [1] [1] https://docs.python.org/3/library/datetime.html#datetime.datetime

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I personally wish we could deprecate utcfromtimestamp. With timezone.utc in stdlib and being a singleton there is no reason to put UTC time in naive datetime instances. -- ___ Python tracker

[issue22823] Use set literals instead of creating a set from a list

2014-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-08 Thread INADA Naoki
INADA Naoki added the comment: akira: It seems cleaner than utcfromtimestamp().replace(). I think utcfromtimestamp() should have note about it. """ Note that it returns **naive** (tz=None) datetime. Naive datetime is treated as localtime in most functions. If you want to create aware datetime,