Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIX: string value return as is (not convert to unicode string) in Pyt…

…hon 2.x
  • Loading branch information...
commit f5a23411b78d086d984e9ac095de6c2a6b74bf4e 1 parent 882051a
@nakagami authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 firebirdsql/fbcore.py
View
10 firebirdsql/fbcore.py
@@ -240,10 +240,7 @@ def _parse_time(self, raw_value):
def value(self, raw_value):
if self.sqltype in (SQL_TYPE_TEXT, SQL_TYPE_VARYING):
- if PYTHON_MAJOR_VER==3:
- return self.bytes_to_str(raw_value)
- else:
- return raw_value
+ return self.bytes_to_str(raw_value)
elif self.sqltype in (SQL_TYPE_SHORT, SQL_TYPE_LONG, SQL_TYPE_INT64):
n = bytes_to_bint(raw_value)
if self.sqlscale:
@@ -595,7 +592,10 @@ def str_to_bytes(self, s):
return s.encode(self.charset_map.get(self.charset, self.charset))
def bytes_to_str(self, b):
- return b.decode(self.charset_map.get(self.charset, self.charset))
+ if PYTHON_MAJOR_VER==3:
+ return b.decode(self.charset_map.get(self.charset, self.charset))
+ else:
+ return b
def uid(self):
if sys.platform == 'win32':
Please sign in to comment.
Something went wrong with that request. Please try again.