postgresql - pgadmin4 1.3 raises CSV export broken -


i installed pgadmin4 1.3 (in docker container) , working fine except csv exports.

i filled in binary paths in preferences still not working. have no error message. when click csv export icon nothing happens.

here config:

  • python version : 2.7.12
  • postgresql version : 9.5
  • pgadmin version : 4.1.3
  • ubuntu 16.04

if has same issue , knows how solve can please ?

thanks !

i found culprit !

i had /var/log/apache2/errors.log , saw unicodeencodeerror during csv creation. error came file :

/usr/local/lib/python2.7/dist-packages/pgadmin4/pgadmin/utils/driver/psycopg2/__init__.py

line 651, csv writer broken when writing special characters accentuated characters (i using python 2, guess not have had issue python 3):

csv_writer.writerows(results)

eventually solved using unicodecsv library :

  • pip install unicodecsv
  • line 22: replaced import csv import unicodecsv csv
  • line 647: replaced csv.dictwriter(res_io, fieldnames=header, delimiter=str(','), quoting=csv.quote_nonnumeric) csv.dictwriter(res_io, encoding='utf-8', fieldnames=header, delimiter=str(','), quoting=csv.quote_nonnumeric)

hope might other people while encoding bug not fixed !


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -