GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make Project model (and future models) handle unicode in responses · Issue #10 · raster-foundry/raster-foundry-python-client

This repository was archived by the owner on Dec 10, 2019. It is now read-only.
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Make Project model (and future models) handle unicode in responses #10

Copy link
Copy link
Open
Open
Make Project model (and future models) handle unicode in responses#10
Copy link

Description

@rossbernet
rossbernet
opened on Jun 8, 2017
Issue body actions

The second cell of the example notebook gave me this error:

`/usr/local/lib/python2.7/site-packages/bravado_core/spec.py:259: Warning: uuid format is not registered with bravado-core!
.format(name), Warning)

UnicodeEncodeError Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/IPython/core/formatters.pyc in call(self, obj)
670 type_pprinters=self.type_printers,
671 deferred_pprinters=self.deferred_printers)
--> 672 printer.pretty(obj)
673 printer.flush()
674 return stream.getvalue()

/usr/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
366 if cls in self.type_pprinters:
367 # printer registered in self.type_pprinters
--> 368 return self.type_pprinters[cls](obj, self, cycle)
369 else:
370 # deferred printer

/usr/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in inner(obj, p, cycle)
550 p.text(',')
551 p.breakable()
--> 552 p.pretty(x)
553 if len(obj) == 1 and type(obj) is tuple:
554 # Special case for 1-item tuples.

/usr/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
381 if callable(meth):
382 return meth(obj, self, cycle)
--> 383 return _default_pprint(obj, self, cycle)
384 finally:
385 self.end_group()

/usr/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
501 if _safe_getattr(klass, 'repr', None) not in baseclass_reprs:
502 # A user-provided repr. Find newlines and replace them with p.break
()
--> 503 _repr_pprint(obj, p, cycle)
504 return
505 p.begin_group(1, '<')

/usr/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in repr_pprint(obj, p, cycle)
699 """A pprint that just redirects to the normal repr function."""
700 # Find newlines and replace them with p.break
()
--> 701 output = repr(obj)
702 for idx,output_line in enumerate(output.splitlines()):
703 if idx:

/usr/local/lib/python2.7/site-packages/rasterfoundry/models/project.pyc in repr(self)
8
9 def repr(self):
---> 10 return '<Project - {}>'.format(self.name)
11
12 def init(self, project, api):

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 1: ordinal not in range(128)`

Activity

  1. rossbernet commented on Jun 8, 2017

    @rossbernet
    rossbernet
    on Jun 8, 2017
    Author
    More actions

    One of the (peru) project names included a fancy o

    When I renamed the project to replace the fancy-o with a non fancy o. It solved the issue.

    But this remains an issue, because as @jisantuc says, "the internet is full of unicode"

    Reacted by James Santucci
  2. jisantuc
    changed the title [-]UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 1: ordinal not in range(128)[/-] [+]Project model (and future models) must handle unicode in responses[/+] on Jun 8, 2017
  3. jisantuc
    changed the title [-]Project model (and future models) must handle unicode in responses[/-] [+]Make Project model (and future models) handle unicode in responses[/+] on Jun 8, 2017
  4. jisantuc commented on Jun 8, 2017

    @jisantuc
    jisantuc
    on Jun 8, 2017
    Contributor
    More actions

    Easiest solution is probably just from __future__ import unicode_literals -- http://python-future.org/compatible_idioms.html#unicode-text-string-literals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.