[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82830] [Ruby trunk Bug#13908] Result of Pathname#dirname / File.dirname handling of paths with trailing File::SEPARATOR is surprising
From:
rocifier@...
Date:
2017-09-16 09:13:31 UTC
List:
ruby-core #82830
Issue #13908 has been updated by rocifier (Ryan O'Connor).
davemyron (Dave Myron) wrote:
> Given `File.dirname("/some/folder/")` the result of `/some` is very surprising because the path is "obviously" a directory without a file specified. (I got bit by this today… yes, I needed more tests)
>
> My expectation was that it would return `/some/folder`. My expectation seems consistent with the method's documentation which states "Returns all components of the filename given in file_name except the last one." – the "last one" should be the item after the last `File::SEPARATOR` ("`/`" on my system)
>
> What is the reasoning for the above being the behavior?
The path is obvious a directory.. true. However, the docs says to call the method with a filename, not a directory name. I'm not quite sure what you would be trying to achieve by calling it with just a directory name. Perhaps you intend to use Pathname.new("/some/folder/") instead?
----------------------------------------
Bug #13908: Result of Pathname#dirname / File.dirname handling of paths with trailing File::SEPARATOR is surprising
https://bugs.ruby-lang.org/issues/13908#change-66713
* Author: davemyron (Dave Myron)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4.1p111
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Given `File.dirname("/some/folder/")` the result of `/some` is very surprising because the path is "obviously" a directory without a file specified. (I got bit by this today… yes, I needed more tests)
My expectation was that it would return `/some/folder`. My expectation seems consistent with the method's documentation which states "Returns all components of the filename given in file_name except the last one." – the "last one" should be the item after the last `File::SEPARATOR` ("`/`" on my system)
What is the reasoning for the above being the behavior?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>