New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PATH_MAX vs MAXPATHLEN vs pathconf(..., _PC_PATH_MAX). #60646
Comments
Two immediate issues identified whilst trying to build on HP-UX and IRIX:
Christian alluded to introducing a PY_PATH_MAX define, which I like. So, my proposal is to fix the logic in osdefs.h so that it works on a wider range of platforms, with the end goal of defining PY_PATH_MAX, then replacing all occurrences of PATH_MAX|MAXPATHLEN in our tree with the new PY_PATH_MAX. (It's worth mentioning that, technically, we shouldn't be using PATH_MAX or MAXPATHLEN. We should be using pathconf(..., _PC_PATH_CONF) to determine the maximum length of the underlying filesystem at runtime and dynamically allocating buffers based on that value. However, that's a huge, non-trivial change. For another day.) |
I don't think that using pathconf is an important part of this issue. Instead, it is more important to deal with ENAMETOOLONG errors. To do so, we should get rid of all stack allocations of arrays with PATH_MAX/MAXPATHLEN size (also because they can consume quite a lot of stack). I agree that it important to scope this issue. You need to determine whether you want it to be a bug fix or a cleanup action. If the issue is "fails to build on HP-UX", then all other aspects not relevant to this issue need to be left out, in particular the introduction of new symbolic constants. If the objective is the code clean-up, all versions but 3.4 need to be left out. IOW, -1 on systematic introduction of PY_PATH_MAX to 2.7, 3.2, and 3.3. |
The HP-UX issue is fixed. Are we leaving this open for IRIX? |
Python doesn't support IRIX. I tried to fix compilation issues on IRIX related to PATH_MAX, but there are more serious compilation issues (ex: in socketmodule.c for example if I remember correctly). I suggest to close this issue. changeset: 87113:159e51e5fc2c |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: