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

$fh.lines fails miserably when the file has no trailing newline #2691

Closed
p6rt opened this issue Mar 30, 2012 · 3 comments
Closed

$fh.lines fails miserably when the file has no trailing newline #2691

p6rt opened this issue Mar 30, 2012 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Mar 30, 2012

Migrated from rt.perl.org#112130 (status was 'resolved')

Searchable as RT112130$

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

From @moritz

$ echo -n foo > test
$ perl6 -e 'my $f = open("test"); say $f.slurp'
foo
$ perl6 -e 'my $f = open("test"); .say for $f.lines'
Unable to open filehandle from path 'test'
  in method open at src/gen/CORE.setting​:6268
  in method get at src/gen/CORE.setting​:6288
  in code <anon> at src/gen/CORE.setting​:6313
  in sub coro at src/gen/CORE.setting​:4797
  in method reify at src/gen/CORE.setting​:4778
  in method reify at src/gen/CORE.setting​:4549
  in method reify at src/gen/CORE.setting​:4549
  in method gimme at src/gen/CORE.setting​:4937
  in method reify at src/gen/CORE.setting​:4628
  in method reify at src/gen/CORE.setting​:4549
  in method reify at src/gen/CORE.setting​:4549
  in method gimme at src/gen/CORE.setting​:4937
  in method eager at src/gen/CORE.setting​:4912
  in method eager at src/gen/CORE.setting​:1024
  in sub eager at src/gen/CORE.setting​:5200
  in block <anon> at -e​:1

$

< moritz> I guess it doesn't really fail to open the file, but it fails
at error reporting
< moritz> if you look closely at the backtrace, you see that method
'get' calls method 'open'
< moritz> so it tries to re-open the file (?) and fails. It's not the
first open() that fails

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

From @moritz

fixed in 3d7cc4d306abd67502fdc941d503459e12ac574a, tested in
S16-filehandles/io.t

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

@moritz - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Mar 30, 2012
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

1 participant