Skip to content

Conversation

@undingen
Copy link
Contributor

@undingen undingen commented Feb 5, 2016

Switches to the cpython file object implementation and printing code.

This makes us pass the following cpython tests:

  • test_file2k
  • test_file_eintr
  • test_print
  • test_softspace

This also make use now call much more often into tp_print which we do not implement for many types. I think in the future we should add them because this functions can directly write to a file descriptor instead of having to always write into a buffer. I had to add it for the dict type because the default dict implementation requires it.

In addition fixes a pyopenssl integration test error:

ERROR: Random data can be saved and loaded to files with paths specified as
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marius/pyston/build/Release/from_cpython/Lib/unittest/case.py", line 329, in run
    testMethod()
  File "/home/marius/pyston/pyopenssl_test_env_pyston_release/site-packages/OpenSSL/test/test_rand.py", line 219, in test_unicode_paths
    self._read_write_test(path)
  File "/home/marius/pyston/pyopenssl_test_env_pyston_release/site-packages/OpenSSL/test/test_rand.py", line 184, in _read_write_test
    with open(path, "w"):
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2603' in position 11: ordinal not in range(128)

@undingen undingen force-pushed the cpython_file branch 5 times, most recently from 8519d51 to 52b2887 Compare February 7, 2016 13:51
return posix_error();
/* We now know we will succeed, so initialize the file object. */

// Pyston change:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tiny, but we can remove the "Pyston change" comment

@kmod
Copy link
Collaborator

kmod commented Feb 8, 2016

lgtm!

undingen added a commit that referenced this pull request Feb 9, 2016
Switch to cpythons file object implementation
@undingen undingen merged commit 1f4a1b0 into pyston:master Feb 9, 2016
@undingen
Copy link
Contributor Author

undingen commented Feb 9, 2016

merged with a fix witch increases the travis ci timeout to 30min from 20 because the debug build hit the limit.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants