Merge lp:~bsdemon/myconnpy/fixes into lp:~geertjmvdk/myconnpy/main

Proposed by andreypopp
Status: Rejected
Rejected by: Geert JM Vanderkelen
Proposed branch: lp:~bsdemon/myconnpy/fixes
Merge into: lp:~geertjmvdk/myconnpy/main
Diff against target: 68 lines (+10/-11)
2 files modified
mysql/connector/connection.py (+6/-7)
mysql/connector/constants.py (+4/-4)
To merge this branch: bzr merge lp:~bsdemon/myconnpy/fixes
Reviewer Review Type Date Requested Status
Geert JM Vanderkelen Disapprove
Review via email: mp+22535@code.launchpad.net

Description of the change

Fixed bug with CharacterSet.get_charset_info -- description of supported charset should be list.

To post a comment you must log in.
lp:~bsdemon/myconnpy/fixes updated
226. By andreypopp

Exception handling in get_charset_info specialized

227. By andreypopp

If we have no items in buffer after receive -- it is disconnect

228. By andreypopp

Removed call overhead on Connection.recv and added specialized error handling

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

We agreed to not merge but take the changes into consideration.
It's also because I was not that familiar yet with merging :)

-Geert

review: Disapprove
Revision history for this message
andreypopp (bsdemon) wrote :

That's ok, thanks!

On May 28, 2010, at 6:15 PM, Geert JM Vanderkelen wrote:

> Review: Disapprove
> We agreed to not merge but take the changes into consideration.
> It's also because I was not that familiar yet with merging :)
>
> -Geert
> --
> https://code.launchpad.net/~bsdemon/myconnpy/fixes/+merge/22535
> You are the owner of lp:~bsdemon/myconnpy/fixes.

Unmerged revisions

228. By andreypopp

Removed call overhead on Connection.recv and added specialized error handling

227. By andreypopp

If we have no items in buffer after receive -- it is disconnect

226. By andreypopp

Exception handling in get_charset_info specialized

225. By andreypopp

Fixed description of supported charsets -- should be list.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mysql/connector/connection.py'
--- mysql/connector/connection.py 2010-02-26 15:36:04 +0000
+++ mysql/connector/connection.py 2010-04-02 14:44:24 +0000
@@ -71,16 +71,12 @@
71 except Exception, e:71 except Exception, e:
72 raise errors.OperationalError('%s' % e)72 raise errors.OperationalError('%s' % e)
7373
74 def _next_buffer(self):
75 buf = self.buffer.popleft()
76 return buf
77
78 def recv(self):74 def recv(self):
79 """Receive packets from the MySQL server75 """Receive packets from the MySQL server
80 """76 """
81 try:77 try:
82 return self._next_buffer()78 return self.buffer.popleft()
83 except:79 except IndexError:
84 pass80 pass
85 81
86 pktnr = -182 pktnr = -1
@@ -107,7 +103,10 @@
107 except:103 except:
108 raise104 raise
109 105
110 return self._next_buffer()106 try:
107 return self.buffer.popleft()
108 except IndexError:
109 raise errors.InterfaceError(errno=2055)
111110
112 def set_connection_timeout(self, timeout):111 def set_connection_timeout(self, timeout):
113 self.connection_timeout = timeout112 self.connection_timeout = timeout
114113
=== modified file 'mysql/connector/constants.py'
--- mysql/connector/constants.py 2010-02-17 12:21:06 +0000
+++ mysql/connector/constants.py 2010-04-02 14:44:24 +0000
@@ -385,7 +385,7 @@
385 name of the used character set or collation.385 name of the used character set or collation.
386 """386 """
387 387
388 desc = (388 desc = [
389 None,389 None,
390 ("big5","big5_chinese_ci"), # 1390 ("big5","big5_chinese_ci"), # 1
391 ("latin2","latin2_czech_cs"), # 2391 ("latin2","latin2_czech_cs"), # 2
@@ -597,7 +597,7 @@
597 ("utf8","utf8_persian_ci"), # 208597 ("utf8","utf8_persian_ci"), # 208
598 ("utf8","utf8_esperanto_ci"), # 209598 ("utf8","utf8_esperanto_ci"), # 209
599 ("utf8","utf8_hungarian_ci"), # 210599 ("utf8","utf8_hungarian_ci"), # 210
600 )600 ]
601601
602 @classmethod602 @classmethod
603 def get_info(cls,setid):603 def get_info(cls,setid):
@@ -644,9 +644,9 @@
644 644
645 try:645 try:
646 idx = cls.desc.index((name,collation))646 idx = cls.desc.index((name,collation))
647 return (idx,) + (name,collation)647 except ValueError: # list.index(x): x not in list
648 except:
649 raise ProgrammingError("Character set '%s' unsupported." % (name))648 raise ProgrammingError("Character set '%s' unsupported." % (name))
649 return (idx,) + (name,collation)
650 650
651 @classmethod651 @classmethod
652 def get_supported(cls):652 def get_supported(cls):

Subscribers

People subscribed via source and target branches

to status/vote changes: