Skip to content

Conversation

@jakebolewski
Copy link
Contributor

Fixes segfault with PR #14.

jakebolewski added a commit that referenced this pull request Aug 30, 2014
Descriptive error messages for julia exceptions
@jakebolewski jakebolewski merged commit cca05cd into master Aug 30, 2014
@jakebolewski jakebolewski deleted the fix_err branch August 30, 2014 14:01
@eslgastal
Copy link
Contributor

Hi Jake,

Your changes give me the following error:

---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)

[...]

/usr/local/lib/python2.7/dist-packages/julia/core.pyc in _capture_showerror_for_last_julia_exception(self)
    310             sprint(showerror, ex, catch_backtrace())
    311         end""")
--> 312         return char_p(msg).value.encode("utf-8")
    313 
    314     def _typeof_julia_exception_in_transit(self):

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding of julia's capi, jl_eval_string()'s return value must be unboxed to get to the actual char* returned by sprint(). This is why I originally used return self.api.jl_bytestring_ptr(msg), which doesn't segfault for me.

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

Successfully merging this pull request may close these issues.

3 participants