[issue46270] Comparison operators in Python Tutorial 5.7
New submission from Jan : In chapter 5.7 in the official Python tutorial (see: https://docs.python.org/3/tutorial/datastructures.html), there is the following paragraph: "The comparison operators in and not in check whether a value occurs (does not occur) in a sequence. The operators is and is not compare whether two objects are really the same object. All comparison operators have the same priority, which is lower than that of all numerical operators." I believe that "in" and "not in" are rather membership operators than comparison operators. I think a differentiation of operator types in one or two sentences would be helpful. -- assignee: docs@python components: Documentation messages: 409782 nosy: docs@python, realjanpaulus priority: normal severity: normal status: open title: Comparison operators in Python Tutorial 5.7 type: enhancement versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue46270> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46270] Comparison operators in Python Tutorial 5.7
Jan added the comment: I really like this solution because it mentions the buzz word "membership". But I would change "container" to "sequence" because the term "container" doesn't appear in chapter 5, "sequence" on the other hand multiple times. My proposal: "The comparison operators `in` and `not in` are membership tests that determine whether a value is in (or not in) a sequence." -- resolution: -> works for me ___ Python tracker <https://bugs.python.org/issue46270> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46270] Comparison operators in Python Tutorial 5.7
Jan added the comment: Sounds reasonable. -- resolution: works for me -> fixed ___ Python tracker <https://bugs.python.org/issue46270> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1528074] difflib.SequenceMatcher.find_longest_match() wrong result
Jan added the comment: hi all, just got bitten by this, so i took the time to reiterate the issue. according to the docs: http://docs.python.org/library/difflib.html find_longest_match() should return the longest matching string: "If isjunk was omitted or None, find_longest_match() returns (i, j, k) such that a[i:i+k] is equal to b[j:j+k], where alo <= i <= i+k <= ahi and blo <= j <= j+k <= bhi. For all (i', j', k') meeting those conditions, the additional conditions k >= k', i <= i', and if i == i', j <= j' are also met. In other words, of all maximal matching blocks, return one that starts earliest in a, and of all those maximal matching blocks that start earliest in a, return the one that starts earliest in b." but after a couple of hours debugging i finally convinced myself that the bug was in the library ... and i ended up here :) any ideas on how to work around this bug/feature, and just get the longest matching string ? (from a normal/newbie user perspective, that is, without patching the C++ library code and recompiling?) from the comments (which i couldn't follow entirely), does it use some concept of popularity that is not exposed by the API ? How is "popularity" defined ? many thanks! - jan ps.: using ubuntu's python 2.5.2 ps2.: and example of a string pair where the issue shows up: s1='Floor Box SystemsFBS Floor Box Systems - Manufacturer & supplier of FBS floor boxes, electrical ... experience, FBS Floor Box Systems continue ... raceways, floor box. ...www.floorboxsystems.com' s2='FBS Floor Box SystemsFBS Floor Box Systems - Manufacturer & supplier of FBS floor boxes, electrical floor boxes, wood floor box, concrete floor box, surface mount floor box, raised floor ...www.floorboxsystems.com' -- nosy: +janpf ___ Python tracker <http://bugs.python.org/issue1528074> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29817] File IO read, write, read causes garbage data write.
New submission from Jan: In Python 2.7.12 when reading, writing and subsequently reading again from a file, python seems to write garbage. For example when running this in python IDLE: import os testPath = r"myTestFile.txt" ## Make sure the file exists and its empty with open(testPath,"w") as tFile: tFile.write("") print "Our Test File: ", os.path.abspath(testPath ) with open(testPath, "r+") as tFile: ## First we read the file data = tFile.read() ## Now we write some data tFile.write('Some Data') ## Now we read the file again tFile.read() When now looking at the file the data is the following: Some Data @ sb d Z d d l m Z d d d ・ ・ YZ e d k r^ d d l m Z e d d d d e ・n d S( s9 Implement Idle Shell history mechanism with History ... As mentioned in the comments on stack overflow ( see link ) this might be a buffer overrun but I am not sure. Also I guess this could be used as a security vulnerability... http://stackoverflow.com/questions/40373457/python-r-read-write-read-writes-garbage-to-a-file?noredirect=1#comment72580538_40373457 -- components: IO, Interpreter Core, Windows messages: 289657 nosy: jan, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: File IO read, write, read causes garbage data write. type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue29817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29817] File IO r+ read, write, read causes garbage data write.
Changes by Jan : -- title: File IO read, write, read causes garbage data write. -> File IO r+ read, write, read causes garbage data write. ___ Python tracker <http://bugs.python.org/issue29817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30773] async generator receives wrong value when shared between coroutines
Jan added the comment: I've reproduced the problem also in 3.7 branch. ``` import asyncio loop = asyncio.get_event_loop() async def consumer(): while True: await asyncio.sleep(0) message = yield print('received', message) async def amain(): agenerator = consumer() await agenerator.asend(None) fa = asyncio.create_task(agenerator.asend('A')) fb = asyncio.create_task(agenerator.asend('B')) await fa await fb loop.run_until_complete(amain()) ``` Output: ``` received A received None ``` If the line `await asyncio.sleep(0)` is omitted the output is ok: ``` received A received B ``` -- nosy: +jan.cespivo versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue30773> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs
Jan Kaliszewski added the comment: Sure. But don't you think there should be ``.__get__(a, type(a))`` rather than ``.__get__(a, A)``? Then the whole statement would be true regardless of whether A is the actual type of a, or only a superclass of the type of a. That would also be more consistent with the second point of the description, i.e., the one about *Instance Binding* (where we have ``type(a).__dict__['x'].__get__(a, type(a))``). Also, I believe that ``type(a).__mro__`` would be more consistent (than ``a.__class__.mro``) with that point. -- ___ Python tracker <https://bugs.python.org/issue20751> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34931] os.path.splitext with more dots
Jan Novak added the comment: Thank you all for discussion and partial solution in latest Python versions and extending documentation. For the future development of Python the initial question remains. How to easy detect extensions for each file with standard python library function. Without programing own function to fix it. Filenames with more dots could exist both in Unix and Windows worlds. Nobody can't say (for example web app users). Please not use those files. Python 3.10.1 Works fine: >>> os.path.splitext('.some.jpg') ('.some', '.jpg') >>> os.path.splitext('..some.jpg') ('..some', '.jpg') Not usable: >>> os.path.splitext('jpg') ('jpg', '') There are some possible ways: - new parametr - new function - change backward compatibility - stay buggy forever Thank you -- status: closed -> open versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue34931> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34931] os.path.splitext with more dots
Jan Novak added the comment: It is interesting that pathlib.Path works fine: >>> pathlib.Path('jpg').suffix '.jpg' >>> pathlib.Path('path/jpg').suffix '.jpg' -- ___ Python tracker <https://bugs.python.org/issue34931> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41945] http.cookies.SimpleCookie.parse error after [keys] or some JSON data values
Jan Novak added the comment: New examples with the structured data. Problems are with quotes and spaces inside { or [ cookie-script.com set those cookie data: CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"} Python loads only cookies before that JSON structure >>> from http.cookies import SimpleCookie >>> ck = SimpleCookie() >>> ck.load('id=12345; >>> CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"}; >>> something="not loaded"') >>> print(ck) Set-Cookie: id=12345 This works: >>> ck.load('id=12345; complex_data={1:[1,2]}; something="loaded"') >>> print(ck) Set-Cookie: complex_data={1:[1,2]} Set-Cookie: id=12345 Set-Cookie: something="loaded" This not works: >>> ck.load('id=12345; complex_data={1:[1, 2]}; something="not loaded"') >>> print(ck) Set-Cookie: complex_data={1:[1, Set-Cookie: id=12345 Conclusion: Parsing JSON like cookie objects works, except quotes and without spaces. Exist some new RFC with JSON data support? How implementation/support/solution in diferent languages? Exist another Python library which support cookie with JSON data? -- title: http.cookies.SimpleCookie.parse error after [keys] -> http.cookies.SimpleCookie.parse error after [keys] or some JSON data values versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue41945> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1044] tarfile insecure pathname extraction
jan matejek added the comment: no change to extract() ? otherwise looks good to me. if you don't object, i am applying this to SUSE's python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1044> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1044] tarfile insecure pathname extraction
jan matejek added the comment: if that can be considered "official stance", it's fine by me. feel free to close the bug. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1044> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12987] Demo/scripts/newslist.py has non-commercial license clause
New submission from jan matejek : from Demo/scripts/newslist.py : # Feel free to copy, distribute and modify this code for # non-commercial use. If you make any useful modifications, let me # know! # # (c) Quentin Stafford-Fraser 1994 # fra...@europarc.xerox.com qs...@cl.cam.ac.uk this is not very nice for commercial distros - we have to drop the file (for now anyway) i'm not sure what the "right" solution for upstream is - you might want to remove the file, ask Quentin to relicense it, or just acknowledge its existence and keep it -- components: Demos and Tools messages: 144088 nosy: matejcik priority: normal severity: normal status: open title: Demo/scripts/newslist.py has non-commercial license clause versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue12987> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic
Jan Kratochvil added the comment: Here is the implementation. Python/getargs.c was modified for: ImportError: /usr/lib64/python2.7/lib-dynload/fcntlmodule.so: undefined symbol: _PyArg_ParseTuple_SizeT but I guess that patch part should be different. There is no need to do #ifdef HAVE_DECLSPEC_DLL as PyAPI_FUNC is properly defined even without it. So the declaration+export block should be unified there. The Modules/ files were modified for: *** WARNING: renaming "_ctypes_test" since importing it failed: dynamic module does not define init function (init_ctypes_test) *** WARNING: renaming "_elementtree" since importing it failed: dynamic module does not define init function (init_elementtree) *** WARNING: renaming "_hotshot" since importing it failed: dynamic module does not define init function (init_hotshot) *** WARNING: renaming "_json" since importing it failed: dynamic module does not define init function (init_json) *** WARNING: renaming "ossaudiodev" since importing it failed: dynamic module does not define init function (initossaudiodev) without this patch: -rw-r--r-- 1 jkratoch jkratoch 5775829 Jan 12 17:42 python-libs-2.7.2-18.fc17.x86_64.rpm -r-xr-xr-x 1 jkratoch jkratoch 1738264 Jan 12 17:44 ./clean/python-libs-2.7.2-18.fc17.x86_64/usr/lib64/libpython2.7.so.1.0* 1226 libpython2.7.so.1.0 .dynsym exports + -rw-r--r-- 1 jkratoch jkratoch 1986161 Jan 12 17:48 gdb-7.4.50.20120103-8.fc17.x86_64.rpm -rwxr-xr-x 1 jkratoch jkratoch 5018800 Jan 12 19:13 clean/gdb-7.4.50.20120103-8.fc17.x86_64/usr/bin/gdb* with this patch: -rw-r--r-- 1 jkratoch jkratoch 5762537 Jan 12 19:04 python-libs-2.7.2-18hidden3.fc17.x86_64.rpm -r-xr-xr-x 1 jkratoch jkratoch 1720920 Jan 12 19:06 ./hidden3/python-libs-2.7.2-18hidden3.fc17.x86_64/usr/lib64/libpython2.7.so.1.0* 1046 libpython2.7.so.1.0 .dynsym exports + -rw-r--r-- 1 jkratoch jkratoch 1886781 Jan 12 19:11 gdb-7.4.50.20120103-8.fc17.x86_64.rpm -rwxr-xr-x 1 jkratoch jkratoch 4732080 Jan 12 19:13 hidden3/gdb-7.4.50.20120103-8.fc17.x86_64/usr/bin/gdb* -- keywords: +patch versions: +Python 2.7 -Python 3.2 Added file: http://bugs.python.org/file24221/hidden.patch ___ Python tracker <http://bugs.python.org/issue10112> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8050] smtplib SMTP.sendmail (TypeError: expected string or buffer)
Jan Papež added the comment: Did you try to use this? q = quotedata(msg.as_string()) -- nosy: +honyczek ___ Python tracker <http://bugs.python.org/issue8050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1731717] race condition in subprocess module
jan matejek added the comment: please check my logic here, but the patched code seems to throw away perfectly valid return codes: in wait(), self._handle_exitstatus(sts) gets called unconditionally, and it resets self.returncode also unconditionally. now, if a _cleanup() already did _internal_poll and set self.returncode that way, it is lost when wait() catches the ECHILD, in the one place where it actually matters, by setting sts=0 for the _handle_exitstatus call IMHO it could be fixed by moving _handle_exitstatus to the try: section, and returning "self.returncode or 0" or something like that -- nosy: +matejcik ___ Python tracker <http://bugs.python.org/issue1731717> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12801] C realpath not used by os.path.realpath
Changes by jan matejek : -- nosy: +matejcik ___ Python tracker <http://bugs.python.org/issue12801> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue858809] Use directories from configure rather than hardcoded
jan matejek added the comment: the problem this patch was solving is "python libraries install into "prefix/lib" regardless of what is the correct local LIBDIR" - which is obviously broken on systems where LIBDIR is something other than "prefix/lib", most notable example being "prefix/lib64" on current 64bit linuxes. but as far i can tell, this problem was fixed (to an extent) in 2.7 by partially applying this patch. SCRIPTDIR is still prefix/lib, but the correctness of that is up for a long and winded debate. -- ___ Python tracker <http://bugs.python.org/issue858809> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9539] python-2.6.4: test failure in test_distutils due to linking to system libpython2.6
jan matejek added the comment: this affects 2.7 as well. the problem was introduced by r78136 which skips out of the directory containing newly built libpython2.7, so the linking command cannot find it in -L. and fails (unless a systemwide libpython is already present) the tests should probably specify that they want to link to a specific file, instead of relying on -lpython however, i have no idea how to do that in general, let alone within distutils :/ see also issue8335 -- nosy: +matejcik versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue9539> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6706] asyncore's accept() is broken
Changes by jan matejek : -- nosy: +matejcik ___ Python tracker <http://bugs.python.org/issue6706> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10057] Unclear if exception should be set
New submission from Jan Kratochvil : http://docs.python.org/py3k/c-api/object.html PyObject_GetItem Return element [...] or NULL on failure. Found element => return its pointer. Found no element => return NULL (with no exception set). But it is unclear whether the function can also: Error happened => return NULL with an exception set. It affects multiple versions of the doc, did not check which all. -- assignee: d...@python components: Documentation messages: 118281 nosy: d...@python, jankratochvil priority: normal severity: normal status: open title: Unclear if exception should be set versions: Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10057> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10057] Unclear if exception should be set
Jan Kratochvil added the comment: OK, I am not used to Python, thanks. -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/issue10057> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic
New submission from Jan Kratochvil : FSF GDB (and future Fedora GDBs) became 250KB smaller than before. Python recently disabled this GDB build optimization so GDB is 250KB larger again. -rwxr-xr-x 1 4524488 gdb-7.1-19.fc13.x86_64/usr/bin/gdb -rwxr-xr-x 1 4266728 gdb-7.1-19dynamiclist.fc13.x86_64/usr/bin/gdb -rw-r--r-- 1 2364656 gdb-7.1-19.fc13.x86_64.rpm -rw-r--r-- 1 2274300 gdb-7.1-19dynamiclist.fc13.x86_64.rpm Some Python binaries/libraries could probably also benefit from smaller pageable code image. GDB regressed due to /usr/lib*/python*/config/Makefile contains: LINKFORSHARED=-Xlinker -export-dynamic and GDB thus has to use it even for its own link, effectively disabling its: -Wl,--dynamic-list=./proc-service.list AFAIK Python already contains the required exports list but it is used only on MS-Windows. It should be utilized even for GNU/Linux builds. -- components: Library (Lib) messages: 118756 nosy: dmalcolm, jankratochvil priority: normal severity: normal status: open title: Use -Wl,--dynamic-list=x.list, not -Xlinker -export-dynamic type: resource usage versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue10112> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9539] python-2.6.4: test failure in test_distutils due to linking to system libpython2.6
jan matejek added the comment: i was able to reproduce this in clean 2.7 Sandro, this is only reproducible on systems without python - so by definition, you can hit this only during installation as for issue8335, yes, i think that it's a duplicate distutils2 is irrelevant here, because you can only install it on top of existing python. The problem here is that stdlib's distutils must use the newly built libpython, *not* the systemwide one - a problem that distutils2 don't need to solve until they become part of stdlib. -- ___ Python tracker <http://bugs.python.org/issue9539> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Jan Kaliszewski added the comment: On python-ideas I have proposed an ABC being also a kind of a mix-in, potentially making namedtuple subclassing (with custom methods etc.) more convenient, e.g.: class MyRecord(namedtuple.abc): _fields = 'x y z' def _my_custom_method(self): return list(self._asdict().items()) or class MyAbstractRecord(namedtuple.abc): def _my_custom_method(self): return list(self._asdict().items()) class AnotherAbstractRecord(MyAbstractRecord): def __str__(self): return '<<<{}>>>'.format(super().__str__()) class MyRecord2(MyAbstractRecord): _fields = 'a, b' class MyRecord3(AnotherAbstractRecord): _fields = 'p', 'q', 'r' Here is an experimental monkey-patcher adding the 'abc' attribute to namedtuple: http://dpaste.org/T9w6/ I am not sure if it is worth preparing an actual patch based on it. If you think it is I could prepare one. -- nosy: +zuo ___ Python tracker <http://bugs.python.org/issue7796> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Jan Kaliszewski added the comment: PS. Newer, shorter version: http://dpaste.org/2aiQ/ -- ___ Python tracker <http://bugs.python.org/issue7796> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Jan Kaliszewski added the comment: Thank you. Raymond is against the idea so I don't know if it makes sense to create the real patch for now (it would patch the collections module and, I suppose, addming tests, docs etc.). Anyway, if somebody would be interested in the idea, the newest version of the draft is here: http://dpaste.org/qyKv/. -- ___ Python tracker <http://bugs.python.org/issue7796> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Jan Kaliszewski added the comment: PS. For the record: the final recipe is here: http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/ -- ___ Python tracker <http://bugs.python.org/issue7796> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11747] unified_diff function product incorrect range information
New submission from Jan Koprowski : Python: --- >>> import difflib >>> dl = difflib.unified_diff([], ['a\n', 'b\n']) >>> print ''.join(dl), --- +++ @@ -1,0 +1,2 @@ +a +b Gnu diff: --- $diff -uN a b --- a 1970-01-01 01:00:00.0 +0100 +++ b 2011-04-03 06:56:28.330543000 +0200 @@ -0,0 +1,2 @@ +a +b -- components: Library (Lib) messages: 132832 nosy: jan.koprowski priority: normal severity: normal status: open title: unified_diff function product incorrect range information versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue11747> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9762] PEP 3149 related build failures
Jan Groenewald added the comment: I am trying to build www.sagemath.org on ubuntu 10.04 natty beta 2 for amd64. Bear with me. Sage includes a patched version of python2.6.4, and it fails to build modules nis and crypt. Upstream python 2.6.4, 2.6.6, and 2.7.1 fail to build with the same error with ./configure, make, as per the README. The patch proposed is for setup.py, which is not used here? Ubuntu has a packaged python 2.6.6 and 2.7.1 (default) which I assume is patched, and builds on their toolchain. -- nosy: +Jan.Groenewald versions: +Python 2.6 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue9762> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9762] PEP 3149 related build failures
Jan Groenewald added the comment: Oops, correction. Ubuntu 11.04 beta 2 for amd64. -- ___ Python tracker <http://bugs.python.org/issue9762> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10466] locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)
Changes by Jan Killian : -- nosy: +iki ___ Python tracker <http://bugs.python.org/issue10466> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError
New submission from Jan Kaliszewski : Let examples speak: def x(a, z): pass # this is ok def x(a, z,): pass # this is ok def x(a, *, z): pass # this is ok in Py3k def x(a, *, z,): pass # but this causes SyntaxError (!) def x(a, *args): pass # this is ok def x(a, *args,): pass # but this causes SyntaxError def x(a, **kwargs): pass # this is ok def x(a, **kwargs,): pass # but this causes SyntaxError def x(a, *args, z): pass # this is ok in Py3k def x(a, *args, z,): pass # but this causes SyntaxError (!) And similarly -- calls: def x(*args, **kwargs): pass x(1, *(2,3,4))# this is ok x(1, *(2,3,4),) # but this causes SyntaxError x(1, **{5: 6})# this is ok x(1, **{5: 6},) # but this causes SyntaxError x(1, 2, 3, 4, z=5)# this is ok x(1, *(2,3,4), z=5) # this is ok in Py2.6+ and Py3k x(1, *(2,3,4), z=5,) # but this causes SyntaxError (!) Similar problem was discussed years ago as a docs bug -- see: issue798652, but -- as inconsistent with intuition and a general Python rule that trailing commas are ok in argument lists and sequence literals (except empty ones) -- it seems to be rather a language syntax definition issue. Now, after introducing new syntax possibilities in Py2.6 and especially Py3k (see the examples above), the issue is even much more painful. Also, please consider that Py3k's function annotations encourage to format argument list in one-argument-per-line-manner: def my_func( spam:"Very tasty and nutritious piece of food", ham:"For experts only", *more_spam:"Not less tasty and not less nutritious!", spammish:"Nobody expects this!"='Inquisition', ): ... -- components: Interpreter Core messages: 123823 nosy: zuo priority: normal severity: normal status: open title: With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue10682> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError
Jan Kaliszewski added the comment: s/**{5: 6}/**{'5': 6}/g (but it's a detail) -- ___ Python tracker <http://bugs.python.org/issue10682> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError
Jan Kaliszewski added the comment: Oops, I see the problem was partly addressed @ issue9232. But: * the proposed patch doesn't fix calls (but defs only), * shouldn't be the issue considered as a bug -- and fixed also in 2.7 and 3.1? -- ___ Python tracker <http://bugs.python.org/issue10682> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9232] Allow trailing comma in any function argument list.
Changes by Jan Kaliszewski : -- nosy: +zuo ___ Python tracker <http://bugs.python.org/issue9232> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9232] Allow trailing comma in any function argument list.
Jan Kaliszewski added the comment: >From 10682: The patch proposed in this (#9232) issue does not fix call syntax >but def sytax only. I think it should fix call sytax as well (see code >examples in #10682). -- ___ Python tracker <http://bugs.python.org/issue9232> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9232] Allow trailing comma in any function argument list.
Jan Kaliszewski added the comment: python-dev discussion continuation: http://mail.python.org/pipermail/python-dev/2010-December/106770.html -- ___ Python tracker <http://bugs.python.org/issue9232> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue444582] Finding programs in PATH, adding shutil.which
Jan Killian added the comment: Hello All, sorry for lack of communication recently, I'd alos like to see it in 3.2 instead of 3.3, but my time is not as scalable as I wish and I can't run on clouds yet .) I like Trent's module and especially its usefullness via the commandline. I'm also happy about learning on "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" key, and did reimplement it in my module (with optional static=True parameter to cache the key and parsed path instead of querying and parsing them on each run). For inclusion in shutil, I'd imho prefer the interface chosen here, ie. which_files() returns generator, which() returns first match, or raises IOError(errno.ENOENT), but that's my opinion only. There's also adapted the default extension list to match the given Windows version, which helps resembling the real command execution behavior. The escape+quote chars in path are an interesting problem. I wrote a simple test for them to find out the behavior on Windows XP/7 and Linux, and will do the correct implementation and tests later this week. -- ___ Python tracker <http://bugs.python.org/issue444582> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3085] chapter 17.1.3.5 'Replacing os.popen*' in the Python library reference contains an error
New submission from Jan Huelsbergen <[EMAIL PROTECTED]>: the 'from' examples contain non-keyword args after keyword args: pipe = os.popen(cmd, mode='r', bufsize) should be pipe = os.popen(cmd, 'r', bufsize) and pipe = os.popen(cmd, mode='w', bufsize) should be pipe = os.popen(cmd, 'w', bufsize) -- assignee: georg.brandl components: Documentation messages: 68032 nosy: afoo, georg.brandl severity: normal status: open title: chapter 17.1.3.5 'Replacing os.popen*' in the Python library reference contains an error type: feature request versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3085> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3111] multiprocessing ppc Debian/ ia64 Ubuntu compilation error
jan matejek <[EMAIL PROTECTED]> added the comment: > "as it doesn't seem /dev/shm is the culprit" Mounting /dev/shm seems to fix the problem in suse's autobuild (chroot) environment, so for me it actually was the culprit. Perhaps you should recheck your buildbots? -- nosy: +matejcik ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3111> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3879] 2.6 regression in urllib.getproxies_environment
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3879> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3886] Integer overflow in _hashopenssl.c (CVE-2008-2316)
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3886> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1424152> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3910] 2.6 regression in socket.ssl method
New submission from jan matejek <[EMAIL PROTECTED]>: python 2.6's compatibility socket.ssl() method does not handle 'sock' parameter in the same way. in 2.5, ssl() looked like this: def ssl(sock, keyfile=None, certfile=None): if hasattr(sock, "_sock"): sock = sock._sock return _realssl(sock, keyfile, certfile) in 2.6 the call is handed to ssl.sslwrap_simple, which then blindly does _ssl.sslwrap(sock._sock, 0, keyfile, certfile, CERT_NONE, PROTOCOL_SSLv23, None) instead of checking whether the sock is the socket itself or the socket object. This causes code that passes the socket directly to fail with "AttributeError: '_socket.socket' object has no attribute '_sock' " the attached patch fixes the behavior. -- components: Library (Lib) files: bug-sslwrap-simple.patch keywords: patch messages: 73434 nosy: matejcik severity: normal status: open title: 2.6 regression in socket.ssl method type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file11526/bug-sslwrap-simple.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3910> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7764] dictview
Changes by Jan Kaliszewski : -- title: Doc for itertools recipe consume is complicated and less efficient -> dictview versions: -Python 2.6, Python 2.7, Python 3.2 ___ Python tracker <http://bugs.python.org/issue7764> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7764] Doc for itertools recipe consume is complicated and less efficient
Changes by Jan Kaliszewski : -- title: dictview -> Doc for itertools recipe consume is complicated and less efficient ___ Python tracker <http://bugs.python.org/issue7764> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7764] Doc for itertools recipe consume is complicated and less efficient
Jan Kaliszewski added the comment: (sorry! typed into a wrong field) -- nosy: +zuo versions: +Python 2.6, Python 2.7, Python 3.2 ___ Python tracker <http://bugs.python.org/issue7764> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7771] dict view comparison methods are not documented
New submission from Jan Kaliszewski : Dictionary views documentation (e.g. http://docs.python.org/3.1/library/stdtypes.html#dictionary-view-objects) contains nothing about comparison (> >= < <= == !=) operations. -- assignee: georg.brandl components: Documentation messages: 98240 nosy: georg.brandl, zuo severity: normal status: open title: dict view comparison methods are not documented versions: Python 2.7, Python 3.1, Python 3.2 ___ Python tracker <http://bugs.python.org/issue7771> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7788] segfault when deleting from a list using slice with very big `step' value
New submission from Jan Kaliszewski : del list_instance([start : stop : very_big_step]) causes segfaults... The boundary values seem to be: * start -- near length of the list * stop -- near (-length) of the list * very_big_step -- near sys.maxint Let examples speak... >>> from sys import maxint >>> del range(10)[::maxint] Segmentation fault >>> from sys import maxint >>> del range(10)[13::maxint] >>> del range(10)[12::maxint] >>> del range(10)[11::maxint] >>> del range(10)[10::maxint] >>> del range(10)[9::maxint] Segmentation fault >>> from sys import maxint >>> del range(10)[:-13:maxint] >>> del range(10)[:-12:maxint] >>> del range(10)[:-11:maxint] >>> del range(10)[:-10:maxint] >>> del range(10)[:-9:maxint] Segmentation fault >>> from sys import maxint >>> del range(10)[-8:8:maxint-5] >>> del range(10)[-8:8:maxint-4] >>> del range(10)[-8:8:maxint-3] >>> del range(10)[-8:8:maxint-2] Segmentation fault System Info: * Python 2.5.4 (r254:67916, Apr 4 2009, 17:55:16) * [GCC 4.3.3] on linux2 * sys.maxint == 2147483647, sys.byteorder == 'little' * Processor: Pentium 4 * libc version: 2.9 (2.9-4ubuntu6) -- components: Interpreter Core messages: 98348 nosy: zuo severity: normal status: open title: segfault when deleting from a list using slice with very big `step' value type: crash versions: Python 2.5 ___ Python tracker <http://bugs.python.org/issue7788> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7788] segfault when deleting from a list using slice with very big `step' value
Jan Kaliszewski added the comment: ** Erratum ** -- was: del list_instance([start : stop : very_big_step]) causes segfaults... -- should be: del list_instance[start : stop : very_big_step] causes segfaults... ** Post scriptum ** In each example only the last statement causes segmentation fault (previous are OK, and I attached them on purpose -- to show exemplary boundary values when things start going wrong). -- ___ Python tracker <http://bugs.python.org/issue7788> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7788] segfault when deleting from a list using slice with very big `step' value
Jan Kaliszewski added the comment: Interesting that in Py2.5... >>> del range(10)[::maxint] ...this causes segfault but in Py2.6 is ok, as well as in Py3.0 (with maxsize insetad of maxint). (That's why I didn't noticed that it concerns newer version than 2.5, and marked only 2.5). But, as Ezio noted, e.g.: >>> del range(10)[5::maxint] ...crashes all of them, e.g: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 >>> from sys import maxsize >>> del list(range(10))[::maxsize] # <- OK >>> del list(range(10))[5::maxsize] Segmentation fault -- ___ Python tracker <http://bugs.python.org/issue7788> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7788] segfault when deleting from a list using slice with very big `step' value
Jan Kaliszewski added the comment: PS. Is such a data-dependant segfault considered as security problem? (if it is, maybe Python2.5 shuld be kept in "Versions" list) -- ___ Python tracker <http://bugs.python.org/issue7788> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue444582] Finding programs in PATH, addition to os
Jan Killian added the comment: Adapted Brian Curtin's http://bugs.python.org/file15381/ shutil_which.patch and made another reference implementation as a standalone module including the following fixes: * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but not before an explicitly passed path * accepts both string or iterable for an explicitly passed path, or pathext * accepts an explicitly passed empty path, or pathext (either '' or []) * does not search ``PATH`` for files that have a path specified in their name already Use any of these changes in the final shutil patch if you like to. The shutil module has availability 'Unix, Windows' after all. -- nosy: +iki Added file: http://bugs.python.org/file16441/which.py ___ Python tracker <http://bugs.python.org/issue444582> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue444582] Finding programs in PATH, addition to os
Jan Killian added the comment: Updated version of reference implementation as a standalone module * changed interface: which_files() returns generator, which() returns first match, or raises IOError(errno.ENOENT) * updated doctest Made this to more closely resemble the 'which' command behavior, and to make the typical use case simpler. The generator interface is still a good idea imho, so it's kept as which_files(). I'm already using the reference implementation module flawlessly, so I don't see any other changes needed on my side. Your ideas are welcome of course. -- Added file: http://bugs.python.org/file16459/which.py ___ Python tracker <http://bugs.python.org/issue444582> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8335] distutils test_build_ext's test_get_outputs fails in bootstrap environment
New submission from jan matejek : when running testsuite in a clean environment without pre-installed system python, test_distutils fail in test_build_ext, test_get_outputs: /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6 LinkError: command 'gcc' failed with exit status 1 full traceback is below. this is most likely caused by change in r72637: http://svn.python.org/view/python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py?r1=72637&r2=72636&pathrev=72637 this changes compiler's working directory, so that it can no longer find libpython2.6.so with "-L." (related to issue 6022 - the comments there point it out) not sure about proper fix - personally, i don't care much about leaving one more file in builddir, whereas i do care about tests passing in clean env, so for SUSE i'm reverting r72637 full traceback: test_distutils /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6 collect2: ld returned 1 exit status test test_distutils failed -- Traceback (most recent call last): File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/tests/test_build_ext.py", line 261, in test_get_outputs cmd.run() File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 449, in build_extensions self.build_extension(ext) File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 531, in build_extension target_lang=language) File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/ccompiler.py", line 769, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/unixccompiler.py", line 259, in link raise LinkError, msg LinkError: command 'gcc' failed with exit status 1 -- assignee: tarek components: Distutils messages: 102552 nosy: matejcik, tarek severity: normal status: open title: distutils test_build_ext's test_get_outputs fails in bootstrap environment type: compile error versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue8335> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6022] test_distutils leaves a 'foo' file behind in the cwd
jan matejek added the comment: see issue 8335 -- nosy: +matejcik ___ Python tracker <http://bugs.python.org/issue6022> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1621] Do not assume signed integer overflow behavior
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1621> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1179] [CVE-2007-4965] Integer overflow in imageop module
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1179> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3620] test_smtplib is flaky
Changes by jan matejek <[EMAIL PROTECTED]>: -- nosy: +matejcik ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3620> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4276] IDLE in 2.6 fails to launch
New submission from Jan Schreuder <[EMAIL PROTECTED]>: I downloaded and installed Python 2.6 for Mac OSX 10.4. It installed Build Applet, Extras, IDLE and Python Launcher in a Python 2.6 folder in the Applications folder. However, IDLE will not launch. I have Python 2.5 installed. That IDLE version works. -- components: IDLE messages: 75596 nosy: JanKarel severity: normal status: open title: IDLE in 2.6 fails to launch versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4276> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4764] open('existing_dir') -> IOError instance's attr filename is None
New submission from Jan Kaliszewski : Py2.4 and 2.5 (and probably other 2.x releases too): >>> try: f=open('existing_dir') ... except IOError, exc: print exc.filename ... None (expected result: "existing_dir") Py3.0 (and possibly 3.1 too): >>> try: f=open('existing_dir') ... except IOError as exc: print(exc.filename) ... None (expected result: "existing_dir") But no problems with: open('existing_dir', 'w') => exc.filename=='existing_dir' open('not_existing_file') => exc.filename=='not_existing_file' Guess: It may be similar to issue #599163 Platform/system info: [GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2 Linux 2.6.25-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz * Py2.4 == Python 2.4.4 (#1, Oct 7 2008, 13:16:18) * Py2.5 == Python 2.5.2 (r252:60911, Sep 15 2008, 12:11:51) * Py3.0 == Python 3.0 (r30:67503, Dec 29 2008, 01:15:48) -- components: Library (Lib) messages: 78437 nosy: zuo severity: normal status: open title: open('existing_dir') -> IOError instance's attr filename is None type: behavior versions: Python 2.4, Python 2.5, Python 3.0 ___ Python tracker <http://bugs.python.org/issue4764> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4958] email/header.py ecre regular expression issue
New submission from Jan Malakhovski : Hello. I have dedicated mail server at home and it holds about 1G of mail. Most of mail is in non UTF-8 codepage, so today I wrote little script that should recode all letters to UTF. But I found that email.header.decode_header parses some headers wrong. For example, header Content-Type: application/x-msword; name="2008 =?windows-1251?B?wu7v8O7x+w==?= 2 =?windows-1251?B?4+7kIDgwONUwMC5kb2M=?=" parsed as [('application/x-msword; name="2008', None), ('\xc2\xee\xef\xf0\xee\xf1\xfb', 'windows-1251'), ('2 =?windows-1251?B?4+7kIDgwONUwMC5kb2M=?="', None)] that is obviously wrong. Now I'm playing with email/header.py file in python 2.5 debian package (but it's same in 2.6.1 version except that all <> changed to !=). If it's patched with ==BEGIN CUT== --- oldheader.py2009-01-16 01:47:32.553130030 +0300 +++ header.py 2009-01-16 01:47:16.783119846 +0300 @@ -39,7 +39,6 @@ \?# literal ? (?P.*?) # non-greedy up to the next ?= is the encoded string \?= # literal ?= - (?=[ \t]|$) # whitespace or the end of the string ''', re.VERBOSE | re.IGNORECASE | re.MULTILINE) # Field name regexp, including trailing colon, but not separating whitespace, ==END CUT== it works fine. So I wonder if this (?=[ \t]|$) # whitespace or the end of the string really needed, after all if there is only whitespaces after encoded word, its just appended to the list by parts = ecre.split(line) -- Also, there is related mail list thread: http://mail.python.org/pipermail/python-dev/2009-January/085088.html -- components: Library (Lib) messages: 79927 nosy: oxij severity: normal status: open title: email/header.py ecre regular expression issue type: behavior versions: Python 2.5, Python 2.6 ___ Python tracker <http://bugs.python.org/issue4958> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5038] urrlib2/httplib doesn't reset file position between requests
New submission from jan matejek : since 2.6 httplib supports reading from file-like objects. Now consider the following situation: There are two handlers in urrlib2, first is plain http, second is basic auth. I want to POST a file to a service, and pass the open file object as data parameter to urllib2.urlopen. First handler is invoked, it sends the file data, but gets 401 Unauthorized return code and fails with that. Second handler in chain is invoked (at least that's how i understand urrlib2, please correct me if i'm talking rubbish). At that point the open file is at EOF, so empty data is sent. furthermore, the obvious solution "you can't do this through urllib so go read the file yourself" doesn't apply that well - the file object in question is actually a mmap.mmap instance. This code is in production since python 2.4. Until file object support in httplib was introduced, it worked fine, handling the mmap'ed file as a string. Now it is picked up as read()-able and this problem occurs. Only workaround to restore pre-2.6 behavior that comes to mind is building a wrapper class for the mmap object that hides its read() method. -- components: Library (Lib) messages: 80419 nosy: matejcik severity: normal status: open title: urrlib2/httplib doesn't reset file position between requests type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue5038> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5144] PySys_SetArgv has wrong documentation
New submission from jan matejek : documentation for PySys_SetArgv states that the function sets sys.argv, but fails to mention that it also resolves script's path and prepends it to sys.path. Or, in case no script was specified, it prepends empty string (which in versions <2.6 allowed relative imports from cwd) -- assignee: georg.brandl components: Documentation messages: 81067 nosy: georg.brandl, matejcik severity: normal status: open title: PySys_SetArgv has wrong documentation ___ Python tracker <http://bugs.python.org/issue5144> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue47161] pathlib method relative_to doesnt work with // in paths
New submission from Jan Bronicki : The `//` path should be equivalent to `/`, and in some ways, it does behave like that in pathlib. But in the `relative_to` method on a `Path` object, it does not work This is causing our CI pipeline to fail. In the documentation here you can see `//` being properly processed: https://docs.python.org/3/library/pathlib.html ```python In [10]: x=Path("/Library/Video") ; x.relative_to(Path("/")) Out[10]: PosixPath('Library/Video') In [11]: x=Path("//Library/Video") ; x.relative_to(Path("/")) --- ValueErrorTraceback (most recent call last) Input In [11], in () > 1 x=Path("//Library/Video") ; x.relative_to(Path("/")) File ~/.pyenv/versions/3.8.13/lib/python3.8/pathlib.py:908, in PurePath.relative_to(self, *other) 906 if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts): 907 formatted = self._format_parsed_parts(to_drv, to_root, to_parts) --> 908 raise ValueError("{!r} does not start with {!r}" 909 .format(str(self), str(formatted))) 910 return self._from_parsed_parts('', root if n == 1 else '', 911abs_parts[n:]) ValueError: '//Library/Video' does not start with '/' ``` -- components: Library (Lib) messages: 416336 nosy: John15321 priority: normal severity: normal status: open title: pathlib method relative_to doesnt work with // in paths type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue47161> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue47161] pathlib method relative_to doesnt work with // in paths
Jan Bronicki added the comment: But shouldn't it just work with `//` as a `/`? It seems like this is the behavior elsewhere. Sure I get that it cannot be done for 3.8. But the new error message implies that either `//` is not a subpath of `/` which it is, or that one is relative and the other is absolute, which is also false because both are absolutes -- ___ Python tracker <https://bugs.python.org/issue47161> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue47161] pathlib method relative_to doesnt work with // in paths
Jan Bronicki added the comment: Hmm..., I get it, but Im not gonna lie it's pretty confusing given that in other places `//` works as a substitute for `/`. Maybe it should be mentioned in the documentation? -- ___ Python tracker <https://bugs.python.org/issue47161> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39812] Avoid daemon threads in concurrent.futures
Jan Konopka added the comment: Hi all! While browsing StackOverflow I came across this question: https://stackoverflow.com/q/67273533/2111778 The user created a ThreadPoolExecutor which started a Process using multiprocessing. The Process produces an exitcode of 0 in Python 3.8 but an exitcode of 1 in Python 3.9. I'm really not familiar with Python internals, but through monkey-patching Lib/concurrent/futures/thread.py I was able to pin this regression down to the change of > atexit.register(_python_exit) to > threading._register_atexit(_python_exit) which led me to this issue! (: I know that multiprocessing in Python is a little funky, since I worked with it on my Master's thesis. I think the entire process gets forked (i.e. copied), so the child process also gets a copy of the active ThreadPoolExecutor, which I think causes some sort of problem there. Note that this behavior seems to differ based on OS. I can confirm the issue on Linux with the 'fork' method and disconfirm it with the 'spawn' and 'forkserver' methods. https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods Could someone with more insight kindly take a look at this? Greetings Jan <3 -- nosy: +janfrederik.konopka ___ Python tracker <https://bugs.python.org/issue39812> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44762] getpass.getpass on Windows fallback detection is bad
New submission from jan matejek : The fallback detection for `win_getpass` checks that `sys.stdin` is different from `sys.__stdin__`. If yes, it assumes that it's incapable of disabling echo, and calls `default_getpass` which reads from stdin. If they are the same object, it assumes it's in a terminal and uses `msvcrt` to read characters. I was not able to find any rationale for this check, it seems to have been introduced, oh wow, in 2001, to fix something IDLE-related. Anyway, the check is trivially incorrect. It fails when such script is launched from `subprocess.Popen(stdin=PIPE)`, where both `sys.stdin` and `sys.__stdin__` are the same instance of `TextIOWrapper`. Same actually happens in MinTTY (Git Bash etc.) which is not a true terminal as far as I was able to find out? It seems that a better check would be, e.g., `sys.stdin.isatty()`, which correctly returns `False` both in subprocesses and in MinTTY. -- components: Library (Lib) messages: 398370 nosy: matejcik priority: normal severity: normal status: open title: getpass.getpass on Windows fallback detection is bad type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44762] getpass.getpass on Windows fallback detection is bad
jan matejek added the comment: ...this is a problem because: When the check incorrectly infers that it can use `msvcrt` while its stdin is a pipe, the calls to `putwch` and `getwch` are going into the void and the program effectively freezes waiting for input that never comes. See also: https://stackoverflow.com/questions/49858821/python-getpass-doesnt-work-on-windows-git-bash-mingw64/54046572 https://github.com/ipython/ipython/issues/854 -- ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44762] getpass.getpass on Windows fallback detection is bad
jan matejek added the comment: For that matter, in standard Windows Command Prompt `sys.stdin` and `sys.__stdin__` are also identical, but `isatty()` reports True. I suspect is that the code has drifted and `sys.stdin` is _always_ identical to `sys.__stdin__` ? -- ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44762] getpass.getpass on Windows fallback detection is bad
Change by jan matejek : -- versions: -Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44762] getpass.getpass on Windows fallback detection is bad
Change by jan matejek : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45031] [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8
New submission from Jan Ripke : When executing the following statement on a Windows machine it fails. On a linux machine it returns the expected date (-31-12 00:00:00) The Error we get on Windows is: OSError: [Errno 22] Invalid argument In another manor it was reported before: https://bugs.python.org/issue29097 The code: from datetime import datetime epoch_time = 25340221080/1000 print(datetime.fromtimestamp(epoch_time)) -- components: Windows messages: 400429 nosy: janripke, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8 type: crash versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45031> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34897] distutils test errors when CXX is not set
Jan Pieczkowski added the comment: This issue also still affects Python versions 3.6.15 and 3.7.12 IMHO it would make sense to backport this patch to the 3.6 and 3.7 branches, especially as it only affects one line of code and doesn't seem to affect anything else, but solves the same issue for prior python versions as the merged patch did for 3.8+ -- nosy: +physicalist ___ Python tracker <https://bugs.python.org/issue34897> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45505] Remove unneeded ZipFile IO
New submission from Jan Wolski : Currently in the ZipFile class implementation, when processing the zip file headers "extra" field, a .read() call is used without using the returned value in any way. This call could be replaced with a .seek() to avoid actually doing the IO. The change would improve performance in use cases where the fileobject given to ZipFile is backed by high latency IO, eg. HTTP range requests. -- components: Library (Lib) messages: 404155 nosy: data-ux priority: normal pull_requests: 27292 severity: normal status: open title: Remove unneeded ZipFile IO type: performance ___ Python tracker <https://bugs.python.org/issue45505> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs
Jan Kaliszewski added the comment: So the current (after the aforementioned commit) form of the description is: A dotted lookup such as ``super(A, a).x`` searches ``obj.__class__.__mro__`` for a base class ``B`` following ``A`` and then returns ``B.__dict__['x'].__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged. I guess here ``obj`` was supposed to be ``a``. But is the description correct when it comes to what class is used where? I.e., shouldn't it be rather something along the lines of the following: A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an instance of ``A`` of some other subclass of ``A``) searches ``A.__mro__`` for a base class ``B`` whose `__dict__` contains name ``"x"`` and then returns ``B.__dict__['x'].__get__(obj, type(obj))``. If ``B.__dict__['x']`` is not a descriptor, it is returned unchanged. *** Ad my comment #2 -- yes, it became groundless with time... Minor explanation: when I reported this issue in 2015, the signature of `object.__get__` was documented just as "__get__(self, instance, owner)" (see: https://docs.python.org/3.5/reference/datamodel.html#implementing-descriptors); that's why I wrote about an inconsistency. -- status: closed -> open ___ Python tracker <https://bugs.python.org/issue20751> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs
Jan Kaliszewski added the comment: Sorry, a few mistakes distorted my proposal. It should be: A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an instance of ``A`` or of a subclass of ``A``) searches ``A.__mro__`` for a base class whose `__dict__` contains name ``"x"``, and then returns ``B.__dict__['x'].__get__(obj, type(obj))`` (where ``B`` is that base class). If ``B.__dict__['x']`` is not a descriptor, it is returned unchanged. -- ___ Python tracker <https://bugs.python.org/issue20751> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs
Jan Kaliszewski added the comment: I am very sorry, I just noticed another mistake. It should be: A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an instance of ``A`` or of a subclass of ``A``) searches ``type(obj).__mro__`` for such a base class ``B`` that follows ``A`` and whose :attr:`__dict__` contains the name ``"x"``; then ``B.__dict__['x'].__get__(obj, type(obj))`` is returned. If not a descriptor, ``B.__dict__['x']`` is returned unchanged. -- ___ Python tracker <https://bugs.python.org/issue20751> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9625] argparse: Problem with defaults for variable nargs when using choices
Jan Hutař added the comment: I think there is a same issue with "nargs='+'" - if you are aware of the, please ignore me. $ python3 --version Python 3.7.5 With "choices=...", there seems to be a problem: $ cat bbb.py #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument('choices', nargs='*', default=['a', 'b', 'c'], choices=['a', 'b', 'c']) args = parser.parse_args() print(args) $ ./bbb.py usage: bbb.py [-h] [{a,b,c} [{a,b,c} ...]] bbb.py: error: argument choices: invalid choice: ['a', 'b', 'c'] (choose from 'a', 'b', 'c') $ ./bbb.py a c Namespace(choices=['a', 'c']) but without choices it works: $ cat bbb.py #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument('choices', nargs='*', default=['a', 'b', 'c']) args = parser.parse_args() print(args) $ ./bbb.py Namespace(choices=['a', 'b', 'c']) $ ./bbb.py a c Namespace(choices=['a', 'c']) As I said, if this is a known issue, I'm sorry for the noise. -- nosy: +Jan Hutař ___ Python tracker <https://bugs.python.org/issue9625> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27793] Double underscore variables in module are mangled when used in class
Jan Christoph added the comment: I would argue to reopen this. Seeing I and other people run into that issue (e.g. https://stackoverflow.com/q/40883083/789308) quiet frequently. Especially since it breaks the `global` keyword, e.g.: __superprivate = "mahog" class AClass(object): def __init__(self, value): global __superprivate __superprivate = value @staticmethod def get_sp(): return __superprivate if __name__ == "__main__": print(__superprivate) # mahog try: print(AClass.get_sp()) except NameError as e: print(e) # NameError: name '_AClass__superprivate' is not defined' cl = AClass("bla") print(cl.get_sp()) # bla __superprivate = 1 print(cl.get_sp()) # bla print(AClass.get_sp()) # bla -- nosy: +con-f-use ___ Python tracker <https://bugs.python.org/issue27793> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27793] Double underscore variables in module are mangled when used in class
Jan Christoph added the comment: Just because it is documented, doesn't mean it's not a bug or illogical and unexpected. -- ___ Python tracker <https://bugs.python.org/issue27793> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27793] Double underscore variables in module are mangled when used in class
Jan Christoph added the comment: In particular, this might conflict with the documentation of global, which states: > If the target is an identifier (name): > >If the name does not occur in a global statement in the current code > block: the name is bound to the object in the current local namespace. > >Otherwise: the name is bound to the object in the current global namespace. There is no exception of names that are within the body of a class object and start (but not end) with double underscores. -- ___ Python tracker <https://bugs.python.org/issue27793> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support
Jan Wilmans added the comment: I couldn't get this to work at all, python 3.7 compiled fine, but at the end it reports: ''' *** WARNING: renaming "_ssl" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory *** WARNING: renaming "_hashlib" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory Python build finished successfully! Following modules built successfully but were removed because they could not be imported: _hashlib _ssl Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381 ''' But in the end I got it to work like this: - install_python3.7.sh #!/bin/bash set -euo pipefail mkdir /tmp/openssl cd /tmp/openssl wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz tar -xvf openssl-1.1.1a.tar.gz cd openssl-1.1.1a ./config --prefix=/usr/local/openssl1.1.1 --openssldir=/usr/local/openssl1.1.1 make make install rm -rf /tmp/opensll echo /usr/local/openssl1.1.1/lib > /etc/ld.so.conf.d/openssl1.1.1.conf ldconfig mkdir /tmp/python37 wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz tar xfz Python-3.7.3.tgz cd Python-3.7.3 ./configure --with-ensurepip=yes --with-openssl=/usr/local/openssl1.1.1 CFLAGS="-I/usr/local/openssl1.1.1/include" LDFLAGS="-L/usr/local/openssl1.1.1/lib" CXX=/usr/bin/g++ make make install rm -rf /tmp/python37 ldconfig This important pieces are: echo /usr/local/openssl1.1.1/lib > /etc/ld.so.conf.d/openssl1.1.1.conf ldconfig to make it find the .so to load it at runtime and ./configure --with-ensurepip=yes --with-openssl=/usr/local/openssl1.1.1 CFLAGS="-I/usr/local/openssl1.1.1/include" LDFLAGS="-L/usr/local/openssl1.1.1/lib" CXX=/usr/bin/g++ specifying the non-standard openssl-version specifically. -- nosy: +Jan Wilmans ___ Python tracker <https://bugs.python.org/issue34028> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.
New submission from BenTen Jan : I downloaded python 3.8.2 which is the latest version of python for windows. Run as admin , changed path of installation though its getting empty Scripts folder. though setup shows successful. Please find attached log files from my %temp% folder. Thanks Regards Ben -- components: Installation files: Installation Log.zip messages: 367307 nosy: BenTen Jan priority: normal severity: normal status: open title: Scripts folder is Empty in python 3.8.2 for Windows 7. versions: Python 3.8 Added file: https://bugs.python.org/file49093/Installation Log.zip ___ Python tracker <https://bugs.python.org/issue40395> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.
BenTen Jan added the comment: First and foremost thanks for replying, 1. I don't have any virus scanner installed. 2. I have tried running "python -m ensurepip" it shows me Following error C:\Python>Python get-pip.py Traceback (most recent call last): File "get-pip.py", line 22711, in main() File "get-pip.py", line 198, in main bootstrap(tmpdir=tmpdir) File "get-pip.py", line 82, in bootstrap from pip._internal.cli.main import main as pip_entry_point File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\cli\main.py", line 10, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\cli\autocompletion.py", line 9, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\cli\main_parser.py", line 7, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\cli\cmdoptions.py", line 28, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\models\target_python.py", line 4, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_internal\utils\misc.py", line 20, in File "", line 259, in load_module File "C:\Users\KNN\AppData\Local\Temp\tmpvrhu1rqz\pip.zip\pip\_vendor\pkg_resources\__init__.py", line 35, in File "C:\Python\Python38-32\lib\plistlib.py", line 65, in from xml.parsers.expat import ParserCreate File "C:\Python\Python38-32\lib\xml\parsers\expat.py", line 4, in from pyexpat import * ImportError: DLL load failed while importing pyexpat: The specified module could not be found. 3. Whole Scripts folder in python root is empty, i don't know if its ok with 3.8.2 but Scripts folder was having files in 2.X versions... Thanks & Appreciate The Handwork of yours towards PY.COMM.. Ben -- ___ Python tracker <https://bugs.python.org/issue40395> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals
Jan Tojnar added the comment: One benefit of using a compile time feature over a runtime method is that the former allows for more predictable dedenting by first dedenting and only then interpolating variables. For example, the following code does not dedent the test string at all: ```python import textwrap foo = "\n".join(["aaa", "bbb"]) test = textwrap.dedent( f""" block xxx: {foo} """ ) ``` It would be much nicer if we had syntactical dedents based on the leftmost non-whitespace column in the string, as supported by Nix language, for example. ```python test = ( df""" block xxx: {textwrap.indent(foo, ' '*4)} """ ) ``` It would be even nicer if the interpolated strings could be indented based on the column the interpolation occurs in but that can at least be done at runtime with only minor inconvenience. -- nosy: +jtojnar ___ Python tracker <https://bugs.python.org/issue36906> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43038] ensurepip: tries to use setup.py/setup.cfg
New submission from Jan Christoph : Running python3 -Im ensurepip --upgrade --default-pip in a directory that contains a setup.cfg / setup.py combination, caused ensurepip to try and use these files, leading to distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has no such option 'icons' A full shell session is attached that contains details on the exact files and python version involved involved. I was under the impression ensurepip simply ensured that a suitable version of pip is installed with my Python distribution in use. -- components: Library (Lib) files: shell-session.txt messages: 385767 nosy: con-f-use priority: normal severity: normal status: open title: ensurepip: tries to use setup.py/setup.cfg type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49768/shell-session.txt ___ Python tracker <https://bugs.python.org/issue43038> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42050] ensurepip fails if cwd contains illformed setup.cf
Jan Christoph added the comment: Just wanted to say, I ran into this while using direnv. See the issue I opened before knowing of this one: https://bugs.python.org/issue43038 -- nosy: +con-f-use Added file: https://bugs.python.org/file49779/shell-session.txt ___ Python tracker <https://bugs.python.org/issue42050> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB
Change by Jan Steinke : -- nosy: +jan-xyz ___ Python tracker <https://bugs.python.org/issue42853> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups
Jan Hudec added the comment: Confirming the fixed version linked in previous comment by Thomas Waldmann is correct and matches what `hostname -f` does. -- nosy: +bulb versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue5004> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41417] SyntaxError: assignment expression within assert
New submission from Jan Češpivo : Hi, it should be useful if assignment expression works within assertion. For example (real use-case in tests): assert r := re.match(r"result is (\d+)", tested_text) assert int(r.group(1)) == expected_number I haven't found a mention about assertions in https://www.python.org/dev/peps/pep-0572/ so it isn't technically a bug but it might be omission (?). Thx! -- components: Interpreter Core messages: 374476 nosy: jan.cespivo priority: normal severity: normal status: open title: SyntaxError: assignment expression within assert type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue41417> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41417] SyntaxError: assignment expression within assert
Jan Češpivo added the comment: Hi Ronald, thank you. It works! :) -- ___ Python tracker <https://bugs.python.org/issue41417> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41945] http.cookies.SimpleCookie.parse error after [keys]
New submission from Jan Novak : If brackets [] are around cookie name, next cookie names are not loaded. try: import http.cookies as Cookie except ImportError: import Cookie c = Cookie.SimpleCookie() c.load('id=12345; [object Object]=data; something=not loaded') print(c) Note: It could cause big problems with session etc. We found that Chrome/Edge starts to save and send this type of cookies for some (couple) users. The origin of that [object Object]=... cookies are probably some implementation of https://cookiepedia.co.uk/cookies/euconsent and errors somewhere in external javascripts or browsers? Related issues: https://bugs.python.org/issue41695 https://bugs.python.org/issue27674 The same problem occures in P3.7, P2.7, six.moves.http_cookies etc. I know RFT says that cookie-name can't use brackets. But you can set them to browser cookies. RFC 6265: set-cookie-header = "Set-Cookie:" SP set-cookie-string set-cookie-string = cookie-pair *( ";" SP cookie-av ) cookie-pair = cookie-name "=" cookie-value cookie-name = token token = RFC 2616: token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT -- components: Library (Lib) messages: 378041 nosy: xnovakj priority: normal severity: normal status: open title: http.cookies.SimpleCookie.parse error after [keys] type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue41945> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42079] Why does tarfile.next swallow InvalidHeaderError
New submission from Jan Schatz : I have a tar gz archive that fails to be extracted via tarfile.extractall(). By adding some debug code I found that at some point InvalidHeaderError is raised inside tarfile.next(). But the function just swallows the exception, because the offset isn't 0 (see https://github.com/python/cpython/blob/5368c2b6e23660cbce7e38dc68f859c66ac349ee/Lib/tarfile.py#L2334). Why does the function behave like this? I would expect an except rather than silently stopping extraction if the archive is damaged. -- components: Library (Lib) messages: 378934 nosy: jan.schatz priority: normal severity: normal status: open title: Why does tarfile.next swallow InvalidHeaderError type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue42079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42173] Drop Solaris support
Jan Poctavek added the comment: I'm speaking officially for Danube Cloud, an advanced project which is open-source virtualization platform similar to Proxmox, XCP-NG, oVirt, Joyent Triton, etc. Our base platform is SmartOS and we have everything written in Python. If you drop support for "Solaris", it will hurt our project a lot. Python has become heart of many projects and it should not limit itself to support just the mainstream platforms and OSes. Thank you for everything you've done so far and I hope we can continue together. Jan Poctavek Danube Cloud https://github.com/erigones/esdc-ce -- nosy: +yanchii ___ Python tracker <https://bugs.python.org/issue42173> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41945] http.cookies.SimpleCookie.parse error after [keys]
Jan Novak added the comment: Possible patch, load parts one by one: http_cookie = 'id=12345; [object Object]=data; something=not_loaded' for cookie_key in http_cookie.split(';'): c.load(cookie_key) print c Set-Cookie: id=12345 Set-Cookie: something=not_loaded -- ___ Python tracker <https://bugs.python.org/issue41945> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14001] Python v2.7.2 / v3.2.2 (SimpleXMLRPCServer): DoS (excessive CPU usage) by processing malformed XMLRPC / HTTP POST request
New submission from Jan Lieskovsky : A denial of service flaw was found in the way Simple XML-RPC Server module of Python processed client connections, that were closed prior the complete request body has been received. A remote attacker could use this flaw to cause Python Simple XML-RPC based server process to consume excessive amount of CPU. Credit: Issue reported by Daniel Callaghan References: [1] https://bugzilla.redhat.com/show_bug.cgi?id=789790 Steps to reproduce: -- A) for v3.2.2 version: 1) start server: cat s.py #!/usr/local/bin/python3 from xmlrpc.server import SimpleXMLRPCServer server = SimpleXMLRPCServer(('127.0.0.1', 12345)) server.serve_forever() 2) # top 3) issue request from client: echo -e 'POST /RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nlol bye' | nc localhost 12345 Return to 'top' screen and see, how CPU consumption on particular host quickly moves to 100%. B) for v2.7.2 version: 1) start server: cat s.py #!/usr/bin/python from SimpleXMLRPCServer import SimpleXMLRPCServer server = SimpleXMLRPCServer(('127.0.0.1', 12345)) server.serve_forever() Steps 2) and 3) for v2.7.2 version are identical to those for v3.2.2 version. -- components: Library (Lib) messages: 153267 nosy: iankko priority: normal severity: normal status: open title: Python v2.7.2 / v3.2.2 (SimpleXMLRPCServer): DoS (excessive CPU usage) by processing malformed XMLRPC / HTTP POST request type: security versions: Python 2.7, Python 3.2 ___ Python tracker <http://bugs.python.org/issue14001> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com