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月20日 21:18 by pitrou, last changed 2022年04月11日 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| imptime.patch | pitrou, 2012年02月20日 21:40 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg153809 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月20日 21:18 | |
This is an experimental patch that limits the frequency of stat() calls in _FileFinder.find_module(). It speeds up finding modules by 2x here, but unfortunately breaks some tests (which expect modules to appear immediately when created). |
|||
| msg153814 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年02月20日 23:04 | |
The patch uses the time module which is not a built-in, so it breaks bootstrapping by directly importing a module, and an extension at that. At best you could switch to a modified _FileFinder after importlib is initially running and able to import extension modules. |
|||
| msg153815 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月20日 23:06 | |
> The patch uses the time module which is not a built-in, so it breaks > bootstrapping by directly importing a module, and an extension at > that. At best you could switch to a modified _FileFinder after > importlib is initially running and able to import extension modules. Yup, as I said it's more of a proof-of-concept. (I was actually surprised that time is not a built-in module) |
|||
| msg153816 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年02月20日 23:20 | |
On Mon, Feb 20, 2012 at 18:06, Antoine Pitrou <report@bugs.python.org>wrote: > > Antoine Pitrou <pitrou@free.fr> added the comment: > > > The patch uses the time module which is not a built-in, so it breaks > > bootstrapping by directly importing a module, and an extension at > > that. At best you could switch to a modified _FileFinder after > > importlib is initially running and able to import extension modules. > > Yup, as I said it's more of a proof-of-concept. > (I was actually surprised that time is not a built-in module) Yeah, I had to double-check myself. |
|||
| msg153840 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年02月21日 03:06 | |
FWIW, I doubt you'd get many objections if you ended up wanting to make time a builtin module and inject it into the bootstrapping namespace. While I don't think the delay in noticing filesystem changes is reasonable as the default behaviour, it might be interesting to see how tricky it would be to create a custom importer (for either meta_path or path_hooks) that did this. |
|||
| msg153891 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月21日 18:33 | |
> While I don't think the delay in noticing filesystem changes is > reasonable as the default behaviour, it might be interesting to see how > tricky it would be to create a custom importer (for either meta_path or > path_hooks) that did this. Mmmh. Then I think it would be simpler to expose a global option to disable freshness checks. That said, it has to be activated as early as possible to be effective, which doesn't make it very practical as an opt-in setting. |
|||
| msg154424 - (view) | Author: Jim Jewett (Jim.Jewett) * (Python triager) | Date: 2012年02月27日 00:46 | |
As long as the interpreter knows about about files that *it* wrote, no repeat checks during startup seems utterly reasonable; sneaking in a new or changed file is inherently a race condition. I think it would also be reasonable for general use, so long as there was also a way to say "for this particular directory, always check". |
|||
| msg154486 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年02月27日 16:18 | |
Well, we already have a delay in detecting new files in importlib as the directory mtime check already adds a delay of the granularity of the mtime value for a directory. So if you manage to mutate a directory, import, write a file, and then import again all within the mtime of a directory, you will miss the new file (which has already triggered sporadic failures in various tests because they were not blowing out importlib's cache). IOW there is already a freshness problem that if we don't have importlib will never get bootstrapped because people will complain about performance too much. |
|||
| msg404878 - (view) | Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) | Date: 2021年10月23日 15:12 | |
I wonder if the circumstances changed since this is an old issue? the method looks to have a deprecation warning and changed a bit too, I stand to be corrected. |
|||
| msg404879 - (view) | Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) | Date: 2021年10月23日 15:13 | |
Related : https://bugs.python.org/issue14067 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:26 | admin | set | github: 58275 |
| 2021年10月23日 15:13:02 | nanjekyejoannah | set | messages: + msg404879 |
| 2021年10月23日 15:12:05 | nanjekyejoannah | set | nosy:
+ nanjekyejoannah messages: + msg404878 |
| 2020年01月29日 00:56:39 | brett.cannon | set | nosy:
- brett.cannon |
| 2013年10月19日 21:02:45 | Arfrever | set | nosy:
+ Arfrever |
| 2012年02月27日 16:18:24 | brett.cannon | set | messages: + msg154486 |
| 2012年02月27日 00:46:13 | Jim.Jewett | set | nosy:
+ Jim.Jewett messages: + msg154424 |
| 2012年02月21日 18:33:46 | pitrou | set | messages: + msg153891 |
| 2012年02月21日 03:06:14 | ncoghlan | set | messages: + msg153840 |
| 2012年02月20日 23:20:14 | brett.cannon | set | messages: + msg153816 |
| 2012年02月20日 23:06:06 | pitrou | set | messages: + msg153815 |
| 2012年02月20日 23:04:39 | brett.cannon | set | messages: + msg153814 |
| 2012年02月20日 21:44:10 | eric.snow | set | nosy:
+ eric.snow |
| 2012年02月20日 21:40:09 | pitrou | set | files: - imptime.patch |
| 2012年02月20日 21:40:01 | pitrou | set | files: + imptime.patch |
| 2012年02月20日 21:18:06 | pitrou | create | |