Bugzilla – Attachment 172378 Details for
Bug 37709
bulkmarcimport.pl should die when the file cannot be opened
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37709: Die and notify if file cannot be opened
Bug-37709-Die-and-notify-if-file-cannot-be-opened.patch (text/plain), 1.64 KB, created by
Julian Maurice
on 2024-10-04 07:50:54 UTC
(
hide
)
Description:
Bug 37709: Die and notify if file cannot be opened
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-10-04 07:50:54 UTC
Size:
1.64 KB
patch
obsolete
>From 2b3251b73ea4bd9a77d46a3b06fcf2d04400ff80 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 22 Aug 2024 11:35:45 +0000 >Subject: [PATCH] Bug 37709: Die and notify if file cannot be opened > >1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v >2 - Output: > Characteristic MARC flavour: MARC21 > > 0 MARC records done in 0.00804400444030762 seconds >3 - Apply patch >4 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v >5 - Output: > Characteristic MARC flavour: MARC21 > Could not open notafile.mrc: No such file or directory at misc/migration_tools/bulkmarcimport.pl line 262. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > misc/migration_tools/bulkmarcimport.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 8161a0bb0a..ade216e3f5 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -255,7 +255,9 @@ my $searcher = Koha::SearchEngine::Search->new( > print "Characteristic MARC flavour: $marc_flavour\n" if $verbose; > my $starttime = gettimeofday; > >-my $fh = IO::File->new($input_marc_file); # don't let MARC::Batch open the file, as it applies the ':utf8' IO layer >+# don't let MARC::Batch open the file, as it applies the ':utf8' IO layer >+my $fh = IO::File->new($input_marc_file) or die "Could not open $input_marc_file: $!"; >+ > if ( defined $format && $format =~ /XML/i ) { > > # ugly hack follows -- MARC::File::XML, when used by MARC::Batch, >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37709
:
170602
|
170608
| 172378