Module-Generic
view release on metacpan or search on metacpan
v1.5.9 2026-06-05T21:50:44+0900
[Bug fixes]
- Fixed a thread-safety defect in Module::Generic::Finfo::_datetime() that caused
atime(), ctime() and mtime() to return a false value under ithreads in a
non-deterministic, scheduling-dependent manner. The shared local_tz capability
flag was resolved under a lock, but the DateTime::Lite object was built only
inside that same locked initialisation block. Any thread that acquired the lock
after another thread had already populated the flag skipped the block and left
the object undefined, which then died on set_formatter(). The lock now resolves
only the boolean capability flag, and the DateTime::Lite object is always built
afterwards, outside the initialisation block, so every thread produces its own
object regardless of which thread won the initialisation race. This clears the
intermittent t/11.finfo.t "All threads accessed datetime successfully" failure
observed on perl 5.18.2 smokers.
- Hardened _datetime() to treat an undefined return from
DateTime::Lite->from_epoch() as a failure even when no exception is raised, both
when probing for local time zone support and when building the final object.
Previously a quiet undef return could set the local_tz flag to true incorrectly,
or fall through to set_formatter() on an undefined object.
v1.5.8 2026-06-05T16:05:06+0900
[Bug fixes]
- Applied the POSIX::localeconv grouping normalisation (_normalise_lconv_grouping)
to the auto-locale branch of Module::Generic::Number::init(), which was previously
only applied to the explicit lang= branch. This fixes test failures on FreeBSD
smokers running with LANG=C.UTF-8, where localeconv() returns grouping="\xFF"
(CHAR_MAX, meaning "no grouping"). Without the helper, the raw byte 255 was stored
as grouping size, then triggered both a "Grouping digit '0' got 255" test failure
and an Encode error when decode_lconv() attempted to decode "\xFF" as UTF-8.
v1.5.7 2026-06-05T07:48:09+0900
[Bug fixes]
- Added DateTime::Format::JP v0.1.7 as a test-time dependency (TEST_REQUIRES).
This ensures CPAN Testers smokers always have a version capable of returning
DateTime::Lite objects directly, which eliminates the round-trip stringification
test failures observed in v1.5.6 on smokers that had an older DateTime::Format::JP
installed.
- Simplified the japan branch guard in t/22.parse_timestamp.t now that
DateTime::Format::JP is a declared test dependency: a simple _load_class() call
without a version constraint is sufficient.
- Kept the defensive DateTime::Lite::from_object() conversion in _parse_timestamp()
as a safety net for users who may install an older DateTime::Format::JP manually
outside of CPAN's dependency resolution. A diagnostic warning is emitted on smokers
(AUTOMATED_TESTING or AUTHOR_TESTING) if this branch ever triggers, so we can
investigate unexpected configurations.
v1.5.6 2026-06-04T09:48:59+0900
- Improved the function 'tempfile' in Module::Generic::File to ensure the temporary
file does not already exist.
Since we use Data::UUID->create_str, it is already very safe, so this is more a
precaution.
[Bug fixes]
- Hardened _parse_timestamp() to drop the formatter when an installed
DateTime::Format::JP is older than v0.1.7. Older versions only know how to format
DateTime objects and emit a warning under an unregistered category when given a
DateTime::Lite, which broke tests using warnings::register on CPAN Testers smokers.
Stringification now falls back to DateTime::Lite's iso8601() in that case.
- Bumped the minimum required version of DateTime::Format::Lite from v0.1.2 to v0.1.3.
Version v0.1.2 called DateTime::Lite::TimeZone->new() without the extended option
when resolving the %O token, which made timezone abbreviations such as JST or CET
fail to resolve via the extended_aliases table. v0.1.3 fixes this by passing extended => 1.
- Module::Generic::Global: callers of _share_repo() now propagate its return value,
returning early with a type-appropriate value if the shared repository cannot be
initialised (typically during END or DESTRUCT phases). This eliminates "Invalid
value for shared scalar (in cleanup)" warnings that were emitted when methods such
as remove(), set(), or get() drilled into $REPO->{ $ns } after threads::shared had
begun tearing down its structures.
- Fixed t/11.finfo.t to always join all threads in the thread-safe datetime subtest.
The previous code used $success &&= $thr->join() which short-circuits as soon as
any thread returns a false value, leaving the remaining threads finished but
unjoined and triggering "Perl exited with active threads" warnings on threaded smokers.
v1.5.5 2026-06-04T05:56:00+0900
- Fixed grouping detection in Module::Generic::Number to correctly interpret
POSIX::localeconv()'s grouping and mon_grouping byte strings. Empty values, a
leading zero byte, and CHAR_MAX byte (>= 127, meaning "no further grouping") are
now all normalised to 0 consistently. Previously, a CHAR_MAX byte could be stored
as 127 and used as a group size in format(), which would produce incorrect output
on very large numbers.
- Updated t/02.num.t to mirror this normalisation and to construct its expected
formatted output dynamically based on the resolved grouping size, rather than
mechanically assuming a 3-digit group.
This fixes spurious FAIL reports on smokers where the system locale does not
provide a grouping value (observed on FreeBSD 10.3 with de_DE.ISO8859-1).
v1.5.4 2026-06-02T15:11:46+0900
- Fixed Module::Generic::File::Cache END block calling Module::Generic::Global when
it should not.
- Reimplemented Module::Generic::_is_class_loaded as an XS function,
_is_class_loaded_xs, with stricter detection semantics than the previous
pure-Perl heuristic.
- gv_stashpvn is called without GV_ADD so that the check never
autovivifies a namespace while testing for its existence.
- Hardened _parse_timestamp's Japanese date branch: if an older DateTime::Format::JP
is installed (< v0.1.7, which used to return a DateTime object), the result is now
converted to DateTime::Lite via from_object(), ensuring the returned value's type
stays consistent regardless of the installed DateTime::Format::JP version.
The test t/22.parse_timestamp.t now also requires DateTime::Format::JP >= v0.1.7
in its guard, skipping the japan block otherwise.
v1.5.3 2026-06-02T09:10:08+0900
- Fixed END phase failures reported by CPAN Testers on perl 5.40+ and FreeBSD smokers.
The phase guards added in v1.5.2 made Module::Generic::Global->new() return undef
during END/DESTRUCT phases, causing callers like Module::Generic::_is_class_loaded()
to crash with "Can't call method 'exists' on an undefined value" or
"Died at Module/Generic.pm line 455" when a module triggered class loading from an
END block.
- Removed phase guards from public methods of Module::Generic::Global.
The refactor of leaf-scalar locks to parent-hash locks in v1.5.2 eliminated the
underlying SIGSEGV cause; the additional phase protection was redundant and
prevented normal operation during END.
- Phase guards retained in _share_repo() to avoid initialising new :shared structures
during interpreter shutdown, and in Module::Generic::Global::Guard::DESTROY.
- Module::Generic::Global bumped to v1.2.1.
v1.5.2 2026-06-01T15:02:08+0900
- Fixed SIGSEGV at exit on Perl 5.16 to 5.22 with useithreads, caused by CORE::lock
on a reference to a scalar leaf inside a :shared hash.
Affected approximately 23 of 38 test files in 'make test' on CPAN Testers smokers
running these configurations.
( run in 2.476 seconds using v1.01-cache-2.11-cpan-e1769b4cff6 )