On Tue, Nov 27, 2007 at 11:38:46PM +0300, Oleg Broytmann wrote:
> -import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER
> +import MySQLdb
Revert this. These constants are not used in SQLObject 0.7, but required
in later versions.
Oleg.
--
Oleg Broytmann
On Tue, Nov 27, 2007 at 11:01:04PM +0300, Oleg Broytmann wrote:
> I have to fix the parameter
Like in the attached patch.
Oleg.
--
Oleg Broytmannhttp://phd.pp.ru/[EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
Index: mysqlconnec
On Tue, Nov 27, 2007 at 08:49:51PM +0100, Markus Gritsch wrote:
> The patch works great!
Thank you for the report.
> If sqlobject_encoding is present, it is not
> silently ignored, but an Exception is raised: 'got an unexpected
> keyword', which is ok.
No, it is not ok. I am going to apply
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 08:17:55PM +0100, Markus Gritsch wrote:
> > use_unicode specifies only if MySQLdb should *return* string values as
> > unicode or as strings. Queries can be issued using unicode or string
> > regardless of this para
On Tue, Nov 27, 2007 at 08:17:55PM +0100, Markus Gritsch wrote:
> use_unicode specifies only if MySQLdb should *return* string values as
> unicode or as strings. Queries can be issued using unicode or string
> regardless of this parameter.
This means SQLObject doesn't need to encode queries at
On 27/11/2007, Markus Gritsch <[EMAIL PROTECTED]> wrote:
> On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > On Tue, Nov 27, 2007 at 08:04:10PM +0100, Markus Gritsch wrote:
> > > On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > > import MySQLdb
> > >
> > > x = MySQLdb.connect
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 08:04:10PM +0100, Markus Gritsch wrote:
> > On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > import MySQLdb
> >
> > x = MySQLdb.connect(db='test', user='markus', charset='utf8') #
> > supplying charset im
On Tue, 2007-11-27 at 19:33 +0100, Markus Gritsch wrote:
> > P.S. Thank you for your example, I will look into it in more detail.
>
> Ah, this example looks quite familiar ;)
Indeed.
> Please look at the attached screenshots, they show that everything is
> ok.
Aha! I have tracked down the pr
On Tue, Nov 27, 2007 at 08:04:10PM +0100, Markus Gritsch wrote:
> On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> import MySQLdb
>
> x = MySQLdb.connect(db='test', user='markus', charset='utf8') #
> supplying charset implies use_unicode=True
> c = x.cursor()
>
> c.execute('DROP TABLE p
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
>
>IWBN if you run the tests using MySQLdb directly, or at least patch
> SQLObject to not set "need_unicode" in MySQLConnection.
import MySQLdb
x = MySQLdb.connect(db='test', user='markus', charset='utf8') #
supplying charset implies us
On Tue, Nov 27, 2007 at 07:48:11PM +0100, Markus Gritsch wrote:
> On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> >There were reports that MySQLdb 1.2.1+ requires unicode, not merely
> > allows it.
>
> I cannot confirm this.
It very much could be that the report was about a beta
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 05:54:41PM +0100, Markus Gritsch wrote:
> > Since it is allowed to use unicode and strings in a query, why is
> > there a need to force unicode?
>
>There were reports that MySQLdb 1.2.1+ requires unicode, not mer
On Tue, 2007-11-27 at 18:01 +0100, Markus Gritsch wrote:
> On 27/11/2007, David Turner <[EMAIL PROTECTED]> wrote:
> > On Tue, 2007-11-27 at 15:17 +0100, Markus Gritsch wrote:
> >
> > Conclusion: SQLObject is doing the wrong thing on many levels for MySQL.
>
> No it is not. Using UTF-8 is an ideal
On Tue, Nov 27, 2007 at 05:54:41PM +0100, Markus Gritsch wrote:
> Since it is allowed to use unicode and strings in a query, why is
> there a need to force unicode?
There were reports that MySQLdb 1.2.1+ requires unicode, not merely
allows it.
Oleg.
--
Oleg Broytmannhttp://ph
On Tue, 2007-11-27 at 15:17 +0100, Markus Gritsch wrote:
> On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > On Tue, Nov 27, 2007 at 02:56:59PM +0100, Markus Gritsch wrote:
> > > But if a BLOB contains just bytes which do *not* trigger the
> > > Exception, the BLOB in the query *does* ge
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 07:44:49PM +0300, Oleg Broytmann wrote:
> >Then the entire "need_unicode" in SQLObject is wrong because it forces
> > SQLObject to use unicode for MySQLdb version 1.2.1 and up.
>
>Should it be a MySQLConnecti
On Tue, Nov 27, 2007 at 07:44:49PM +0300, Oleg Broytmann wrote:
>Then the entire "need_unicode" in SQLObject is wrong because it forces
> SQLObject to use unicode for MySQLdb version 1.2.1 and up.
Should it be a MySQLConnection/DBuri parameter instead of calculated
var?
Oleg.
--
Oleg
On Tue, Nov 27, 2007 at 05:38:23PM +0100, Markus Gritsch wrote:
> As I read the docs, you are *allowed* to use unicode in queried, not
> required.
Then the entire "need_unicode" in SQLObject is wrong because it forces
SQLObject to use unicode for MySQLdb version 1.2.1 and up.
Oleg.
--
Ol
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 07:16:16PM +0300, Oleg Broytmann wrote:
> > On Tue, Nov 27, 2007 at 06:08:31PM +0200, Dan Pascu wrote:
> > > So I think we should:
> > > 1. get rid of the try/except
>
>Sorry, sent that to fast.
>
> >The poin
On Tue, Nov 27, 2007 at 07:16:16PM +0300, Oleg Broytmann wrote:
> On Tue, Nov 27, 2007 at 06:08:31PM +0200, Dan Pascu wrote:
> > So I think we should:
> > 1. get rid of the try/except
Sorry, sent that to fast.
>The point taken. Thank you!
But...
> > 2. only use the connection encoding
On Tue, Nov 27, 2007 at 06:08:31PM +0200, Dan Pascu wrote:
> So I think we should:
> 1. get rid of the try/except
> 2. only use the connection encoding to encode strings / string values
> 3. use latin1 to encode/decode blobs that ensures that they are sent
> unmodified to the db
The point take
On Tuesday 27 November 2007, Oleg Broytmann wrote:
> On Tue, Nov 27, 2007 at 03:17:23PM +0100, Markus Gritsch wrote:
> > Having this try/except
> > here unconditionally for all cases
>
>Let's satisfy all (to possible extent) - let's make a parameter for
> MySQLConnection (and SQLObject DB URI)
On Tue, Nov 27, 2007 at 03:17:23PM +0100, Markus Gritsch wrote:
> Having this try/except
> here unconditionally for all cases
Let's satisfy all (to possible extent) - let's make a parameter for
MySQLConnection (and SQLObject DB URI) that allows/prevents the try/except.
By default it could be "d
On Tue, Nov 27, 2007 at 03:17:23PM +0100, Markus Gritsch wrote:
> Instead of getting an exception, the
> code just continues to run, issuing a query containing the wrong
> characters for the DB.
[skip]
> But I doubt that the BLOB would be inserted *correctly* if it gets
> converted to unicode using
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 02:56:59PM +0100, Markus Gritsch wrote:
> > But if a BLOB contains just bytes which do *not* trigger the
> > Exception, the BLOB in the query *does* get converted to unicode, and
> > I doubt this would be the desired
On Tue, Nov 27, 2007 at 02:56:59PM +0100, Markus Gritsch wrote:
> But if a BLOB contains just bytes which do *not* trigger the
> Exception, the BLOB in the query *does* get converted to unicode, and
> I doubt this would be the desired behavior.
The absence of try/except in question wouldn't pre
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 02:43:06PM +0100, Markus Gritsch wrote:
> > On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > > if self.need_unicode and not isinstance(query, unicode):
> > > -try:
> >
On Tue, Nov 27, 2007 at 02:43:06PM +0100, Markus Gritsch wrote:
> On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > if self.need_unicode and not isinstance(query, unicode):
> > -try:
> > -query = unicode(query, self.encoding)
>
On 27/11/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 27, 2007 at 02:02:02PM +0100, Markus Gritsch wrote:
> > How about applying the attached patch?
>
> --- mysqlconnection_orig.py 2007-09-27 02:18:28.0 +0200
> +++ mysqlconnection.py 2007-11-27 13:57:30.324125000 +0100
On Tue, Nov 27, 2007 at 02:02:02PM +0100, Markus Gritsch wrote:
> How about applying the attached patch?
--- mysqlconnection_orig.py 2007-09-27 02:18:28.0 +0200
+++ mysqlconnection.py 2007-11-27 13:57:30.324125000 +0100
@@ -110,10 +110,7 @@
# For MySQLdb 1.2.1 and lat
On 04/10/2007, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 03, 2007 at 06:15:21PM -0400, David Turner wrote:
> > On Wed, 2007-10-03 at 23:57 +0200, Markus Gritsch wrote:
> > > Ah, I see. I have no objection against removing the conversion to
> > > unicode completely.
> >
> > Ok, I comm
On Thu, 2007-10-04 at 17:40 -0400, David Turner wrote:
> On Thu, 2007-10-04 at 14:47 +0200, Markus Gritsch wrote:
> > On 10/4/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > > On Thu, Oct 04, 2007 at 01:50:52PM +0200, Markus Gritsch wrote:
> > > > In MySQLdb queries are *allowed* to be unicode.
>
On Thu, 2007-10-04 at 14:47 +0200, Markus Gritsch wrote:
> On 10/4/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > On Thu, Oct 04, 2007 at 01:50:52PM +0200, Markus Gritsch wrote:
> > > In MySQLdb queries are *allowed* to be unicode.
> >
> > I meant - there were a period when SQLObject forces quer
On 10/4/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 04, 2007 at 01:50:52PM +0200, Markus Gritsch wrote:
> > In MySQLdb queries are *allowed* to be unicode.
>
> I meant - there were a period when SQLObject forces queries to be
> unicode for MySQLdb 1.2.1+. Is that over now? Do we all
On Thu, Oct 04, 2007 at 01:50:52PM +0200, Markus Gritsch wrote:
> On 10/4/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > We've finally returned to the
> > beginning - do not use unicode with MySQLdb at all?
>
> No, I don't think this is true. In MySQLdb queries are *allowed* to be
> unicode.
On 10/4/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
>Now where is self.need_unicode used?
I don't know.
> We've finally returned to the
> beginning - do not use unicode with MySQLdb at all?
No, I don't think this is true. In MySQLdb queries are *allowed* to be unicode.
>From the 'MySQLdb
On Wed, Oct 03, 2007 at 06:15:21PM -0400, David Turner wrote:
> On Wed, 2007-10-03 at 23:57 +0200, Markus Gritsch wrote:
> > Ah, I see. I have no objection against removing the conversion to
> > unicode completely.
>
> Ok, I committed it to trunk. Thanks for your suggestions.
Now where is se
On Wed, 2007-10-03 at 23:57 +0200, Markus Gritsch wrote:
> On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> > On Wed, 2007-10-03 at 22:57 +0200, Markus Gritsch wrote:
> > > http://www.mail-archive.com/sqlobject-discuss@lists.sourceforge.net/msg02607.html
> >
> > This appears to be an example w
On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-10-03 at 22:57 +0200, Markus Gritsch wrote:
> > http://www.mail-archive.com/sqlobject-discuss@lists.sourceforge.net/msg02607.html
>
> This appears to be an example which breaks when you convert a unicode
> string to unicode. I was
On Wed, 2007-10-03 at 22:57 +0200, Markus Gritsch wrote:
> On 10/3/07, Markus Gritsch <[EMAIL PROTECTED]> wrote:
> > On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> > > I was thinking that it might make more sense to just remove that whole
> > > section. I understand that whoever wrote that
On Wed, 2007-10-03 at 22:49 +0200, Markus Gritsch wrote:
> On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> > I was thinking that it might make more sense to just remove that whole
> > section. I understand that whoever wrote that code thought it was
> > necessary to convert to Unicode, but I
On 10/3/07, Markus Gritsch <[EMAIL PROTECTED]> wrote:
> On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> > I was thinking that it might make more sense to just remove that whole
> > section. I understand that whoever wrote that code thought it was
> > necessary to convert to Unicode, but I th
On 10/3/07, David Turner <[EMAIL PROTECTED]> wrote:
> I was thinking that it might make more sense to just remove that whole
> section. I understand that whoever wrote that code thought it was
> necessary to convert to Unicode, but I think it is not. Can you comment
> on this idea?
There was a t
On Wed, Oct 03, 2007 at 04:46:00PM -0400, David Turner wrote:
> > > > if self.need_unicode and not isinstance(query, unicode):
> > > > try:
> > > > query = unicode(query, self.encoding)
> > > > except UnicodeError:
> > > > pass
>
> I was thinking that it
On Wed, 2007-10-03 at 11:22 +0200, Andres Freund wrote:
> Hi,
>
> On Tuesday 02 October 2007, Oleg Broytmann wrote in "Re: [SQLObject]
> SQLObject
> 0.9.2b1":
> > Hello!
> >
> > On Tue, Oct 02, 2007 at 09:34:08AM +0200, Markus Gritsch wrote:
>
Hi,
On Tuesday 02 October 2007, Oleg Broytmann wrote in "Re: [SQLObject] SQLObject
0.9.2b1":
> Hello!
>
> On Tue, Oct 02, 2007 at 09:34:08AM +0200, Markus Gritsch wrote:
> > the new version 0.9.2b1 added a try except block around the conversion
> > to unicode of
On 10/2/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
>Do you have a problem with the new code?
No, so far it works fine.
Markus
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual St
Hello!
On Tue, Oct 02, 2007 at 09:34:08AM +0200, Markus Gritsch wrote:
> the new version 0.9.2b1 added a try except block around the conversion
> to unicode of the query in mysqlconnection.py:
>
> if self.need_unicode and not isinstance(query, unicode):
> try:
> query = un
Hi,
the new version 0.9.2b1 added a try except block around the conversion
to unicode of the query in mysqlconnection.py:
if self.need_unicode and not isinstance(query, unicode):
try:
query = unicode(query, self.encoding)
except UnicodeError:
pass
In w
Hello!
I'm pleased to announce the 0.9.2b1, the first beta of 0.9.2 release of
SQLObject.
What is SQLObject
=
SQLObject is an object-relational mapper. Your database tables are described
as classes, and rows are instances of those classes. SQLObject is meant to be
easy to use
50 matches
Mail list logo