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

Fix IO#write frozen string issue in textmode #2593

Merged
merged 1 commit into from Feb 13, 2015
Merged

Conversation

@lumeet
Copy link
Contributor

@lumeet lumeet commented Feb 12, 2015

The bug affects write operations at least when Tempfile.create is
used in text mode. This patch aims to make IO#write consistent with
MRI's io_write.

I saw no test failing because of the patch. Neither could I find an obvious reason for str being dup'ed or frozen.

The bug is only present on master:

$ bin/jruby -e "require 'tempfile'; Tempfile.create('test', textmode: true) { |f| f.write 'x' }"
RuntimeError: can't modify frozen string
               write at org/jruby/RubyIO.java:1429
               write at org/jruby/RubyIO.java:1399
The bug affects write operations at least when Tempfile.create is
used in text mode. This patch aims to make IO#write consistent with
MRI's io_write.
enebo added a commit that referenced this pull request Feb 13, 2015
Fix IO#write frozen string issue in textmode. We will give it a whirl and see if something breaks.  If so we will have a test case we can add somewhere as a result.
@enebo enebo merged commit 20cd102 into jruby:master Feb 13, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@enebo enebo added this to the 9.0.0.0.pre2 milestone Feb 13, 2015
@lumeet lumeet deleted the lumeet:file_text_mode branch Feb 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants