[issue6869] Embedded python crashed on 4th run, if ctypes is used
New submission from Ilya kaplan.i...@gmail.com: When embedding python from C, and importing ctypes module in embedded script, it always crashes on Py_Finalize() on 4th cycle. Tested with both PyRun_SimpleString(...) and PyRun_String(...). Platform: Windows XP IDE's: LabWindows/CVI 8.5 and Code::Blocks/gcc Code: -- #include stdio.h #include python.h int main() { int i; for (i=0; i10; i++) { printf(--- %d ---\n, i); Py_Initialize(); PyRun_SimpleString(import ctypes); Py_Finalize(); } return 0; } Output: --- 0 --- --- 1 --- --- 2 --- --- 3 --- Process returned -1073741819 (0xC005) execution time : 3.109 s Press any key to continue. -- assignee: theller components: ctypes messages: 92444 nosy: Warlock, theller severity: normal status: open title: Embedded python crashed on 4th run, if ctypes is used type: crash versions: Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6870] sybase module for python3.1
New submission from Pravin Chavan pravinpcha...@rediffmail.com: How can I use sybase module in python 3.1? -- components: Extension Modules messages: 92445 nosy: pravinpchavan severity: normal status: open title: sybase module for python3.1 type: feature request versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6870 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6163] [HP-UX] ld: Unrecognized argument: +s -Ldir
Tarek Ziadé ziade.ta...@gmail.com added the comment: done in r74728 (trunk), r74729 (2.6.x), r74730 (pyk3) and r74731 (3.1.x) Thanks guys ! -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6163 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6865] Refcount error in pwd module
caglar10ur cag...@pardus.org.tr added the comment: It seems Python 2.6.x also have same problem, will it be merged automatically (seems like svn-merge is used for this purpose) or do you want me to open a new bug against that version? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6865 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6870] sybase module for python3.1
Martin v. Löwis mar...@v.loewis.de added the comment: This question is off-topic for the Python bug tracker. Please use a different forum, such as comp.lang.python (aka: python-l...@python.org) -- nosy: +loewis resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6870 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6851] urllib.urlopen crashes in a thread on Snow Leopard
Changes by Emlyn Murphy m...@emlyn.net: -- nosy: +emlyn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6851 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6869] Embedded python crashed on 4th run, if ctypes is used
Ilya kaplan.i...@gmail.com added the comment: Tested obj=PyImport_ImportModule(ctypes); Py_DECREF(obj); instead of PyRun_SimpleString(...) - same result -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6163] [HP-UX] ld: Unrecognized argument: +s -Ldir
Sridhar Ratnakumar sridh...@activestate.com added the comment: From http://svn.python.org/view/python/trunk/Misc/NEWS? r1=74728r2=74727pathrev=74728 Initial patch by Sridhar Ratnakumar The author of the initial patch - distutils_hpux_libdir_option.patch - is actually Trent Mick. I only pulled it from the ActivePython patches/ directory and reported it here. I must have mentioned this before; and I will do so from now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6163 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6163] [HP-UX] ld: Unrecognized argument: +s -Ldir
Tarek Ziadé ziade.ta...@gmail.com added the comment: The rule I apply is as follow (any other rule would be too complicated for me): I add in Misc/NEWS the name of the user that initialy provides the patch in the tracker. If you want a different name, you need to provide a patch with the text you want to see in Misc/NEWS included. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6163 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6865] Refcount error in pwd module
Benjamin Peterson benja...@python.org added the comment: 2009/9/9 caglar10ur rep...@bugs.python.org: caglar10ur cag...@pardus.org.tr added the comment: It seems Python 2.6.x also have same problem, will it be merged automatically (seems like svn-merge is used for this purpose) or do you want me to open a new bug against that version? It's now backported. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6865 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6871] decimal.py: more format issues
New submission from Stefan Krah stefan-use...@bytereef.org: Hi, I've two more issues where format behavior should probably be identical: 1: (version 2.6 vs. 3.1): Version 2.6: format(Decimal(NaN), +08.4) '+NaN' format(float(NaN), +08.4) '+00.0nan' Version 3.1: format(Decimal(NaN), +08.4) '+NaN' format(float(NaN), +08.4) '+nan' 2: (float vs. decimal): format(float(123), 00) '123.0' format(Decimal(123), 00) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.1/decimal.py, line 3611, in __format__ spec = _parse_format_specifier(specifier, _localeconv=_localeconv) File /usr/lib/python3.1/decimal.py, line 5563, in _parse_format_specifier raise ValueError(Invalid format specifier: + format_spec) ValueError: Invalid format specifier: 00 -- messages: 92453 nosy: marketdickinson, skrah severity: normal status: open title: decimal.py: more format issues ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6871 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6844] BaseException DeprecationError raises inappropriately
Brett Cannon br...@python.org added the comment: Making this a release blocker to see what Barry thinks of this. -- priority: - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6844 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6871] decimal.py: more format issues
Eric Smith e...@trueblade.com added the comment: For #1 for floats, 2.6 is in error. This has been fixed in 2.7 (trunk). For #2, I think float is correct. The PEP says the specifier is: [[fill]align][sign][#][0][minimumwidth][.precision][type] so '00' is parsed as minimumwidth=0 with zero-padding specified. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6871 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1590864] Function-level import in os triggering an threaded import deadlock
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1590864 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6871] decimal.py: more format issues
Eric Smith e...@trueblade.com added the comment: Also, see issue 4482 for a discussion of float formatting for nan and inf. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6871 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6872] Support system readline on OS X 10.6
New submission from Mark Dickinson dicki...@gmail.com: The readline library supplied in OS X 10.6 looks good enough to use in Python. It would be nice to enable building with this library, to avoid having to install GNU readline. There's a curious off-by-one difference between Apple's readline (which, as I understand it, is just libedit wrapped to look like libreadline) and GNU readline: with 'n' history items, the valid indices for Apple's readline are 0 through n-1; for GNU they're 1 through n. I was able to get Python trunk + system readline working on OS X 10.6 using the attached patch (which obviously isn't suitable for applying, since it breaks the build with a non-system readline). A side effect of the patch is that readline.get_history_item and friends store the first history entry with index 0 rather than 1: Python 2.7a0 (trunk:74735M, Sep 9 2009, 19:40:25) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. import readline [39474 refs] readline.get_history_item(0) 'import readline' [39476 refs] readline.get_history_item(2) 'readline.get_history_item(2)' [39476 refs] Interestingly, the Apple-supplied Python also behaves this way: Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. import readline readline.get_history_item(0) 'import readline' readline.get_history_item(2) 'readline.get_history_item(2)' If people think this is worth pursuing, I'll put together a proper patch. -- assignee: ronaldoussoren components: Build, Extension Modules, Macintosh messages: 92457 nosy: marketdickinson, ronaldoussoren severity: normal status: open title: Support system readline on OS X 10.6 type: feature request versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6872] Support system readline on OS X 10.6
Mark Dickinson dicki...@gmail.com added the comment: And here's the patch. -- keywords: +patch Added file: http://bugs.python.org/file14868/snow_leopard_readline.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6786] readline and zero based indexing
Mark Dickinson dicki...@gmail.com added the comment: I'd guess the same. Most of the readline module is just a thin wrapper around the system readline library, so if the system readline library uses one-based indexing, so does the readline module. Changing this would probably be quite error-prone, with a high chance of introducing off-by- one errors somewhere along the line. Interestingly, the Apple-supplied python (2.6.1) in OS X 10.6 does have zero-based readline history. See issue 6872. -- nosy: +marketdickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6786 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6872] Support system readline on OS X 10.6
Ronald Oussoren ronaldousso...@mac.com added the comment: I wouldn't mind having a proper patch and doing away with the need for GNU's readline. IMHO the patch should try to stay as close to GNU readline's interface as possible, and should therefore fix the off-by-one difference you mention. BTW. I suppose the configuration (readline.parse_and_bind) needs to be in libedit format rather than readline format. If so, we should add something to the readline documentation about that and possibly add something to the readline library to make it possible to detect if readline is ultimately linked to libedit. BTW. If you want to push the Apple's readline to the limit you should try if it works properly with ipython. It used to cause hard crashes with Apple's python in 10.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6871] decimal.py: more format issues
Mark Dickinson dicki...@gmail.com added the comment: Issue #1: In both trunk and py3k I get: from decimal import Decimal format(Decimal('nan'), '+08.4') '+NaN' format(float('nan'), '+08.4') '+nan' format(Decimal('inf'), '+012.4') ' +Infinity' format(float('inf'), '+012.4') '+inf' Two potential issues here: first is the zero padding; to me, a zero- padded nan or inf just looks ugly, but if people think that's the correct output (and I suppose that I have to admit that it probably is) then I'll add the zeros in for the Decimal type. The second issue is the difference in spelling; ('nan' versus 'NaN', 'inf' versus 'Infinity'); I'm not really bothered by this difference, and it would be quite awkward to change. The output format for Decimal is mandated by the standard, while changing the spelling for floats seems both unnecessary and likely to break code. Issue #2: This is a bit odd. If a minimumwidth of 0 is permissible, then the format '0' is ambiguous. Assuming that '0' continues to mean zero-padded, this leaves '00' as the *only* way to specify a minimum width of 0. It seems cleaner just to assume that minimumwidth always has to be strictly positive, making '00' invalid. At least, I think that's what I was thinking when I wrote the Decimal formatting code. But I agree that float and Decimal should be consistent here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6871 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions
Gawain Bolton gp.bol...@computer.org added the comment: Yes I agree it would be a good idea to have one definition and one instantiation of the _decimal_digit_table[] and BitLengthTable[32] arrays. Where do you suggest these tables could be put? I'll be happy to provide an updated patch if you can let me know. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4773] HTTPMessage not documented and has inconsistent API across 2.6/3.0
Changes by Sridhar Ratnakumar sridh...@activestate.com: -- nosy: +srid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6872] Support system readline on OS X 10.6
Mark Dickinson dicki...@gmail.com added the comment: Hmm. This is looking like a bigger task than I bargained for. I notice that the readline library currently has no tests (or maybe I'm just failing to find them). I'm not even sure how to go about writing tests for readline. IMHO the patch should try to stay as close to GNU readline's interface as possible, and should therefore fix the off-by-one difference you mention. I suppose so. I'm a bit worried about subtle bugs occurring as a result of fixing off-by-one differences in some places and missing them in others; it seems safer to provide direct access to the library behaviour without trying to fix anything. Third-party stuff that wants to work with Apple's Python is also going to have to deal with zero-based history. So I guess I'd prefer not to fix the off-by-one difference; this would make it even more important to provide some way for users to tell whether they're using GNU readline or the wrapped libedit version. Thanks for the ipython suggestion; I've never used it before, but I'll see if I can play around with it a bit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +collinwinter, gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions
Mark Dickinson dicki...@gmail.com added the comment: I'm a bit ambivalent about this patch: I'd like to see string to integer conversions improved, and on the surface it makes sense to special-case base 10 conversions (just as power-of-two bases are already special- cased), but this seems like quite a lot of extra code to debug and maintain just to speed up one aspect of the integer implementation. It would be easy to grow longobject.c by several thousand lines by adding a handful of optimizations of this type. If you're working with huge integers and care about speed, then you should probably be using gmpy or similar (or something other than Python). And this patch doesn't solve the real problem with converting huge integers to and from decimal strings, which is that the algorithms used have quadratic running time. Amongst quadratic-time algorithms, I'm tempted to call Python's implementation 'good enough'. Gawain, do you have a particular use-case in mind for this optimization? Are there common applications where string - int conversion times are critical? -- versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6873] posix_lchown: possible overflow of uid, gid
New submission from Boya Sun boya@case.edu: posix_lchown(PyObject *self, PyObject *args) { ... int uid, gid; ... if (!PyArg_ParseTuple(args, etii:lchown, Py_FileSystemDefaultEncoding, path, uid, gid)) ... } uid and gid could cause over flow. A similar bug is issue 5705. Patch attached. Any comment is appreciated! Boya -- files: patch.diff keywords: patch messages: 92465 nosy: boya severity: normal status: open title: posix_lchown: possible overflow of uid, gid Added file: http://bugs.python.org/file14869/patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6873 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5705] os.getpwent returns unsigned 32bit value, os.setuid refuses it
Boya Sun boya@case.edu added the comment: Created issue 6879 following Victor's suggestion. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6871] decimal.py: more format issues
Stefan Krah stefan-use...@bytereef.org added the comment: Issue 1: I would definitely keep the spelling in decimal, my concern was only the padding. The C standard agrees with Mark's view: Leading zeros (following any indication of sign or base) are used to pad to the field width rather than performing space padding, except when converting an infinity or NaN. If this could be agreed on, issue 1 should be handled by changing float and decimal 2.6. Issue 2: I can't find it quickly in the C standard, but gcc warns in this situation: warning: repeated '0' flag in format This would support the behavior of decimal and float should be changed. I would like to add two new issues. Issue 3: Regarding padding, the C standard further says: If the 0 and - flags both appear, the 0 flag is ignored This is quite sensible, since signless 0 padding looks a bit awkward. (But this is a minor issue). Issue 4: format(Decimal('1e88'), '020') '1E+88000' format(float('1e88'), '020') '0001e+88' I think right-padding with digits is dangerous, since it changes the numerical value. I'm not sure what float does, it doesn't look correct (but protects the user). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6871 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5705] os.getpwent returns unsigned 32bit value, os.setuid refuses it
Boya Sun boya@case.edu added the comment: Sorry, typo. Created issue 6873 following Victor's suggestion. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions
Mark Dickinson dicki...@gmail.com added the comment: On the other hand, _PyLong_Format currently contains general machinery for integer - string conversion in any base in the range [2, 36], but I don't think that machinery is ever used for bases other than 2, 8, 10 and 16. So ripping _PyLong_Format out and just leaving the binary base and the suggested base 10 code might actually make longobject.c shorter. I'd be interested to know how much the conversion of two digits at one time instead of one is contributing to the speedup by itself. For large integers, I'd suspect that this makes very little difference. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6854] UnicodeDecodeError when retrieving binary data from cgi.FieldStorage()
loveminix lovemi...@yahoo.com.cn added the comment: Is there an update on this? Let me know if more information is needed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6854 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com