[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 <http://bugs.python.org/issue1038591> ___ ___ 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
[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
[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
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
[issue7689] Pickling of classes with a metaclass and copy_reg
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__` 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 <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 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 <http://bugs.python.org/issue7689> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4028] Problem compiling the multiprocessing module on sunos5
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/issue4028> ___ ___ 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 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 <http://bugs.python.org/issue1205239> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10592] pprint module doesn't work well with OrderedDicts
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue10592> ___ ___ 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 : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue11629> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9196] Improve docs for string interpolation "%s" re Unicode strings
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 tracker <http://bugs.python.org/issue9196> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9196] Improve docs for string interpolation "%s" re Unicode strings
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. -- Added file: http://bugs.python.org/file20334/class_str_unicode_methods.py ___ Python tracker <http://bugs.python.org/issue9196> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2840] Expat parser locks XML source file if ContentHandler raises an exception
New submission from Craig Holmquist <[EMAIL PROTECTED]>: This was observed in Python 2.5.2 on Windows XP. Run this code in IDLE: import xml.sax from xml.sax.handler import ContentHandler class C(ContentHandler): def startElement(self, name, attrs): assert False xml.sax.parse(xml_path, C()) Where "xml_path" points to a well-formed XML file. This will raise an AssertionError. Then, attempt to modify or delete the XML file that was specified; it's still locked by the Python process. Deleting the ContentHandler does not unlock it. There doesn't seem any way to unlock it aside from terminating the Python process. If the ContentHandler doesn't raise an exception or error, the file is unlocked properly. -- components: XML messages: 66754 nosy: craigneuro severity: normal status: open title: Expat parser locks XML source file if ContentHandler raises an exception type: behavior versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2840> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3215] Can't import sqlite3 in Python 2.6b1
New submission from Craig Holmquist <[EMAIL PROTECTED]>: This is observed on Windows XP; I don't know if it affects other platforms. Trying to import sqlite3 gives this error: >>> import sqlite3 Traceback (most recent call last): File "", line 1, in import sqlite3 File "C:\Python26\Lib\sqlite3\__init__.py", line 24, in from dbapi2 import * File "C:\Python26\lib\sqlite3\dbapi2.py", line 27, in from _sqlite3 import * ImportError: DLL load failed: The specified module could not be found. A look at the dependencies for _sqlite3.pyd shows that it's trying to link to a file called sqlite3.pyd, which doesn't exist. Renaming sqlite3.dll to sqlite3.pyd doesn't work either, because then "import sqlite3" causes Python to try to import that file as a Python module (instead of C:\Python26\Lib\sqlite3\__init__.py). In Python 2.5.2, the _sqlite3.pyd module correctly links to sqlite3.dll. If there's already an issue regarding this I couldn't find it. -- components: Extension Modules, Windows messages: 68827 nosy: craigneuro severity: normal status: open title: Can't import sqlite3 in Python 2.6b1 type: behavior versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3215> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4019] 2.6 (final) uses old icons in Start Menu
New submission from Craig Holmquist <[EMAIL PROTECTED]>: The Start Menu icons created by the Python 2.6 installer use the old icons (the green snake, 4-bit color) instead of the new ones (blue and yellow snake, 24-bit color). This was observed on Windows XP. An installation of 2.5.2 on the same machine uses the new icons. -- components: Installation messages: 74171 nosy: craigneuro severity: normal status: open title: 2.6 (final) uses old icons in Start Menu type: behavior versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4019> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4019] 2.6 (final) uses old icons in Start Menu
Changes by Craig Holmquist <[EMAIL PROTECTED]>: -- components: +Windows ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4019> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4043] Attempting to import deprecated modules in IDLE raises TypeError
New submission from Craig Holmquist <[EMAIL PROTECTED]>: In Python 2.6, attempting to import depecated modules in IDLE raises a TypeError exception. I verified this with sets, mimify, and MimeWriter. Here's the output for sets: >>> import sets Traceback (most recent call last): File "", line 1, in import sets File "C:\Python26\Lib\sets.py", line 85, in stacklevel=2) File "C:\Python26\Lib\warnings.py", line 29, in _show_warning file.write(formatwarning(message, category, filename, lineno, line)) TypeError: idle_formatwarning_subproc() takes exactly 4 arguments (5 given) The other modules give a similar trace. Normally, I wouldn't consider this a serious issue, but there are some major packages out there that still use deprecated modules such as these. For example, MySQLdb 1.2.2 and SQLAlchemy 4.7p1 import the sets module so they can't be used at all in IDLE. -- components: IDLE messages: 74324 nosy: craigh severity: normal status: open title: Attempting to import deprecated modules in IDLE raises TypeError type: behavior versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4043] Warnings in IDLE raise TypeError (such as attempting to import deprecated modules)
Craig Holmquist <[EMAIL PROTECTED]> added the comment: Actually, it looks like ANY warning will raise this error in IDLE. For example: >>> import warnings >>> warnings.warn('blah blah') Traceback (most recent call last): File "", line 1, in warnings.warn('blah blah') File "C:\Python26\Lib\warnings.py", line 29, in _show_warning file.write(formatwarning(message, category, filename, lineno, line)) TypeError: idle_formatwarning_subproc() takes exactly 4 arguments (5 given) -- title: Attempting to import deprecated modules in IDLE raises TypeError -> Warnings in IDLE raise TypeError (such as attempting to import deprecated modules) ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4043] Warnings in IDLE raise TypeError (such as attempting to import deprecated modules)
Craig Holmquist <[EMAIL PROTECTED]> added the comment: I should have checked this more carefully, but apparently you can still use the imported module after the exception. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4043] Warnings in IDLE raise TypeError (such as attempting to import deprecated modules)
Craig Holmquist <[EMAIL PROTECTED]> added the comment: Okay, I think I've got it now: 1. If you import sets, it raises TypeError. However, if you import it a second time, it seems to work properly. 2. Trying to import a module that relies on the deprecated module (ie, sqlalchemy) fails no matter how many times it's imported. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4043> ___ ___ 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 added the comment: Just for the record... here is a relevant use case... I'm working on some code for calculating CRCs, and hope to support any CRC width, including CRC-5. This involves, among the calculations: crc >> (crc_width - 8) The complete expression is: crc = table[((crc >> (crc_width - 8)) ^ data_byte) & 0xFF] ^ (crc << 8) where crc_width is typically 32 or 16, but in the case of CRC-5 would be 5. I think the calculation would work fine for all cases, if only Python allowed me to right-shift with a negative number. But now I'll have to handle the two cases separately. -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue1205239> ___ ___ 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 added the comment: Thanks, good points. I'm thinking with a C background and the fixed-width data types. The 0xFF could be needed if the data_byte is actually a larger number and you need to ensure only the lowest 8 bits are set. Or, if there is some sign-extending going on with the right-shift. That could happen in Python if the user passed a negative 'crc' in to the function (for whatever reason). Yes, I'm missing a final mask. Thanks for pointing that out. I was thinking like a C programmer! As for crc << 8 >> crc_width... the 'crc << 8' could bump an integer into long territory, making calculations slower. E.g.: >>> 2**23 << 8 >> 16 32768L >>> 2**23 >> (16 - 8) 32768 -- ___ Python tracker <http://bugs.python.org/issue1205239> ___ ___ 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 added the comment: To complete that thought... Since crc << 8 could bump the calculation into long territory, for that final mask I guess I'd want to mask and then shift. I.e. rather than crc_mask = ((1 << crc_width) - 1) crc = (...) ^ ((crc << 8) & crc_mask) do: crc_lower_mask = ((1 << (crc_width - 8)) - 1) crc = (...) ^ ((crc & crc_lower_mask) << 8) But that expression should evaluate to 0 if crc_width <= 8, so I guess I'll need to special-case it. And if I special-case it, I don't need to shift by a negative value after all! -- ___ Python tracker <http://bugs.python.org/issue1205239> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4617] SyntaxError when free variable name is also an exception target
Craig McQueen added the comment: There's also this one which caught me out: def outer(): x = 0 y = (x for i in range(10)) del x # SyntaxError -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue4617> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: This still seems to be a bug in Python 3.1.1, does it not? Can this be re-opened? -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: Not so much of a traceback. But essentially the same final error: running build running build_py running build_ext building 'cobs._cobsext' extension error: Unable to find vcvarsall.bat -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: This bug was confirmed to no longer be present for Python 2.6.4, however it is still present for Python 3.1.1. Could someone with "open" privileges re-open this please? -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: I ran it as follows: \python31\python.exe setup.py build --compiler=mingw32 --verbose and got: running build running build_py running build_ext building 'cobs._cobsext' extension error: Unable to find vcvarsall.bat If I run: gcc --version I get: gcc (GCC) 3.4.5 (mingw-vista special r3) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Path: PATH=C:\Program Files\CollabNet\Subversion Server;C:\WINNT\Microsoft.NET\Framewo rk\v1.1.4322\;C:\WINNT\system32;C:\WINNT;C:\Program Files\Microsoft Visual Studi o 8\VC\bin;C:\Program Files\Subversion\bin;C:\Program Files\IVI Foundation\IVI\b in;C:\Program Files\IVI Foundation\VISA\WinNT\Bin\;C:\PROGRA~1\IVIFOU~1\VISA\Win NT\Bin;C:\Program Files\IVI Foundation\VISA\WinNT\Bin;c:\python26\;C:\Program Fi les\TortoiseSVN\bin;C:\Program Files\TortoiseHg;c:\MinGW\bin -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: And, I should add, doing nearly the same thing, except with Python 2.6.4, works fine. Same machine, same console window, same path: \python26\python.exe setup.py build --compiler=mingw32 --verbose running build running build_py running build_ext building 'cobs._cobsext' extension c:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Pytho n26\PC -c src/_cobsext2.c -o build\temp.win32-2.6\Release\src\_cobsext2.o writing build\temp.win32-2.6\Release\src\_cobsext.def c:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.6\Release\src\_co bsext2.o build\temp.win32-2.6\Release\src\_cobsext.def -LC:\Python26\libs -LC:\P ython26\PCbuild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\cobs\_cobsext.pyd -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: I tried it in Python 3.1.2. \Python31\python.exe setup.py build --compiler=mingw32 I got a stack-trace: ... File "C:\Python31\lib\distutils\cygwinccompiler.py", line 280, in __init__ CygwinCCompiler.__init__ (self, verbose, dry_run, force) File "C:\Python31\lib\distutils\cygwinccompiler.py", line 124, in __init__ if self.ld_version >= "2.10.90": TypeError: unorderable types: NoneType() >= str() -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8384] Distutils C extension build with MinGW on Windows fails
New submission from Craig McQueen : I tried to build a C extension in Python 3.1.2. \Python31\python.exe setup.py build --compiler=mingw32 I got a stack-trace: ... File "C:\Python31\lib\distutils\cygwinccompiler.py", line 280, in __init__ CygwinCCompiler.__init__ (self, verbose, dry_run, force) File "C:\Python31\lib\distutils\cygwinccompiler.py", line 124, in __init__ if self.ld_version >= "2.10.90": TypeError: unorderable types: NoneType() >= str() This is Windows 2000 SP4, with MinGW 5.1.6. -- assignee: tarek components: Distutils messages: 103000 nosy: cmcqueen1975, tarek severity: normal status: open title: Distutils C extension build with MinGW on Windows fails type: crash versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue8384> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: Sure can--done. Issue #8384. -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8384] Distutils C extension build with MinGW on Windows fails
Craig McQueen added the comment: \MinGW\bin\ld.exe -v GNU ld (GNU Binutils) 2.20 -- ___ Python tracker <http://bugs.python.org/issue8384> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8384] Distutils C extension build with MinGW on Windows fails
Craig McQueen added the comment: I just realised--I didn't have c:\mingw\bin in my path. Once I added that to the path, then the build worked fine. So I guess the issue is only that the error message is somewhat cryptic. -- ___ Python tracker <http://bugs.python.org/issue8384> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
New submission from Craig Holmquist <[EMAIL PROTECTED]>: Applications on Windows that don't link to the MSVCR90.DLL via a manifest are broken with Python 2.6.1. This includes apps that link with the C library statically and apps that link with other versions of it. These applications worked fine with Python 2.6. To test this, I created a simple application that did nothing but call Py_Main (compiled with VS2008). When that app links with the C library statically, attempting to import the socket module gives this error: Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\socket.py", line 46, in import _socket ImportError: DLL load failed: The specified module could not be found. When that app links with the C library dynamically, it works properly. In particular, this issue breaks mod_python. From the Apache error log: [Sat Dec 06 00:49:21 2008] [error] make_obcallback: could not import mod_python.apache.\n Traceback (most recent call last): File "C:\Python26\lib\site-packages\mod_python\apache.py", line 29, in import cgi File "C:\Python26\Lib\cgi.py", line 40, in import urllib File "C:\Python26\Lib\urllib.py", line 26, in import socket File "C:\Python26\lib\socket.py", line 46, in import _socket ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. I'm guessing this is a side-effect of the fix for #4120. Since modules like _socket.pyd don't have manifests that tell Windows where to find the side-by-side assembly to load, and the application loading _socket.pyd doesn't have it in its manifest either, Windows has no clue where to find MSVCR90.dll. Something I discovered (by accident) is that, if there's an external manifest in the same folder as the hosting application (ie, testpy.exe.manifest) that points to the C runtime, it fixes the problem, even if the host app links statically to the C runtime. I don't recall off-hand whether these external manifests take precedence over the internal ones, but in this case it seems to provide enough information to Windows that it can resolve the dependency. -- components: Windows messages: 77133 nosy: craigh severity: normal status: open title: 2.6.1 breaks many applications that embed Python on Windows type: behavior versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Changes by Craig Holmquist <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file12249/testpy.c ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist <[EMAIL PROTECTED]> added the comment: I've attached the test program I was using. The commands I used to compile it are: cl /MT /c /IC:\Python26\include testpy.c link /LIBPATH:C:\Python26\libs testpy.obj ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist <[EMAIL PROTECTED]> added the comment: I've attached a manifest file that references the C runtime; adding this file to the Apache bin folder seems to workaround this issue. Added file: http://bugs.python.org/file12250/httpd.exe.manifest ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist <[EMAIL PROTECTED]> added the comment: I understand the rationale behind #4120, but it seems like it only helps a narrow set of applications, namely "applications that link dynamically with the same version of MSVCR90 as Python and that bundle the MSVCR90 DLL and that can't install the VS2008 redist". In 2.6.1 those apps don't have to install the VS2008 redist, but every other app needs to either bundle the runtime DLLs (as a private assembly) or use the manifest workaround I described above, even if the VS2008 redist is installed on the system. The 2.6.0 behavior - requiring the VS2008 redist to be installed - is hardly perfect (to put it mildly), but in my opinion it's more obvious and straightforward, and more consistent with the behavior of other Windows software. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist <[EMAIL PROTECTED]> added the comment: > I don't quite understand this issue yet. python26.dll is linked with > a manifest. Isn't that good enough? Apparently not, at least in my testing. It seems that if a DLL is loaded, Windows will try to resolve its dependencies by looking at that DLL's own manifest; if that fails, Windows will try to resolve them by looking at the EXE's manifest. It won't check other DLLs. From the loader's perspective, it seems like there's no "tree" of DLLs, it's just "EXE loads DLL, EXE loads DLL", even if the loading code is actually in one of the DLLs. I guess I'm more concerned about applications like Apache that only use Python through an external module or plugin; there's no reason the Apache developers would be expected to make this kind of change with the manifests and everything, much less any commercial, closed-source app (say, an IDE or editor that has plugins for several scripting languages). Also, the manifest trick I described as a workaround was only as simple as it was in this case because httpd.exe didn't have any manifest at all; if it already had an internal manifest, working-around this would have been much more gruesome. I understand, though, the value of "xcopy deployment", and I realize that having some means of doing that is better than none at all. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist added the comment: Here's an option, though unfortunately not a trivial one: use a private build of the C runtime. The Windows version of Firefox does this (mozcrt19.dll). The private CRT build doesn't use SxS in any way, so it gets around this issue, as well as other issues like not allowing "for me" installs on Vista (#4018). For me to build the CRT from the source included with Visual Studio 2008 took some tweaking - apparently having the CRT source build properly out of the box wasn't a priority for MS (the Mozilla CRT seems to be built from the VS2005 source; perhaps that version is more cooperative). It does yield a CRT that links like an ordinary DLL, but the fact that it can't be built without modifications is a major drawback to this solution. Also, I'd assume that the CRT source isn't included in the Express version (and possibly other ones), so that's a downside, too. As far as Python itself, the project configurations would have to be changed to define _CRT_NOFORCE_MANIFEST, suppress the default linking to the stock CRT (/NODEFAULTLIB:msvcrt.lib), and link to the import library for the private CRT. I might try to create an experimental solution config for this. ___ Python tracker <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist added the comment: > test.c's error is "can't find the DLL" - this will be as we attempt to > load Python's DLL - but this isn't the same as the original error, which > is "DLL init routine failed". To repro the initial error, I suspect you > will want to put the full assembly next to test.exe - that will allow > python.dll to load - then test.c should call PyExec_EvalString("import > socket\n") - it is at *that* point the error we care about is likely to > be thrown. The test program isn't having a problem loading python26.dll - it gets to an interpreter prompt and it can execute simple Python statements. It doesn't throw ImportError until the user types in "import socket". Further, I can see in Process Explorer that python26.dll is loaded in the running testpy.exe process. I apologize if my initial description wasn't clear on that point. I do see the error codes are different (between testpy.c and mod_python), but both are triggered by trying to load _socket.pyd. Nonetheless: if I copy the CRT assembly into the same folder as testpy.exe, I get a popup dialog when I try to import socket, saying "Runtime Error!" and "R6034; An application has made an attempt to load the C library incorrectly.". When I click OK in that dialog, I get this error in the console running testpy.exe: ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. (If the assembly is not in the folder, there is no popup dialog at all.) So it does indeed change the error code received. Also, I see now that I made a mistake in reporting the error code from the Apache log. The actual behavior is this: * Ordinary, the ImportError is: ImportError: DLL load failed: The specified module could not be found. * However, if I put the CRT assembly in the same folder as _socket.pyd: ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. and I received the same popup dialog as above. Putting the CRT assembly in the Apache bin folder or Apache modules folder still gives the first error (module could not be found). I apologize for the confusion; when I first experienced this problem I tried to fix it by experimenting with putting the manifest in various folders and I wasn't paying close enough attention to what error was given when. To summarize: testpy.exe with CRT assembly in testpy.exe folder: init routine failed and popup. testpy.exe with CRT assembly in _socket.pyd folder: init routine failed and popup. testpy.exe otherwise: module could not be found Apache with CRT assembly in _socket.pyd folder: init routine failed and popup. Apache otherwise: module could not be found ___ Python tracker <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist added the comment: I took a look at this with the debugger, as Mark recommended. The CRT's DLLMain is called _CRTDLL_INIT, that in turn calls __CRTDLL_INIT. __CRTDLL_INIT calls another function, _check_manifest. _check_manifest calls an SxS function called FindActCtxSectionString. It's looking for a string called "msvcr90.dll" in the ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION section of the process's activation context (activation contexts are data structures used by SxS). That call fails (_check_manifest doesn't call GetLastError or anything, it just returns FALSE right there). There's a comment there that says: /* no activation context used to load CRT DLL, means no manifest present in the process */ What's bizarre is that python26.dll successfully loaded msvcr90.dll (the global one from WinSxS), so it must have passed _check_manifest. It seems like the activation context consists of the DLL's manifest (_socket.pyd's in this case) and the exe's manifest, but no other ones, regardless of what other libraries have been loaded. The documentation doesn't seem to explain the interaction between manifests in different modules. It's also annoying that this restriction (the _check_manifest call) is completely artificial. I don't know if any of this information is useful (I'm only superficially familiar with activation contexts and the functions to manipulate them). The code is all in crtlib.c (in the CRT source) if someone else wants to take a look. ___ Python tracker <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist added the comment: I haven't been able to try this patch myself yet, but I see a potential problem: the "cookie" variable is declared as a DWORD, while ActivateActCtx expects a ULONG_PTR. DWORD and ULONG_PTR are only the same thing in 32-bit Windows. Also, where are you seeing that these SxS functions are "Vista or later"? My XP kernel32.dll has all of them. MSDN says they're XP or Vista. ___ Python tracker <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4566] 2.6.1 breaks many applications that embed Python on Windows
Craig Holmquist added the comment: The patch works fine on my system (32-bit XP). Also I verified in Process Explorer that there's only one instance of msvcr90.dll loaded. ___ Python tracker <http://bugs.python.org/issue4566> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4631] urlopen returns extra, spurious bytes
Changes by Craig Holmquist : -- nosy: +craigh ___ Python tracker <http://bugs.python.org/issue4631> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
[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
[issue14550] os.path.abspath() returns physical path, not logical path.
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 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 <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 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 <http://bugs.python.org/issue14550> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11129] logging: allow multiple entries in qualname config
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue11129> ___ ___ 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 <http://bugs.python.org/issue31049> ___ ___ 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 <http://bugs.python.org/issue24502> ___ ___ 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 <http://bugs.python.org/issue6090> ___ ___ 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 <http://bugs.python.org/issue4851> ___ ___ 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 <http://bugs.python.org/issue15290> ___ ___ 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 : Added file: http://bugs.python.org/file46718/issue23407-5.patch ___ Python tracker <http://bugs.python.org/issue23407> ___ ___ 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 : >>> 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 <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
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/Development/OSS/cpython/test2' instead of the (now broken) path from the first call. Maybe I'm missing something? -- ___ Python tracker <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 : >>> 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 <https://bugs.python.org/issue31658> ___ ___ Python-bugs-list mailing list Unsubscribe: https://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 : 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 <http://bugs.python.org/issue15025> ___ ___ 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 : 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 <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 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 <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 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 <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 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 <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 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 <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 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 <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 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 <http://bugs.python.org/issue15315> ___ ___ 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 <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?
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 <http://bugs.python.org/issue16338> ___ ___ 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 <http://bugs.python.org/issue12758> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[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 <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 <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 <http://bugs.python.org/issue9816> ___ ___ 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)
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 <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 <http://bugs.python.org/issue20353> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Craig Holmquist added the comment: To clarify the specific problem: - If the file object passed to XMLGenerator is opened in binary mode, XMLGenerator raises TypeError as soon as it tries to write to it - If the passed file object is opened in text mode, XMLGenerator writes the prescribed encoding to the XML declaration but it actually uses the file object's encoding when writing everything -- nosy: +craigh ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Craig Holmquist added the comment: Patch attached. This patch doesn't actually restrict the output object to RawIOBase (that wouldn't work well, since files opened as binary are actually derived from BufferedIOBase). Instead, it just assumes the output object has a 'write' method that accepts a single bytes argument. Also, XMLGenerator no longer needs to check if the input is str or unicode. -- keywords: +patch Added file: http://bugs.python.org/file14541/xmlgen.patch ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Craig Holmquist added the comment: Actually, that patch may not work so well either... out defaults to sys.stdout, but that can't accept bytes. -- ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Craig Holmquist added the comment: This new patch removes the "default to stdout" behavior. -- Added file: http://bugs.python.org/file14544/xmlgen2.patch ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Craig Holmquist added the comment: Patch for documentation. -- Added file: http://bugs.python.org/file14545/xmlgen-doc.patch ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
Changes by Craig Holmquist : Removed file: http://bugs.python.org/file14541/xmlgen.patch ___ Python tracker <http://bugs.python.org/issue4997> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1606092] csv module broken for unicode
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue1606092> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1606092] csv module broken for unicode
Craig McQueen added the comment: Is this still an open bug? I have the following code: lookup = {} csv_reader = csv.reader(codecs.open(lookup_file_name, 'r', 'utf-8')) for row in csv_reader: lookup[row[1]] = row[0] And it "appears to work" (it runs) using Python 2.6.2. So has this bug been fixed? -- ___ Python tracker <http://bugs.python.org/issue1606092> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1606092] csv module broken for unicode
Craig McQueen added the comment: I think I see now--it accepts Unicode input, but converts it back to bytes internally using the ASCII codec. So it works as long as the Unicode input contains on ASCII characters. That's a gotcha. It appears that it's been fixed in Python 3.x, judging by the documentation. -- versions: +Python 2.4, Python 2.5, Python 2.6, Python 2.7 ___ Python tracker <http://bugs.python.org/issue1606092> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6377] distutils compiler switch ignored
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue6377> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: This seems to be an bug in Python 3.1.1. Is it fixed in the Python 3 code? Is the issue being tracked in a separate issue? -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: Eric (keldonin), please consider attaching the file (solution you mentioned) to this issue for the benefit of the rest of us. I'm interested to see it. -- ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat
Craig McQueen added the comment: Eric sent a build_ext.py to me and Daniel26 by e-mail. Attached. The idea was to copy it over the one in C:\Python31\Lib\distutils\command. I tried the file that he sent, but I'm getting the same issue that Daniel26 described. -- Added file: http://bugs.python.org/file15826/build_ext.py ___ Python tracker <http://bugs.python.org/issue2698> ___ ___ 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
New submission from Craig Citro : Currently, it's impossible to use the usual pickle mechanisms to pickle a dynamically created class, even if the user requests a different pickling mechanism via copy_reg. The attached patch makes this customization possible by simply transposing two blocks of code. Longer explanation: Classes are pickled by name, which is of course problematic when trying to pickle a dynamically created class. The natural solution would be to create a __reduce__ method on the metaclass. However, as mentioned in issue 494904, this won't work -- the issue is that for any class C with a metaclass M, C.__reduce__ is the unbound method for instances of class C, as opposed to the bound method M.__reduce__ for C (i.e. viewing C as an instance of M). Guido's patch on that ticket does the sensible thing, which is force the class to be pickled by name -- this is fine, until you want to pickle a class that's created at runtime. The copy_reg module exists to handle custom pickling of objects, which is exactly what's needed here. However, the code from #494904 that checks for instances of a metaclass does this *just before* it looks at the copy_reg dispatch table. The patches just reorder these tests in pickle.py and cPickle.c, so that one can register a custom pickler for instances of a metaclass. Comments: First, let me preemptively say that I do indeed have a use case for this fix. We ran into this bug working on Sage (http://www.sagemath.org), where we create lots of dynamic classes at runtime (to model mathematical relationships between different kinds of objects). There's a healthy mix of dynamic and non-dynamic classes floating around, and we want the user to be able to pickle them without having to know anything about how the class was created. We could create our own pickling function, but we'd much rather just use the default Python mechanisms, especially since it's such a small fix. Second, this patch is fairly "safe," in the sense that it's pretty unlikely it can break any existing code. The only way it could break is if someone created a dynamic class, registered a pickler for it with copy_reg, and was depending on calls to pickle to fail. Third, there's a few extra lines of code in the chunk the patch moves around coming from ticket #502085. These are there to deal with versions of Boost circa 2002. Is it worth removing these? The attached patch is against trunk (r77421). At least as I write this, the same patch should apply against the py3k branch (up to renaming copy_reg to copyreg, anyway), but I'm happy to do the legwork of rebasing it as needed. Also, I'd happily review something else in exchange for a review of this. We'll be keeping this patch around in Sage until it gets merged, so the sooner the better. Authors: Nicolas Thiery (nthi...@users.sf.net) first hunted this down and wrote a patch for cPickle.c. I did the (fairly trivial) work of mirroring the fix in pickle.py, and added the tests in pickletester. -- components: Library (Lib) files: dynamic_class_copyreg.patch keywords: patch messages: 97702 nosy: craigcitro severity: normal status: open title: Pickling of classes with a metaclass and copy_reg type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file15853/dynamic_class_copyreg.patch ___ Python tracker <http://bugs.python.org/issue7689> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails
Craig McQueen added the comment: @gregory.p.smith: > This change is not suitable for back porting as it arguably adds a new feature. Speaking as a Mercurial user who can't use Mercurial at work through a proxy firewall... I beg you to consider that fixing this is not really adding a "new feature" but fixing a broken implementation requirement. Surely proxy support is not optional for any serious HTTP library. -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue1424152> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8820] IDLE not launching correctly
Jeff Craig added the comment: I can confirm this behaviour and error. On Windows Server 2008 R2 64-bit. -- nosy: +foxxtrot ___ Python tracker <http://bugs.python.org/issue8820> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8820] IDLE not launching correctly
Jeff Craig added the comment: Further information, this was an issue for me in 2.6.4, but with 2.6.5 it appears to no longer be an issue. -- ___ Python tracker <http://bugs.python.org/issue8820> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1596321] KeyError at exit after 'import threading' in other thread
Craig McQueen added the comment: >From my limited experience using cx_Freeze 4.1.2 with Python 2.6.5, it seems >that this issue is triggered in a cx_Frozen program simply by having `import >threading` in the program. I'm not sure what cx_Freeze is doing that makes >this issue show up. -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue1596321> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1596321] KeyError at exit after 'import threading' in other thread
Craig McQueen added the comment: Sorry I should have said, I'm running on Windows 2000 SP4. -- ___ Python tracker <http://bugs.python.org/issue1596321> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9061] cgi.escape Can Lead To XSS Vulnerabilities
New submission from Craig Younkins : The method in question: http://docs.python.org/library/cgi.html#cgi.escape http://svn.python.org/view/python/tags/r265/Lib/cgi.py?view=markup # at the bottom http://code.python.org/hg/trunk/file/3be6ff1eebac/Lib/cgi.py#l1031 "Convert the characters '&', '<' and '>' in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag quote is true, the quotation mark character ('"') is also translated; this helps for inclusion in an HTML attribute value, as in . If the value to be quoted might include single- or double-quote characters, or both, consider using the quoteattr() function in the xml.sax.saxutils module instead." cgi.escape never escapes single quote characters, which can easily lead to a Cross-Site Scripting (XSS) vulnerability. This seems to be known by many, but a quick search reveals many are using cgi.escape for HTML attribute escaping. The intended use of this method is unclear to me. Up to and including Mako 0.3.3, this method was the HTML escaping method. Used in this manner, single-quoted attributes with user-supplied data are easily susceptible to cross-site scripting vulnerabilities. While the documentation says "if the value to be quoted might include single- or double-quote characters... [use the] xml.sax.saxutils module instead," it also implies that this method will make input safe for HTML. Because this method escapes 4 of the 5 key XML characters, it is reasonable to expect some will use it for HTML escaping. I suggest rewording the documentation for the method making it more clear what it should and should not be used for. I would like to see the method changed to properly escape single-quotes, but if it is not changed, the documentation should explicitly say this method does not make input safe for inclusion in HTML. This is definitely affecting the security of some Python web applications. I already mentioned Mako, but I've found this type of bug in other frameworks and engines because the creators either called cgi.escape directly or modeled their own after it. Craig Younkins -- assignee: d...@python components: Documentation, Library (Lib) messages: 108457 nosy: Craig.Younkins, d...@python priority: normal severity: normal status: open title: cgi.escape Can Lead To XSS Vulnerabilities versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue9061> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9061] cgi.escape Can Lead To XSS Vulnerabilities
Changes by Craig Younkins : -- type: -> security ___ Python tracker <http://bugs.python.org/issue9061> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9061] cgi.escape Can Lead To XSS Vulnerabilities
Craig Younkins added the comment: Proof of concept: print """""" % cgi.escape("' onload='alert(1);' bad='") -- ___ Python tracker <http://bugs.python.org/issue9061> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com