Skip Menu |

This queue is for tickets about the Net-Printer CPAN distribution.

Report information
The Basics
Id: 83100
Status: open
Priority: 0/
Queue: Net-Printer

People
Owner: cfuhrman [...] panix.com
Requestors: mmusgrove [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.11
Fixed in: (no value)



Subject: test.pl hangs on Windows after ok 2
This smoker is running Strawberry Perl 5.12.3 on Windows 7 CPAN.pm: Building C/CF/CFUHRMAN/Net-Printer-1.11.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Net::Printer Writing MYMETA.yml and MYMETA.json (C:\strawberry\perl\bin\perl.exe Makefile.PL exited with 0) CPAN::Reporter: Makefile.PL result is 'pass', No errors. cp lib/Net/Printer.pm blib\lib\Net\Printer.pm (C:\strawberry\c\bin\dmake.EXE exited with 0) CPAN::Reporter: dmake result is 'pass', No errors. CFUHRMAN/Net-Printer-1.11.tar.gz C:\strawberry\c\bin\dmake.EXE -- OK Running make test C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl 1..1 # Running under perl version 5.012003 for MSWin32 # Current time local: Fri Feb 1 23:30:36 2013 # Current time GMT: Sat Feb 2 05:30:36 2013 # Using Test.pm version 1.26 ok 1 ok 2
RT-Send-CC: cfuhrman [...] panix.com
Howdy, The problem is apparently that the POSIX::tmpnam() function, as provided by Strawberry Perl, is returning temporary file names preceded with a "\" (e.g., \s2j8., \s45o., \sis., etc.) Since I've got the call to tmpnam() wrapped in a do-while loop, it gets stuck since it cannot get a valid file handle. I can work around this, although someone really should fix POSIX::tmpnam() such that it works as expected under MSWin32 (A quick test under cygwin worked perfectly okay). Give me a couple of days to fix this as my access to Windows Machines is limited and I'll release an update. /Chris
When I saw your reply I pulled up the code to look at it and now I'm curious. Obviously you don't have to answer this but why did you choose to use POSIX::tmpname and IO::File together instead simply using of POSIX::tmpfile (or IO::File::new_tmpfile or File::Temp)?
Howdy, Truth be told, this code is *very* old and antiquated. I had to dig through the source code history and found that the tmpfile code was committed February 10th, 2003 (Wow! 10 years!). More than likely, I either was using sample code I either found in the Perl Cookbook or else found online. It worked at the time. I've updated the code to use File::Temp and tested it against ActiveState Perl under MSWin32. To check out the latest version, visit https://github.com/cfuhrman/net-printer and let me know if it works for you. If it does, I'll push out a new release. Cheers! On Wed Feb 06 10:24:19 2013, MMUSGROVE wrote: Show quoted text
> When I saw your reply I pulled up the code to look at it and now I'm > curious. Obviously you don't have to answer this but why did you choose > to use POSIX::tmpname and IO::File together instead simply using of > POSIX::tmpfile (or IO::File::new_tmpfile or File::Temp)?
Subject: Re: [rt.cpan.org #83100] test.pl hangs on Windows after ok 2
Date: Sat, 9 Feb 2013 20:03:14 -0600
To: bug-Net-Printer [...] rt.cpan.org
From: "Mr. Muskrat" <mmusgrove [...] cpan.org>
I don't remember why I was testing Net::Printer (don't think my smokers would pull it down on their own if the last release date was February 2011). Regardless, I'm installing GitHub for Windows now and when that's ready, I'll pull it down and try it out. Matt On Sat, Feb 9, 2013 at 7:49 PM, Chris Fuhrman via RT < bug-Net-Printer@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83100 > > > Howdy, > > Truth be told, this code is *very* old and antiquated. I had to dig > through the source code > history and found that the tmpfile code was committed February 10th, 2003 > (Wow! 10 years!). > More than likely, I either was using sample code I either found in the > Perl Cookbook or else > found online. It worked at the time. > > I've updated the code to use File::Temp and tested it against ActiveState > Perl under MSWin32. To > check out the latest version, visit > https://github.com/cfuhrman/net-printer and let me know if it > works for you. If it does, I'll push out a new release. > > Cheers! > > On Wed Feb 06 10:24:19 2013, MMUSGROVE wrote:
> > When I saw your reply I pulled up the code to look at it and now I'm > > curious. Obviously you don't have to answer this but why did you choose > > to use POSIX::tmpname and IO::File together instead simply using of > > POSIX::tmpfile (or IO::File::new_tmpfile or File::Temp)?
> >
C:\Users\mmusgrove\Documents\GitHub\net-printer>perl Makefile.PL Writing Makefile for Net::Printer Writing MYMETA.yml and MYMETA.json C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake cp lib/Net/Printer.pm blib\lib\Net\Printer.pm C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake test C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl 1..0 # SKIP Unable to connect to localhost port 515. Aborting C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake install Installing C:\strawberry\perl\site\lib\Net\Printer.pm Appending installation info to C:\strawberry\perl\lib/perllocal.pod
Whoops! You can set the following environmental variables to influence the tests: LPD_SERVER # Server to connect to, e.g., printer.example.com LPD_PRINTER # Printer to print to (defaults to lp) LPD_PORT # Port to connect to (defaults to 515) HTH On Sat Feb 09 21:22:50 2013, MMUSGROVE wrote: Show quoted text
> C:\Users\mmusgrove\Documents\GitHub\net-printer>perl Makefile.PL > Writing Makefile for Net::Printer > Writing MYMETA.yml and MYMETA.json > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake > cp lib/Net/Printer.pm blib\lib\Net\Printer.pm > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake test > C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl > 1..0 # SKIP Unable to connect to localhost port 515. Aborting > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake install > Installing C:\strawberry\perl\site\lib\Net\Printer.pm > Appending installation info to C:\strawberry\perl\lib/perllocal.pod
Subject: Re: [rt.cpan.org #83100] test.pl hangs on Windows after ok 2
Date: Sat, 9 Feb 2013 22:51:09 -0600
To: bug-Net-Printer [...] rt.cpan.org
From: "Mr. Muskrat" <mmusgrove [...] cpan.org>
I don't actually have a network printer to test it out with (remember what I said earlier about not being sure how it ever got queued for testing?). I'm not sure what the tests should do if one is not found. Matt On Sat, Feb 9, 2013 at 10:40 PM, Chris Fuhrman via RT < bug-Net-Printer@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83100 > > > Whoops! > > You can set the following environmental variables to influence the tests: > > LPD_SERVER # Server to connect to, e.g., printer.example.com > LPD_PRINTER # Printer to print to (defaults to lp) > LPD_PORT # Port to connect to (defaults to 515) > > HTH > > On Sat Feb 09 21:22:50 2013, MMUSGROVE wrote:
> > C:\Users\mmusgrove\Documents\GitHub\net-printer>perl Makefile.PL > > Writing Makefile for Net::Printer > > Writing MYMETA.yml and MYMETA.json > > > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake > > cp lib/Net/Printer.pm blib\lib\Net\Printer.pm > > > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake test > > C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl > > 1..0 # SKIP Unable to connect to localhost port 515. Aborting > > > > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake install > > Installing C:\strawberry\perl\site\lib\Net\Printer.pm > > Appending installation info to C:\strawberry\perl\lib/perllocal.pod
> > > >
Subject: Re: [rt.cpan.org #83100] test.pl hangs on Windows after ok 2
Date: Sat, 9 Feb 2013 22:52:27 -0600
To: bug-Net-Printer [...] rt.cpan.org
From: "Mr. Muskrat" <mmusgrove [...] cpan.org>
At least I thought I said that Matt On Sat, Feb 9, 2013 at 10:51 PM, Mr. Muskrat <mmusgrove@cpan.org> wrote: Show quoted text
> I don't actually have a network printer to test it out with (remember what > I said earlier about not being sure how it ever got queued for testing?). > I'm not sure what the tests should do if one is not found. > > Matt > > > On Sat, Feb 9, 2013 at 10:40 PM, Chris Fuhrman via RT < > bug-Net-Printer@rt.cpan.org> wrote: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=83100 > >> >> Whoops! >> >> You can set the following environmental variables to influence the tests: >> >> LPD_SERVER # Server to connect to, e.g., printer.example.com >> LPD_PRINTER # Printer to print to (defaults to lp) >> LPD_PORT # Port to connect to (defaults to 515) >> >> HTH >> >> On Sat Feb 09 21:22:50 2013, MMUSGROVE wrote:
>> > C:\Users\mmusgrove\Documents\GitHub\net-printer>perl Makefile.PL >> > Writing Makefile for Net::Printer >> > Writing MYMETA.yml and MYMETA.json >> > >> > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake >> > cp lib/Net/Printer.pm blib\lib\Net\Printer.pm >> > >> > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake test >> > C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl >> > 1..0 # SKIP Unable to connect to localhost port 515. Aborting >> > >> > C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake install >> > Installing C:\strawberry\perl\site\lib\Net\Printer.pm >> > Appending installation info to C:\strawberry\perl\lib/perllocal.pod
>> >> >> >>
>
Apparently I can enable the LPD Print Service which should provide the missing functionality. I'll give it shot and let you know how it works out.
On Sat Feb 09 23:58:14 2013, MMUSGROVE wrote: Show quoted text
> Apparently I can enable the LPD Print Service which should provide the > missing functionality. I'll give it shot and let you know how it works
out. I configured my printer on the wireless LAN and to use LPR. I must be doing something wrong though because I can't print to it from the command line with the lpr command. I did get a little further with the test file though. C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl 1..1 # Running under perl version 5.016002 for MSWin32 # Current time local: Sat Feb 9 23:37:24 2013 # Current time GMT: Sun Feb 10 05:37:24 2013 # Using Test.pm version 1.25_02 defined(@array) is deprecated at test.pl line 42. (Maybe you should just omit the defined()?) ok 1 ok 2
This simple script doesn't error out but like my previous attempts, nothing is printed. use Net::Printer; my $lp = new Net::Printer( filename => 'C:\Users\mmusgrove\Desktop\chili.txt', printer => '0000006C0B23', server => '192.168.1.81', port => 515, ); my $res = $lp->printfile(); print "res: $res\n"; my $err = $lp->printerror(); print "err: $err\n"; Output: res: 1 err:
Howdy, Please try the following: 1) Upgrade your code to the latest version via git 2) Try running the included test.pl script after setting up the appropriate environmental variables 3) If possible, open up the test.pl script and set "debug" to "yes" 4) Note that there will be a delay while it does it's thing. I've now been successful getting it to work with Strawberry Perl 5) Let me know if you run into any problems. Cheers! On Sun Feb 10 00:51:35 2013, MMUSGROVE wrote: Show quoted text
> This simple script doesn't error out but like my previous attempts, > nothing is printed. > > use Net::Printer; > my $lp = new Net::Printer( > filename => 'C:\Users\mmusgrove\Desktop\chili.txt', > printer => '0000006C0B23', > server => '192.168.1.81', > port => 515, > ); > my $res = $lp->printfile(); > print "res: $res\n"; > my $err = $lp->printerror(); > print "err: $err\n"; > > Output: > res: 1 > err: >
Subject: Re: [rt.cpan.org #83100] test.pl hangs on Windows after ok 2
Date: Mon, 11 Feb 2013 19:39:47 -0600
To: bug-Net-Printer [...] rt.cpan.org
From: "Mr. Muskrat" <mmusgrove [...] cpan.org>
1. I still don't know how my CPAN smoker ended up trying to test this module last week. 2. What should happen if a CPAN smoker were to pull down the mdule and attempt to test it? It looks like all tests are now skipped which would result in a pass. 3. Even after following all of the instructions given, I cannot get my printer to respond to commands of any kind. It looks like it's a issue with my printer and not the module. Port 515 is in use but I cannot figure out what to use for LPD_PRINTER. I changed the printer name before I began today so that it would be easier to type and it made no difference at all. C:\Users\mmusgrove\Documents\GitHub\net-printer>SET LPD_PRINTER=MP990 C:\Users\mmusgrove\Documents\GitHub\net-printer>dmake test C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl 1..3 ok 1 DEBUG-> Net::Printer::printfile : invoked ... DEBUG-> Net::Printer::printfile : Filename is ./testprint.txt DEBUG-> Net::Printer::_nlConvert : invoked ... DEBUG-> Net::Printer::printfile : Real Data File C:\Users\MMUSGR~1\Ap pData\Local\Temp\xTNLgo7APA DEBUG-> Net::Printer::printfile : Real Control File C:\Users\MMUSGR~1\Ap pData\Local\Temp\kkuLVYUqZe DEBUG-> Net::Printer::printfile : Fake Data File dfA598blackbox DEBUG-> Net::Printer::printfile : Fake Control File cfA598blackbox DEBUG-> Net::Printer::_lpdInit : invoked ... DEBUG-> Net::Printer::_lpdCommand : Sending ?MP990 DEBUG-> Net::Printer::_lpdCommand : Got back :: DEBUG-> Net::Printer::_lpdInit : Return code is 49 ERROR:Net::Printer[717]: Printer MP990 on Server 192.168.1.81 not okay at test.pl line 42. DEBUG-> Net::Printer::_lpdInit : Printer said nothing ERROR:Net::Printer[250]: Printer MP990 on 192.168.1.81 not ready! at test.pl line 42. not ok 2 # Failed test at test.pl line 42. DEBUG-> Net::Printer::_lpdCommand : Sending ?MP990 not ok 3 # Failed test at test.pl line 51. Please check your default printer for printout. # Looks like you failed 2 tests of 3. dmake: Error code 130, while making 'test_dynamic' Matt On Mon, Feb 11, 2013 at 4:52 PM, Chris Fuhrman via RT < bug-Net-Printer@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83100 > > > Howdy, > > Please try the following: > > 1) Upgrade your code to the latest version via git > 2) Try running the included test.pl script after setting up the > appropriate environmental variables > 3) If possible, open up the test.pl script and set "debug" to "yes" > 4) Note that there will be a delay while it does it's thing. I've > now been successful getting it to work with Strawberry Perl > 5) Let me know if you run into any problems. > > Cheers! > > On Sun Feb 10 00:51:35 2013, MMUSGROVE wrote:
> > This simple script doesn't error out but like my previous attempts, > > nothing is printed. > > > > use Net::Printer; > > my $lp = new Net::Printer( > > filename => 'C:\Users\mmusgrove\Desktop\chili.txt', > > printer => '0000006C0B23', > > server => '192.168.1.81', > > port => 515, > > ); > > my $res = $lp->printfile(); > > print "res: $res\n"; > > my $err = $lp->printerror(); > > print "err: $err\n"; > > > > Output: > > res: 1 > > err: > >
> >