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

sysread() is deprecated on :utf8 handles #8

Open
danielluke opened this issue Nov 18, 2020 · 1 comment
Open

sysread() is deprecated on :utf8 handles #8

danielluke opened this issue Nov 18, 2020 · 1 comment

Comments

@danielluke
Copy link

I'm upgrading some old hosts and the newer perl is warning from the sysread in interconect() (which looks like it will be an error in perl-5.30).

I've tested with current Expect + IO::Tty and still get the warning.

This hack silences the warning for the version 1.21 that comes with Ubuntu Bionic (the same change but with different offset also silences the warning for 1.35). For my use cases, this replicates the previous behavior, but I suspect it's not the 'right' fix for the module.

--- /usr/share/perl5/Expect.pm	2010-10-17 02:59:29.000000000 +0000
+++ foo/Expect.pm	2020-11-18 17:13:22.422382834 +0000
@@ -1107,6 +1107,7 @@
     # doing something like $temp_mask='' unless defined ($temp_mask)
     # has no effect whatsoever. This may be a bug in 5.001.
     $read_mask = $read_mask | $temp_mask;
+    binmode($handle, ':raw');
   }
   if ($Expect::Debug) {
     print STDERR "Read handles:\r\n";
@danielluke
Copy link
Author

Upstream perl ticket discussing the deprecation: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=125760

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