[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
[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
[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
[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
[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
[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
[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
[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
[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
[issue1172711] long long support for array module
Craig McQueen added the comment: So it looks as though this isn't going in to Python 2.7. How about 3.x? -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue1172711> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9066] Standard type codes for array.array, same as struct
New submission from Craig McQueen : The type codes for array.array are platform-dependent. The type codes are similar to those for the struct module. It would be helpful for array.array to adopt the struct module's "=" format specifier prefix, to specify "standard" sizes. E.g. array_object = array.array("=L") # 4-byte elements on all platforms -- components: Library (Lib) messages: 108501 nosy: cmcqueen1975 priority: normal severity: normal status: open title: Standard type codes for array.array, same as struct type: feature request versions: Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue9066> ___ ___ 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: A follow-on re the cx_Freeze issue: I looked at the source code, and found it doesn't seem to be doing any thread creation. But I found that in the initscripts/Console.py, there are the following lines: if sys.version_info[:2] >= (2, 5): module = sys.modules.get("threading") if module is not None: module._shutdown() If these lines are commented-out, then the error message at exit does not occur. -- ___ 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
[issue9161] add_option in optparse no longer accepts unicode string
New submission from Craig McQueen : Working in Japan, I find it very helpful to be able to read full Unicode arguments in Python 2.x under Windows 2000/XP. So I am using the following: http://stackoverflow.com/questions/846850/how-to-read-unicode-characters-from-command-line-arguments-in-python-on-windows/846931#846931 Brilliantly, the optparse module in Python 2.6 has worked fine with Unicode arguments. Sadly, it seems Python 2.7 is preventing this. When I try to run my program with Python 2.7, I get the following: ... File "c:\python27\lib\optparse.py", line 1018, in add_option raise TypeError, "invalid arguments" TypeError: invalid arguments It seems that the type check in optparse.py line 1018 has changed from this in 2.6: if type(args[0]) in types.StringTypes: to this in 2.7: if type(args[0]) is types.StringType: This makes it more difficult to support Unicode in 2.7, compared to 2.6. Any chance this could be reverted? -- messages: 109300 nosy: cmcqueen1975 priority: normal severity: normal status: open title: add_option in optparse no longer accepts unicode string versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue9161> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9161] add_option in optparse no longer accepts unicode string
Craig McQueen added the comment: My program currently uses ASCII options, so I can change the Unicode string parameter to byte string. The optparse module still seems to match the option against the incoming Unicode argv, I guess by implicit string conversion. -- ___ Python tracker <http://bugs.python.org/issue9161> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9161] add_option in optparse no longer accepts unicode string
Craig McQueen added the comment: To further explain, I had code e.g.: parser.add_option(u'-s', u'--seqfile', dest='seq_file_name', help=u'Write sequence file output to FILE', metavar=u'FILE') I had to remove the unicode designator for the first parameter: parser.add_option('-s', u'--seqfile', dest='seq_file_name', help=u'Write sequence file output to FILE', metavar=u'FILE') On further investigation, it looks as though the optparse module has other problems with Unicode: e.g. if I try to set a non-ASCII parameter on the command line e.g.: myprog.py -本 Then optparse can't handle that--it gets an encoding error on line 1396. What _does_ work is that an option's parameters can be Unicode: myprog.py -s 本.txt So I guess there are broader problems than the specific 2.6 to 2.7 change that I originally reported. -- ___ Python tracker <http://bugs.python.org/issue9161> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9195] Link in docs from "String Formatting Operations" to "Template Strings"
New submission from Craig McQueen : I stumbled across "Template Strings" of PEP 292 by accident recently. I'd never heard of it before. I'm familiar with the "string interpolation" aka "String Formatting Operations", and I know to find that in the docs under "Standard Types", i.e. http://docs.python.org/library/stdtypes.html#string-formatting-operations http://docs.python.org/py3k/library/stdtypes.html#old-string-formatting-operations It would be good for that documentation to mention "Template Strings", and include a cross-reference to the docs for it, since it was created as an alternative string formatting. I.e. cross-reference to http://docs.python.org/library/string.html#template-strings http://docs.python.org/py3k/library/string.html#template-strings -- assignee: d...@python components: Documentation messages: 109515 nosy: cmcqueen1975, d...@python priority: normal severity: normal status: open title: Link in docs from "String Formatting Operations" to "Template Strings" versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue9195> ___ ___ 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
New submission from Craig McQueen : I have just been trying to figure out how string interpolation works for "%s", when Unicode strings are involved. It seems it's a bit complicated, but the Python documentation doesn't really describe it. It just says %s "converts any Python object using str()". Here is what I have found (I think), and it could be worth improving the documentation of this somehow. Example 1: "%s" % test_object >From what I can tell, in this case: 1. test_object.__str__() is called. 2. If test_object.__str__() returns a string object, then that is substituted. 3. If test_object.__str__() returns a Unicode object (for some reason), then test_object.__unicode__() is called, then _that_ is substituted instead. The output string is turned into Unicode. This behaviour is surprising. [Note that the call to test_object.__str__() is not the same as str(test_object), because the former can return a Unicode object without causing an error, while the latter, if it gets a Unicode object, will then try to encode('ascii') to a string, possibly generating a UnicodeEncodeError exception.] Example 2: u"%s" % test_object In this case: 1. test_object.__unicode__() is called, if it exists, and the result is substituted. The output string is Unicode. 2. If test_object.__unicode__() doesn't exist, then test_object.__str__() is called instead, converted to Unicode, and substituted. The output string is Unicode. Example 3: "%s %s" % (u'unicode', test_object) In this case: 1. The first substitution causes the output string to be Unicode. 2. It seems that (1) causes the second substitution to follow the same rules as Example 2. This is a little surprising. -- assignee: d...@python components: Documentation messages: 109516 nosy: cmcqueen1975, d...@python priority: normal severity: normal status: open title: Improve docs for string interpolation "%s" re Unicode strings versions: Python 2.7 ___ 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: Another thing I discovered, for Example 1: 4. If test_object.__str__() returns a Unicode object (for some reason), and test_object.__unicode__() does not exist, then the Unicode value from the __str__() call is used as-is (no conversion to string, no encoding errors). This is also a little surprising [in this situation unicode(test_object) also returns the Unicode object returned by __str__() as-is, so I guess there's some consistency there]. -- ___ 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
[issue7696] Improve Memoryview/Buffer documentation
Craig McQueen added the comment: The documentation implies that memoryview always accesses bytes: * "len(view) returns the total number of bytes in the memoryview, view." * "Taking a single index will return a single byte." But, the following example shows this is misleading: >>> from array import array >>> ar = array('H', [1,2,3]) >>> arv = memoryview(ar) >>> len(arv) 3 >>> arv[1] b'\x02\x00' -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue7696> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7696] Improve Memoryview/Buffer documentation
Craig McQueen added the comment: My previous comment was referring to Python 3.x, by the way. Python 2.7 has not implemented the buffer protocol for `array`. -- ___ Python tracker <http://bugs.python.org/issue7696> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7696] Improve Memoryview/Buffer documentation
Craig McQueen added the comment: I've seen the changes Mr Pitrou made, both for the 2.x and 3.x docs. That's a good improvement--thanks very much. -- ___ Python tracker <http://bugs.python.org/issue7696> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7639] bdist_msi fails on files with long names
Changes by Craig McQueen : -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue7639> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4755] Common path prefix
Craig McQueen added the comment: http://code.activestate.com/recipes/577016-path-entire-split-commonprefix/ -- nosy: +cmcqueen1975 ___ Python tracker <http://bugs.python.org/issue4755> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com