Jim Jewett added the comment:
That sounds like a good idea, particularly since it is a bit different
from Perl. Please do write up the a clarification.
Typically, I have either attached a file with the suggested wording, or
included it in a comment from which a commiter could cut-and-paste
Jim Jewett added the comment:
I agree with Raymond. A comment *might* be sufficient, but ... in some
sense, that is the purpose of an assert.
The loop is reasonably long; it already includes macros which could
(but currently don't) change the value, and function calls which might
plau
Changes by Jim Baker :
--
nosy: +jbaker
___
Python tracker
<http://bugs.python.org/issue4242>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
Jim Baker added the comment:
Ideally packages should not need to add "optimize=1" to their setup.cfg,
as this currently breaks Jython compatibility. This is because Jython,
including 2.5, does not support the -O flag.
--
nosy: +jbaker
Jim DeLaHunt added the comment:
As the original reporter, I have no objection to closing this old report. It
remains in the historical record. That was its purpose all along. Thank you to
all the bug data maintainers!
--
___
Python tracker
Jim Wygralak added the comment:
DATA:
Just chiming in to report that I'm seeing this issue with the following freshly
installed:
Python 3.10.4
tkinter 8.6.12
PySimpleGUI 4.57.0
OS is Windows 10
As others have report it is related to the cursor entering the tool tip box
before clickin
New submission from Jim Jeon :
When `assert_called_with` is used with mutable object, test fails if the object
has changed. I think this is not what it meant to do.
https://docs.python.org/dev/library/unittest.mock-examples.html#coping-with-mutable-arguments
The same situation is explained
Jim Jeon added the comment:
Thank you all for the kind answers.
I didn't know copying could cause so many problems.
@veky
Thank you for the example.
But it seems that the example will actually raise and I think it should.
I am talking f.assert_called_with(b) when `b` has same values
New submission from Jim Carroll :
While working with codecs.iterdecode(), encountered "can't concat int to
bytes". The source of the problem is BufferedIncrementalDecoder stores it's
internal buffer as a bytes (ie: b""), but decode() can be passed either a
Change by Jim Carroll :
Removed file: https://bugs.python.org/file48661/codecs.patch
___
Python tracker
<https://bugs.python.org/issue38482>
___
___
Python-bugs-list m
Change by Jim Carroll :
Added file: https://bugs.python.org/file48662/codecs.patch
___
Python tracker
<https://bugs.python.org/issue38482>
___
___
Python-bugs-list mailin
Jim Carroll added the comment:
According to the documentation
(https://docs.python.org/3.7/library/codecs.html#codecs.iterdecode), the first
parameter is a bytes object to decode (not an iterable of bytes). Which is also
consistent with it's companion iterencode() which accepts a str o
New submission from Jim Carroll :
The io.TextIOWrapper class initializes a codec.IncrementalEncoder and uses it
to encode str, but it never calls the encoder's encode('', final=True).
According to the docs
https://docs.python.org/3.5/library/codecs.html#codecs.Incrementa
Jim Carroll added the comment:
I understand.
btw; I did a deep dive on cpython codebase, and the only references to
codecs.iterencode()/iterdecode() is in ./Lib/tests/test_codecs.py. I suspect
functions are not used by many people.
The patch I proposed was a three line change that would
New submission from Jim Carroll :
_elementtree.c defines a custom exception 'xml.etree.ElementTree.ParseError'
that inherits from SyntaxError. According to the docs
https://docs.python.org/3/library/exceptions.html#SyntaxError
``Instances of this class have attributes filena
Jim Carroll added the comment:
This patch solves the issue
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index c3f30c9339..d265021f75 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2782,6 +2782,7 @@ treebuilder_handle_start(TreeBuilderObject* self
Jim Jewett added the comment:
What is the status on this? If you are losing interest, would you like someone
else to turn your patch into a pull request?
--
___
Python tracker
<https://bugs.python.org/issue24
Jim Jewett added the comment:
It sounds like the fix is a configuration change already included in the next
version, so ... I think that counts as a fix.
--
nosy: +Jim.Jewett
resolution: -> fixed
status: open -> pending
___
Python tracker
Jim Carroll added the comment:
I can confirm the os.walk() behavior still exists on 3.8. Just curious on the
status of the patch?
--
nosy: +jamercee
___
Python tracker
<https://bugs.python.org/issue23
Jim DeLaHunt added the comment:
We discovered and fixed this same problem back in 2011-2012 with #12947 .
That was apparently the source of the monkeypatch that was removed as "obselete
code" on 2019-09-12. That old issue commentary has some suggestions about other
workaro
Jim DeLaHunt added the comment:
My goodness, things get complex sometimes.
If we cannot make Sphinx preserve doctest directives and comments, perhaps we
should go back to the historical bug discussion to look at workarounds which we
considered earlier. For instance, maybe we should modify
Jim Jewett added the comment:
This was originally "can be reopened if a patch is submitted" and Hristo Venev
has now done so. Therefore, I am reopening.
--
resolution: rejected -> remind
stage: -> patch review
status: closed -> open
ver
Jim Jewett added the comment:
Based on Hristo's timing, it appears to be a clear win.
A near-wash for truly string-only dicts that shouldn't be effected; a near-wash
for looking up non-(exact-)strings, and a nearly 40% speedup for the target
case of looking up but not inser
New submission from Jim Carroll :
We encountered an interesting mtime problem in the field, that I believe
represents a bug in python's datetime timestamp handling.
A file stored on a windows server had the last-modified date '1/1/4501' (that's
the year 4501). os.path.
Jim Carroll added the comment:
My bad. I read the docs, but mistakenly believed platform support meant OS. I
figured since Windows maketh then Windows should taketh. I've spent the day
studying the _datetimemodule.c code and now realize my error.
Question -- it seems to me an unnece
Jim Jewett added the comment:
Raymond, did you replace the screenshot with a later one showing that things
are fixed now? The timestamp suggests it went up at the same time as your
comment, but what I see in the .png file is that the two are identical other
than addresses.
--
nosy
Jim Jewett added the comment:
@Ben Griffin -- Unicode has defined astral characters for a while, but they
were explicitly intended for rare characters, with any living languages
intended for the basic plane. It is only the most recent releases of unicode
that have broken the "most p
Jim Jewett added the comment:
Looks good to me.
--
nosy: +Jim.Jewett
___
Python tracker
<https://bugs.python.org/issue41217>
___
___
Python-bugs-list mailin
Jim Jewett added the comment:
Looks good to me.
I at first worried that the different function names were useful metadata that
was getting lost -- but the names were already duplicated in several cases.
*If* that is still a concern for the committer, then instead of repeating the
code
Jim Jewett added the comment:
Going back to Raymond's analysis, this is useful when at least some of the
parameters either do not change the result, or are not hashable.
At a minimum, you need to figure out which parameters those are, and whether to
drop them or transform them.
Is
Jim Jewett added the comment:
Is this a platform where 3.8 was working?
The curses test seems to think you have too many color-pairs defined, and this
might well be part of a semi-compatible curses library. I guess I would add
some output to the test showing how many (and which) color pairs
Jim Jewett added the comment:
It may well have been intentional, as deques should normally be mutated only at
the ends. But Raymond did make changes to conform to the ABC, so this should
probably be supported too. Go ahead and include docstrings and/or discouraging
it, though, except for
Jim Jewett added the comment:
The standard itself says that it only applies to content served over http; if
the content is retrieved by ftp or from a file system, then you should trust
that. I don't notice that in the code you pointed to.
So maybe filetype is the right answer if the
Jim Jewett added the comment:
I won't speak of nroff or troff in particular, but many programs had trouble
distinguishing the end of a sentence from an honorific abbreviation, such as
Mr. Spock or Dr. Seuss.
--
nosy: +Jim.Jewett
___
P
Jim Jewett added the comment:
Why would you raise StopIteration if you didn't want to stop the nearest
iteration loop? I agree that the result of your sample code seems strange, but
that is because it is strange code.
I agree with Steven D'Aprano that changing it would cause more
Jim Jewett added the comment:
Is it safe to say that there is an now intent to support VxWorks within the
main tree, with Wind River agreeing to be primary support?
And this ticket has become a tracking ticket for the status on getting it
there, small PR by small PR plus buildbot
Jim Jewett added the comment:
Looks Good To Me
--
nosy: +Jim.Jewett
___
Python tracker
<https://bugs.python.org/issue41391>
___
___
Python-bugs-list mailin
Jim Jewett added the comment:
There are a zillion reasons a filename could be wrong -- but the standard
says to trust the filesystem. So if it sniffs based on contents, it isn't
quite following the standard. It is probably still a useful tool, but it
won't be the One Right Way, an
Jim Jewett added the comment:
Then I suspect they also exist in even earlier versions, and are actually tied
to your development setup. That should still be fixed, but it is probably not
in Python's own code. It might be in python's build process, which is still on
us. Or it m
Jim Jewett added the comment:
Unicode probably won't make the correction, because of backwards
compatibility. I do support the sentence suggested in Thorsten's most
recent reply. Is expanding ligatures the only other normalization it does?
Ideally, we should also mention that it
Change by Jim Jewett :
--
stage: patch review -> commit review
___
Python tracker
<https://bugs.python.org/issue41246>
___
___
Python-bugs-list mailing list
Un
New submission from Jim Lin :
I think the exception "raise ValueError("Pool not running")" is not easy for a
programmer to quickly know the problem of their code.
Therefore, I add the value of self._state when throwing the ValueError.
--
components: Library (L
Change by Jim Lin :
--
keywords: +patch
pull_requests: +22190
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23299
___
Python tracker
<https://bugs.python.org/issu
Jim Jewett added the comment:
Why was the delta-processing removed from the casing functions?
As best I can tell, the whole point of going through multiple levels of
indirection (courtesy splitbins) is to maximize compression and minimize the
amount of cache that unicode might occupy.
By
New submission from Jim Jewett :
The documentation for hasattr, getattr, and delattr state that they are
equivalent to object.attribute access; this isn't quite true, because
object.attribute uses a NFKC-normalized version of the string as only the
secondary location, while hasattr, ge
Jim Jewett added the comment:
Why is normalization in getattr unacceptable? I won't pretend to *like* it,
but the difference between two canonically equal strings really is (by
definition) just a representational issue.
Would it be OK to normalize in object's own implementatio
Jim Jewett added the comment:
The URL got mangled in at least my browser, so I'm repasting it on its own line:
http://svn.python.org/projects/sandbox/trunk/stringbench
--
nosy: +Jim.Jewett
___
Python tracker
<http://bugs.python.org/is
Jim Jewett added the comment:
To be more explicit about Martin A. Lemburg's msg151121 (which I agree with):
Count the collisions on a single lookup.
If they exceed a threshhold, do something different.
Martin's strawman proposal was threshhold=1000, and raise. It would be just a
New submission from Jim Jewett :
http://docs.python.org/reference/lexical_analysis.html
Changed in version 2.5: Both as and with are only recognized when the
with_statement future feature has been enabled. It will always be enabled in
Python 2.6. See section The with statement for details
New submission from Jim Jewett :
Python identifiers are in NFKC form; string method .isidentifier() returns true
on strings that are not in that form. In some contexts, these non-canonical
strings will be replaced with their NFKC equivalent, but in other contexts
(such as the builtins
Jim Jewett added the comment:
My preference would be for non_NFKC.isidentifier() to return False, but that
may be a problem for backwards compatibility.
It *may* be worth adding an asidentifier() method that returns either False or
the canonicalized string that should be used instead.
At a
Jim Jewett added the comment:
@Benjamin -- the catch is, if it isn't already in NFKC form, then python won't
really accept it as an identifier. Sometimes it will silently canonicalize it
for you so that it seems to work, but other times it won't. And program
calling isident
New submission from Jim Jewett :
> http://hg.python.org/cpython/rev/0b5ce36a7a24
> changeset: 74515:0b5ce36a7a24
> + Casefolding is similar to lowercasing but more aggressive because it is
> + intended to remove all case distinctions in a string. For example, t
Jim Jewett added the comment:
Frankly, I do think that sample code is too long, but correctness matters ...
perhaps a better solution would be to add either a method or a unicodedata
function that does the work, then the extra note could just say
Note that most case-insensitive matches
New submission from Jim Jewett :
Parser/parsetok.c was recently changed (e.g.
http://hg.python.org/cpython/rev/2bd7f40108b4 ) to raise an error if multiple
statements were found in a single-statement compile call. It sensibly ignores
trailing whitespace and comments. Unfortunately,
(1) It
Jim Jewett added the comment:
Ignoring non-ascii whitespace is defensible, and I agree that it should match
the rest of the parser. Ignoring 2nd lines is still a problem, and supposedly
part of what got fixed. Test case:
s="""x=5 # comment
x=6
""
Jim Jewett added the comment:
Marc-Andre Lemburg:
>> So you get the best of both worlds and randomization would only
>> kick in when it's really needed to keep the application running.
Charles-François Natali
> The only argument in favor the collision counting is that
Jim Jewett added the comment:
On Fri, Jan 20, 2012 at 7:58 AM, STINNER Victor
> If the hash output depends on an argument, the result cannot be
> cached.
They can still be cached in a separate dict based on id, rather than
string contents.
It may also be possible to cache them in th
Jim Jewett added the comment:
On Mon, Jan 23, 2012 at 4:39 PM, Marc-Andre Lemburg
wrote:
> Running (part of (*)) the test suite with debugging enabled on a 64-bit
> machine shows that slot collisions are much more frequent than
> hash collisions, which only account for less than 0.0
Jim Jewett added the comment:
On Wed, Jan 25, 2012 at 6:06 AM, Dave Malcolm
added the comment:
> hybrid-approach-dmalcolm-2012-01-25-001.patch
> As per haypo's random-8.patch, a randomization seed is read at startup.
Why not wait until it is needed? I suspect a lot of scripts
Jim Jewett added the comment:
Sorry; hit the wrong key... intended message below:
On Wed, Jan 25, 2012 at 6:06 AM, Dave Malcolm
added the comment:
[lots of good stuff]
> hybrid-approach-dmalcolm-2012-01-25-001.patch
> As per haypo's random-8.patch, a randomization seed
Jim Jewett added the comment:
On Wed, Jan 25, 2012 at 1:05 PM, Antoine Pitrou
added the comment:
> It looks like that approach will break any non-builtin type (in either C
> or Python) which can compare equal to bytes or str objects. If that's
> the case, then I think the
Jim Jewett added the comment:
The wording in 138415 suggested this patch was changing socket to not support
timeouts -- which would be unacceptable.
But the actual patch only seems to touch multiprocessing/connection.py -- a far
more reasonable change.
Unfortunately, the patch no longer
New submission from Jim Jewett :
http://hg.python.org/cpython/file/fec45282dc28/Include/weakrefobject.h#l54
The comment makes sense -- but doesn't appear to be true, so perhaps it is the
macro that should change.
/* This macro calls PyWeakref_CheckRef() last since that can invo
Jim Jewett added the comment:
I like Nick Coghlan's suggestion in msg140493, but I think he was giving up too
soon in the "or" cases, and I think the confusion could be slightly reduced by
some re-spellings around return values and comments about short-circuiting.
def n
New submission from Jim Jewett :
http://hg.python.org/cpython/file/tip/Lib/collections/__init__.py#l37 states
that the prev/next links are weakref proxies; as of
http://hg.python.org/cpython/diff/3977dc349ae7/Lib/collections.py this is no
longer true of the next links.
It could be fixed by
New submission from Jim Jewett :
collections.namedtuple raises a ValueError if any of the field names are not
valid identifiers, or are duplicates.
It does not normalize the identifiers when checking for duplicates.
(Similar issue with the typename)
>>> namedtuple("dup_fie
Jim Jewett added the comment:
On Thu, Jan 26, 2012 at 8:19 PM, Antoine Pitrou wrote:
> If I read your [Martin v. Löwis' ] patch correctly, collisions will
> produce additional allocations ... That's a pretty massive
> change in memory consumption for string dicts
Not in p
Jim Jewett added the comment:
Given PYTHONHASHSEED, what is the point of PYTHONHASHRANDOMIZATION?
Alternative:
On startup, python reads a config file with the seed (which defaults to zero).
Add a function to write a random value to that config file for the next startup
Jim Jewett added the comment:
On Mon, Jan 30, 2012 at 12:31 PM, Dave Malcolm
added the comment:
> It's useful for the selftests, so I've kept PYTHONHASHSEED.
The reason to read PYTHONHASHSEED was so that multiple members of a
cluster could use the same hash.
It would have been
Jim Jewett added the comment:
On Mon, Feb 6, 2012 at 8:12 AM, Marc-Andre Lemburg
wrote:
>
> Marc-Andre Lemburg added the comment:
>
> Antoine Pitrou wrote:
>>
>> The simple collision counting approach leaves a gaping hole open, as
>> demonstrated by Frank.
Jim Jewett added the comment:
On Mon, Feb 6, 2012 at 12:07 PM, Marc-Andre Lemburg
wrote:
>
> Marc-Andre Lemburg added the comment:
>
> Jim Jewett wrote:
>> The problematic case is, roughly,
>> (1) Find out what N will trigger collision-counting countermeasures.
>
Jim Jewett added the comment:
On Mon, Feb 6, 2012 at 1:53 PM, Frank Sievertsen wrote:
>>> BTW: If you set the limit N to e.g. 100 (which is reasonable given
>>> Victor's and my tests),
>> So it would take around 3Mb to cause a minute's delay...
> How di
New submission from Jim Jewett :
Add a comment explaining why _PyUnicode_FromId can (and should) assume
ASCII-only identifiers.
/* PEP3131 guarantees that all python-internal identifiers
are ASCII-only. Violating this would break some supported
C compilers
Jim Jewett added the comment:
On Mon, Feb 6, 2012 at 4:25 PM, Martin v. Löwis wrote:
> Martin v. Löwis added the comment:
> This has nothing to do with PEP 3131. Python could (and does)
> support non-ASCII identifiers just fine, regardless of C compiler
> limitations.
I *t
Jim Jewett added the comment:
And is there a way to characterize the compilers that would break? Is
it a few specific compilers, or "compilers that do not implement UTF8,
which is not required by the C standard", or ...
--
___
Python trac
Jim Jewett added the comment:
After clarification, the original change was backed out.
These are C Identifiers, and nothing beyond ASCII is guaranteed, but other
characters are in practice possible.
--
resolution: -> fixed
status: open ->
New submission from Jim Jewett :
http://hg.python.org/cpython/file/aba513307f78/Lib/importlib/_bootstrap.py#l974
974 # The hell that is fromlist ...
975 if not fromlist:
976 # Return up to the first dot in 'name'. This is
complicated by the fact
977 #
Jim Jewett added the comment:
On Fri, Feb 10, 2012 at 6:02 PM, STINNER Victor
> - PYTHONHASHSEED doc is not clear: it should be mentionned
> that the variable is ignored if PYTHONHASHRANDOMIZATION
> is not set
*That* is why this two-envvar solution bothers me.
PYTHONHASHSEED ha
Jim Jewett added the comment:
Martin v. Löwis (loewis) wrote:
> Displaying a warning whenever the code has changed on disk is
> clearly unacceptable
As clarified, the request is only for when a traceback is being created (or
perhaps even only for when one is being printed).
I agre
New submission from Jim Jewett :
def reset(self):
""" Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of
New submission from Jim Jewett :
Recent discussion on the mailing lists and in http://bugs.python.org/issue13997
make it clear that the best way to get python2 results for
"ASCII-in-the-parts-I-might-process-or-change" is to replace
f = open(fname)
with
f = open(fname
Jim Jewett added the comment:
See bugs/python.org/issue14015 for one reason that surrogateescape isn't better
known.
--
nosy: +Jim.Jewett
___
Python tracker
<http://bugs.python.org/is
Jim Jewett added the comment:
On Mon, Feb 13, 2012 at 3:37 PM, Dave Malcolm
added the comment:
> * added comments about the specialcasing of length 0:
> /*
> We make the hash of the empty string be 0, rather than using
> (prefix ^ suffix), since this slightly ob
Jim Jewett added the comment:
As long as the interpreter knows about about files that *it* wrote, no repeat
checks during startup seems utterly reasonable; sneaking in a new or changed
file is inherently a race condition.
I think it would also be reasonable for general use, so long as there
Jim Jewett added the comment:
As of Feb 28, 2012, the PEP mentions an additional optimization of storing the
values in an array indexed by (effectively) key insertion order, rather than
key position. ("Alternative Implementation")
It states that this would reduce memory usage for
Jim Jewett added the comment:
Can't this be triggered by non-malicious code that just happened to have a
python comparison and get hit with a thread switch?
I'm not sure how often it happens, but today it would not be visible to the
user; after the patch, users will see a sporad
Jim Jewett added the comment:
On Tue, Mar 6, 2012 at 11:56 AM, Mark Shannon wrote:
> Jim Jewett:
>> Can't this be triggered by non-malicious code that just happened
>> to have a python comparison and get hit with a thread switch?
> So, they are writing to a dict in o
Jim Jewett added the comment:
(1) I think this module would benefit greatly from a map explaining what each
file does, and perhaps from some reorganization.
As best I can yet tell, there are about ~130 files, over a dozen directories,
but the only ones that directly affect the
Jim Jewett added the comment:
On Tue, Mar 6, 2012 at 1:05 PM, Guido van Rossum
Jim Jewett:
>>... If they're just adding new keys, or even deleting other
>> (==> NOT the one being looked up) keys, why should that
>> keep them from finding the existing, unchang
Jim Jewett added the comment:
On Tue, Mar 6, 2012 at 3:07 PM, Stefan Krah
> Jim Jewett wrote:
>> (1) I think this module would benefit greatly from a map explaining
>> what each file does, and perhaps from some reorganization.
> Just MAP.txt in the top level direc
Jim Jewett added the comment:
I think the latest patch is indeed cleaner.
--
nosy: +Jim.Jewett
___
Python tracker
<http://bugs.python.org/issue13897>
___
___
Jim Jewett added the comment:
On Wed, Mar 7, 2012 at 5:28 AM, Stefan Krah
added the comment:
> OK, as a basis for discussion I've added:
> http://hg.python.org/features/cdecimal/file/8b75c2825508/Modules/_decimal/FILEMAP.txt
That is indeed very helpful. So helpful that now I unde
Jim Jewett added the comment:
On Thu, Mar 8, 2012 at 7:43 PM, STINNER Victor wrote:
> Python < 3.3 retries the lookup an unlimited number of times which
> lead to a crash, that's the issue fixed by my change.
How does it lead to a crash? I think it just leads to an infinite
Jim Jewett added the comment:
>> As of Feb 28, 2012, the PEP mentions an additional
>> optimization of storing the values in an array indexed
>> by (effectively) key insertion order, rather than key
>> position. ("Alternative Implementation")
>> It st
Jim Jewett added the comment:
On Fri, Mar 9, 2012 at 12:13 PM, Jim Jewett
> So to get beneath 2/3 without lots of reallocation
> probably requires knowing when the key set is likely
> to be complete, and that is indeed more complex than
> the current changes. (That said, you ha
Jim Jewett added the comment:
So the risk is that descr may be given garbage memory that just happens to look
like an object with 1 reference, so that it really does a decref and tries to
re-deallocate whatever was there before.
I would rather see the change at the top of the function; just
Jim Jewett added the comment:
If I understood correctly, that *is* the minimal case, which suggests some sort
of size problem.
That said, I could not duplicate on 2.6.2, nor with py_compile.compiler in
3.2.2; I am not currently sufficiently motivated to install another version
just for
New submission from Jim Fulton :
Currently, distutils2.pypi.wrapper has a notion of a simple index, which has
subdirectories for each project as pypi/simple does. This is good. It should
also support flat indexes ala a directory of files.
--
assignee: eric.araujo
components
New submission from Jim Fulton :
Requiring md5s makes it hard to implement simple indexes with simple web
servers, where simple indexes include flat directories of distributions.
--
assignee: eric.araujo
components: Distutils2
messages: 155542
nosy: alexis, eric.araujo, j1m, tarek
101 - 200 of 742 matches
Mail list logo