public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dave Page <[email protected]>
To: Murtuza Zabuawala <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: PATCH: Encoding issue with qtLiteral function (pgAdmin4)
Date: Mon, 25 Jul 2016 12:31:41 +0100
Message-ID: <CA+OCxoxcKKbHqmhaaOZKQLk1tqTkpereYzN5vCz3zS3oZbUM7A@mail.gmail.com> (raw)
In-Reply-To: <CAKKotZQNGSBSa=XjhKfDgBgMpAXEQUaMrBnNkW_F58q2CkdvLQ@mail.gmail.com>
References: <CAKKotZR5b=JjkC5cS2x=TzVY2MfEhc+eHpcbMm41eW5jv4uYBA@mail.gmail.com>
	<CA+OCxow2ZO0RRELTnQo45o+mqX6GJpEEHzuZYGg0g6D6msb_9w@mail.gmail.com>
	<CAKKotZQNGSBSa=XjhKfDgBgMpAXEQUaMrBnNkW_F58q2CkdvLQ@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

Whenever I connect to my primary test server I get the following in the
console, and see the attached error:

2016-07-25 12:22:56,684: INFO pgadmin: Connection Request for server#1
2016-07-25 12:22:56,688: ERROR pgadmin: 'ascii' codec can't decode byte
0x8f in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
line 785, in connect
    server_types=ServerType.types()
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
line 250, in connect
    password = password.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8f in position 0:
ordinal not in range(128)

I can no longer connect to that server even without the patch, following
the testing I did on your patch last week.

To make everythign work again, I had to drop the SQLite database. If I then
try to add an emojii to the comment for the server (with your patch), I get:

2016-07-25 12:29:36,930: INFO werkzeug: 127.0.0.1 - - [25/Jul/2016
12:29:36] "PUT /browser/server/obj/1/1 HTTP/1.1" 500 -
Traceback (most recent call last):
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 235,
in dispatch_request
    return method(*args, **kwargs)
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
line 403, in update
    data = request.form if request.form else
json.loads(request.data.decode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 119:
ordinal not in range(128)


On Mon, Jul 25, 2016 at 7:19 AM, Murtuza Zabuawala <
[email protected]> wrote:

> Hi Dave,
>
> I'm not able to re-produce the issue on my side (PFA screenshot), and from
> exception log you mentioned it looks like connection to database issue
> rather than encoding.
> Would you please try & test one more time?
>
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, Jul 22, 2016 at 9:20 PM, Dave Page <[email protected]> wrote:
>
>> Hi
>>
>> On Fri, Jul 22, 2016 at 3:11 PM, Murtuza Zabuawala
>> <[email protected]> wrote:
>> > Hi,
>> >
>> > PFA patch to fix the issue when we use qtLiteral function and user
>> enters
>> > special characters(like emojis) which it fails to handle.
>> > RM#1307
>>
>> It still seems to be broken to me. For example, if I try to set a
>> comment on a table to 😬, I get the following error:
>>
>> 2016-07-22 16:47:49,526: INFO werkzeug: 127.0.0.1 - - [22/Jul/2016
>> 16:47:49] "GET
>> /browser/table/msql/1/1/17251/2200/17267?id=17267&description=%F0%9F%98%AC+&columns=%7B%22changed%22%3A%5B%7B%22attlen%22%3Anull%7D%2C%7B%22attlen%22%3Anull%7D%2C%7B%22attlen%22%3Anull%7D%2C%7B%22attlen%22%3Anull%7D%2C%7B%22attlen%22%3Anull%7D%5D%7D&_=1469202363116
>> HTTP/1.1" 500 -
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 2000, in __call__
>>     return self.wsgi_app(environ, start_response)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1991, in wsgi_app
>>     response = self.make_response(self.handle_exception(e))
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1567, in handle_exception
>>     reraise(exc_type, exc_value, tb)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1988, in wsgi_app
>>     response = self.full_dispatch_request()
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1641, in full_dispatch_request
>>     rv = self.handle_user_exception(e)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1544, in handle_user_exception
>>     reraise(exc_type, exc_value, tb)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1639, in full_dispatch_request
>>     rv = self.dispatch_request()
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1625, in dispatch_request
>>     return self.view_functions[rule.endpoint](**req.view_args)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
>> line 84, in view
>>     return self.dispatch_request(*args, **kwargs)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
>> 235, in dispatch_request
>>     return method(*args, **kwargs)
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py",
>> line 276, in wrap
>>     self.conn = self.manager.connection(did=kwargs['did'])
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
>> line 1278, in connection
>>     raise Exception(msg_active_conn)
>> Exception: Server has no active connection. Please connect to the server.
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [image/png] Screen Shot 2016-07-25 at 12.23.47.png (622.0K, 3-Screen%20Shot%202016-07-25%20at%2012.23.47.png)
  download | view image

view thread (16+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: PATCH: Encoding issue with qtLiteral function (pgAdmin4)
  In-Reply-To: <CA+OCxoxcKKbHqmhaaOZKQLk1tqTkpereYzN5vCz3zS3oZbUM7A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox