This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年02月09日 22:12 by fif0, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| maybe_a_bug.py | fif0, 2012年02月09日 22:12 | |||
| Messages (2) | |||
|---|---|---|---|
| msg152991 - (view) | Author: (fif0) | Date: 2012年02月09日 22:12 | |
Please take a look at the detached file. At the first call of the methode foo(), path and the second getcwd are the same. After the directory change, the default value path is not the the current working directory. |
|||
| msg152995 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年02月09日 22:40 | |
That's just how function definitions in Python work. The prototype is evaluated when the function is defined, not when it is run, so the default value of path will always be the value of getcwd at the time the function *defintion* is done (which will generally be the CWD when python starts, unless you are defining functions at runtime). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:26 | admin | set | github: 58188 |
| 2012年02月09日 22:40:50 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg152995 resolution: not a bug stage: resolved |
| 2012年02月09日 22:18:02 | fif0 | set | title: getcwd problem -> getcwd problem does not return cwd |
| 2012年02月09日 22:12:58 | fif0 | create | |