[issue44377] Truncated error message of original function while multiprocessing or multithreading
New submission from Prasanth Rajendran : Under multiprocessing package, in pool.py, when an error occurs on line 122: result = (True, func(*args, **kwds)) The exception "e" has the error message due to execution of the function that is executed in parallel. However, the error message is lost when another error is occurred due to the execution of following line 128: put((job, i, result)) The MaybeEncodingError masks or truncates the original error message, due to the following line at 130: MaybeEncodingError(e, result[1]) where the repr function in the class truncates the message. The final error message has pickling error and the masked error of the actual execution. -- components: Library (Lib) messages: 395529 nosy: mrshanth priority: normal severity: normal status: open title: Truncated error message of original function while multiprocessing or multithreading versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue44377> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41683] Python3: Installation error on Ubunti-18
New submission from Prasanth R : Got this error on Ubuntu-18 alone ``` _PYTHON_PROJECT_BASE=python3-3.8.3/Python-3.8.3 _PYTHON_HOST_PLATFORM=linux-x86_64 PYTHONPATH=python3-3.8.3/Python-3.8.3/build/lib.linux-x86_64-3.8/sysconfigdata:./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu python3.8 -m ensurepip \ $ensurepip --root=toolchain/ ; \ fi ERROR: Exception: Traceback (most recent call last): File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 188, in main status = self.run(options, args) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 286, in run with self._build_session(options) as session: File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 101, in _build_session session = PipSession( File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 559, in __init__ self.headers["User-Agent"] = user_agent() File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 144, in user_agent zip(["name", "version", "id"], distro.linux_distribution()), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 122, in linux_distribution return _distro.linux_distribution(full_distribution_name) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 677, in linux_distribution self.version(), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 737, in version self.lsb_release_attr('release'), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 899, in lsb_release_attr return self._lsb_release_info.get(attribute, '') File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 552, in __get__ ret = obj.__dict__[self._fname] = self._f(obj) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 1012, in _lsb_release_info stdout = subprocess.check_output(cmd, stderr=devnull) File "python3-3.8.3/Python-3.8.3/Lib/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "python3-3.8.3/Python-3.8.3/Lib/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1. Makefile:1189: recipe for target 'install' failed make[1]: *** [install] Error 2 make[1]: Leaving directory 'python3-3.8.3/Python-3.8.3' ``` -- components: Build messages: 376177 nosy: prasanth priority: normal severity: normal status: open title: Python3: Installation error on Ubunti-18 type: compile error versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue41683> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
How to call a method returning a value from a main function
#!/sur/bin/env python import sys import jwt import argparse from calendar import timegm from datetime import datetime import uuid class TokenGenerator: def __init__(self, args): self.macKey = args.authzSystemMacKey self.authzSystemId = args.authzSystemId self.permissions = args.permissions self.configurationId = args.configurationId self.tokenExpiry = args.tokenExpiryInSeconds def generate(self): payload = { 'iss': self.authzSystemId, 'aud': 'qed:' + self.configurationId, 'sub': 'admin:tokengen.py', 'qedp': self.permissions, 'exp': timegm(datetime.utcnow().utctimetuple()) + self.tokenExpiry } if self.tokenExpiry <= 300: # less than 5minutes payload['jti'] = str(uuid.uuid1()) return jwt.encode(payload, self.macKey, algorithm='HS256') class JWTParms: pass def GenAccessToken(mackey,authid,configid,tokenexp,*perm): args=JWTParms() args.configurationId=configid args.authzSystemMacKey=mackey args.authzSystemId=authid args.tokenExpiryInSeconds=tokenexp args.permissions=perm tokenGen=TokenGenerator(args) tok=tokenGen.generate() return tok if __name__ == '__main__': GenAccessToken("This_is_a_Test_QED_MAC_Key_Which_Needs_to_be_at_Least_32_Bytes_Long", "default", "default", 6, "g,m,a,s,c,p,d") when i am calling the above method it is not returning any value but when i use print it is printing the value. Is there any wrong in returning the value from above method. Please help me ASAP -- https://mail.python.org/mailman/listinfo/python-list
[issue24901] single element tuple 's ending comma is different that without comma
New submission from shiva prasanth: Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2] on linux2 Type help, copyright, credits or license for more information. (2,)==(2) False (2,3,)==(2,3) True (2,3)==(2,3,) True s=(2,) s2=(2) s==s2 False -- messages: 248880 nosy: shivaprasanth priority: normal severity: normal status: open title: single element tuple 's ending comma is different that without comma versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24901 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24901] (2, )!=(2) and (2, 3)==(2, 3, ) why ??? tested in each version
Changes by shiva prasanth kesavarapu.s...@gmail.com: -- nosy: -shivaprasanth title: single element tuple 's ending comma is different that without comma - (2,)!=(2) and (2,3)==(2,3,) why ??? tested in each version type: - behavior versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24901 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
Changes by shiva prasanth kesavarapu.s...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
Changes by shiva prasanth kesavarapu.s...@gmail.com: -- status: closed - open type: compile error - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
Changes by shiva prasanth kesavarapu.s...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
Changes by shiva prasanth kesavarapu.s...@gmail.com: -- type: - compile error versions: +Python 3.5 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
New submission from shiva prasanth: i created a zip file with password as getlost using Archive Manager which comes with ubuntu. and when i try to extract the same file using zipfile module which comes with python2.7 with same password it is showing error as Bad Password for file which is absurd. it should either give response of cant decrypt zipfile or some other. when i try to do it with terminal command $zip --encrypt file.zip file and upon entering the password it is working my main point is it should not show Bad Password for file and and it should extractall -- components: Extension Modules files: raj messages: 248698 nosy: shiva prasanth priority: normal severity: normal status: open title: Bad Password for file using zipfile module versions: Python 2.7 Added file: http://bugs.python.org/file40192/raj ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
shiva prasanth added the comment: Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2] on linux2 Type help, copyright, credits or license for more information. import zipfile s=zipfile.ZipFile('random.zip') s.extractall(pwd='getlost') Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/zipfile.py, line 1040, in extractall self.extract(zipinfo, path, pwd) File /usr/lib/python2.7/zipfile.py, line 1028, in extract return self._extract_member(member, path, pwd) File /usr/lib/python2.7/zipfile.py, line 1082, in _extract_member with self.open(member, pwd=pwd) as source, \ File /usr/lib/python2.7/zipfile.py, line 1007, in open raise RuntimeError(Bad password for file, name) RuntimeError: ('Bad password for file', zipfile.ZipInfo object at 0x7faf1d1921e0) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Pinging a machine from python
On May 26, 5:21 am, Zerge [EMAIL PROTECTED] wrote: On May 25, 11:13 am, Prasanth [EMAIL PROTECTED] wrote: I tried pinging a machine from python using socket programming but could not do it. Is there any module which we can use to ping the machine like net::ping in perl or can you give me simple program. Import OS ip=192.168.1.1 pingtext=ping +ip+ -n 1 pingresult=os.popen(pingtext).readlines() OS gives you access to the command line of the operating system. Thanks for the solution guys. But the above program is giving the output as : If we print pingresult it is giving the output as : ['\r\n', 'Pinging 0.168.1.1 with 32 bytes of data:\r\n', '\r\n', 'Request timed out.\r\n', '\r\n', 'Ping statistics for 0.168.1.1:\r \n', 'Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),\r\n'] my requirement is IP address and whether the machine is pinging or not. we should not display the above output. However we can do it by using regular expression or there is any other way. Please suggest. Thanks, Prasanth. -- http://mail.python.org/mailman/listinfo/python-list
Pinging a machine from python
I tried pinging a machine from python using socket programming but could not do it. Is there any module which we can use to ping the machine like net::ping in perl or can you give me simple program. -- http://mail.python.org/mailman/listinfo/python-list