[issue10030] Patch for zip decryption speedup
Shashank shashank.sunny.si...@gmail.com added the comment: Attached is a patch with changes in Lib/test/test_zipfile.py to test both C and pure-py impls (on systems where the C impl is present). Admittedly, this approach to emulating the absence of C impl is a bit hacky. This is primarily because the changed class is not a part of the public API and hence not being tested directly. David, could you verify that the approach is ok? -- Added file: http://bugs.python.org/file19196/zipdecrypt.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10030 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10049] Add a no-op (null) context manager to contextlib
Hrvoje Nikšić hnik...@gmail.com added the comment: Is there anything else I need to do to have the patch reviewed and applied? I am in no hurry since we're still using 2.x, I'd just like to know if more needs to be done on my part to move the issue forward. My last Python patch was accepted quite some years ago, so I'm not closely familiar with the current approval process. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10030] Patch for zip decryption speedup
Changes by Shashank shashank.sunny.si...@gmail.com: Added file: http://bugs.python.org/file19197/zipdecrypt.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10030 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10067] itertools' docs put izip_longest in the terminating on the shortest input sequence section
New submission from Daniel Abel ab...@hal.elte.hu: Both the 2.x and 3.x documentation for itertools has izip_longest (zip_longest for 3.x) in the Iterators terminating on the shortest input sequence section. However, according to izip_longest's documentation, it terminates when the _longest_ iterator is exhausted. Possible fixes might be: - put izip_longest in a new Iterators terminating on the longest input sequence section - rename section to Iterators terminating on one of the input sequences -- assignee: d...@python components: Documentation messages: 118407 nosy: abeld, d...@python priority: normal severity: normal status: open title: itertools' docs put izip_longest in the terminating on the shortest input sequence section versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10068] global objects created in some module are not destroyed when last reference to that module is released
New submission from Valery Lesin valery.le...@gmail.com: Interpreter: Python 3.1.2 Sample: = first.py = import sys import second if 'second' in sys.modules: print ('in sys modules') del sys.modules['second'] del second = second.py = class A: def __init__(self): print('created') def __del__(self): print('destroyed') a = A() - Result: 'destroyed' isn't printed With Python 2.6.5 it worked fine -- components: Interpreter Core messages: 118408 nosy: Valery.Lesin priority: normal severity: normal status: open title: global objects created in some module are not destroyed when last reference to that module is released type: behavior versions: Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10049] Add a no-op (null) context manager to contextlib
R. David Murray rdmur...@bitdance.com added the comment: Unless Nick has further feedback I think you've done all you need to, thanks. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10069] 2to3 crash in fix_urllib.py
New submission from Hallvard B Furuseth h.b.furus...@usit.uio.no: This line: from urllib import quote as quote_url, urlencode makes 2to3 on Python 3.2a2 crash. At lib2to3/fixes/fix_urllib.py line 124, member = None. -- components: 2to3 (2.x to 3.0 conversion tool) messages: 118410 nosy: hfuru priority: normal severity: normal status: open title: 2to3 crash in fix_urllib.py versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
New submission from Hallvard B Furuseth h.b.furus...@usit.uio.no: It would be nice with some official way to tell 2to3, Leave this code chunk alone. This is 2.* code, that is 3.* code: try: # Python 2.6 from urlparse import urlparse, urlunparse except ImportError: # Python 3 from urllib.parse import urlparse, urlunparse Could 2to3 without -p notice more cases of print(single argument), to avoid slapping another () around them? For example: print(2*3) print(, .join(dir)) -- components: 2to3 (2.x to 3.0 conversion tool) messages: 118411 nosy: hfuru priority: normal severity: normal status: open title: 2to3 wishes for already-2to3'ed files type: feature request versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10068] global objects created in some module are not destroyed when last reference to that module is released
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This also reproduces in 2.7. 2.6 and 2.7 have a different behaviour. -- nosy: +amaury.forgeotdarc versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10069] 2to3 crash in fix_urllib.py
Changes by Hallvard B Furuseth h.b.furus...@usit.uio.no: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Currently, PC/winreg.c releases GIL while calling registry API, but I found this in Remarks section of RegEnumValue. http://msdn.microsoft.com/en-us/library/ms724865%28VS.85%29.aspx While using RegEnumValue, an application should not call any registry functions that might change the key being queried. Maybe we shouldn't release GIL in PC/winreg.c? Thank you. # I sometimes experienced crash of test_changing_value(test_winreg) # on release27-maint. It happens when 2 threads calls PyEnumValue and # PySetValue simultaneously. And I could stop it by following patch. # I'll attach the stack trace of crash. Index: PC/_winreg.c === --- PC/_winreg.c(revision 85344) +++ PC/_winreg.c(working copy) @@ -1219,7 +1219,6 @@ } while (1) { -Py_BEGIN_ALLOW_THREADS rc = RegEnumValue(hKey, index, retValueBuf, @@ -1228,7 +1227,6 @@ typ, (BYTE *)retDataBuf, retDataSize); -Py_END_ALLOW_THREADS if (rc != ERROR_MORE_DATA) break; @@ -1577,9 +1575,7 @@ if (subKey == NULL) return NULL; } -Py_BEGIN_ALLOW_THREADS rc = RegSetValue(hKey, subKey, REG_SZ, str, len+1); -Py_END_ALLOW_THREADS if (rc != ERROR_SUCCESS) return PyErr_SetFromWindowsErrWithFunction(rc, RegSetValue); Py_INCREF(Py_None); -- components: Extension Modules files: py27_test_winreg_crash_stack_trace.txt messages: 118413 nosy: ocean-city priority: normal severity: normal status: open title: Should not release GIL while running RegEnumValue versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file19198/py27_test_winreg_crash_stack_trace.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: -- Removed message: http://bugs.python.org/msg118413 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Currently, PC/winreg.c releases GIL while calling registry API, but I found this in Remarks section of RegEnumValue. http://msdn.microsoft.com/en-us/library/ms724865%28VS.85%29.aspx While using RegEnumValue, an application should not call any registry functions that might change the key being queried. Maybe we shouldn't release GIL in PC/winreg.c? Thank you. # I sometimes experienced crash of test_changing_value(test_winreg) # on release27-maint. It happens when 2 threads calls PyEnumValue and # PySetValue simultaneously. And I could stop it by following patch. # I'll attach the stack trace of crash. Index: PC/_winreg.c === --- PC/_winreg.c(revision 85344) +++ PC/_winreg.c(working copy) @@ -1219,7 +1219,6 @@ } while (1) { -Py_BEGIN_ALLOW_THREADS rc = RegEnumValue(hKey, index, retValueBuf, @@ -1228,7 +1227,6 @@ typ, (BYTE *)retDataBuf, retDataSize); -Py_END_ALLOW_THREADS if (rc != ERROR_MORE_DATA) break; @@ -1577,9 +1575,7 @@ if (subKey == NULL) return NULL; } -Py_BEGIN_ALLOW_THREADS rc = RegSetValue(hKey, subKey, REG_SZ, str, len+1); -Py_END_ALLOW_THREADS if (rc != ERROR_SUCCESS) return PyErr_SetFromWindowsErrWithFunction(rc, RegSetValue); Py_INCREF(Py_None); -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis mar...@v.loewis.de added the comment: I don't understand. If the code is already Python 3 code, why are you running 2to3 on it? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Removed file: http://bugs.python.org/file19198/py27_test_winreg_crash_stack_trace.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: -- Removed message: http://bugs.python.org/msg118414 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10071] Should not release GIL while running RegEnumValue
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Currently, PC/winreg.c releases GIL while calling registry API, but I found this in Remarks section of RegEnumValue. http://msdn.microsoft.com/en-us/library/ms724865%28VS.85%29.aspx While using RegEnumValue, an application should not call any registry functions that might change the key being queried. Maybe we shouldn't release GIL in PC/winreg.c? Thank you. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10069] 2to3 crash in fix_urllib.py
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +benjamin.peterson type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Hallvard B Furuseth h.b.furus...@usit.uio.no added the comment: Martin v. Löwis writes: Martin v. Löwis mar...@v.loewis.de added the comment: I don't understand. If the code is already Python 3 code, why are you running 2to3 on it? I should have clarified - it's still Python 2 code (maybe 2.7), moving one step at a time towards something which will work on Python 3 as well. Or it's just that I'm handling one issue which 2to3 reports at a time, like modifying str vs bytes vs unicode usage, then I come back and look at another thing 2to3 has to say. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10068] global objects created in some module are not destroyed when last reference to that module is released
Antoine Pitrou pit...@free.fr added the comment: Probably issue7140, which will disable clearing of the module dict if it's caught in a reference cycle (which it is here, since A.__init__ and A.__del__ will reference it as their globals dict). -- nosy: +benjamin.peterson, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis mar...@v.loewis.de added the comment: I still don't understand. If it's 2.x code, why do you want to say that it is 3.x code? If you don't want to run a specific fixer, you can exclude it from the list of fixers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10030] Patch for zip decryption speedup
Antoine Pitrou pit...@free.fr added the comment: Hello, Some quick comments: - the C module should be private and therefore called _zipdecrypt - if you want to avoid API mismatch, you could give a tp_call to your C decrypter object, rather than a decrypt method - you can put all initialization code in zipdecrypt_new and avoid the need for zipdecrypt_init - it's better to use the y* code in PyArg_ParseTuple, rather than s# - you should define your module as PY_SSIZE_T_CLEAN and use Py_ssize_t as length variables (rather than int) - you *mustn't* change the contents of the buffer which is given you by s# or y*, since that buffer is read-only (it can be a bytes object); instead, create a new bytes object using PyBytes_FromStringAndSize(NULL, length) and write into that; or, if you want a read-write buffer, use the w* code -- nosy: +pitrou stage: - patch review versions: +Python 3.2 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10030 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8611] Python3 doesn't support locale different than utf8 and an non-ASCII path (POSIX)
Changes by Georg Brandl ge...@python.org: -- priority: deferred blocker - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8611 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8746] os.chflags() and os.lchflags() are not built when they should be be
Changes by Georg Brandl ge...@python.org: -- priority: deferred blocker - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8746 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Hallvard B Furuseth h.b.furus...@usit.uio.no added the comment: Martin v. Löwis writes: I still don't understand. If it's 2.x code, why do you want to say that it is 3.x code? It works on Python 2. It runs on Python 3 - maybe correctly, or maybe it's not that far along yet. Maybe some files in a package work on Python 3, and others have not yet been updated. If you don't want to run a specific fixer, you can exclude it from the list of fixers. I know. So this request is mostly for convenience, but then so is 2to3 in the first place. print(single argument) would be nice to leave alone in any case though, since there can be other reasons for the (). E.g.: print(very long single argument) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4758] Python 3.x internet documentation needs work
Rafe H. Kettler rafe.kett...@gmail.com added the comment: Thanks Eric, I think you're right. I'll do that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4758 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
New submission from Rafe H. Kettler rafe.kett...@gmail.com: I think that the documentation for ftplib is a bit too concise and assumes that the reader in an expert in the protocol when the point of the module is to abstract out such details. For example, for the error documentation, the exceptions are only explained by the error code the server can return to trigger them. So, while the explanation of error_perm, for example, should say something about permissions, it just says raised when an error code in the range 500–599 is received. This is particularly unclear for those with no knowledge of the internals of the protocol. Also, in the documentation for RetrLines(), the documentation mentions the options LIST, NLST, and MLSD without explaining what they are. I know that when I first started using ftplib I had to experiment with each option to determine what they do, and I think it would be better if this was clear in the docs from the start. This can become particularly unclear for less FTP-savvy users. I can propose a patch to the documentation if needed. -- assignee: d...@python components: Documentation messages: 118423 nosy: Rafe.H..Kettler, d...@python, orsenthil priority: normal severity: normal status: open title: ftplib documentation is unclear type: feature request versions: Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
New submission from AM Helin shadi...@gmail.com: calendar.isleap() doesn't enforce any types, leading to string formatting errors when a string is passed to it: calendar.isleap(2011) Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/calendar.py, line 99, in isleap return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) TypeError: not all arguments converted during string formatting A quick peek at the SVN shows that the problem still exists. -- components: Library (Lib) messages: 118424 nosy: shadikka priority: normal severity: normal status: open title: calendar.isleap() not checking parameter type versions: Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Changes by AM Helin shadi...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis mar...@v.loewis.de added the comment: Maybe we need to tackle this from a different angle: can you please specify the feature you are asking for exactly, with any syntax, API, or command line changes that you consider necessary? Omitting redundant parentheses for print is a separate issue (feel free to open an issue); we should not mix it with this issue (which I still don't understand). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
R. David Murray rdmur...@bitdance.com added the comment: In Python we often don't type check, we just let errors happen. It is true that it would make the problem clearer to do a type check and issue a specific error message, but I don't know if it is worth it. (The error would already have been clear if it weren't for the fact that % is the string formatting operator...) -- nosy: +r.david.murray versions: +Python 3.1, Python 3.2 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Hallvard B Furuseth h.b.furus...@usit.uio.no added the comment: Maybe we need to tackle this from a different angle: can you please specify the feature you are asking for exactly, with any syntax, API, or command line changes that you consider necessary? First, nothing here is necessary, since it's just a request for a convenience. The syntax could be a generalization of the example I gave: whatever: # Python version indented block and whatever: # Python version indented block tell 2to3 The code in block it is expected to only run (or succeed) in Python version. Do not modify it, except it is an error if it is a syntax error under Python 3 so the script won't even run. 'whatever:' can be some if,else,try,except, I don't know what else, and is responsible for making different Python versions do the right thing. Omitting redundant parentheses for print is a separate issue (feel free to open an issue); we should not mix it with this issue (which I still don't understand). OK. But I don't understand what you don't understand... I have some Python 2 files in various stages of transition to be runnable and correct in Python 3, while still working in Python 2. It'd be convenient if the parts that do work under both Python 2 and 3 could be written so that 2to3 would be silent about them, without need for different 2to3 command line options for different .py files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1708] improvements for linecache
R. David Murray rdmur...@bitdance.com added the comment: I am indeed going to close this. The patch isn't complete, since there's the line ending issue Antoine pointed out, which implies that there are also some missing tests. I doubt that linecache performance is something that affects very many people, but if someday someone wants to pick this up and finish it, it sounds like there's no objection in principle to the change. -- nosy: +r.david.murray -BreamoreBoy resolution: - later stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1708 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Hallvard B Furuseth h.b.furus...@usit.uio.no added the comment: Another syntax could be attached to if-else and try-except. Given: if ...: block 1 else: block 2 or try: block 1 except ...: block 2 if 2to3 would translate block 1 to block 2 or vise versa, sans whitespace/comment differences, then it does not do so. Instead it assumes the blocks are for running under Python 2 and 3 respectively. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I agree with David on this one. In addition to the arguments already stated, the string value of an exception is not part of specification. The exception is still TypeError even if the message may be confusing. I also find that once read in the context of the backtrace, the error is clear enough. I am changing this to an RFE for now, but I think this should be closed as won't fix. -- assignee: - belopolsky type: behavior - feature request versions: -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6322] Pdb breakpoints don't work on lines without bytecode
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +georg.brandl -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
Éric Araujo mer...@netwok.org added the comment: file: URIs provoking FTP access seem wrong to me. Are there widely-used tools displaying this behavior? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
R. David Murray rdmur...@bitdance.com added the comment: I doubt it. As Senthil says, file invoking ftp it is a bug. I'm just betting that *someone* is going to complain when it stops working in their particular situation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
Éric Araujo mer...@netwok.org added the comment: Ah, I thought this was not a bug, because of “RFC 1738, says that host, if present should be the FQDN of the machine”. If it’s a bug I’m all for fixing it in all three versions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10066] xmlrpclib does not handle some non-printable characters properly
Éric Araujo mer...@netwok.org added the comment: Thanks for the report. Unfortunately, 2.6 only gets security fixes, not general bug fixes; can you tell if this applies to 2.7, 3.1 and 3.2? If you have a small script that displays the problem, please attach it. -- nosy: +eric.araujo, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10066 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10069] 2to3 crash in fix_urllib.py
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Changes by Éric Araujo mer...@netwok.org: -- nosy: +benjamin.peterson, eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Éric Araujo mer...@netwok.org added the comment: How about this phrasing: “Make 2to3 fixers not touch code in a block starting with ’if sys.version = '3'’“ (and hexversion, version_info, you get the idea)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10039] python é.py fails with UnicodeEncodeErr or if PYTHONFSENCODING is used
Éric Araujo mer...@netwok.org added the comment: I don’t understand why reading a filename would not respect the envvar stating the filesystem encoding. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10042] total_ordering stack overflow
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10042 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Giampaolo Rodola' g.rod...@gmail.com added the comment: A patch would be great. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8106] SSL session management
Antoine Pitrou pit...@free.fr added the comment: http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html suggests that SSL session caching already occurs by default in server mode: “SSL_SESS_CACHE_SERVER Server sessions are added to the session cache. When a client proposes a session to be reused, the server looks for the corresponding session in (first) the internal session cache (unless SSL_SESS_CACHE_NO_INTERNAL_LOOKUP is set), then (second) in the external cache if available. If the session is found, the server will try to reuse the session. This is the default.” A nice and easy thing to do would be to export the statistics given by http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html# . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8106 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10066] xmlrpclib does not handle some non-printable characters properly
Martin v. Löwis mar...@v.loewis.de added the comment: The patch is incorrect. Even though this may let get these characters through, the other end will have no clue that \x is meant as an escape. Please face the ugly truth: XML (and hence XML-RPC) just does not support these characters, see http://www.w3.org/TR/REC-xml/#NT-Char This is fixed slightly in XML 1.1 (which allows to refer to these characters by character reference), however, XML 1.1 is not used for XML-RPC, so this is not an option. I'm closing this as won't fix. If there is interest in doing something about it, I could accept a patch that rejects non-Char characters with an exception, instead of sending ill-formed XML. I'd recommend to use a regular expression for that. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10066 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10067] itertools' docs put izip_longest in the terminating on the shortest input sequence section
Changes by Éric Araujo mer...@netwok.org: -- nosy: +rhettinger versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
Antoine Pitrou pit...@free.fr added the comment: I'd say disable hostnames in file:// URIs altogether. There's no practical reason for forcing a hostname in there, and trying to check that it matches the local host's FQDN sounds like a distraction. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
Antoine Pitrou pit...@free.fr added the comment: (by disable I meant disallow, sorry) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
R. David Murray rdmur...@bitdance.com added the comment: Éric: WellI suppose that depends on how you look at it. The RFC says that 'file:' does not specify a network protocol, and so it's utility in network protocols between hosts is limited. So, technically an implementation that decides to handle 'file://fqdn' by using ftp isn't *wrong*, but it certainly isn't something that someone writing a 'file:' uri should expect to work. I agree with Senthil, I am -1 on backporting this to earlier versions because of the potential for breaking working applications (even though those applications shouldn't really be working :) Antoine: except that the RFC allows FQDNs in 'file:' URIs. So I don't think we can just reject them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis mar...@v.loewis.de added the comment: How about this phrasing: “Make 2to3 fixers not touch code in a block starting with ’if sys.version = '3'’“ (and hexversion, version_info, you get the idea)? I don't think this can work. You may have to write code like if sys.version_info = (3,): try: some_code() except Exception, e: pass (i.e. not use the as syntax), because it otherwise won't parse on Python 2. Hence, one has to rely on 2to3 fixing it, even though it will never be run on Python 2. So any scheme of skipping code must be opt-in. While I now understand what is being requested, I still fail to see the rationale. In my applications of 2to3, I never look at the generated code, so it doesn't bother me at all if print gets another pairs of brackets, or if redundant (but dead) import statements are inserted. In fact, I also avoid writing code explicitly so that it works unmodified on Python 3 if I know that 2to3 will fix it. There has been a long-standing request to suppress 2to3 in certain expressions in cases where the 2to3 conversion would actually be incorrect. However, this does not seem to be the motivation here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10039] python é.py fails with UnicodeEncodeErr or if PYTHONFSENCODING is used
R. David Murray rdmur...@bitdance.com added the comment: Éric, if you are saying, the user asked for it, it *should* fail, then that is indeed one of the arguments put forward in issue 9992 where this was discussed. But I think the emerging consensus is that it is better to just avoid the problem by always using the locale on Unix, and solve the problem that PYTHONFSENCODING was supposed to solve in a different way (by always using utf-8 on OSX and unicode on Windows). -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10039] python é.py fails with UnicodeEncodeErr or if PYTHONFSENCODING is used
Éric Araujo mer...@netwok.org added the comment: if you are saying, the user asked for it, it *should* fail, then that is indeed one of the arguments put forward in issue 9992 where this was discussed. You could put it that way, thanks for phrasing my thoughts :) But I think the emerging consensus is that it is better to just avoid the problem by always using the locale on Unix, *displays his lack of knowledge* Is it always correct to decode a filename with the locale encoding on Unix? Can’t each filesystem have its own encoding? and solve the problem that PYTHONFSENCODING was supposed to solve in a different way (by always using utf-8 on OSX and unicode on Windows). If there is a better alternate way, let’s go for it, and maybe remove PYTHONFSENCODING altogether, since it’s new in 3.2. Thanks for explaining! I’ll repay your time by reviewing the doc patches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
Éric Araujo mer...@netwok.org added the comment: With this explanation, I agree with Senthil’s plan too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10063] file:// scheme will stop accessing via ftp protocol
R. David Murray rdmur...@bitdance.com added the comment: I think the error message should be changed from 'allowed' to 'supported', though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10063 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10049] Add a no-op (null) context manager to contextlib
Giampaolo Rodola' g.rod...@gmail.com added the comment: I'm with Antoine. Why not just do this in the context function itself? I think it's more explicit and easier than reading the doc to figure out what nullcontext is supposed to do: from contextlib import contextmanager CONDITION = False @contextmanager def transaction(): if not CONDITION: yield None else: yield ... with transaction() as x: ... -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10074] dictobject.c: crash in Py_XDECREF
New submission from Sridhar Ratnakumar sridh...@activestate.com: I noticed that Python 2.6.6 crashes on OSX 10.6 when using Komodo. The below traceback indicates a crash in line 911 - Py_XDECREF(ep-me_value); in tags/r266/Objects/dictobject.c Thread 0: Dispatch queue: com.apple.main-thread 0 org.activestate.ActivePython26 0x129a3716 dict_dealloc + 82 (dictobject.c:911) 1 org.activestate.ActivePython26 0x12976ed1 instance_dealloc + 437 (classobject.c:669) 2 org.activestate.ActivePython26 0x129a3752 dict_dealloc + 142 (dictobject.c:907) 3 org.activestate.ActivePython26 0x129bfcdd subtype_dealloc + 884 (typeobject.c:1004) 4 org.activestate.ActivePython26 0x12994f96 list_dealloc + 212 (listobject.c:306) 5 org.activestate.ActivePython26 0x129a2f81 insertdict + 122 (dictobject.c:459) 6 org.activestate.ActivePython26 0x129a33d9 PyDict_SetItem + 92 (dictobject.c:701) 7 org.activestate.ActivePython26 0x129a8f2e PyObject_GenericSetAttr + 262 (object.c:1504) 8 org.activestate.ActivePython26 0x129a7c2b PyObject_SetAttr + 135 (object.c:1252) 9 org.activestate.ActivePython26 0x12a08132 PyEval_EvalFrameEx + 8529 (ceval.c:1864) 10 org.activestate.ActivePython26 0x12a0bcaa PyEval_EvalFrameEx + 23753 (ceval.c:3836) 11 org.activestate.ActivePython26 0x12a0bcaa PyEval_EvalFrameEx + 23753 (ceval.c:3836) 12 org.activestate.ActivePython26 0x12a0cbca PyEval_EvalCodeEx + 1973 (ceval.c:3000) 13 org.activestate.ActivePython26 0x12990d81 function_call + 162 (funcobject.c:524) 14 org.activestate.ActivePython26 0x12963b46 PyObject_Call + 77 (abstract.c:2492) 15 org.activestate.ActivePython26 0x12a08f3b PyEval_EvalFrameEx + 12122 (ceval.c:4063) 16 org.activestate.ActivePython26 0x12a0cbca PyEval_EvalCodeEx + 1973 (ceval.c:3000) 17 org.activestate.ActivePython26 0x12990d81 function_call + 162 (funcobject.c:524) 18 org.activestate.ActivePython26 0x12963b46 PyObject_Call + 77 (abstract.c:2492) 19 org.activestate.ActivePython26 0x12974615 instancemethod_call + 401 (classobject.c:2579) 20 org.activestate.ActivePython26 0x12963b46 PyObject_Call + 77 (abstract.c:2492) 21 org.activestate.ActivePython26 0x12968e47 PyObject_CallMethod + 154 (abstract.c:2524) 22 libpyxpcom.dylib0x0078cdde PyXPCOM_XPTStub::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) + 242 Even though the traceback is for ActivePython (that Komodo includes), this seems to happen with the official Python binaries as well: http://www.gossamer-threads.com/lists/python/python/844086 -- assignee: ronaldoussoren components: Interpreter Core, Macintosh messages: 118449 nosy: ronaldoussoren, srid priority: normal severity: normal status: open title: dictobject.c: crash in Py_XDECREF type: crash versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10074 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10049] Add a no-op (null) context manager to contextlib
R. David Murray rdmur...@bitdance.com added the comment: Because hardcoding a particular condition into a context manager is less flexible? (I'm +0 on this thing myself, by the way.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9003] urllib.request and http.client should allow certificate checking
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file19189/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9003 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10074] dictobject.c: crash in Py_XDECREF
Ronald Oussoren ronaldousso...@mac.com added the comment: It is not impossible that this is a bug in python, but IMHO pretty unlikely, it is way more likely to be a bug in a 3th-party extension. BTW. This issue is very likely to languish unless you add a way to reproduce the issue (and preferably without Komodo). If you do have a reliable way to reproduce the issue you could try using a debug build of python (--with-pydebug) to gather more information. -- assignee: ronaldoussoren - nobody nosy: +nobody ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10074 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10067] itertools' docs put izip_longest in the terminating on the shortest input sequence section
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I saw that when I put in in. It doesn't fit the overall category but it does belong in the same general grouping and the notes make the semantics clear, so there is no harm in it and I like the current presentation better than the alternatives. -- resolution: - wont fix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10067] itertools' docs put izip_longest in the terminating on the shortest input sequence section
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10049] Add a no-op (null) context manager to contextlib
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Are you sure that this is useful enough to warrant inclusion in the standard lib? I don't know of anyone else who has used the same idiom. It seems crufty to me -- something that adds weight (mental burden and maintenance effort) without adding much value. I don't know that anyone actually needs this. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Hallvard B Furuseth h.b.furus...@usit.uio.no added the comment: [I got failed issue tracker submission, trying again...] How about this phrasing: “Make 2to3 fixers not touch code in a block starting with ’if sys.version = '3'’“ (and hexversion, version_info, you get the idea)? Right, almost... it doesn't need to be flexible, it only needs to be documented for 2to3. So it also doesn't need to handle the varions version variables - if e.g. version_info is easiest for 2to3, it need only handle that. I've been posting with routine avoidance of testing versions instead of features (learned from javascript frustration:-) but that concern was misplaced here. But it should be if sys.version {either or =} '3':, and it should not touch the else: block either. Just trust that the programmer has written correct version's code for each block, and parse one of the blocks to pick up whatever info 2to3 needs to process the rest of the python file. So... I don't think this can work. You may have to write code like if sys.version_info = (3,): try: some_code() except Exception, e: pass (i.e. not use the as syntax), because it otherwise won't parse on Python 2. Hence, one has to rely on 2to3 fixing it, even though it will never be run on Python 2. I assume it should be if sys.version_info (3,): since that looks like Python 2 code, and that'll work with the above revised suggestion. So any scheme of skipping code must be opt-in. Fair enough, if it's a 2to3 option which to obey whatever skip some code hack is defined. That's the same 2to3 command line for a lot of files, instead of different commmand lines for different files. Unless we're still talking past each other - if the example code will never run on Python 2 as you say, there's no reason not to fix syntax problems like the above. It's fixing things like bytes vs str which takes more thought. While I now understand what is being requested, I still fail to see the rationale. In my applications of 2to3, I never look at the generated code, so it doesn't bother me at all if print gets another pairs of brackets, or if redundant (but dead) import statements are inserted. Wow. We live in different mental worlds. It would not have occurred to me to take the 2to3 output as more than helpful suggestions. Some to be applied straight (like 'except' syntax), other to maybe apply but also look closer at nearby code. Indeed, one of my early 2to3 experiences led to a bug in python 3 code which I'm now discussing in comp.lang.python. Also my internal bug detector zooms in on ((foo)) when I read Python code - I'm seeing code where something was apparently left out, maybe an inner comma to make it a tuple. -- Hallvard -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10075] Get session cache stats from SSLContext
New submission from Antoine Pitrou pit...@free.fr: This patch adds a method to query the session cache statistics from an SSL context. See http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html# for more info. -- components: Library (Lib) files: sslstats.patch keywords: patch messages: 118455 nosy: giampaolo.rodola, janssen, jcea, pitrou priority: normal severity: normal stage: patch review status: open title: Get session cache stats from SSLContext type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file19199/sslstats.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10075 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10074] dictobject.c: crash in Py_XDECREF
Ned Deily n...@acm.org added the comment: And what is libpyxpcom.dylib? As Ronald says, this is almost certainly a 3rd-party extension module problem. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10074 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module
Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment: Made an attempt to port lekma's patch to py3k-trunk. No (logical) changes needed. Don't know about accept4() issue. As I saw in Qt sources, they ifdef'ed CLOEXEC by default on file descriptors. Don't think it's acceptable :) in this particular case. So, @Antoine, what do you say? -- nosy: +nvetoshkin Added file: http://bugs.python.org/file19200/issue7523_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7523 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I would also like to note the following curiosity: calendar.isleap(%d) False I still don't think there is anything worth fixing here, but we can consider replacing year % 4 == 0 predicate with year 3 == 0 which will change the error raised by isleap(2004) from TypeError: not all arguments converted during string formatting to TypeError: unsupported operand type(s) for : 'str' and 'int' I am not sure if the later is much clearer than the former once you consider obfuscated year 3 == 0 showing up in the backtrace compared to a clear year % 4 == 0 test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Rafe Kettler rafe.kett...@gmail.com added the comment: I've drafted up a patch. For those of you who don't want to read the diff, it changes all references to FTP reply codes with short explanations of what they do. Also, in the docs for retrlines() and nlst() the commands LIST, NLST, and MLSD are explained. Attached is the patch. -- Added file: http://bugs.python.org/file19201/ftplib-patch.rst ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Changes by Rafe Kettler rafe.kett...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file19202/ftplib-patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Changes by Rafe Kettler rafe.kett...@gmail.com: Removed file: http://bugs.python.org/file19201/ftplib-patch.rst ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Changes by Rafe Kettler rafe.kett...@gmail.com: Added file: http://bugs.python.org/file19203/ftplib-patch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Éric Araujo mer...@netwok.org added the comment: Looks good to me. Before committing, spaces after full stops should be doubled. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Éric Araujo mer...@netwok.org added the comment: I’d be in favor of type checking here, but I know I’m in the minority. I’m very much not in favor of making code less readable (“ 3”). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Changes by Rafe Kettler rafe.kett...@gmail.com: Removed file: http://bugs.python.org/file19203/ftplib-patch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10072] ftplib documentation is unclear
Rafe Kettler rafe.kett...@gmail.com added the comment: Double spaced after the sentence ending periods. -- Added file: http://bugs.python.org/file19204/ftplib-patch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module
Antoine Pitrou pit...@free.fr added the comment: The accept() issue is the following: the socket created by accept() (in Lib/socket.py) will formally inherit its parent's `type` attribute (including any SOCK_NONBLOCK and SOCK_CLOEXEC flags). However, the underlying Linux socket is created by the accept() system call, which doesn't inherit flags as mentioned in the aforementioned man page. Therefore, the Python socket gives the wrong information about the socket's real flags. This can be witnessed quickly: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM | socket.SOCK_CLOEXEC) s.bind((, 0)) s.getsockname() ('0.0.0.0', 34634) s.listen(5) c, a = s.accept() # Here, just start a telnet or nc session from another term import fcntl fcntl.fcntl(s, fcntl.F_GETFD) 1 fcntl.fcntl(c, fcntl.F_GETFD) 0 fcntl.fcntl(c, fcntl.F_GETFD) fcntl.FD_CLOEXEC 0 c.type socket.SOCK_CLOEXEC 524288 The quick solution would be to mask out these flags when creating the Python socket in accept(). A better solution might be to inherit these flags by using the accept4() system call when possible (this is useful especially for SOCK_CLOEXEC, of course). Apart from that, the patch looks ok, but it would be nice to test that at least the underlying socket is really in non-blocking mode, like is done in NonBlockingTCPTests.testSetBlocking. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7523 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
shadikka shadi...@gmail.com added the comment: To clarify my original point, I'm for making an explicit error message for that, definitely not for any silent failure or automatic string conversion. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10075] Get session cache stats from SSLContext
Antoine Pitrou pit...@free.fr added the comment: I've renamed the method to session_stats() and commited the patch in r85383. -- resolution: - fixed stage: patch review - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10075 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10075] Get session cache stats from SSLContext
Changes by Antoine Pitrou pit...@free.fr: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10075 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return
Antoine Pitrou pit...@free.fr added the comment: The proposed test case doesn't test a lot, IMHO. It would be better if it sent binary from one end and received unicode on the other end, or vice-versa (with explicit encoding and errors, preferably). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10041 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10073] calendar.isleap() not checking parameter type
Philip Jenvey pjen...@underboss.org added the comment: Another option is to wrap the operations in a try/except. When a TypeError is raised have it throw a new TypeError with an improved error message and the original chained to it -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis mar...@v.loewis.de added the comment: I don't think this can work. You may have to write code like if sys.version_info = (3,): try: some_code() except Exception, e: pass (i.e. not use the as syntax), because it otherwise won't parse on Python 2. Hence, one has to rely on 2to3 fixing it, even though it will never be run on Python 2. I assume it should be if sys.version_info (3,): since that looks like Python 2 code, and that'll work with the above revised suggestion. No, I meant this as stated. Suppose you would write (as you apparently expected me to) if sys.version_info = (3,): try: some_code() except Exception as e: pass then the entire module (and not just this if-block) will fail to import in Python 2. Therefore, you must not use syntax that is exclusively Python 3 in an if-python3 block if you want to continue to use the code in Python 2 (and if you don't want to use the code in Python 2, you don't need the if block). Then you run the code (as I originally posted) through 2to3, and out you get the block that will then get executed in Python 3. Therefore, it is necessary to convert the code that is meant for Python 3 with 2to3 still. While I now understand what is being requested, I still fail to see the rationale. In my applications of 2to3, I never look at the generated code, so it doesn't bother me at all if print gets another pairs of brackets, or if redundant (but dead) import statements are inserted. Wow. We live in different mental worlds. It would not have occurred to me to take the 2to3 output as more than helpful suggestions. Some to be applied straight (like 'except' syntax), other to maybe apply but also look closer at nearby code. So please reconsider. Using that approach will allow you to have a single source code for Python 2 and Python 3. You write it so that it works fine on Python 2, and let 2to3 generate the Python 3 version, which you then run unmodified. For that to work, it's important that any modifications that 2to3 won't do will be done *before* invoking 2to3, and these modifications must therefore then work with Python 2 as well (albeit possibly in a block that is never executed on Python 2). If, at some point, you are then ready to burn the bridges (i.e. give up Python 2 support), you run 2to3 once, and start removing all ugliness that you had collected during the transition phase. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10076] Regex objects became uncopyable in 2.5
New submission from Michael Shields mshie...@google.com: For many years now, the sre module has provided __copy__ and __deepcopy__ modules that raise an exception (cannot copy this pattern object) by default, with an #ifdef to enable their implementations. Until Python 2.5, these were simply unused. Since then, deepcopying these objects fails, instead of falling back to the default implementation. Python 2.4.6 (#1, Nov 23 2009, 03:28:22) [GCC 4.2.2] on linux2 Type help, copyright, credits or license for more information. import re x = [re.compile('.*')] import copy copy.deepcopy(x) [_sre.SRE_Pattern object at 0x7f3e9411e168] Python 2.6.2 (r262:71600, Jul 24 2009, 17:29:21) [GCC 4.2.2] on linux2 Type help, copyright, credits or license for more information. import re x = [re.compile('.*')] import copy copy.deepcopy(x) Traceback (most recent call last): File stdin, line 1, in module File /usr/grte/v1/k8-linux/lib/python2.6/copy.py, line 162, in deepcopy y = copier(x, memo) File /usr/grte/v1/k8-linux/lib/python2.6/copy.py, line 228, in _deepcopy_list y.append(deepcopy(a, memo)) File /usr/grte/v1/k8-linux/lib/python2.6/copy.py, line 173, in deepcopy y = copier(memo) TypeError: cannot deepcopy this pattern object I'll attach a patch against 2.7 to correct this. -- components: Library (Lib) messages: 118469 nosy: Michael.Shields priority: normal severity: normal status: open title: Regex objects became uncopyable in 2.5 type: behavior versions: Python 2.5, Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10076 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10076] Regex objects became uncopyable in 2.5
Michael Shields mshie...@google.com added the comment: Here's the patch. I updated the test case and release notes also. I'm a Google employee, so this patch is covered by whatever usual copyright arrangement we have with the PSF. -- keywords: +patch Added file: http://bugs.python.org/file19205/copy-pattern.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10076 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module
Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment: Thanks! I can see the problem now, but I think checking should be done like this: fcntl.fcntl(c, fcntl.F_GETFD) fcntl.FD_CLOEXEC 0 fcntl.fcntl(s, fcntl.F_GETFD) fcntl.FD_CLOEXEC 1 and with accept4() call I've got flag set: fcntl.fcntl(c, fcntl.F_GETFD) fcntl.FD_CLOEXEC 1 fcntl.fcntl(s, fcntl.F_GETFD) fcntl.FD_CLOEXEC 1 Don't know how to properly check if accept4 is available. Second attempt - dropping flags from sock_type should be done on Python level in socket.py and I don't quite like idea to check if SOCK_CLOEXEC is in locals every time. -- Added file: http://bugs.python.org/file19206/issue7523_py3k_accept4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7523 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3873] Unpickling is really slow
Antoine Pitrou pit...@free.fr added the comment: Patch committed in r85384. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3873 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module
Antoine Pitrou pit...@free.fr added the comment: You can check accept4() presence by adding it to the AC_CHECK_FUNCS macro in configure.in around line 2553, and add the corresponding HAVE_ACCEPT4 lines in pyconfig.h.in. Then run autoconf and you will have access to a HAVE_ACCEPT4 constant when accept4() exists. By the way, you shouldn't use C++-style comments (// ...), because some C compilers refuse them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7523 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10068] global objects created in some module are not destroyed when last reference to that module is released
Benjamin Peterson benja...@python.org added the comment: Tricky. I think the only way to do this properly is to call _PyModule_Clear when the dict is destroyed. However, there's no good way to flag a dictionary as a module dict. Therefore, I propose we remove the Py_REFCNT == 1 guard in module_dealloc, and simply leave as an open bug that modules will clear their dictionaries on deallocation. Thoughts? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10068] global objects created in some module are not destroyed when last reference to that module is released
Antoine Pitrou pit...@free.fr added the comment: Therefore, I propose we remove the Py_REFCNT == 1 guard in module_dealloc, and simply leave as an open bug that modules will clear their dictionaries on deallocation. Yes, I think it's the best solution. People can easily copy the dict if they want to keep it around after the module gets destroyed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10074] dictobject.c: crash in Py_XDECREF
Sridhar Ratnakumar sridh...@activestate.com added the comment: On 2010-10-12, at 11:49 AM, Ned Deily wrote: And what is libpyxpcom.dylib? Likely PyXPCOM https://developer.mozilla.org/en/PyXPCOM As Ronald says, this is almost certainly a 3rd-party extension module problem. Ok, I've made a note for Todd (current developer for PyXPCOM) here, http://bugs.activestate.com/show_bug.cgi?id=88165#c5 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10074 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10074] dictobject.c: crash in Py_XDECREF
Changes by Sridhar Ratnakumar sridh...@activestate.com: -- nosy: +toddw ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10074 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10069] 2to3 crash in fix_urllib.py
Benjamin Peterson benja...@python.org added the comment: r85388. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10077] Python 3.1: site error is not logged
New submission from STINNER Victor victor.stin...@haypocalc.com: If the site module fails, the error is not logged because of a bug in initsite(). The problem is that PyFile_WriteString() does nothing if an error occurred. - Edit Lib/site.py to add raise Exception('xxx') at the beginning of main() - Run ./python - (no error is logged) In verbose mode, only the exception is logged, without the first line: 'import site' failed; traceback: Attached patch fixes both issues. -- This issue is specific to Python 3.1: - Python 2.7 and 3.2 consider site error as a fatal error - Python 2.6 doesn't have the bug because PyFile_WriteString() write the message even if an error occurred -- components: Library (Lib) files: site_error.patch keywords: patch messages: 118478 nosy: haypo priority: normal severity: normal status: open title: Python 3.1: site error is not logged versions: Python 3.1 Added file: http://bugs.python.org/file19207/site_error.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10077 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com