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
1=== modified file 'mysql/connector/connection.py'
2--- mysql/connector/connection.py 2010-02-26 15:36:04 +0000
3+++ mysql/connector/connection.py 2010-04-02 14:44:24 +0000
4@@ -71,16 +71,12 @@
5 except Exception, e:
6 raise errors.OperationalError('%s' % e)
7
8- def _next_buffer(self):
9- buf = self.buffer.popleft()
10- return buf
11-
12 def recv(self):
13 """Receive packets from the MySQL server
14 """
15 try:
16- return self._next_buffer()
17- except:
18+ return self.buffer.popleft()
19+ except IndexError:
20 pass
21
22 pktnr = -1
23@@ -107,7 +103,10 @@
24 except:
25 raise
26
27- return self._next_buffer()
28+ try:
29+ return self.buffer.popleft()
30+ except IndexError:
31+ raise errors.InterfaceError(errno=2055)
32
33 def set_connection_timeout(self, timeout):
34 self.connection_timeout = timeout
35
36=== modified file 'mysql/connector/constants.py'
37--- mysql/connector/constants.py 2010-02-17 12:21:06 +0000
38+++ mysql/connector/constants.py 2010-04-02 14:44:24 +0000
39@@ -385,7 +385,7 @@
40 name of the used character set or collation.
41 """
42
43- desc = (
44+ desc = [
45 None,
46 ("big5","big5_chinese_ci"), # 1
47 ("latin2","latin2_czech_cs"), # 2
48@@ -597,7 +597,7 @@
49 ("utf8","utf8_persian_ci"), # 208
50 ("utf8","utf8_esperanto_ci"), # 209
51 ("utf8","utf8_hungarian_ci"), # 210
52- )
53+ ]
54
55 @classmethod
56 def get_info(cls,setid):
57@@ -644,9 +644,9 @@
58
59 try:
60 idx = cls.desc.index((name,collation))
61- return (idx,) + (name,collation)
62- except:
63+ except ValueError: # list.index(x): x not in list
64 raise ProgrammingError("Character set '%s' unsupported." % (name))
65+ return (idx,) + (name,collation)
66
67 @classmethod
68 def get_supported(cls):

Subscribers

People subscribed via source and target branches

to status/vote changes: