google-code-export / crunchyfrog

Automatically exported from code.google.com/p/crunchyfrog
0 stars 0 forks source link

Cannot connect to a MySQL datasource if port is specified #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new MySQL Datasource
2. Specify the port (eg 3306)
3. Test the connection

What is the expected output?
A popup displaying "Succeeded" message.
What do you see instead?
A popup displaying: Failed. an integer is required.

What version of the product are you using?
changeset:   602:56e6bd0d7091
On what operating system?
Debian GNU/Linux 5.0
Python version?
python 2.5.4-2

Please provide any additional information below.
I tried to create a new MySQL datasource and specified
a port. The connection test failed and it wouldn't
connect failing with them message: "an integer is required"

Here is the output in console:

Traceback (most recent call last):
  File "/home/istirbu/src/crunchyfrog/cf/ui/datasources.py", line 499, in
test_connection
    conn = ds._open_connection()
  File "/home/istirbu/src/crunchyfrog/cf/db/__init__.py", line 211, in
_open_connection
    conn = self.backend.get_connection(self.url)
  File "/home/istirbu/src/crunchyfrog/cf/db/backends/__init__.py", line
113, in get_connection
    conn = self.dbapi().connect(*args, **kwds)
  File "/usr/lib/pymodules/python2.5/MySQLdb/__init__.py", line 74, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/pymodules/python2.5/MySQLdb/connections.py", line 170, in
__init__
    super(Connection, self).__init__(*args, **kwargs2)
TypeError: an integer is required

Original issue reported on code.google.com by igor.sti...@gmail.com on 29 Jul 2009 at 9:29

GoogleCodeExporter commented 9 years ago
Again, thanks for reporting! :)

Original comment by albrecht.andi on 29 Jul 2009 at 8:09

GoogleCodeExporter commented 9 years ago

Original comment by albrecht.andi on 29 Jul 2009 at 8:10

GoogleCodeExporter commented 9 years ago
[forgot to set labels, sorry for the noise]

Original comment by albrecht.andi on 29 Jul 2009 at 8:10

GoogleCodeExporter commented 9 years ago
Not fixed in 0.4.1.  I am suffering of the same problem.

Original comment by LynxHeur...@gmail.com on 1 May 2010 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by albrecht.andi on 3 May 2010 at 4:03

GoogleCodeExporter commented 9 years ago
little patch:

in /usr/lib/pymodules/python2.6/MySQLdb/connections.py
add line
        kwargs2['port'] = 0+kwargs.get('port',3306)
before:
        super(Connection, self).__init__(*args, **kwargs2)

it's my first python I ever write, but it seems to do the job

Original comment by pascal.m...@gmail.com on 14 May 2010 at 5:21

GoogleCodeExporter commented 9 years ago
@pascal.masschelier: MySQLdb is the wrong place to fix this. CrunchyFrog 
shouldn't 
allow anything other than integers for ports.

Original comment by albrecht.andi on 17 May 2010 at 4:08

GoogleCodeExporter commented 9 years ago
This issue was closed by revision beb3754add.

Original comment by albrecht.andi on 17 May 2010 at 4:45

GoogleCodeExporter commented 9 years ago
I am having this issue, using crunchyfrog 0.4.2-dev.

Original comment by davidj...@gmail.com on 20 Jun 2014 at 1:47