Bug 18229 – Misleading documentation of std.process.environment.get

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-01-12T09:51:12Z
Last change time
2018-02-07T03:07:43Z
Keywords
ddoc, pull
Assigned to
No Owner
Creator
Tomáš Chaloupka

Comments

Comment #0 by chalucha — 2018-01-12T09:51:12Z
It is stated: Unlike $(LREF environment.opIndex), this function never throws. Here: https://github.com/dlang/phobos/blob/master/std/process.d#L3344 But the method is not nothrow and there is also: Throws: $(REF UTFException, std,utf) if the variable contains invalid UTF-16 characters (Windows only). I'm not sure if at least for POSIX this can be marked as a nothrow or just change the documentation.
Comment #1 by schveiguy — 2018-01-17T01:33:49Z
Hm... I think it means it doesn't throw when the variable doesn't exist (as opIndex does). But it does throw if the name being searched for is invalid. Definitely I think this is a doc issue.
Comment #2 by greensunny12 — 2018-02-03T15:54:10Z
Comment #3 by github-bugzilla — 2018-02-07T03:07:42Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/50307774bf09cfa0ffa58e283716fb37af0e8731 Fix Issue 18229 - Misleading documentation of std.process.environment.get https://github.com/dlang/phobos/commit/09122acb34508a0b127000025c1c600bb558c5e8 Merge pull request #6117 from wilzbach/fix-18229 Fix Issue 18229 - Misleading documentation of std.process.environment.get merged-on-behalf-of: Vladimir Panteleev <[email protected]>