New submission from Matthew Smart :
The 'license' meta-data option is not listed under:
http://docs.python.org/distutils/setupscript.html#meta-data
There are others, too, from:
$ python setup.py --help
.. snip ..
Information display options (just display information, ignore an
Matthew Barnett added the comment:
It includes Unicode character properties, but not the Unicode script
identification, because the Python Unicode database contains the former
but not the latter.
Although they could be added to the re module, IMHO their proper place
is in the Unicode database
Matthew Barnett added the comment:
I've just found that:
[1] + foo()
crashes, but:
[1].__add__(foo())
gives:
Traceback (most recent call last):
File "", line 1, in
[1].__add__(foo())
TypeError: can only concatenate list (not "foo")
Matthew Barnett added the comment:
Re: msg107776.
If it looks like an integer (ie, can be converted to an integer by 'int') then
it's positional, otherwise it's a key. An optimisation is to perform a quick
check upfront to see whether it st
Matthew Barnett added the comment:
That's a good question. :-)
Possibly just an optional sign followed by one or more digits.
Another possibility that occurs to me is for it to default to positional if it
looks like an integer, but allow quoting to force it to be a key:
>>>
Matthew Barnett added the comment:
Your original:
"{0[-1]}".format('fox')
is a worse gotcha than:
"{-1}".format('fox')
because you're much less likely to want to do the latter.
It's one of those things that it would be nice to
Matthew Barnett added the comment:
Issue #2636 resulted in the new regex module (also available on PyPI), so this
issue is addressed by that, but there's no patch for the re module.
--
___
Python tracker
<http://bugs.python.org/issu
Matthew Barnett added the comment:
issue2636-20100706.zip is a new version of the regex module.
I've added your examples to the unit tests. The module now passes.
Keep up the good work! :-)
--
Added file: http://bugs.python.org/file17877/issue2636-2010070
Matthew Barnett added the comment:
Should a regex compile if a group is referenced before it's defined?
Consider this:
(?:(?(2)(a)|(b))+
Other regex implementations permit forward references to groups.
BTW, I had a look at the re module, found it too difficult, and so started on
m
Matthew Barnett added the comment:
I started with trying to modify the existing re module, but I wanted to make
too many changes, so in the end I decided to make a clean break and start on a
new implementation which was compatible with the existing re module and which
could replace the
Matthew Barnett added the comment:
The file at:
http://pypi.python.org/pypi/regex
was downloaded 75 times, if that's any help. (Now reset to 0 because of the bug
fix.)
If it's included in 3.2 then there's the question of whether it should replace
the re module an
Matthew Barnett added the comment:
As a crude guide of the speed difference, here's Python 2.6:
re regex
bm_regex_compile.py 86.53secs 260.19secs
bm_regex_effbot.py 13.70secs8.94secs
bm_regex_v8.py 15.66secs9.09secs
Note
Matthew Barnett added the comment:
issue2636-20100709.zip is a new version of the regex module.
I've moved most of the regex module's Python code into a private module.
--
Added file: http://bugs.python.org/file17912/issue2636-20
Matthew Barnett added the comment:
Here's a patch for Python 3.1, if anyone's still interested after 5 years. :-)
--
keywords: +patch
nosy: +mrabarnett
Added file: http://bugs.python.org/file17930/from_template.diff
___
Python trac
Matthew Barnett added the comment:
issue2636-20100719.zip is a new version of the regex module.
Just a few more tweaks for speed.
--
Added file: http://bugs.python.org/file18054/issue2636-20100719.zip
___
Python tracker
<http://bugs.python.
Matthew Barnett added the comment:
This has already been reported in issue #3511.
--
___
Python tracker
<http://bugs.python.org/issue2636>
___
___
Python-bug
Matthew Barnett added the comment:
issue2636-20100725.zip is a new version of the regex module.
More tweaks for speed.
re regex
bm_regex_compile.py 87.05secs 278.00secs
bm_regex_effbot.py 14.00secs6.58secs
bm_regex_v8.py 16.11secs
Matthew Barnett added the comment:
No.
Wouldn't that break compatibility with 're'?
--
___
Python tracker
<http://bugs.python.org/issue2636>
___
___
Matthew Barnett added the comment:
That's a possibility.
I must admit that I don't entirely understand it enough to implement it (the OP
said "I don't believe that the algorithm for this is a
whole lot more complicated"), and I don't have a need for it myself,
Matthew Barnett added the comment:
(1) would break existing code. It would also mean that you wouldn't have access
to the start and end positions of the matches either.
(2) would also break existing code which is expecting a list. It's like the
change that happened when some met
Matthew Barnett added the comment:
Ah, I see what you mean. I still think you're wrong, though! :-)
The 'for' loop is doing is basically this:
it = re.finditer(r'(\w+):(\w+)', text)
try:
while True:
match_object = next(it)
Matthew Barnett added the comment:
Not a bug.
Python 2 had 'range', which returned a list, and 'xrange', which returned an
xrange object which was iterable:
>>> range(7)
[0, 1, 2, 3, 4, 5, 6]
>>> xrange(7)
xrange(7)
>>> list(xrange(7))
[0, 1, 2
Matthew Barnett added the comment:
So prune would default to None?
None means current behaviour (prune if sep is None else don't prune)
True means prune empty strings
False means don't prune empty string
--
nosy: +mrabarnett
___
Pyth
Matthew Barnett added the comment:
See issue 17087: "Improve the repr for regular expression match objects".
It was decided that it might be a bad idea to show the entire matched portion
of the string because it could be very long, so it's shown truncated if
necessary.
--
Matthew Barnett added the comment:
Probably "...", although we also have to consider that the matched portion
could in fact not be truncated but just happen to end with "...", although that
would be a rare occurrence.
--
___
P
New submission from Jason Matthew:
Fairly new to MSIs here. Working towards extracting the same information which
is available via Orca graphical interfaces.
I believe I've hit a bug within _msi.View class, namely the inability to safely
determine the number of records in my r
Jason Matthew added the comment:
Thanks for pointing that one out Berker. I agree, this is a dup.
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
New submission from Matthew Brett:
The behavior of dict iteration has changed in Python 3.6, in that inserting
keys during iteration has a different and unpredictable affect. For this code:
d = {'foo': 1}
for key in d:
print(key)
d.pop(key)
d[key] = 1
Python 3.5 prints a s
Matthew Brett added the comment:
To clarify from comments on issue 19332:
"""
* The normal rule (not just for Python) is that a data structures have
undefined behavior for mutating while iterating, unless there is a specific
guarantee
"""
The change in
Matthew Barnett added the comment:
I agree with Marco that it shouldn't be too verbose. I'd like to suggest that
it says that it's compatible (i.e. has the same API), but with additional
features.
--
___
Python tracker
<http
Matthew Barnett added the comment:
With the VERSION0 flag (the default behaviour), it should behave the same as
the re module, and that's not going to change.
--
___
Python tracker
<http://bugs.python.org/is
Matthew Barnett added the comment:
Ah, well, if it hasn't changed after this many years, it never will. Expect one
or two changes to the text. :-)
--
___
Python tracker
<http://bugs.python.org/is
Matthew Barnett added the comment:
I'm just wondering whether the problem is just due to the locale's encoding
being UTF-8. The locale support in re really only works with encodings that use
1 byte/character.
--
___
Python trac
Matthew Barnett added the comment:
The report says "== encodings: locale=UTF-8, FS=utf-8".
It says that "test_locale_caching" was skipped, but also that
"test_locale_flag" failed.
--
___
Python tracker
<
New submission from Matthew Hall:
I have some Python code which takes advantage of the ability to prepopulate the
argparse Namespace before passing it to argparse. This allows me to read
sensitive settings such as usernames and passwords from DBs, environment
variables, etc. in addition to
Matthew Tanous added the comment:
It makes sense, except for this case is not true when "x" is an immutable data
type - it appears as though something like [5] * n creates a list of totally
separate elements (even if they start as the same thing).
It is difficult to see a case whe
Matthew Barnett added the comment:
It would be a bug if it was supported but gave the wrong result.
It has never been supported (the re module predates PEP 357), so it's a new
feature.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Matthew Malcomson:
While the itertools.islice(iterator, n, n) trick is useful as used in the
consume recipe, I find the current behaviour if stop is less than start (e.g.
itertools.islice(iterator, 3, 0) ) to be surprising.
It still consumes the first three elements of
New submission from Matthew Gilson:
The man page for python says:
> Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix.
The official documentation
(https://docs.python.org/2/using/cmdline.html#cmdoption-3) does not mention
2to3 at all:
> Warn about Python 3.x po
Matthew Barnett added the comment:
There's a move to treat invalid escape sequences as an error (see issue 27364).
The previous behaviour was to treat them as literals.
The replacement template string contains \d, which is not a valid escape
sequence (it's valid for the pattern, b
Matthew Barnett added the comment:
FTR, I can't reproduce it. This is what I get on Windows XP (32-bit):
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "lice
Matthew Barnett added the comment:
When I tried it, I got matches for both 'match' and 'fullmatch' (output
attached as 'output.txt') as expected.
--
Added file: http://bugs.python.org/file43984/output.txt
___
Python tr
Matthew Barnett added the comment:
Are you using the same version on the other systems?
I've had a quick look through the bug tracker and found some fixes for
fullmatch that postdate Python 3.4.0, so I'll suggest you just update to a more
recent version of
Matthew Barnett added the comment:
"*" and the other quantifiers ("+", "?" and "{...}") operate on the preceding
_item_, not the entire preceding expression. For example, "ab*" means "a"
followed by zero or more repeats of "
New submission from Matthew Porter:
I've got two lists:
state_cns_list = [0.001, 1, 2, 5]
state_names_list = [L, S, D, H]
When I try to create an OrderedDict linking each state_cns_list entry with its
corresponding state_names_list entry, like so:
states = OrderedDict( {float(state_cns
Matthew Porter added the comment:
Ahh nevermind, just realized my error :P Sorry for the waste of internet space
--
___
Python tracker
<http://bugs.python.org/issue17
Matthew Barnett added the comment:
FYI, I did eventually add it to my regex implementation. It was quite
challenging!
--
___
Python tracker
<http://bugs.python.org/issue694
Matthew Barnett added the comment:
This question should've been posted to python-l...@python.org, not here.
Your functions are calling themselves, but not returning the result of the call
to their own callers.
--
___
Python tracker
Matthew Barnett added the comment:
I've attached fnmatch_implementation.py, which is a simple pure-Python
implementation of the fnmatch function.
It's not as susceptible to catastrophic backtracking as the current re-based
one. For example:
fnmatch('a' * 50, '*a*&
Matthew Barnett added the comment:
The way the re handles ranges is to convert the two endpoints to lowercase and
then check whether the lowercase form of the character in the text is in that
range.
For example, [A-Z] is converted to the range [\x41-\x5A], and the lowercase
form of
Matthew Barnett added the comment:
In issue #3511 the range was slightly unusual, so closing it seemed a
reasonable approach, but the range in this issue is less clearly a problem. My
preference would be to fix it, if possible.
--
___
Python
Matthew Barnett added the comment:
The regex behaves the same as re.
The reason it isn't supported is that \0 starts an octal escape sequence.
--
___
Python tracker
<http://bugs.python.org/is
Matthew Barnett added the comment:
I already use it in the regex module for named groups. I don't think it would
ever be a problem in practice because the names are invariably handled as
strings.
--
nosy: +mrabarnett
___
Python tracker
Matthew Barnett added the comment:
It's not a bug.
The documentation says """Split string by the occurrences of pattern. 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."
Matthew Barnett added the comment:
Here are some simpler examples of the bug:
re.compile('.*yz', re.S).findall('xyz')
re.compile('.?yz', re.S).findall('xyz')
re.compile('.+yz', re.S).findall('xyz')
Unfortunately I find it difficult to
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
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
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
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
Matthew Hall added the comment:
I don't think having to call a method with a weird secret underscored name to
update a value in a URL named tuple is very elegant. Neither is creating a
handful of pointless objects to make one simple validator function like the one
I had to code today. I
Matthew Barnett added the comment:
@Mateon1: "I hope it's fixed"? Did you report it?
--
___
Python tracker
<http://bugs.python.org/issue2636>
___
___
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
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
Matthew Brett added the comment:
I think this is a frank bug for Pythons that use MSVC 10+ by default (3.3, 3.4
for example).
The lack of the /MANIFEST flag breaks the
distutils.ccompiler.CCompiler.link_executable command - see attached setup.py
example. The example gives the error
Matthew Brett added the comment:
Steve - did you try my 'setup.py' example; it's standalone, as in `python
setup.py build` will reproduce the error.
This is specifically VS 2010.
It doesn't make any difference for me if I specify an extension or not, so I
don't
Matthew Brett added the comment:
I think the argument previously was that VS 2010 was not the default compiler
for Python 2.7, and so this problem was not important, but I'm happy to be
corrected.
I haven't tried building extensions for Python 2.7 with VS 2010 but I guess the
probl
Matthew Atkinson added the comment:
Hi
I've modified Pierre's patch to apply to the latest 3.5 and 3.4, and made the
most of the simple changes suggested in
http://bugs.python.org/review/11352/#ps4792 . I've also added all the non
internal parameters to the FieldStorage c
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
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
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
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
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)
New submission from Matthew Havard:
The documentation from json.dumps says this about skipkeys:
If ``skipkeys`` is false then ``dict`` keys that are not basic types
(``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
instead of raising a ``TypeError``.
However, that
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
Matthew Havard added the comment:
It's in the actual code in the docstring:
https://hg.python.org/cpython/file/6905a7f8c7ac/Lib/json/__init__.py#l187
I'm really new to Mercurial, so I'm not quite sure how to link to the 2.7
version of the Mercurial repo, but here is the l
Matthew Havard added the comment:
Also, this typo is present in all versions anyway.
--
___
Python tracker
<http://bugs.python.org/issue24540>
___
___
Python-bug
Matthew Havard added the comment:
Great! Glad to be of service.
--
___
Python tracker
<http://bugs.python.org/issue24540>
___
___
Python-bugs-list mailin
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
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
New submission from Matthew Keeter:
The C API docs for PyRun_StringFlags, PyEval_EvalCodeEx, and PyEval_EvalCode
say that globals and locals both must be dictionaries. However, digging into
the source [1] shows that locals can be any object implementing the mapping
protocol. Furthermore
Matthew Barnett added the comment:
There's an "executable installer"; it's a .exe instead of a .msi.
--
nosy: +mrabarnett
___
Python tracker
<http://bug
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
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
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"
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.
--
__
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
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
Changes by Matthew Brett :
--
nosy: +Matthew.Brett
___
Python tracker
<http://bugs.python.org/issue25626>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
New submission from Matthew Zipay:
The zipfile.ZipInfo.__init__ method permits several of ZipInfo's slot
attributes to go uninitialized unless the object is obtained from
ZipFile.getinfo() or ZipFile.infolist().
As a result, accessing those attributes (header_offset, CRC, compress_siz
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
Matthew Barnett added the comment:
The pattern '\', which is the same as '', matches the string
'', and that is replaced with ''.
--
___
Python tra
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
New submission from Matthew Ryan:
On Solaris 11.3 (intel tested, but I assume issue is on SPARC as well),
I found the following fails:
import os
os.urandom(2500)
The above throws OSError: [Errno 22] Invalid argument.
It turns out that the Solaris version of getrandom() is limited to
Matthew Ryan added the comment:
The new patch looks fine; I used __sun__ rather than sun out of habit
(C standard requires
system specific macros be in the reserved namespace), but either will work.
I found the original problem through debugging with GDB, so I know
getrandom() was being
called
Matthew Ryan added the comment:
Yes, I've verified that:
* the issue existed in the default branch as of this morning.
* the patch applies cleanly against both 3.5 and default, and
addresses the issue in both branches.
--
___
Python tracker
Changes by Matthew Barnett :
--
nosy: -mrabarnett
___
Python tracker
<http://bugs.python.org/issue24557>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Matthew Tanous:
If I produce a list in this fashion:
l = [[x] * n] * n
I would expect that I would obtain a matrix-like structure. Instead, I get a
list of the *same* list, such that the statement:
l[x][y] = z
would change, in essence, every value in "column"
Matthew Tanous added the comment:
I'm aware that it's how Python works at present. My point was that this is
awkward and counter-intuitive, with no purpose I can see worth serving.
"That's just how it works" seems to me a rather insufficient answer, especially
for
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
701 - 800 of 828 matches
Mail list logo