Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serialization problems with specific sequence of chars #107

Closed
mcaramma opened this issue Sep 3, 2015 · 0 comments
Closed

serialization problems with specific sequence of chars #107

mcaramma opened this issue Sep 3, 2015 · 0 comments

Comments

@mcaramma
Copy link

mcaramma commented Sep 3, 2015

OSerializationException is raised when calling record_create() with specific strings.

setup:

  • Debian GNU/Linux 8.1 (Jessie)
  • virtualenv
  • pip install pyorient --upgrade
  • created new database "test"
  • created new class "MyModel" which get clusterID = 12

Code examples generating the exception:

= code example 1

import pyorient
client = pyorient.OrientDB("localhost", 2424)
client.db_open("test", "admin", "admin" )
data = {'sku': '""">'}
rec = {'@MyModel': data}
client.record_create(12, rec)
Traceback (most recent call last):
  File "data.py", line 9, in <module>
    client.record_create(12, rec)
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/orient.py", line 297, in record_create
    .prepare(args).send().fetch_response()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/records.py", line 101, in fetch_response
    result = super( RecordCreateMessage, self ).fetch_response()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 239, in fetch_response
    self._decode_all()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 223, in _decode_all
    self._decode_header()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 181, in _decode_header
    [ exception_message.decode( 'utf8' ) ]
pyorient.exceptions.PyOrientCommandException: com.orientechnologies.orient.core.exception.OSerializationException - Found invalid > character at position 8 of text sku:"""">". Ensure it is opened and closed correctly.

= code example 2

import pyorient
client = pyorient.OrientDB("localhost", 2424)
client.db_open("test", "admin", "admin" )
data = {'sku': '">""'}
rec = {'@MyModel': data}
client.record_create(12, rec)
Traceback (most recent call last):
  File "data.py", line 9, in <module>
    client.record_create(12, rec)
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/orient.py", line 297, in record_create
    .prepare(args).send().fetch_response()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/records.py", line 101, in fetch_response
    result = super( RecordCreateMessage, self ).fetch_response()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 239, in fetch_response
    self._decode_all()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 223, in _decode_all
    self._decode_header()
  File "/home/marco/.virtualenvs/devlab/local/lib/python2.7/site-packages/pyorient/messages/base.py", line 181, in _decode_header
    [ exception_message.decode( 'utf8' ) ]
pyorient.exceptions.PyOrientCommandException: com.orientechnologies.orient.core.exception.OSerializationException - Found invalid > character at position 6 of text sku:"">""". Ensure it is opened and closed correctly.

A few examples of strings that generate issues during serialization are:

  • """>
  • ">""
  • " fdas " fda " fdsaf &gt; fdsa
  • " > fdas " fda "
  • " &gt; fdas " fda "
  • " > fdas " fda &gt; "

Many more variants can be used.

@Ostico Ostico closed this as completed Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants