mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

self.query.encode(self.encoding) error since 0.9.8 #177

Closed optio closed 6 years ago

optio commented 6 years ago

Issue Type

Bug/Error |

Description

After today's update from SQLTools by PackageControl, I get this error when trying to perform a query using Postgresql:

Exception in thread Thread-43: Traceback (most recent call last): File "./python3.3/threading.py", line 901, in _bootstrap_inner File "/home/sacha/.config/sublime-text-3/Packages/SQLTools/SQLToolsAPI/Command.py", line 92, in run results, errors = self.process.communicate(input=self.query.encode(self.encoding)) TypeError: encode() argument 1 must be str, not None

Same setup was working fine until yesterday so I'm 90% sure it's due to SQLTools update.

Version

tkopets commented 6 years ago

Sorry for breaking stuff )). I will fix this today, meanwhile please make sure your connection has the encoding set (usually to utf-8). I think that should solve your problem for now.

{
  "connections": {
    "Connection PostgreSQL": {
      "type"    : "pgsql",
      "host"    : "127.0.0.1",
      "port"    :  5432,
      "database": "dbname",
      "username": "anotheruser",
      "password": "password",
      "encoding": "utf-8"
    }
  }
}
tkopets commented 6 years ago

Should be fixed in the new release, which will be available via Package Control in a few hours. Let me know if that works for you or reopen this issue.

optio commented 6 years ago

Fixed, Thanks!!! (Did not need to set the decoding option in Postgresql connection settings)