On Mon, 7 May 2012 05:03:09 -0400, "Mark Lawrence via RT"
<bug-DBI@rt.cpan.org> wrote:
Show quoted text> Mon May 07 05:03:08 2012: Request 77033 was acted upon.
> Transaction: Ticket created by nomad@null.net
> Queue: DBI
> Subject: parse_dsn seems to fail on Strawberry Perl
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: nomad@null.net
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=77033 >
>
>
> I don't have a Strawberry Perl system to test or reproduce this on, but
> cpantesters fails one of my modules on Win32 with the following:
>
> Could not parse DSN:
> 'dbi:SQLite:dbname=C:\Users\DSOLIM~1\AppData\Local\Temp\Test-Database-solimanod\SQLite\tdd_sqlite_solimanod_0'
> at
> C:/strawberry/cpan/build/SQL-DB-0.19_15-8yrOYF/t/../lib/App/sqldb_schema.pm
> line 36.
>
> I'm guessing the issue is something to do with ':' or '\' in the path.
With a minimal excerpt from the current DBI (1.620), that reduces to
--8<---
use strict;
use warnings;
my $dsn = 'dbi:SQLite:dbname=C:\Users\DSOLIM~1\AppData\Local\Temp\Test-Database-solimanod\SQLite\tdd_sqlite_solimanod_0';
use Data::Peek;
my %pd;
@pd{qw( scheme driver attr attr_hash dsn)} = DBI->parse_dsn ($dsn);
DDumper \%pd;
package DBI;
sub parse_dsn
{
my ($class, $dsn) = @_;
$dsn =~ s/^(dbi):(\w*?)(?:\((.*?)\))?://i or return;
my ($scheme, $driver, $attr, $attr_hash) = (lc ($1), $2, $3);
$driver ||= $ENV{DBI_DRIVER} || '';
$attr_hash = {split /\s*=>?\s*|\s*,\s*/, $attr, -1} if $attr;
return ($scheme, $driver, $attr, $attr_hash, $dsn);
}
-->8---
On Linux with perl5.14.2:
$ perl rt77033.pl
{ attr => undef,
attr_hash => undef,
driver => 'SQLite',
dsn => 'dbname=C:\\Users\\DSOLIM~1\\AppData\\Local\\Temp\\Test-Database-solimanod\\SQLite\\tdd_sqlite_solimanod_0',
scheme => 'dbi'
}
On Win7 with Strawberry 5.12.1:
S:\Tmp>perl rt77033.pl
{ attr => undef,
attr_hash => undef,
driver => 'SQLite',
dsn => 'dbname=C:\\Users\\DSOLIM~1\\AppData\\Local\\Temp\\Test-Database-solimanod\\SQLite\\tdd_sqlite_solimanod_0',
scheme => 'dbi'
}
Which shows no problems on either.
Could you post more context?
--
H.Merijn Brand
http://tux.nl Perl Monger
http://amsterdam.pm.org/
using perl5.00307 .. 5.14 porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/