[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread oopos
New submission from oopos myoo...@gmail.com: Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32 - Hi,I user Python! UnicodeDecodeError Python 3.0: G:\cgi\python\python.exe Thu Jan 15 16:46:34 2009 A problem

[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Does it work if you change your script like this: opsform = cgi.FieldStorage(open(sys.stdin.fileno(), 'rb')) -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread oopos
oopos myoo...@gmail.com added the comment: To Amaury Forgeot d'Arc : Thank you. That error have sloved with your way: [quote]Does it work if you change your script like this: opsform = cgi.FieldStorage(open(sys.stdin.fileno(), 'rb'))[/quote] Now,The new problem come out: [code] 97

[issue4242] Classify language vs. impl-detail tests, step 1

2009-01-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The patch looks nice to me. (I'm curious why you call gc.collect() several times in a row, though) However, since it is an important change in the long run, perhaps the specifics could be further discussed on python-dev before taking a decision?

[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: OK, another try. Please replace the previous version with these 3 lines: encoding = os.environ.get('HTTP_TRANSFER_ENCODING') stdin = open(sys.stdin.fileno(), 'r', encoding=encoding) opsform = cgi.FieldStorage(stdin)

[issue4928] Problem with tempfile.NamedTemporaryFile on Solaris 10

2009-01-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- priority: - high stage: - test needed versions: +Python 2.6, Python 2.7 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4928 ___

[issue4397] test_socket fails occassionaly in teardown: AssertionError: [Errno 57] Socket is not connected

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm. I take it back: this *does* appear to be OS X specific. I've attached a small (17-line) example that fails with the Errno 57 error on OS X, but passes on the Linux machines I tested. In this example, it appears that when 'conn.close()'

[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread oopos
oopos myoo...@gmail.com added the comment: Thank you for time. Now,I try with you saied.Bu it is taken wrong as before. See the files: Added file: http://bugs.python.org/file12753/full_source_and_error.zip ___ Python tracker rep...@bugs.python.org

[issue4397] test_socket fails occassionaly in teardown: AssertionError: [Errno 57] Socket is not connected

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Found a better (one-line) fix. Fixed in the trunk in r68611. Will port to 2.6, 3.0, 3.1. -- resolution: - fixed versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org

[issue4397] test_socket fails occassionaly in teardown: AssertionError: [Errno 57] Socket is not connected

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed in 2.6, 3.0, 3.1. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4397 ___

[issue4953] Cannot upload binary file from form ?

2009-01-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Thanks for the test case. I reproduced it easily. There is indeed a real problem in CGI streams. The first thing to do is to start python with the -u option (add it to the end of the first #! line), so that stdin yields bytes instead of

[issue4910] Remove uses of nb_long slot, and rename to nb_reserved.

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Benjamin! Checked in in r68553, backported to 3.0 in r68556. Here's the second patch, which fixes almost all remaining uses of nb_long but stops short of actually removing/renaming the nb_long slot. Notes: (1) I haven't tested the

[issue1530559] struct.pack raises TypeError where it used to convert

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Retargeting, now that 2.5 is in security-fix-only mode. Bob, can you clarify what *should* be happening in 2.6, 2.7, 3.0 and 3.1 for things like: struct.pack('L', 2009.1) struct.pack('L', Decimal('3.14')) ? It also seems that 'L' and 'Q

[issue4929] smptlib.py can raise socket.error

2009-01-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Submitted as r68618 -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4929 ___

[issue4927] Inconsistent unicode repr for fileobject

2009-01-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Just to clarify, Ascii files and unicode files will repr() as open file 'tmp\foo', mode 'wb' at ... open file u'tmp\\foo', mode 'wb' at ... respectively. In the former, the backslash isn't escaped, but in the latter it is. The

[issue1530559] struct.pack raises TypeError where it used to convert

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Some more strange results: Python 2.6.1+ (release26-maint:68613, Jan 15 2009, 15:19:54) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type help, copyright, credits or license for more information. from struct import pack from decimal

[issue4910] Remove uses of nb_long slot, and rename to nb_reserved.

2009-01-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: On Thu, Jan 15, 2009 at 10:48 AM, Mark Dickinson rep...@bugs.python.org wrote: Mark Dickinson dicki...@gmail.com added the comment: Thanks, Benjamin! Checked in in r68553, backported to 3.0 in r68556. Here's the second patch, which

[issue4842] int('3L') still valid in Python 3.0

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Does anyone have time to review these patches? I think the first is straightforward, and I'm reasonably sure of the correctness of the second patch. I'm less sure that it's the right thing to do. The question is what should happen when

[issue4860] js_output wrong for cookies with characters

2009-01-15 Thread Noufal
Noufal nou...@nibrahim.net.in added the comment: What's wrong with and ? I can see the issues with ; though. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4860 ___

[issue4927] Inconsistent unicode repr for fileobject

2009-01-15 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Any thoughts? I still hadn't time to reproduce the problem, so I still don't understand it. What specific failure (file and line number) occurs, and what specific strings get compared? test_file.py has 600 lines, and I can't guess which

[issue4930] Small optimization in type construction

2009-01-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Looks good to me. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4930 ___

[issue1700288] Armin's method cache optimization updated for Python 2.6

2009-01-15 Thread Collin Winter
Collin Winter coll...@gmail.com added the comment: Looks like this was re-applied in r59943 and r59944. Thanks for taking care of this, Amaury. -- nosy: +collinwinter, jyasskin resolution: accepted - fixed status: open - closed ___ Python tracker

[issue4910] Remove uses of nb_long slot, and rename to nb_reserved.

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I wonder if we should mark PyNumber_Long as deprecated in the docs, though. It would be nice to standardize on one of (PyNumber_Long, PyNumber_Int) and document the other as deprecated. Maybe it would make more sense to stick with

[issue1242657] list(obj) can swallow KeyboardInterrupt

2009-01-15 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Anyone else want to pick this up from here? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1242657 ___

[issue4860] js_output wrong for cookies with characters

2009-01-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: What's wrong with and ? c=Cookie.Cookie('Customer=/script;'); print c.js_output() script type=text/javascript !-- begin hiding document.cookie = Customer=/script; // end hiding -- /script

[issue3871] cross and native build of python for mingw32 with distutils

2009-01-15 Thread Luke Kenneth Casson Leighton
Changes by Luke Kenneth Casson Leighton l...@lkcl.net: -- nosy: +lkcl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3871 ___ ___ Python-bugs-list

[issue4954] native build of python win32 using msys under wine.

2009-01-15 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton l...@lkcl.net: this patch uses work from #3871 to get a build of python for win32 by running msys under Wine, the windows emulator, on linux. no proprietary operating system or proprietary software was used. /bin/sh.exe is so ing unbelievably

[issue4954] native build of python win32 using msys under wine.

2009-01-15 Thread Luke Kenneth Casson Leighton
Changes by Luke Kenneth Casson Leighton l...@lkcl.net: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4954 ___ ___

[issue4954] native build of python win32 using msys under wine.

2009-01-15 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Are you seriously requesting inclusion of the file f into Python? It contains many changes that are unsuitable for inclusion, such as the removal of graminit.c and the removal of configure. (besides, I personally think that the ability to

[issue4910] Remove uses of nb_long slot, and rename to nb_reserved.

2009-01-15 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Second patch applied in r68619 (py3k) and r68620 (3.0 maintenance branch). Here's the third and final patch: rename the nb_long slot to nb_reserved, and change its type to (void *). Added file:

[issue4927] Inconsistent unicode repr for fileobject

2009-01-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I thought I'd explained it in detail without having to invoke the testsuite. If TEMPFN is tm...@test you get the following failure: FAILED (failures=1) test test_file failed -- Traceback (most recent call last): File

[issue4955] inconsistent, perhaps incorrect, behavior with respect to entities parsed by xml.sax

2009-01-15 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone exar...@divmod.com: The attached program demonstrates that the ContentHandler.skippedEntity callback is not invoked for all skipped entities. Specifically, it is not invoked for those in attribute values. Additionally, it demonstrates that when parsing a

[issue4927] Inconsistent unicode repr for fileobject

2009-01-15 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I thought I'd explained it in detail [...] Well, so far, you didn't say that it was testUnicodeOpen that failed. Now that I see that, I can understand the problem. In your original message, I failed to see a problem. Yes, the repr is

[issue1242657] list(obj) can swallow KeyboardInterrupt

2009-01-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: In _PyObject_LengthHint() code, at the line: if (ro == NULL PyErr_Occurred()) { It seems that PyErr_Occurred() is not useful and is always true when the previous PyObject_CallMethodObjArgs() returned NULL. Otherwise the patch is

[issue4927] Inconsistent unicode repr for fileobject

2009-01-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I think the testsuite just exposed a design fault in python or a bug, if you will. When we by accident had a backslash in the filename, I noticed the inconsistency between 't...@test' and u'tm...@test'. One is a valid repr, the

[issue4956] Py_Initialize needs to be done before file load (on msys+wine)

2009-01-15 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton l...@lkcl.net: this is a _very_ strange case where the file contents cannot be read, under msys+wine, but under _just_ wine (cmd.exe) everything goes absolutely fine. by moving Py_Initialize() to _before_ the file load, it works! --

[issue4957] os.ftruncate raises IOError instead of OSError

2009-01-15 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: I stumbled upon this. Of all the errors in the posixmodule.c, ftruncate alone raises an IOError upon failure. All the others raise OSError. This behaviour is not documented. However, the os module documentation says Note

[issue4946] Lib/test/test__locale uses is to compare strings

2009-01-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r68628. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4946

[issue4950] Redundant declaration in pyerrors.h

2009-01-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r68629. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4950

[issue4922] set.add and set.discard are not conformant to collections.MutableSet interface

2009-01-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Ported to py3k in r68630 and 3.0 in r68631. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4922 ___

[issue4959] inspect.formatargspec fails for keyword args without defaults, affects help and likely pydoc

2009-01-15 Thread dariusp
New submission from dariusp dari...@internode.on.net: Hi, Suggested log message: formatargspec now handles keyword only args that don't have defaults. Previously it expected an empty dict but was being given None. Patch: The patch contains a suggested fix to inspect.py and a new test in

[issue4956] Py_Initialize needs to be done before file load (on msys+wine)

2009-01-15 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: what is WEIRD_DEBUG? why do you remove a test from string_tests.py? why do you modify a command in setup.py? What do you mean the file contents cannot be read under msys+wine? What specific error you have? The right thing to do

[issue4960] askdirectory from tkinter.filedialog does not work

2009-01-15 Thread Martin Saturka
New submission from Martin Saturka kvu...@gmail.com: Directory selection from Tkinter part of Python 3.0, i.e. askdirectory function from tkinter.filedialog does not work. It works for 2.x Python, other Tkinter functions (askopenfilename, asksaveasfilename) work well at both 2.x and 3.0

[issue4960] askdirectory from tkinter.filedialog does not work

2009-01-15 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Please be more explicit: what does not work mean? What do you do, what happens, what do you expect to happen instead? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org

[issue4960] askdirectory from tkinter.filedialog does not work

2009-01-15 Thread Martin Saturka
Martin Saturka kvu...@gmail.com added the comment: When I do in Python 2.x (e.g. 2.6) next: import Tkinter as T import tkFileDialog as F t = T.Tk() dn = F.askdirectory() It pop-ups the dialog, it is OK. Analogical case for Python 3.0

[issue4960] askdirectory from tkinter.filedialog does not work

2009-01-15 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Ah. That's a duplicate of issue 4406. -- resolution: - duplicate status: open - closed superseder: - In Lib\tkinter\filedialog.py, class Directory define loss a_ ___ Python tracker

[issue4958] email/header.py ecre regular expression issue

2009-01-15 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Your example header is invalid. Excerpt from RFC2047 http:// www.ietf.org/rfc/rfc2047.txt section 5: + An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Content-Disposition field, or in any structured