Craig Coleman added the comment:
>From https://docs.python.org/3/reference/datamodel.html#object.__hash__
User-defined classes have __eq__() and __hash__() methods by default; with
them, all objects compare unequal (except with themselves) and x.__hash__()
returns an appropriate value s
Craig Coleman added the comment:
Seems I learned a python lesson today.
I've put myself back in python school and done some reading on a) the code
behind dataclasses, b) PEP 557 and c) the doc'n for __eq__.
After all the reading I've realised this I'd been making some as
New submission from Craig Coleman :
In a test, dataclasses generate an __eq__ function appears to be wrong.
@dataclass
class C:
pass
class K:
pass
a = C()
b = C()
c = K()
d = K()
(a is b) # False
(a == b) # True # Incorrect, Why?
(c is d) # False
(c == d) # False # Correct
Change by Craig Holmquist :
--
nosy: +craigh
___
Python tracker
<https://bugs.python.org/issue46006>
___
___
Python-bugs-list mailing list
Unsubscribe:
Craig Dowkes added the comment:
Same issue for me on Mac OS 12.0.1 hoping for a quick solution to this
--
nosy: +craig.dowkes
___
Python tracker
<https://bugs.python.org/issue45
New submission from Craig Dowkes :
I recently updated to Mac OS Montery 12.0.1 and am now unable to open or save
any idle files. Running on a 2021 M1 iMac. I get the save dialogue box but then
also an error box as shown in the attached picture. Failed to connect to the
open and save panel
Craig Holmquist added the comment:
In my test, the second call to path.absolute() is just returning the same
result as the first call, which is what I would expect (as you say, the path
object doesn't update automatically).
However, your output shows it returning
'/Users/e/Devel
New submission from Craig Holmquist :
>>> import os, pathlib, shutil
>>> os.mkdir('test1')
>>> os.mkdir('test2')
>>> path = pathlib.Path('test1')
>>> shutil.move(path, 'test2')
Traceback (most recent call l
New submission from Craig Holmquist :
>>> import xml.sax
>>> import pathlib
[...]
>>> xml.sax.parse(pathlib.Path('path/to/file'), handler)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.6/xml/sax/__init__.py
Craig McQueen added the comment:
One ongoing weakness I see with this situation is that it's difficult to code a
suitable work-around if a user wants to zip files that have a date < 1980 (e.g.
to zip it with a datestamp of 1-Jan-1980).
https://stackoverflow.com/q/45703747/60075
I am t
Shea Craig added the comment:
For what it's worth, I manage a lot of Macs and know a lot of people in similar
roles at major enterprises. We greatly prefer installer packages for automated
installation, and end up having to repackage installer apps routinely for
products that don'
New submission from Shea Craig:
The Python installer package for macOS is versioned, however, the included sub
packages have no version information. This results in the receipts having no
version. Many enterprise software management tools rely on the receipt
information to determine whether
Changes by Craig McQueen :
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issue11129>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Craig Holmquist :
Added file: http://bugs.python.org/file46718/issue23407-5.patch
___
Python tracker
<http://bugs.python.org/issue23407>
___
___
Python-bug
Craig Rodrigues added the comment:
Same issue was brought up in http://bugs.python.org/issue4851
--
nosy: +Craig Rodrigues
___
Python tracker
<http://bugs.python.org/issue15
Craig Rodrigues added the comment:
This looks like a duplicate of https://bugs.python.org/issue15290 .
15290 was closed as invalid, and the submitter was told that the
code should be changed to not rely on creating elements outside
of the document interface.
I encountered the same problem when
Craig Holmquist added the comment:
New patch with test.
I'm not sure if C:\Users\All Users and C:\ProgramData exist with those names on
non-English installations of Windows. I set the test to skip if they aren't
found.
--
nosy: +craigh
Added file: http://bugs.python.org
Craig Holmquist added the comment:
New patch with spaces instead of tabs
--
Added file: http://bugs.python.org/file46291/issue23407-4.patch
___
Python tracker
<http://bugs.python.org/issue23
Changes by Craig Holmquist :
--
keywords: +patch
Added file: http://bugs.python.org/file46290/issue29248.patch
___
Python tracker
<http://bugs.python.org/issue29
Craig Holmquist added the comment:
Here's a new patch: now, _Py_attribute_data_to_stat and Py_DeleteFileW will
just use the IsReparseTagNameSurrogate macro to determine if the file is a
link, so os.walk etc. will know not to follow them. os.readlink, however, will
only work with junc
Craig Holmquist added the comment:
FWIW, the only name-surrogate tags in the user-mode SDK headers (specifically
winnt.h) are IO_REPARSE_TAG_MOUNT_POINT and IO_REPARSE_TAG_SYMLINK, as of at
least the Windows 8.1 SDK.
--
___
Python tracker
<h
Craig Holmquist added the comment:
Can you point me toward any documentation on the additional tags you want to
support? Searching for IO_REPARSE_TAG_IIS_CACHE mostly seems to yield header
files that define it (and nothing at all on MSDN), and the non-Microsoft tags
just yield a few results
Craig Holmquist added the comment:
Updated patch with changes to Win32JunctionTests.
--
Added file: http://bugs.python.org/file44824/issue23407-2.patch
___
Python tracker
<http://bugs.python.org/issue23
Craig Holmquist added the comment:
Actually, it looks like there is already a way to create junctions and a test
for them in test_os. However, it includes this line:
# Junctions are not recognized as links.
self.assertFalse(os.path.islink(self.junction))
That suggests the old
Craig Holmquist added the comment:
The attached patch changes _Py_attribute_data_to_stat to set S_IFLNK for both
symlinks and junctions, and changes win_readlink to return the target path for
junctions (IO_REPARSE_TAG_MOUNT_POINT) as well as symlinks.
I'm not sure what to do as far as a
Craig Northway added the comment:
Whoops, looks like there is definitely some redundancy. I didn't notice those
tests at the time I wrote these (PyCon AU last year) and while I have been
grappling with getting permission to make the contributions it looks like it's
been worked on a
Changes by Craig Northway :
--
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue24579>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Craig Northway :
--
keywords: +patch
Added file: http://bugs.python.org/file39877/urllib.patch
___
Python tracker
<http://bugs.python.org/issue24
New submission from Craig Northway:
Patch containing additional tests for urllib module to increase code coverage
for url parsing.
Current coverage:
Lib/urllib/parse 51320261%
Updated coverage:
Lib/urllib/parse 51313973%
--
components
New submission from Nick Craig-Wood:
Here is a patch to remove some unused code in `symtable.c`
In Python3 `from x import *` was banned from use in functions completely.
This is detected by `symtable_visit_alias`
if (st->st_cur->ste_type != ModuleBlock) {
int linen
Craig Holmquist added the comment:
Okay, I attached another patch. The new version of the test returns success if
the client's response is anything other than the abort line (*\r\n).
It fails with the current version of imaplib, fails if I change
_Authenticator.process to output a
Craig Holmquist added the comment:
New patch is attached.
--
Added file: http://bugs.python.org/file38749/imap_auth2.patch
___
Python tracker
<http://bugs.python.org/issue23
New submission from Craig Holmquist:
If the authenticator object passed to the IMAP authenticate method tries to
abort the handshake by returning None, TypeError is raised instead of sending
the * line to the server.
>>> import imaplib
>>> imap = imaplib.IMAP4_S
Craig Holmquist added the comment:
It seems like performance is drastically improved by doing this:
class Category(Enum):
tiny = 1
medium = 2
large = 3
tiny = Category.tiny
medium = Category.medium
In other words, resolving Category.tiny and Category.medium is what's slow.
Craig Holmquist added the comment:
I may not have been clear before. What I mean is, code like this:
for obj in get_objects():
if obj.category == Cat.cat1:
#do something
elif obj.category == Cat.cat2:
#do something else
elif obj.category == Cat.cat3 or obj.category
New submission from Craig Holmquist:
Running the attached test script:
$ time python test.py enum
real0m6.546s
user0m6.530s
sys 0m0.007s
$ time python test.py int
real0m0.384s
user0m0.377s
sys 0m0.000s
I encountered this with a script that yielded a sequence of
New submission from Craig Holmquist:
os.walk follows Windows junctions even if followlinks is False:
>>> import os
>>> appdata = os.environ['LOCALAPPDATA']
>>> for root, dirs, files in os.walk(appdata, followlinks=False):
... print(root)
C:\Users\Tes
Craig added the comment:
Surely if there is data loss this *has* to be fixed in 2.x?
I'm seeing this a *lot* using Twisted which, I believe isn't fully 3.x ported
yet, so we have to support 2.x for now.
--
nosy: +craigemery
___
Python trac
Craig Silverstein added the comment:
Thanks -- we managed to work around it by removing the tkinter dependency, so
this isn't time-critical for us. It is curious, though.
One thing I forgot to mention before is that playing around with the hung
process in gdb, it seems like sqlit
New submission from Craig Silverstein:
Don't ask me how, but our code managed to combine multiprocessing, sqlite, and
tkinter all in one app, and got a hanging behavior, though only on a particular
OS. Removing any of these removes the hang. I filed this under tkinter, but
the fault
Craig McQueen added the comment:
StackOverflow question about Mersenne Twister jumpahead:
http://stackoverflow.com/q/4184478/60075
which refers to this:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/JUMP/index.html
--
___
Python tracker
<h
Craig McQueen added the comment:
C++11 Mersenne Twister discard() member function:
http://www.cplusplus.com/reference/random/mersenne_twister_engine/discard/
--
___
Python tracker
<http://bugs.python.org/issue9
Craig McQueen added the comment:
I notice that the C++11 library has a discard() member function for its random
generators, which is effectively a jumpahead operation. It seems that the C++11
library has implemented discard() for the Mersene Twister generator. If
jumpahead() is technically
Brandon Craig Rhodes added the comment:
Kristján, you are certainly correct that a single-argument that can be either a
filename or a cert is inappropriate; we should not be peeking inside of strings
to guess what they contain.
And I think you also have a good point about Pythonic-ness when
Brandon Craig Rhodes added the comment:
Kristján, your patch is a wonderful idea—I am about to commit production code
that will have to create tens of thousands of temporary files during operation,
one file each time SSL is started up on a socket, which could be avoided if
something like this
Brandon Craig Rhodes added the comment:
Adding an entirely separate API for introspection strikes me as
counter-productive — instead of merely having to maintain the logging API that
you already maintain, you will additionally now have an entirely separate and
second API that also has to be
Craig McDaniel added the comment:
Closing; duplicate of 18045
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
New submission from Craig McDaniel:
Running "setup.py bdist_rpm" throws an exception on some libraries (e.g. -
simplejson) since 2.7.4 due to introduction of get_python_version():
Traceback (most recent call last):
File "setup.py", line 103, in
run_setup(True)
File
Brandon Craig Rhodes added the comment:
Larry Hastings writes:
> Huh. tar *can* infer it from the data itself. On the other hand, it
> chooses explicitly not to. I guess "tar" knows explicit is better
> than implicit too ;-)
I am told that the refusal of "tar&qu
Brandon Craig Rhodes added the comment:
The original inspiration:
https://twitter.com/theomn/status/309468740611891200
--
___
Python tracker
<http://bugs.python.org/issue17
Brandon Craig Rhodes added the comment:
(Corrected "not" to "note" in the title and went with "enhancement")
--
title: PEP should not if it has been superseded -> PEP should note if it has
been superseded
type: -> enhancement
__
New submission from Brandon Craig Rhodes:
A friend (@theomn on Twitter) was just working off of PEP-333 when I mentioned
to him that PEP-, and he had never heard of it, and he expressed the wish
that PEPs would have a banner or something at the top if there is a more recent
version of
Craig McQueen added the comment:
Alexander Belopolsky wrote:
> No. Seconds since the epoch is neither local nor UTC. It is just
> an elapsed number of seconds since an agreed upon time called the
> "epoch".
This statement just seems wrong. And I have just been conf
Trenton Craig added the comment:
So, in testing, we reset retries to 1 instead of 0, and on our ubuntu
environment this allows it to function. So issue is not with timeout, but with
the retries variable.
--
___
Python tracker
<h
New submission from Trenton Craig:
I have an application that is set to use pysnmp to obtain sysDescription and
system names from devices on our network. Currently, we are using python
2.6.2, due to the limitations of the box (solaris), and it works fine.
However, our new environment uses
Craig McQueen added the comment:
I've succeeded in building an extension for Python 3.3 (at least, on Windows
XP, 32-bit; haven't tried any 64-bit), by the hack of copying libmsvcr100.a
from a recent MinGW release (20120426) into an older MinGW release (20101030).
I haven't
Craig McQueen added the comment:
It would be great if this could be sorted out in time for Python 3.3. Otherwise
I don't think we'll be able to use MinGW to build extensions in Windows. Unless
there is a version of MinGW which supports the -mno-cygwin option, as well as
l
Craig McQueen added the comment:
I've come across this issue when trying to build extensions for Python 3.3 on
Windows, needing a recent enough MinGW to provide a library for msvcr100. See
issue #15315.
--
nosy: +cmcqueen1975
___
Python tr
Craig McQueen added the comment:
It sounds as though the option '-mno-cygwin' is related to issue #12641.
Does that mean I need to find a version of MinGW that is old enough to support
the option '-mno-cygwin', but new enough to include a
Craig McQueen added the comment:
I downloaded the latest MinGW, and now it tells me:
...
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python33\include
-IC:\Python33\PC -c python3/src/_cobs_ext.c -o bui
ld\temp.win32-3.3\Release\python3\src\_cobs_ext.o
cc1.exe: error: unrecognized
Craig McQueen added the comment:
That's definitely an improvement. It gets further, but on my PC, the compile
fails:
...
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot
find -lmsvcr100
collect2: ld returned 1 exit status
error: command 'gcc' f
New submission from Craig McQueen :
I'm trying this with my 'cobs' Python package:
c:\Python33\python.exe setup.py build --compiler=mingw32 bdist_msi
With Python 3.3 beta, it fails with an exception:
ValueError: Unknown MS Compiler version 1600
It works
New submission from Craig Loftus :
Calling httplib.responses[httplib.UNPROCESSABLE_ENTITY] in 2.7, or
http.client.responses[http.client.UNPROCESSABLE_ENTITY] raises "KeyError: 422".
The expected behaviour would be to return "Unprocessable Entity".
This is the specific i
Craig Sawyer added the comment:
Antoine,
I see your point about getcwd() not having symlinks, doesn't mean any path
outside of getcwd() might have symlinks, and I agree this is true. I apologize.
As for which one to choose, it should choose based on PWD (i.e. the current
wo
New submission from Craig Sawyer :
we have os.path.abspath() and os.path.realpath(). the difference according to
the documentation is realpath() returns the physical path (i.e. no symlinks in
the path). while abspath() uses getcwd() but because of POSIX.1-2008 (IEEE Std
1003.1-2008) says
Craig Foster added the comment:
I can confirm that the compile completes with a multiprocessing module where it
hasn't before--at least in SunOS 5.9.
--
nosy: +fosterremy
___
Python tracker
<http://bugs.python.org/i
New submission from Brandon Craig Rhodes :
The tarfile module should have a simple command line that allows it to be
executed with "-m" — even if its only ability was to take a filename and
extract it to the current directory, it could be a lifesaver on Windows
machines where Pytho
Craig Citro added the comment:
Antoine -- ah, that makes sense. Is that the only blocker? I've let this patch
rot on the vine a long time; if so, I'll happily switch `__eq__` back to
`__cmp__` and re-post if it'll get submitted.
--
___
Craig Citro added the comment:
Antoine -- why do you want to switch "if r" for "if not r"?
If we did, the test would just confirm that the unpicked object was of the same
type as the original; if we were going to do that, we might as well just
replace the whole `__cmp__
Brandon Craig Rhodes added the comment:
In case Google brings anyone else to this bug: this error typically indicates
that a `threading.py` which is not actually the Standard Library's `threading`
module has somehow wound up on an earlier path in `sys.path` and is therefore
shadowin
Brandon Craig Rhodes added the comment:
Brett, yes, you are welcome to close this issue — Ned quite handily convinced
me that coverage code belongs in the "coverage" distribution, not languishing
about in the CPython source tree. That solution also quite beautifully solves
the
Craig McQueen added the comment:
So this has been rejected I see. Too bad, since I stub my metaphorical toe on
this issue from time to time. Just for the record, here is an example:
http://stackoverflow.com/questions/4130936/perfect-hash-function/6976723#6976723
Brandon Craig Rhodes added the comment:
Ezio and Sandro, thank you very much for your attention to this issue, and for
helping me split it into manageable chunks! To answer the question about why
"coverage" does not show as high a total as it ought: it's because coverage
nor
Brandon Craig Rhodes added the comment:
Éric, I think your suggestions are all good ones, and I have incorporated them
into the file. (But do note that the departures we are now making from Ned's
own copy of the tracer code — removing the commented-out debugging statement,
and the
Brandon Craig Rhodes added the comment:
Éric, I think your points are good ones. (And, as I return to this patch after
three months, I should thank the PSF for sponsoring the CPython sprint here at
PyOhio, and creating this opportunity for me to continue trying to land this
patch!) I am
Brandon Craig Rhodes added the comment:
But if we allow for ellipsis, then would we not also have to start allowing
characters like ≥ and ≤ in Python? And the problem with any of these
(admittedly very attractive) substitutions is that they seem to abandon the
principle of there being One
Changes by Craig McQueen :
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issue11629>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandon Craig Rhodes added the comment:
Nick Coghlan writes:
> Regarding "__reduce__", other readers will have the same question Éric
> did, so that point should definitely go in a comment after the
> "__reduce_ex__" check.
I just sat down to review this issu
Brandon Craig Rhodes added the comment:
Nick Coghlan writes:
> Nick Coghlan added the comment:
>
> Regarding "__reduce__", other readers will have the same question Éric
> did, so that point should definitely go in a comment after the
> "__reduce_ex__" che
Brandon Craig Rhodes added the comment:
Éric, after checking line 112 of the two patches and then of the new file, I
figured out that you meant line 112 of the old file — and, yes, that test can
go away too since in python3 "complex" always exists and "unicode" neve
Brandon Craig Rhodes added the comment:
Antoine, neither this issue, nor either version of my patch, was intended to
assert that 100% test coverage indicates that a test of tests are complete. If
you will point out where in the text this is implied, I will correct it. Thanks
Brandon Craig Rhodes added the comment:
Éric, the Makefile in Python trunk seems to include Objects/complexobject.o in
the build unilaterally without any way to turn it off. What is leading you to
believe that Python 3 can conditionally turn the "complex" type off during a
build?
Brandon Craig Rhodes added the comment:
Benjamin, thanks for the pointers! The attached patch now uses assertIs() and
assertIsNot(), and calls self.fail() instead of using the exception from
"support".
In the future I would like some way to determine when test coverage is fully
ac
Changes by Brandon Craig Rhodes :
Removed file: http://bugs.python.org/file21245/test_copy2.patch
___
Python tracker
<http://bugs.python.org/issue502085>
___
___
Pytho
Brandon Craig Rhodes added the comment:
Benjamin, I would like some way to know when our tests achieve 100% coverage
because otherwise I will keep coming back to this module to add more tests and
have to re-discover code that is not CPython relevant. But for now I have
removed the pragmas
New submission from Brandon Craig Rhodes :
The attached patch will bring Lib/copy.py to 100% test coverage.
A bug in "coverage" results in its only reporting 99% at the moment; see
coverage issue #122 on bitbucket:
https://bitbucket.org/ned/coveragepy/issue/122/for-else-always-repor
Brandon Craig Rhodes added the comment:
Here is a module that solves this problem if the tests are run with the
"fullcoverage" directory at the front of the PYTHONPATH, like this:
PYTHONPATH=Tools/fullcoverage ./python -m coverage run --pylib
Lib/test/regrtest.py
New submission from Brandon Craig Rhodes :
When running the Python regression tests in "coverage", the initial outer level
of interpreted code in several standard library modules shows as not having
been covered by the tests, because they were imported during the Python boot
proces
Changes by Craig McQueen :
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issue10592>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brandon Craig Rhodes :
Normally, unittest cleanly reports an exception in a setUpClass method. But if
I place the attached test in a directory by itself and then run "python -m
unittest discover -b" from inside of the same directory, then instead of being
Brandon Craig Rhodes added the comment:
Here is a patch that fixes the problem. The problem probably only occurs if the
MIMEMultipart is actually given several MIME parts to use in its interior.
--
keywords: +patch
Added file: http://bugs.python.org/file20391/email-boundary.diff
New submission from Brandon Craig Rhodes :
If you try doing "msg.as_string()" to a MIMEMultipart message that has not been
given a boundary, then it dies with this exception:
Traceback (most recent call last):
File "mime_gen_alt.py", line 40, in
print(msg.as_str
Craig McQueen added the comment:
I'm attaching a file that I used (in Python 2.x).
It's a little rough--I manually commented and uncommented various lines to see
what would change under various circumstances. But at least you should be able
to see what I was doing.
--
Craig McQueen added the comment:
I should be able to attach my test code. But it is at my work, and I'm on
holidays for 2 more weeks. Sorry 'bout that!
I do assume that Python 3 greatly simplifies this.
--
___
Python trac
Nick Craig-Wood added the comment:
Terry J. Reedy (terry.reedy) wrote:
> > IMHO pprint should be able to make a decent job of all the built in types
>
> Agreed, already true as far as I know, and irrelevant. This issue is not
> about built-in types in the builtins module, as
Nick Craig-Wood added the comment:
Raymond Hettinger (rhettinger) wrote:
> Ben, I don't think there is any value is opening more issues like
> pprint-doesn't-handle-object-x (named tuples, defautdicts, deques,
> generators, etc).
>
> As it is currently designed, pp
Craig de Stigter added the comment:
Hi, sorry no I haven't had time to add a real test for this
--
___
Python tracker
<http://bugs.python.org/issue9720>
___
___
Craig de Stigter added the comment:
Yes, the bug still exists in Python 3.1.2. However, struct.pack() no longer
silently ignores overflow, so I get this error instead:
>>> z.write('foo.txt')
Traceback (most recent call last):
File "", line 1, in
File &
New submission from Brandon Craig Rhodes :
The only way to safely build shell command lines from inside of Python — which
is necessary when sending commands across SSH, since that behaves like
os.system() rather than like subprocess.call() — is to use the wonderful
pipes.call() method to turn
New submission from Craig de Stigter :
Steps to reproduce:
# create a large (>4gb) file
f = open('foo.txt', 'wb')
text = 'a' * 1024**2
for i in xrange(5 * 1024):
f.write(text)
f.close()
# now zip the file
import zipfile
z = zipfile.ZipFile('foo.zi
1 - 100 of 184 matches
Mail list logo