[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists
Raúl Cumplido added the comment: I have reproduced on python3.10 and validated this is also happening for other python versions: # PYTHON 3.9 $ mkdir /tmp/bar $ cd /tmp/bar $ rmdir /tmp/bar $ python3.9 Python 3.9.5 (default, May 19 2021, 11:32:47) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> inspect.getouterframes(inspect.currentframe()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/inspect.py", line 1529, in getouterframes frameinfo = (frame,) + getframeinfo(frame, context) File "/usr/lib/python3.9/inspect.py", line 1499, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/usr/lib/python3.9/inspect.py", line 709, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/usr/lib/python3.9/inspect.py", line 738, in getmodule file = getabsfile(object, _filename) File "/usr/lib/python3.9/inspect.py", line 722, in getabsfile return os.path.normcase(os.path.abspath(_filename)) File "/usr/lib/python3.9/posixpath.py", line 379, in abspath cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or directory # PYTHON 3.8 $ mkdir /tmp/bar $ cd /tmp/bar $ rmdir /tmp/bar $ python3.8 Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> inspect.getouterframes(inspect.currentframe()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/inspect.py", line 1503, in getouterframes frameinfo = (frame,) + getframeinfo(frame, context) File "/usr/lib/python3.8/inspect.py", line 1473, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/usr/lib/python3.8/inspect.py", line 708, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/usr/lib/python3.8/inspect.py", line 737, in getmodule file = getabsfile(object, _filename) File "/usr/lib/python3.8/inspect.py", line 721, in getabsfile return os.path.normcase(os.path.abspath(_filename)) File "/usr/lib/python3.8/posixpath.py", line 379, in abspath cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or directory Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 76, in apport_excepthook binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0])) FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/inspect.py", line 1503, in getouterframes frameinfo = (frame,) + getframeinfo(frame, context) File "/usr/lib/python3.8/inspect.py", line 1473, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/usr/lib/python3.8/inspect.py", line 708, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/usr/lib/python3.8/inspect.py", line 737, in getmodule file = getabsfile(object, _filename) File "/usr/lib/python3.8/inspect.py", line 721, in getabsfile return os.path.normcase(os.path.abspath(_filename)) File "/usr/lib/python3.8/posixpath.py", line 379, in abspath cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or directory >>> -- nosy: +raulcd ___ Python tracker <https://bugs.python.org/issue45406> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45378] Can't find "map" with search on docs.python.org
Change by Raúl Cumplido : -- nosy: +raulcd ___ Python tracker <https://bugs.python.org/issue45378> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45377] Default python 3 docs still pointing to 3.9.7
New submission from Raúl Cumplido : We are going to start the python 3.10 work on the python-docs-es and we have realised that when accessing: https://docs.python.org/3/ It is still redirecting to Python 3.9.7 documentation As Python 3.10 was released yesterday shouldn't the default docs point to python 3.10 already? -- assignee: docs@python components: Documentation messages: 403235 nosy: docs@python, mdk, raulcd priority: normal severity: normal status: open title: Default python 3 docs still pointing to 3.9.7 type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue45377> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45370] Typo in pep-0636 page
Raúl Cumplido added the comment: This has been merged on the peps repo and can be closed. -- ___ Python tracker <https://bugs.python.org/issue45370> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45370] Typo in pep-0636 page
Raúl Cumplido added the comment: Thanks! I have created a PR for it on the peps repo. https://github.com/python/peps/pull/2101 I can't seem to be able to link the Github PR correctly. Probably because it's not on the cpython repo. -- nosy: +raulcd ___ Python tracker <https://bugs.python.org/issue45370> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41959] Doc/library/asyncio-policy.rst grammar error
Change by Raúl Cumplido : -- keywords: +patch pull_requests: +21575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22580 ___ Python tracker <https://bugs.python.org/issue41959> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41959] Doc/library/asyncio-policy.rst grammar error
New submission from Raúl Cumplido : The Doc/library/asyncio-policy.rst file contains the following: ``` This implementation registers a :py:data:`SIGCHLD` signal handler on instantiation. That can break third-party code that installs a custom handler for `SIGCHLD`. signal). ``` The latest . and ) are incorrect. -- assignee: docs@python components: Documentation messages: 378124 nosy: docs@python, raulcd priority: normal severity: normal status: open title: Doc/library/asyncio-policy.rst grammar error type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41959> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: ping, any comment on the patch that was provided during the PyCon 2015 sprints? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: Added new patch as per review comments. -- Added file: http://bugs.python.org/file39069/21327.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21250] sqlite3 doesn't have unit tests for 'insert or [algorithm]' functionality.
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21250 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23217] help() function incorrectly captures comment preceding a nested function
Raúl Cumplido added the comment: I am not sure what the expected behavior is. Based on the code on pydoc.py we can find: def getdoc(object): Get the doc string or comments for an object. result = inspect.getdoc(object) or inspect.getcomments(object) So if the doc string is not found it searches for the lines of comments immediately preceding the object's source code. This is why the example from Anupama returns the preceding comment on both python2.7 and python3.5 (not only on python2.7). @rhettinger this seems like a deliberate decision to add as help documentation the preceding comment if the docstring is not found. What were you expecting? Should this be changed? -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: Forget my previous comment. Done with Linux and had the initial behavior again: s = socket.socket() s.type SocketType.SOCK_STREAM: 1 s.settimeout(2) s.type 2049 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: While reproducing it I've seen that this has been already solved: sock = socket.socket(type=socket.SOCK_STREAM) sock.type SocketKind.SOCK_STREAM: 1 sock.settimeout(2) sock.type SocketKind.SOCK_STREAM: 1 But the next is still not correct: sock = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK) sock.type 2049 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: after conversation with @r.david.murray I understand that we only want to return the type, not all the flags, so the function will return just the socket.SOCK_STREAM or socket.SOCK_DGRAM ... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: @haypo Would you expect the new function to return a tuple? i.e: socket.get_socket_type(sock) (socket.SOCK_STREAM, socket.SOCK_NONBLOCK) socket.get_socket_type(sock2) (socket.SOCK_STREAM,) -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23936] Wrong references to deprecated find_module instead of find_spec
Raúl Cumplido added the comment: Added changes on both places where there was still references to find_module without specifying that has been deprecated. -- keywords: +patch Added file: http://bugs.python.org/file39021/issue23936.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17784] the test suite should honor an http_proxy for running the test suite
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17784 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: Added docs and test in the patch. -- keywords: +patch Added file: http://bugs.python.org/file39009/issue21327.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21327] socket.type value changes after using settimeout()
Raúl Cumplido added the comment: Added patch that solves issue, but I am not sure this is what you expect. If you think this is the expected behavior I will add docs and tests: sock = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK) sock.type 2049 socket.get_socket_type(sock) SocketKind.SOCK_STREAM: 1 sock = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK |socket.SOCK_CLOEXEC) sock.type 526337 socket.get_socket_type(sock) SocketKind.SOCK_STREAM: 1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23794] http package should support HTTP/2
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23794 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1102973] Incorrect RFC 2231 decoding
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1102973 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23911] Move path-based bootstrap code to a separate frozen file.
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23911 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21062] Evalute all import-related modules for best practices
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21062 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23773] importlib does not properly remove frames when invoking external import hooks
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23773 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23642] Interaction of ModuleSpec and C Extension Modules
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23642 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23723] Provide a way to disable bytecode staleness checks
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23936] Wrong references to deprecated find_module instead of find_spec
New submission from Raúl Cumplido: While taking a look on the import mechanisms I've seen in the documentation that find_module has been deprecated for find_spec, but on different parts of the documentation there are still references to find_module, as in the definition of sys.meta_path (https://docs.python.org/3/library/sys.html#sys.meta_path). Shouldn't it be (example on this case) a list of finder objects that have their find_spec() methods called, instead of find_module method? I've been taking a look on _bootstrap.py and I can see we call find_spec: for finder in sys.meta_path: with _ImportLockContext(): try: find_spec = finder.find_spec If you agree with me that this is wrong I'll submit a patch to fix it. -- assignee: docs@python components: Documentation messages: 240671 nosy: brett.cannon, docs@python, eric.snow, raulcd priority: normal severity: normal status: open title: Wrong references to deprecated find_module instead of find_spec versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21108] Add examples for importlib in doc
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21108 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
Raúl Cumplido added the comment: From your question, yes I have completed the form. I've added a new patch just with the documentation change and changing the output from the help command as it was wrong. If it doesn't make sense do let me know. I've done it from 3.4 -- Added file: http://bugs.python.org/file37985/23357.3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
Raúl Cumplido added the comment: thanks for the comments. @haypo I'll add a new one for the pep8 fixes, sorry. @vinay.sajip I would like to help and try to do the change myself, if this is ok with you -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
Raúl Cumplido added the comment: So, do you think that maybe adding something to the documentation. Or we just leave it as it is? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
Raúl Cumplido added the comment: Added tests (hope is what you expect) and changed some bits on the test file to be pep8 comliant. -- Added file: http://bugs.python.org/file37944/23357.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
New submission from Raúl Cumplido: Currently when you execute pyvenv the help message is wrong: host@~ $ pyvenv usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...] venv: error: the following arguments are required: ENV_DIR Based on the docs on https://docs.python.org/3/library/venv.html it should be: host@~ $ pyvenv usage: pyvenv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...] pyvenv: error: the following arguments are required: ENV_DIR Basically instead of saying usage venv it should say usage pyvenv but if you execute the module it should be venv: host@~ $ python3.5 -m venv usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...] venv: error: the following arguments are required: ENV_DIR -- components: Library (Lib) messages: 235094 nosy: raulcd priority: normal severity: normal status: open title: pyvenv help shows incorrect usage type: enhancement versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23357] pyvenv help shows incorrect usage
Raúl Cumplido added the comment: Patch that solves the issue. I am on Misc/ACKS on branch 3.4 but not on default branch. I would appreciate if that gets merged to be added :) -- keywords: +patch Added file: http://bugs.python.org/file37936/23357.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22417] PEP 476: verify HTTPS certificates by default
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22417 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22598] IMAP4 UTF-7 support
Changes by Raúl Cumplido raulcumpl...@gmail.com: -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22598 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22459] str.strip() documentation: wrong example
Raúl Cumplido added the comment: As it is a simple one I will try to submit a patch today or tomorrow. This will be my first contribution to Python. -- nosy: +raulcd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22459] str.strip() documentation: wrong example
Raúl Cumplido added the comment: It was also incorrect on the example for bytes split: b'1,2,3'.split(b',', maxsplit=1) [b'1', b'2 3'] Patch submitted. -- keywords: +patch Added file: http://bugs.python.org/file36692/issue22459.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com