[issue46739] dataclasses __eq__ isn't logical
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 such that x == y implies both that x is y and hash(x) == hash(y). It doesn't work like that for tuples, NamedTuples nor dataclasses because their behaviour isn't expected to be a "user-defined class". -- ___ Python tracker <https://bugs.python.org/issue46739> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46739] dataclasses __eq__ isn't logical
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 assumptions about how __eq__ works which have now been corrected. Thanks for your help. -- ___ Python tracker <https://bugs.python.org/issue46739> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46739] dataclasses __eq__ isn't logical
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 Using @dataclass(eq = False) for annotation of C would make (a == b) == False which I think is correct behaviour. -- components: Library (Lib) messages: 413188 nosy: ccoleman priority: normal severity: normal status: open title: dataclasses __eq__ isn't logical type: behavior versions: Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue46739> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters
Change by Craig Holmquist : -- nosy: +craigh ___ Python tracker <https://bugs.python.org/issue46006> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45641] Error In opening a file through Idle
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/issue45641> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45642] Unable to save
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 service. -- files: Screenshot 2021-10-28 at 10.24.11 am.jpg messages: 405168 nosy: craig.dowkes priority: normal severity: normal status: open title: Unable to save type: performance versions: Python 3.10 Added file: https://bugs.python.org/file50406/Screenshot 2021-10-28 at 10.24.11 am.jpg ___ Python tracker <https://bugs.python.org/issue45642> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Twisted 21.2.0 Release Announcement
On behalf of Twisted Matrix Laboratories, I am honored to announce the release of Twisted 21.2.0! There are two major announcements for this release: - Python 2.7 support has been dropped. Twisted 21.2.0 supports Python 3.5.3 and higher only - This will be the last Twisted release to support Python 3.5. Twisted 21.2.0 brings the following: - twist dns --pyzone now works on Python 3 - twisted.web.twcgi now works on Python 3 - all tests pass on all platforms on Python 3.8, including asyncio tests on Windows - tests pass on Python 3.9 (thanks to Michał Górny) - type hints, as specified in PEP 484, are now used in functions throughout the codebase - mypy (static type checker) is now run over the codebase during CI to help detect problems, and help improve the use of types - code in is now formatted with Black (thanks to Tom Most) - many CI and automation improvements (thanks to Adi Roiban and Thomas Grainger) - many more fixes (225 tickets closed!) You can install by running this command: python -m pip install Twisted==21.2.0 The full tarball is available at: https://pypi.org/project/Twisted/21.2.0/#files The full NEWS file with all changes is at: https://github.com/twisted/twisted/blob/twisted-21.2.0/NEWS.rst ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce-list.python.org/ Member address: arch...@mail-archive.com
This is a test
I have added you to the EMAIL list, so when I have questions. Just learn for fun. Craig Hatch -- https://mail.python.org/mailman/listinfo/python-list
[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory
Craig Holmquist <craigh...@gmail.com> 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/Development/OSS/cpython/test2' instead of the (now broken) path from the first call. Maybe I'm missing something? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32689> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory
New submission from Craig Holmquist <craigh...@gmail.com>: >>> import os, pathlib, shutil >>> os.mkdir('test1') >>> os.mkdir('test2') >>> path = pathlib.Path('test1') >>> shutil.move(path, 'test2') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/shutil.py", line 540, in move real_dst = os.path.join(dst, _basename(src)) File "/usr/lib/python3.6/shutil.py", line 504, in _basename return os.path.basename(path.rstrip(sep)) AttributeError: 'PosixPath' object has no attribute 'rstrip' -- components: Library (Lib) messages: 310900 nosy: craigh priority: normal severity: normal status: open title: shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory type: behavior versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32689> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31658] xml.sax.parse won't accept path objects
New submission from Craig Holmquist <craigh...@gmail.com>: >>> 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", line 33, in parse parser.parse(source) File "/usr/lib/python3.6/xml/sax/expatreader.py", line 105, in parse source = saxutils.prepare_input_source(source) File "/usr/lib/python3.6/xml/sax/saxutils.py", line 355, in prepare_input_source if source.getCharacterStream() is None and source.getByteStream() is None: AttributeError: 'PosixPath' object has no attribute 'getCharacterStream' -- components: Library (Lib), XML messages: 303490 nosy: craigh priority: normal severity: normal status: open title: xml.sax.parse won't accept path objects type: behavior versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31658> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6090] zipfile: Bad error message when zipping a file with timestamp before 1980
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 trying to create a zip file with Python 3.5.2 zipfile, on Linux. Some of the files I'm trying to add have timestamps of 1-Jan-1970 (embedded system without a real-time clock module). So zipfile gives an exception: ValueError: ZIP does not support timestamps before 1980 My goal then is to implement a work-around to add these files to the zip file with a timestamp of 1-Jan-1980. However, I am finding it difficult to find a suitable work-around. At first I thought I can do this: def zinfo_from_file(fullname, arcname): st = os.stat(fullname) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] if date_time[0] < 1980: date_time = (1980, 1, 1, 0, 0, 0) zinfo = zipfile.ZipInfo(arcname, date_time) return zinfo ... zinfo = zinfo_from_file(fullname, arcname) chunksize=512 with open(fullname, 'rb') as src, myzipfile.open(zinfo, 'w') as dest: while True: data = src.read(chunksize) if not data: break dest.write(data) ... However, it turns out that myzipfile.open(zinfo, 'w') is not supported until Python 3.6. (I'm using Yocto to build embedded Linux, which currently only supports Python 3.5.x.) I guess I could try doing myzipfile.writestr(...), although then it appears that I have to load the entire file data into memory. -- nosy: +cmcqueen1975 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6090> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24502] OS X installer provides flat sub-packages with no version numbers
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't use that mechanism. If it's not an app that can be dropped into the Applications folder, Apple installer packages really are the best format for enterprise deployment. >From the development side I'm not familiar enough with the advantages of >trying to use a metapackage to bundle the contained packages, but I can say >that the version numbers all being 0 causes me to have to do some extra work >to ensure upgrades can be compared against what's already installed. I assume the metapackage is used to create the ability for the user to choose to exclude some of the subpackages. This is not a feature I use in deploying the software, although I recognize its utility. -- nosy: +Shea Craig ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24502> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31049] macOS Python package receipts do not have version numbers
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 something is present and whether it's due for an update. We use Munki, are are currently working around this issue, but ideally the subpackages would have the version info included. $ for PKG in $(pkgutil --pkgs | grep org.python);do pkgutil --pkg-info $PKG;done package-id: org.python.Python.PythonApplications-3.6 version: 0 volume: / location: Applications install-time: 1494351483 package-id: org.python.Python.PythonDocumentation-3.6 version: 0 volume: / location: Library/Frameworks/Python.framework/Versions/3.6/Resources/English.lproj/Documentation install-time: 1494351483 package-id: org.python.Python.PythonFramework-3.6 version: 0 volume: / location: Library/Frameworks/Python.framework install-time: 1494351483 package-id: org.python.Python.PythonUnixTools-3.6 version: 0 volume: / location: usr/local/bin install-time: 1494351483 -- components: macOS messages: 299257 nosy: Shea Craig, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: macOS Python package receipts do not have version numbers versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31049> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11129] logging: allow multiple entries in qualname config
Changes by Craig McQueen <pyt...@craig.mcqueen.id.au>: -- nosy: +cmcqueen1975 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11129> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
Changes by Craig Holmquist <craigh...@gmail.com>: Added file: http://bugs.python.org/file46718/issue23407-5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15290] setAttribute() can fail
Craig Rodrigues added the comment: Same issue was brought up in http://bugs.python.org/issue4851 -- nosy: +Craig Rodrigues ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15290> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4851] xml.dom.minidom.Element.cloneNode fails with AttributeError
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 trying to port Twisted to Python 3. -- nosy: +Craig Rodrigues ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4851> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29248] os.readlink fails on Windows
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/file46293/issue29248-2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29248> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
Craig Holmquist added the comment: New patch with spaces instead of tabs -- Added file: http://bugs.python.org/file46291/issue23407-4.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29248] os.readlink fails on Windows
Changes by Craig Holmquist <craigh...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file46290/issue29248.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29248> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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 junctions and symbolic links; otherwise it will raise ValueError with "unsupported reparse tag". This way, there's a basic level of support for all name-surrogate tags, but os.readlink only works with the ones whose internal structure is (semi-) documented. -- Added file: http://bugs.python.org/file46289/issue23407-3.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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 <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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 each. (For comparison, the junction and symbolic link tags yield 10K+ results each.) Junctions are created with each user's home directory so they exist on every Windows system, even if the user never explicitly creates them. The additional tags seem like they're far less common and much less well-documented. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
Craig Holmquist added the comment: Updated patch with changes to Win32JunctionTests. -- Added file: http://bugs.python.org/file44824/issue23407-2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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 behavior is intentional--does anyone know why? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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 adding a test--either Python needs a way to create junctions or the test needs to rely on the ones Windows creates by default. Incidentally, the existing win_readlink doesn't always work correctly with symbolic links, either (this is from 3.5.2): >>> import os >>> os.readlink(r'C:\Users\All Users') '\x00\x00f\x00\u0201\x00\x02\x00\x00\x00f\x00\x00\x00' The problem is that PrintNameOffset is an offset in bytes, so it needs to be divided by sizeof(WCHAR) if you're going to add it to a WCHAR pointer (https://msdn.microsoft.com/en-us/library/windows/hardware/ff552012(v=vs.85).aspx). Some links still seem to work correctly because PrintNameOffset is 0. The attached patch fixes this problem also--I wasn't sure if I should open a separate issue for it. -- keywords: +patch Added file: http://bugs.python.org/file44823/issue23407.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Need assistance
On Thursday, July 16, 2015 at 9:16:01 PM UTC-5, craig...@gmail.com wrote: I need help writing a homework program. I'll write it, but I can't figure out how to incorporate what I have read in the book to work in code. The assignment wants us to take a users first, middle and last name in a single input ( name=('enter your full name: )). Then we must display the full name rearranged in Last, First Middle order. I tried to use the search function in Python to locate any spaces in the input. It spot back the index 5 (I used Craig Daniel Sirna) That is correct for the first space, but I can't figure out how to get it to continue to the next space. The indexing process is also a bit confusingto me. I get that I can use len(fullName) to set the length of the index, and how the index is counted, but after that I'm lost. I have emailed my professor a few times, but haven't gotten a response.(online course) Any help would be greatly appreciated. def main(): name= input('Enter your full name: ') split=name.split() Full_name=split[2],split[0], split[1] print(Full_name[2],',', Full_name[0], Full_name[1]) main() Sorry it took so long to get back to you guys and I greatly appreciate all the help!!! But I just did it now and it does work. I have been working on my College algebra homework for the past week and I am still not even finished or ready for the testfml -- https://mail.python.org/mailman/listinfo/python-list
Need assistance
I need help writing a homework program. I'll write it, but I can't figure out how to incorporate what I have read in the book to work in code. The assignment wants us to take a users first, middle and last name in a single input ( name=('enter your full name: )). Then we must display the full name rearranged in Last, First Middle order. I tried to use the search function in Python to locate any spaces in the input. It spot back the index 5 (I used Craig Daniel Sirna) That is correct for the first space, but I can't figure out how to get it to continue to the next space. The indexing process is also a bit confusingto me. I get that I can use len(fullName) to set the length of the index, and how the index is counted, but after that I'm lost. I have emailed my professor a few times, but haven't gotten a response.(online course) Any help would be greatly appreciated. -- https://mail.python.org/mailman/listinfo/python-list
Re: Need assistance
I am in bed, on my phone, gotta be up in 4 hours for work. I will get back with you guys tomorrow after I take care of my Math class stuff. I need to step away from this for a day lol. Worst part...this is the C assignment and it's driving me crazy. I do recall the list fuction. But isn't it imperative that I have the index of the spaces in the string name? I use the Fullname.isspace function. -- https://mail.python.org/mailman/listinfo/python-list
[issue24579] Additional tests for urllib module
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: Tests messages: 246386 nosy: craign priority: normal severity: normal status: open title: Additional tests for urllib module type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24579 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24579] Additional tests for urllib module
Changes by Craig Northway craig.north...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file39877/urllib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24579 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24579] Additional tests for urllib module
Changes by Craig Northway craig.north...@gmail.com: -- versions: +Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24579 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24579] Additional tests for urllib module
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 bit. I'll close this for now. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24579 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24049] Remove unused code in symtable.c and fix docs for import * checking
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 lineno = st-st_cur-ste_lineno; int col_offset = st-st_cur-ste_col_offset; PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING); However in `check_unoptimized` it checks for `import *` being used in a nested function etc. This is the python2 behaviour which wasn't removed at the time the new python3 behaviour was added. According to my analysis and tests it is now impossible for `check_unoptimized` to raise an error, since only valid uses of `import *` are left at the point it is called. I propose to remove that function entirely, its call, and fix some stray documentation in this patch. -- components: Interpreter Core files: python3.5-symtable.patch keywords: patch messages: 241937 nosy: ncw priority: normal severity: normal status: open title: Remove unused code in symtable.c and fix docs for import * checking type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file39195/python3.5-symtable.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24049 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
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 byte-string besides *, and succeeds with the change in the patch. -- Added file: http://bugs.python.org/file38768/imap_auth3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
Craig Holmquist added the comment: New patch is attached. -- Added file: http://bugs.python.org/file38749/imap_auth2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
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_SSL('imap.gmail.com') imap.authenticate(b'PLAIN', lambda x: None) Traceback (most recent call last): File pyshell#5, line 1, in module imap.authenticate(b'PLAIN', lambda x: None) File C:\Python34\lib\imaplib.py, line 380, in authenticate typ, dat = self._simple_command('AUTHENTICATE', mech) File C:\Python34\lib\imaplib.py, line 1133, in _simple_command return self._command_complete(name, self._command(name, *args)) File C:\Python34\lib\imaplib.py, line 940, in _command self.send(literal) File C:\Python34\lib\imaplib.py, line 276, in send self.sock.sendall(data) File C:\Python34\lib\ssl.py, line 723, in sendall v = self.send(data[count:]) File C:\Python34\lib\ssl.py, line 684, in send v = self._sslobj.write(data) TypeError: 'str' does not support the buffer interface The problem is that _Authenticator.process returns a string instead of bytes in this case. -- components: Library (Lib) files: imap_auth.patch keywords: patch messages: 239283 nosy: craigh priority: normal severity: normal status: open title: imaplib authenticate raises TypeError if authenticator tries to abort type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file38694/imap_auth.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23486] Enum comparisons are 20x slower than comparing equivalent ints
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 objects (potentially a few hundred thousand of them) and categorized them with instances of an Enum subclass. The consumer of that iteration processes each object with a switch-case-like comparison of the category, checking it sequentially against each instance of the Enum. This seems like a fairly common use case. From cProfile it looks like EnumMeta.__getattr__ and _is_dunder are the main bottlenecks: [...] 7/10.0000.0000.0000.000 abc.py:194(__subclasscheck__) 10.0000.0000.0010.001 enum.py:1(module) 30.0000.0000.0000.000 enum.py:132(genexpr) 2210.9880.0000.9880.000 enum.py:16(_is_dunder) 190.0000.0000.0000.000 enum.py:24(_is_sunder) 2021.8250.0002.8130.000 enum.py:241(__getattr__) 170.0000.0000.0000.000 enum.py:282(__setattr__) 30.0000.0000.0000.000 enum.py:342(_get_mixins_) 30.0000.0000.0000.000 enum.py:387(_find_new_) [...] -- components: Library (Lib) files: test.py messages: 236234 nosy: craigh priority: normal severity: normal status: open title: Enum comparisons are 20x slower than comparing equivalent ints type: performance versions: Python 3.4 Added file: http://bugs.python.org/file38177/test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23486 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23486] Enum comparisons are 20x slower than comparing equivalent ints
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 == Cat.cat4: #... obj.category is already an instance of Cat, in other words. The consumer is using it to determine what to do with each obj. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23486 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23486] Enum comparisons are 20x slower than comparing equivalent ints
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. The comparison itself is very fast. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23486 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23407] os.walk always follows Windows junctions
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\Test\AppData\Local C:\Users\Test\AppData\Local\Apple C:\Users\Test\AppData\Local\Apple\Apple Software Update C:\Users\Test\AppData\Local\Apple Computer C:\Users\Test\AppData\Local\Apple Computer\iTunes C:\Users\Test\AppData\Local\Application Data C:\Users\Test\AppData\Local\Application Data\Apple C:\Users\Test\AppData\Local\Application Data\Apple\Apple Software Update C:\Users\Test\AppData\Local\Application Data\Apple Computer C:\Users\Test\AppData\Local\Application Data\Apple Computer\iTunes C:\Users\Test\AppData\Local\Application Data\Application Data C:\Users\Test\AppData\Local\Application Data\Application Data\Apple C:\Users\Test\AppData\Local\Application Data\Application Data\Apple\Apple Software Update C:\Users\Test\AppData\Local\Application Data\Application Data\Apple Computer C:\Users\Test\AppData\Local\Application Data\Application Data\Apple Computer\iTunes C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data\Apple C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data\Apple\Apple Software Update C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data\Apple Computer C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data\Apple Computer\iTunes C:\Users\Test\AppData\Local\Application Data\Application Data\Application Data\Application Data [...] For directory symbolic links, os.walk seems to have the correct behavior. However, Windows 7 (at least) employs junctions instead of symlinks in situations like the default user profile layout, i.e. the Application Data junction shown above. I also noticed that, for junctions, os.path.islink returns False but os.stat and os.lstat return different results. -- components: Library (Lib) messages: 235531 nosy: craigh priority: normal severity: normal status: open title: os.walk always follows Windows junctions type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23407 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1038591] Python 2.3+ socket._fileobject handles EAGAIN with data loss
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 tracker rep...@bugs.python.org http://bugs.python.org/issue1038591 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: inheriting a large python code base
Look at the algorithms and see if there are faster ways. Great advice with the comments of writing test cases, getting into version control, taking passes through the code with tools, understanding what is slow and why it is considered slow. Then you should invest the time to understand the internal logic and the algorithms. Understand the performance O(N log N), O(N^2), O(2^N). See if there are better algorithms that should be used - is there an O(N). Implement that algorithm, test, then compare performance. Finally optimize the coding constructs. Depending on how long your program takes (a few milli-secs, a few secs, a few hours, a few days), optimized coding constructs may make no measurable difference. Finding better algorithms will. But a better algorithm changing code from 2 milli-secs to 1 milli-sec is only useful in specific environments - so it may not be worth your effort. Understand the performance of the code and the environment it is executed in. That is how I have gone about it type of work. -- https://mail.python.org/mailman/listinfo/python-list
[issue20353] Hanging bug with multiprocessing + sqlite3 + tkinter (OS X 10.9 only)
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 could well be elsewhere. This happens for us only when run under OS X 10.9 (Mavericks). We are using python 2.7.5; I don't know if other versions are affected. -- components: Tkinter files: hang.py messages: 208838 nosy: Craig.Silverstein priority: normal severity: normal status: open title: Hanging bug with multiprocessing + sqlite3 + tkinter (OS X 10.9 only) type: crash versions: Python 2.7 Added file: http://bugs.python.org/file33631/hang.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20353 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20353] Hanging bug with multiprocessing + sqlite3 + tkinter (OS X 10.9 only)
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 sqlite was waiting on a lock. I don't know what lock it might be though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20353 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: How to install pip for python3 on OS X?
Mavericks? Homebrew all the way. Google Homebrew and install it brew install python3 pip3 install pyserial Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233 On Nov 19, 2013, at 10:55 PM, Travis Griggs travisgri...@gmail.com wrote: OSX (Mavericks) has python2.7 stock installed. But I do all my own personal python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial again. I can do it the way I've done it before, which is: Download pyserial from pypi untar pyserial.tgz cd pyserial python3 setup.py install But I'd like to do like the cool kids do, and just do something like pip3 install pyserial. But it's not clear how I get to that point. And just that point. Not interested (unless I have to be) in virtualenv yet. -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
[issue9816] random.jumpahead and PRNG sequence independence
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 possible for MT, can it be added back into the Python library? -- nosy: +cmcqueen1975 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9816 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9816] random.jumpahead and PRNG sequence independence
Craig McQueen added the comment: C++11 Mersenne Twister discard() member function: http://www.cplusplus.com/reference/random/mersenne_twister_engine/discard/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9816 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9816] random.jumpahead and PRNG sequence independence
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 rep...@bugs.python.org http://bugs.python.org/issue9816 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16487] Allow ssl certificates to be specified from memory rather than files.
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 it comes to polymorphism; routines that are sensitive to object type have been going more and more out of style for the past twenty years, and for good reason. But, having ceded those points, I still think string-or-file-like-object is the correct approach here, simply because it is the overwhelming approach of the Standard Library; everyone is used to it, and will already know the ropes of that approach; and it prevents noisying up the interface with redundant arguments. Were we doing this over again, we would simply not allow a filename at all, and let the user open the file if they needed to. But since a filename is allowed, it feels like the Official Standard Library Approach to also allow a file-like object. Some examples: zipfile.ZipFile: Open a ZIP file, where file can be either a path to a file (a string) or a file-like object. http://docs.python.org/2/library/zipfile#zipfile.ZipFile binhex.hexbin: Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. http://docs.python.org/release/2.7.5/library/binhex.html#binhex.hexbin xml.dom.minidom.parse: filename_or_file may be either a file name, or a file-like object. http://docs.python.org/2/library/xml.dom.minidom.html#xml.dom.minidom.parse mailbox.Mailbox.add: Parameter message may be a Message instance, an email.message.Message instance, a string, or a file-like object (which should be open in text mode). http://docs.python.org/2/library/mailbox.html#mailbox.Mailbox.add pickletools.dis: pickle can be a string or a file-like object. http://docs.python.org/2/library/pickletools.html#pickletools.dis I suggest that these precedents, along with others that I believe we could find with a more exhaustive search of the Standard Library, are sufficient to suggest that in this case the least-surprise approach is a single argument that's either a filename or file-like object. I would suggest reviewing quickly the code for the above examples and following their example for how to distinguish most cleanly between a filename and file-like object; I wonder if they call any common code to get the contents out, or each do it completely by themselves? :) Thanks again for wanting to add this to the SSL module, it will be a *great* addition that solves an important use case! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16487] Allow ssl certificates to be specified from memory rather than files.
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 patch were applied. I had always assumed that it was simply a limitation of the underlying SSL library! An interface that takes a filename like this, instead of a live file-like object, seems so un-Pythonic that I assumed the only reason for it was a limitation in OpenSSL. Thank you very much for looking under the covers and discovering that this was not the case! I do, though, feel a slight twinge when we add Even More Parameters to a Standard Library routine but in such a way that it cannot be used with an existing parameter — as here in your patch, where we gain a parameter like `certdata` that cannot be (should not be?) used at the same time as `certfile`. It seems redundant to have two names for the same parameter to the underlying library, and makes it look like the routine needs more information than it really does. Since my own instinct was to think, ten minutes ago, Maybe I can pass a StringIO, since it says it wants a fine!, I am very much in support of the idea of keeping only the existing parameters, but making them accept both strings (which, for compatibility, would continue to be interpreted as filenames) and file-like objects as arguments. I think this would have a great deal of symmetry with how other parts of the Standard Library work, while keeping this patch's central value of making it possible for those of us with cert-heavy code to avoid the creation of thousands of files a minute. Again, thank you VERY much for discovering that OpenSSL can do this, and I will try to provide whatever encouragement I can as you try to shepherd this past the other committers. -- nosy: +brandon-rhodes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16487 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17855] Implement introspection of logger hierarchy
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 maintained forever. Reading back over the current logging documentation, it looks like the problem is that the documentation only includes verbs — the methods that can be invoked — but not adjectives: the attributes that are attached to each logger, handler, and filter. This is contrary to modern Python APIs, which typically document their attributes and offer direct access to them; within the Standard Library, cf the threading.Thread object for one that has done a good job of moving into the modern world with directly-accessible attributes. So my guess would be that you should discard the idea of a separate introspection API, and simply document that attributes of each logger, handler, and filter that today are already perfectly introspectable. Check out the logging_tree code if you want to make sure that you are “promoting” into document-hood all of the attributes that I needed in order to do my introspecting there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17855 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18051] get_python_version undefined in bdist_rpm.py
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 module run_setup(True) File setup.py, line 99, in run_setup cmdclass={'build_ext': ve_build_ext}, File /home/cmcdaniel/src/cpython/Lib/distutils/core.py, line 152, in setup dist.run_commands() File /home/cmcdaniel/src/cpython/Lib/distutils/dist.py, line 953, in run_commands self.run_command(cmd) File /home/cmcdaniel/src/cpython/Lib/distutils/dist.py, line 972, in run_command cmd_obj.run() File build/bdist.linux-i686/egg/setuptools/command/bdist_rpm.py, line 28, in run File /home/cmcdaniel/src/cpython/Lib/distutils/command/bdist_rpm.py, line 383, in run pyversion = get_python_version() NameError: global name 'get_python_version' is not defined -- assignee: eric.araujo components: Distutils files: mywork.patch keywords: patch messages: 189926 nosy: Craig.McDaniel, eric.araujo, tarek priority: normal severity: normal status: open title: get_python_version undefined in bdist_rpm.py versions: Python 2.7 Added file: http://bugs.python.org/file30361/mywork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18051 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18051] get_python_version undefined in bdist_rpm.py
Craig McDaniel added the comment: Closing; duplicate of 18045 -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18051 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13477] tarfile module should have a command line
Brandon Craig Rhodes added the comment: Larry Hastings rep...@bugs.python.org 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 to introspect the data is because: (a) Tar runs gunzip -c (for example) as an external program; it does not actually compile against libz. (b) Streams in UNIX cannot be rewound. Tar cannot look at the first block of an input pipe and then put the block back so that the same input can be fed directly to gunzip as its input. (c) Given (a) and (b), tar could only support data introspection of input from a pipe if it were willing to be a pass-through that, after reading and introspecting the first block, then fired up gunzip and sent ALL of the blocks through. Which would require multiprocessing, threading, or async I/O so that tar could both read and write, which would make tar more complicated. (d) Therefore, tar refuses to even look. Since Python does bundle compression in its standard library, it can quite trivially step forward and actually do the data introspection that tar insists on not doing; the first few bytes of a tar archive are quite demonstrably different from the first bytes of a gzip stream, if I recall. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17370] PEP should not if it has been superseded
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 them. I think his idea is great, and is like the feature of PyPI where if Google lands you on an old version of a package then it is careful to tell you up at the top that a more recent version is available. This could extend to all sorts of cross-references that we should maintain: some PEPs have been superseded; others have more recent supplements that people should read as well (think of the relationship between packaging PEPs); PEPs that did not wind up being implemented have cousins who were; and so forth. Is this something that needs to wait until the New Python Web Site appears, and that would be meta-markup somehow maintained along with the PEP texts themselves? Or should there be a “Related PEPs” paragraph that we open at the top of each relevant PEP and just include the cross-links as raw updates to the PEP's own restructured text? I'm open to a simple implementation here, so long as we can provide more “community context” when people land on a PEP. -- assignee: docs@python components: Documentation messages: 183625 nosy: brandon-rhodes, docs@python priority: normal severity: normal status: open title: PEP should not if it has been superseded ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17370 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17370] PEP should note if it has been superseded
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17370 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17370] PEP should note if it has been superseded
Brandon Craig Rhodes added the comment: The original inspiration: https://twitter.com/theomn/status/309468740611891200 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17370 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12758] time.time() returns local time instead of UTC
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 confused by the current documentation, hence finding this issue. In what timezone is the epoch? It makes a difference. It seems with the current behaviour, the epoch is _in the local timezone_. So I reckon the documentation is unclear, because the way I read it, I interpretted it to mean UTC. I think it does need to state in local time. However, what I'd really prefer is a new function that returns the seconds since the epoch in UTC. -- nosy: +cmcqueen1975 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12758 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Beowulf clusters
When you write HPC code the GIL isn't an issue, but you'll have plenty of others. Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233 On Jan 13, 2013, at 6:22 PM, Mark Janssen dreamingforw...@gmail.com wrote: On Sun, Jan 13, 2013 at 8:19 PM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 14 January 2013 02:10, Mark Janssen dreamingforw...@gmail.com wrote: Has anyone used python for high-performance computing on Beowulf clusters? Yes. How did they deal with the Global interpreter lock across many machines? Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: RIse and fall of languages in 2012
At one point or another I'm pretty sure I've googled _ sucks for every language I've ever used- even the ones I like. ie: Python easily more than once. Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233 On Jan 10, 2013, at 3:32 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 10 Jan 2013 12:42:49 -0700, Michael Torrie wrote: And from the TIOBE Index, Python is steady at number 8: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html The TIOBE index is meaningless. Since it's based on google searches, one could probably guess that any language that is awkward and difficult will require more searches to figure out how to use the thing. Thus of course C is top! Especially if ranked by sarcastic queries like, C sucks, and why does C suck so much. If you have a problem with TIOBE's methodology, feel free to come up with your own. Or take it up with them. I dispute that TIOBE measures difficulty of language. If it did, Malbolge would likely be at the top of the list. Yes, there are sarcastic queries asking C sucks, but that's just measurement error: 21,200 hits for C sucks versus 9,900,000 for C programming. It's not as if there is any language, not even Python, that is so easy to use that nobody needs to write about it. Javascript is doing much more than just treading water. How do you know? What's *your* methodology for determining the popularity of a language? * But everybody knows that Javascript is super popular!!! * All my friends are using Javascript. * I'm a web developer, and I use Javascript for my day job. * I counted 14 job adverts on Monster.com for Javascript devs last week, what more evidence does anyone need? * I googled for `What's the most popular language?` and found a blog that says it's Javascript, that's good enough for me. * I have a gut feeling. If you are going to criticise TIOBE's methodology, and then make your own claims for language popularity, you really need to demonstrate that your methodology is better. Javascript may not be glamorous but it is *the* glue that makes the web run. And web development is a tiny fraction of all software development. -- Steven -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
[issue16338] pysnmp/asyncore - timeout ineffective?
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 rep...@bugs.python.org http://bugs.python.org/issue16338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16338] pysnmp/asyncore - timeout ineffective?
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 python2.7.3, and ubuntu, and the timeout attribute appears to be failing. Not sure if this is a bug with pysnmp or asyncore. I apologize for the brevity of the situation, but will be happy to provide more details upon request. -- components: None messages: 173940 nosy: Trenton.Craig priority: normal severity: normal status: open title: pysnmp/asyncore - timeout ineffective? type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15315] Can't build Python extension with mingw32 on Windows
Craig McQueen pyt...@craig.mcqueen.id.au 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' failed with exit status 1 I'll have to see if I can get the required library I guess. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15315] Can't build Python extension with mingw32 on Windows
Craig McQueen pyt...@craig.mcqueen.id.au 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 command line option '-mno-cygwin' error: command 'gcc' failed with exit status 1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15315] Can't build Python extension with mingw32 on Windows
Craig McQueen pyt...@craig.mcqueen.id.au 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 library for msvcr100? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12641] Remove -mno-cygwin from distutils
Craig McQueen pyt...@craig.mcqueen.id.au 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 tracker rep...@bugs.python.org http://bugs.python.org/issue12641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12641] Remove -mno-cygwin from distutils
Craig McQueen pyt...@craig.mcqueen.id.au 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 libmsvcr100. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15315] Can't build Python extension with mingw32 on Windows
Craig McQueen pyt...@craig.mcqueen.id.au 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 looked at MinGW releases to see if I can find one that supports both the -mno-cygwin option and msvcr100. I guess the best solution for this is to resolve issue #12641 for Python 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15315] Can't build Python extension with mingw32 on Windows
New submission from Craig McQueen pyt...@craig.mcqueen.id.au: 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 with Python 3.2. -- components: Extension Modules messages: 165159 nosy: cmcqueen1975 priority: normal severity: normal status: open title: Can't build Python extension with mingw32 on Windows versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15025] httplib and http.client are missing response messages for defined WEBDAV responses, e.g., UNPROCESSABLE_ENTITY (422)
New submission from Craig Loftus cr...@wildknowledge.co.uk: 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 issue that I have hit, but the same is true of all the WEBDAV status codes that constants are defined for. -- components: Library (Lib) messages: 162470 nosy: craigloftus priority: normal severity: normal status: open title: httplib and http.client are missing response messages for defined WEBDAV responses, e.g., UNPROCESSABLE_ENTITY (422) type: behavior versions: Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15025 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14550] os.path.abspath() returns physical path, not logical path.
New submission from Craig Sawyer csaw...@yumaed.org: 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 os.getcwd() returns without symbolic links as well, so os.path.abspath() == os.path.realpath() near as I can tell. I think os.path.abspath() should return a logical path(i.e. one with symlinks). The only solution I know of is to getenv('PWD') except that is not guaranteed to be around in POSIX (some BSD's don't offer PWD I understand). The other option is to ask /bin/pwd which is part of the POSIX standard. Anyways, I couldn't find a previous bug around this issue, but I think there should be a way in the standard library to get a logical path, as well as a realpath(). -- components: None messages: 158056 nosy: csawyer-yumaed priority: normal severity: normal status: open title: os.path.abspath() returns physical path, not logical path. type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14550 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14550] os.path.abspath() returns physical path, not logical path.
Craig Sawyer csaw...@yumaed.org 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 working directory's parent directories). I'd love to see something like os.path.abspath(path, logical=True) which would use PWD instead of getcwd() to get the current working directories path. i.e. symlinks are honored within the current path. From a language perspective this probably means needing os.getpwd() or something similar, that would return the pwd information. I know pwd isn't always guaranteed to be around, so the failsafe should be to return getcwd() in that case, just like os.path.abspath() does now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14550 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
alternative to with statement?
I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. The best I've found is to abuse the for notation: for _ in cachingcontext(x): # create cached resources here # return cached resources I would have really liked: with cachingcontext(x): # create cached resources here # return cached resources I'd also like to avoid the following because it is unnecessary boilerplate: with cachingcontext(x) as skip: if not skip: # create cached resources here # return cached resources -- http://mail.python.org/mailman/listinfo/python-list
Re: alternative to with statement?
It is a bit non-normal. but I think this is a good use case as I want to create a very simple-to-use system for non-python experts to safely wrap their CLI programs in a caching architecture... that's why I lament the inability to not use the more streamlined 'with' syntax– abusing the for loop might just be confusing. The with statement is also a good fit because the caching strategy does have to atomically acquire, create and release the appropriate locks. With this statement the cached CLI wrappers can be called from simultaneously from different scripts and still coordinate their activity, by waiting for each other to finish, and reusing the cached results, etc. On Feb 28, 2012, at 1:04 PM, Craig Yoshioka wrote: I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. The best I've found is to abuse the for notation: for _ in cachingcontext(x): # create cached resources here # return cached resources I would have really liked: with cachingcontext(x): # create cached resources here # return cached resources I'd also like to avoid the following because it is unnecessary boilerplate: with cachingcontext(x) as skip: if not skip: # create cached resources here # return cached resources -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
[issue4028] Problem compiling the multiprocessing module on sunos5
Craig Foster foster.cr...@gmail.com 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 rep...@bugs.python.org http://bugs.python.org/issue4028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13477] tarfile module should have a command line
New submission from Brandon Craig Rhodes bran...@rhodesmill.org: 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 Python has been installed but nothing else. Would such a patch be welcome if I could write one up? -- messages: 148300 nosy: brandon-rhodes priority: normal severity: normal status: open title: tarfile module should have a command line ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7689] Pickling of classes with a metaclass and copy_reg
Craig Citro craigci...@gmail.com 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__` function with just `return cmp(type(self), type(other))`. On the flipside, I could see an argument for adding *more* content to the test, but that seemed like overkill. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7689] Pickling of classes with a metaclass and copy_reg
Craig Citro craigci...@gmail.com 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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1947] Exception exceptions.AttributeError '_shutdown' in module 'threading'
Brandon Craig Rhodes bran...@rhodesmill.org 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 shadowing the Standard Library module. This upsets the Python exit logic, which tries to run `threading._shutdown()` if `threading` exists in `sys.modules`. I just helped someone on Stack Overflow with a situation like this, which in that case resulted from an error in how `pylint` works. -- nosy: +brandon-rhodes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1947 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] coverage of Python regrtest cannot see initial import of libs
Brandon Craig Rhodes bran...@rhodesmill.org 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 copyright problem. So I happily withdraw my request for this feature. Nick, Brett is working on exactly the sort of devguide improvement that you suggest — not least because the devguide will now need to instruct people in how to build coverage so that its C-accelerated tracer is available, which Ned's own patch to coverage to cover stdlib tracing uses instead of the Python tracer that I cut-and-pasted into this patch. Finally, it would be wonderful to have a more formal mechanism for boot-time interventions. I have mentioned before my wish that Python's first action be to open() the executable, check its tail to see if it's a valid zipfile, and if so to try loading and running startup.py from that zipfile. Among other things, that would allow single-file distribution of pure-Python applications without the py2exe/py2app mess that prevails in the projects I work with today. But since the whole issue of grabbing control at boot time raises hackles (why would you want to do that!?), and I needed something working immediately during the PyCon sprint, I elected to simply adopt encodings.py as my way in. It works great, and coverage can evolve to an even better mechanism as soon as one becomes available, should anyone want to take the bootup option and run with it. One final thought: should PyPy etc also implement the same boot protocol, should one be invented, so that all mainline interpreters can be instrumented the same way? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1205239] Let shift operators take any integer value
Craig McQueen pyt...@craig.mcqueen.id.au 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 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1205239 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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 normally can't see the outer, global scope execution of modules that are already imported by the time coverage itself can take control and install a tracer. I have another patch outstanding that fixes this — we are still working on it, but the code works fine — if you want to run coverage and see a more accurate number: http://bugs.python.org/issue11561 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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 attaching a fourth version of the patch. It incorporates your two suggestions, Éric. It also applies cleanly once against today's trunk; besides the usual line number changes as code has come and gone, I am happy to see that my change of an assertTrue for an assertIs in the test suite has already taken place thanks to another patch in the meantime. -- Added file: http://bugs.python.org/file22822/test_copy4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] coverage of Python regrtest cannot see initial import of libs
Brandon Craig Rhodes bran...@rhodesmill.org 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 long comment, and the inheritance from object — might make it harder to bring in changes from his own copy if he should ever further improve it.) I have tried to write the comments to be more informative, while also addressing your own ideas; let me know if you like the result! Oh: and, I am continuing to use this new file in my own work on the Python core, and it has been working fine — so no problems with the actual code have developed over these first 3+ months of use. -- Added file: http://bugs.python.org/file22823/fullcoverage2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
AUTO: Craig Churchill is out of the office (returning 27/07/2011)
I am out of the office until 27/07/2011. I will respond to your message when I return. If you require assitance in relation to the SPEAR Integration project please contact Terry Mandalios. Note: This is an automated response to your message Re: Tabs -vs- Spaces: Tabs should have won. sent on 19/7/2011 2:59:19. This is the only notification you will receive while this person is away. Notice: This email and any attachments may contain information that is personal, confidential, legally privileged and/or copyright.No part of it should be reproduced, adapted or communicated without the prior written consent of the copyright owner. It is the responsibility of the recipient to check for and remove viruses. If you have received this email in error, please notify the sender by return email, delete it from your system and destroy any copies. You are not authorised to use, communicate or rely on the information contained in this email. Please consider the environment before printing this email. -- http://mail.python.org/mailman/listinfo/python-list
Looking for beta testers for Rapid Application Development tool for Python
We're looking for beta testers for our new product. Testers who send feedback and bug reports will be given a free copy of the released version of the software after testing is completed. What's our product? Gumption is a powerful and versatile toolkit for building computer applications using the Python language. With a few mouse clicks you can create screens with buttons, checkboxes, radio buttons, list boxes, combo boxes, and more. The built-in script editor allows you to write the Python code for your application, and you can customize your menus using the menu builder. Applications are cross-platform so they can be used on Windows, OS X, and Unix computers with no recompiling. It uses native widgets, so your application will look correct no matter what operating system it's running on. Still interested? If so email us with the subject line: Beta Test. Let us know how long you've been using Python, how you expect to use our software, and what platforms you'll be testing on (Windows, Unix, or Apple OS X). http://www.seagrape.us/news.html -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
[issue12056] … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP)
Brandon Craig Rhodes bran...@rhodesmill.org 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 Obvious Way of typing any given expression. Instead there would now be several alternate ways, with different styles in different codebases and, I think, something of a visual and symbolic mess resulting. I like each symbol to have exactly one possible representation. -- nosy: +brandon-rhodes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12056 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11629] Reference implementation for PEP 397
Changes by Craig McQueen pyt...@craig.mcqueen.id.au: -- nosy: +cmcqueen1975 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: Nick Coghlan rep...@bugs.python.org 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 issue, and, looking at test_copy3.patch, isn't there already a comment next to each __reduce_ex__ check that reminds the reader that object.__reduce_ex__ will itself call __reduce__? Does the comment just need to be more elaborate or something? Finally, Éric wants me to replace this: self.assertTrue(issubclass(copy.Error, Exception)) with self.assertIsInstance(). But surely the question is not whether copy.Error is an *instance* of Exception? They are both instances of *type*, right? What I would need is something like assertIsSubclass or assertInheritsFrom, neither of which exists. So I think that test_copy3.patch already includes all of the valid improvements on the table; if I'm missing one, just point it out and I'll fix it! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: Nick Coghlan rep...@bugs.python.org writes: Nick Coghlan ncogh...@gmail.com 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__ check. I had initially wanted to make a comment, but feared the objection that a comment would eventually fall out of sync with the implementation of object.__reduce_ex__ over the years (just as copy.py currently has all sorts of cruft that is no longer applicable). But I think that you are right that a comment that's at least true today is better than no comment at all; so I will add one on Monday. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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 never exists. A further improved patch (#3) is attached. -- Added file: http://bugs.python.org/file21276/test_copy3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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? I do not understand your question about Unicode — could you reference the line number in the patch file that is worrying you? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
New submission from Brandon Craig Rhodes bran...@rhodesmill.org: 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-reports-missing-branch This patch makes several minor improvements to copy: when doing getattr lookups with a default of None, it now uses an is comparison against None which is both faster and more correct; several special cases have been removed since Python 3 always has CodeType available; and an ancient obsolete test suite that had been appended to copy.py in ancient times has been removed. -- files: test_copy.patch keywords: patch messages: 131135 nosy: brandon-rhodes priority: normal severity: normal status: open title: bring Lib/copy.py to 100% coverage versions: Python 3.3 Added file: http://bugs.python.org/file21244/test_copy.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue502085] pickle problems (with Boost.Python)
Brandon Craig Rhodes bran...@rhodesmill.org 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. The attached patch also changes assertIs() and assertIsNot(), and uses self.fail() instead of the exception inside of support. Thanks for those pointers! -- keywords: +patch nosy: +brandon-rhodes Added file: http://bugs.python.org/file21245/test_copy2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue502085 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue502085] pickle problems (with Boost.Python)
Changes by Brandon Craig Rhodes bran...@rhodesmill.org: Removed file: http://bugs.python.org/file21245/test_copy2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue502085 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes bran...@rhodesmill.org 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 achieved, so that I do not come back to this module every few months and have to re-discover why it is not 100%. But for the moment I have indeed removed the pragmas, pending a better approach! -- Added file: http://bugs.python.org/file21246/test_copy2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] coverage of Python regrtest cannot see initial import of libs
New submission from Brandon Craig Rhodes bran...@rhodesmill.org: 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 process and were already loaded when the coverage command got control. -- messages: 131051 nosy: brandon-rhodes priority: normal severity: normal status: open title: coverage of Python regrtest cannot see initial import of libs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com