[#99115] [Ruby master Bug#17023] How to prevent String memory to be relocated in ruby-ffi — larskanis@...
Issue #17023 has been reported by larskanis (Lars Kanis).
22 messages
2020/07/10
[#99375] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings — merch-redmine@...
Issue #17055 has been reported by jeremyevans0 (Jeremy Evans).
29 messages
2020/07/28
[#101207] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— merch-redmine@...
2020/12/02
Issue #17055 has been updated by jeremyevans0 (Jeremy Evans).
[#101231] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— Austin Ziegler <halostatue@...>
2020/12/03
What does this mean?
[ruby-core:99278] [Ruby master Bug#17042] Times with timezones return incorrect week numbers
From:
gamelinks007@...
Date:
2020-07-22 19:15:28 UTC
List:
ruby-core #99278
Issue #17042 has been updated by S_H_ (Shun Hiraoka).
This code resolve this behaviour.
```c
static VALUE
time_strftime(VALUE time, VALUE format)
{
struct time_object *tobj;
const char *fmt;
long len;
rb_encoding *enc;
VALUE tmp;
GetTimeval(time, tobj);
if (tobj->vtm.yday == 0) {
VALUE zone = tobj->vtm.zone;
if (!NIL_P(zone)) zone_localtime(zone, time);
}
MAKE_TM(time, tobj);
StringValue(format);
if (!rb_enc_str_asciicompat_p(format)) {
rb_raise(rb_eArgError, "format should have ASCII compatible encoding");
}
tmp = rb_str_tmp_frozen_acquire(format);
fmt = RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
enc = rb_enc_get(format);
if (len == 0) {
rb_warning("strftime called with empty format string");
return rb_enc_str_new(0, 0, enc);
}
else {
VALUE str = rb_strftime_alloc(fmt, len, enc, time, &tobj->vtm, tobj->timew,
TZMODE_UTC_P(tobj));
rb_str_tmp_frozen_release(format, tmp);
if (!str) rb_raise(rb_eArgError, "invalid format: %"PRIsVALUE, format);
return str;
}
}
```
`tobj->vtm.yday`is seems to be 0.
So, these code resolve.
```c
if (tobj->vtm.yday == 0) {
VALUE zone = tobj->vtm.zone;
if (!NIL_P(zone)) zone_localtime(zone, time);
}
```
----------------------------------------
Bug #17042: Times with timezones return incorrect week numbers
https://bugs.ruby-lang.org/issues/17042#change-86666
* Author: timcraft (Tim Craft)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.8.0dev (2020-07-15 master 79d06483a8)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Times with timezones return incorrect week numbers from strftime. For example:
$ irb -r tzinfo
irb(main):001:0> Time.utc(2020, 7, 22, 12, 0, 0).strftime('%U %V %W')
=> "29 30 29"
irb(main):002:0> Time.new(2020, 7, 22, 12, 0, 0, TZInfo::Timezone.get('America/New_York')).strftime('%U %V %W')
=> "00 00 00"
Follow up to #17024
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>