[issue10740] sqlite3 module should allow DDL statements in transactions
Changes by Jeremy Banks jer...@jeremybanks.ca: -- nosy: +Jeremy Banks ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10740 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries
New submission from Jeremy Banks jer...@jeremybanks.ca: I was experimenting with the sqlite3 library and noticed that using certain strings as identifiers cause bus errors or segfaults. I'm not very familiar with unicode, but after some Googling I'm pretty sure this happens when I use non-characters or surrogate characters incorrectly. This causes a bus error: import sqlite3 c = sqlite3.connect(:memory:) table_name = '' + chr(0xD800) + '' c.execute(create table + table_name + (bar)) The equivalent Python 2 (replacing chr with unichr) works properly. -- components: Library (Lib) messages: 140381 nosy: jeremybanks priority: normal severity: normal status: open title: sqlite3 segfaults and bus errors when given certain unicode strings as queries type: crash versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries
Jeremy Banks jer...@jeremybanks.ca added the comment: I'm using OS X 10.6.7. The bus error is occurring with my Python 3.1 installation: path: /Library/Frameworks/Python.framework/Versions/3.1/bin/python3 sqlite3.version == 2.4.1 sqlite3.sqlite_version = 3.6.11. But now that you mention it, my MacPorts installations of Python 3.0 and 3.1 just get an exception like you do: paths: /opt/local/bin/python3.0 / python3.1 sqlite3.version == 2.4.1 sqlite3.sqlite_version == 3.7.7.1 A Python 2.7 installation where it works without any error: path: /Library/Frameworks/Python.framework/Versions/2.7/bin/python sqlite3.version == 2.6.0 sqlite3.sqlite_version == 3.6.12 A MacPorts Python 2.6 installation where it works without any error: path: /opt/local/bin/python2.6 sqlite3.version == 2.4.1 sqlite3.sqlite_version == 3.7.7.1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries
Jeremy Banks jer...@jeremybanks.ca added the comment: I'll try that, thank you. If it works without exception in Python 2, isn't the behaviour in Python 3 a regression bug, even if it doesn't crash? If so, should I create a new/separate issue for the behaviour? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4291] Allow Division of datetime.timedelta Objects
Jeremy Banks jer...@jeremybanks.ca added the comment: Redundant with #2706 and others. -- nosy: -belopolsky, haypo, marketdickinson status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4291] Allow Division of datetime.timedelta Objects
Jeremy Banks [EMAIL PROTECTED] added the comment: Sorry, allowing for conversion to int/float is probably a more sensible solution. This idea was brought to my mind when I was making a very very simple script for a friend to display how far through a time range we currently are. For example: elapsed = datetime.timedelta(hours=4, days=3) duration = datetime.timedelta(days=30) percentage = (100 * elapsed / duration) In my case, precision wasn't important so I just divided elapsed.days by duration.days, but it would be continent to have an accurate result by just writing what I did above. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4291] Allow Division of datetime.timedelta Objects
New submission from Jeremy Banks [EMAIL PROTECTED]: It would be convenient if it were possible to divide one datetime.timedelta object by another to determine their relative durations. Were the datetime module pure Python a crude solution would just be to add two methods like this: def toMicroseconds(self): return ((self.days * 24 * 60) + self.seconds * 100) + self.microseconds def __truediv__(self, other): return self.toMicroseconds() / other.toMicroseconds() However, I don't understand know the Python C API well enough to know how to patch the C module. -- components: Library (Lib) messages: 75670 nosy: Jeremy Banks severity: normal status: open title: Allow Division of datetime.timedelta Objects type: feature request ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4291] Allow Division of datetime.timedelta Objects
Jeremy Banks [EMAIL PROTECTED] added the comment: Thanks, I should have paid more attention to the results when I searched for duplicates. I think that Christian's suggestion of enabling float() and int() for timedeltas is worth having here, though. -- nosy: -christian.heimes ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com