[issue9801] Can not use append/extend to lists in a multiprocessing manager dict

2010-09-08 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: tested python 3.1.2 Man = multiprocessing.Manager(); d = man.dict(); d['l'] = list(); d['l'].append(hey); print(d['l']); [] using debugger reveals a KeyError. Extend also does not work. Only thing that works is += which means you

[issue9803] IDLE closes with save while breakpoint open

2010-09-08 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: I have multiple versions of python - 2.6.1 and 3.1.2. 2.6.1 is the primary install (i.e., right click on a file and edit with IDLE brings up 2.6), and was installed first. This issue occurs on 3.1.2, Windows XP 32-bit If I

[issue9847] Binary strings never compare equal to raw/normal strings

2010-09-13 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: Tested on Python 3.1.2 Windows XP 32-bit Binary strings (such as what is returned by filereader.readline()) are never equal to raw or normal strings, even when both strings are empty if(b == ): print(Strings are equal

[issue9801] Can not use append/extend to lists in a multiprocessing manager dict

2010-09-23 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: Is there a way to get this so it behaves more intuitively? You'd think adding a managed list to a managed dictionary (or another managed list) or making a deep copy would work but it still doesn't. When you get an item from a managed

[issue10332] Multiprocessing maxtasksperchild results in hang

2010-11-05 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: v.3.2a3 If the maxtasksperchild argument is used, the program will just hang after whatever that value is rather than working as expected. Tested in Windows XP 32-bit test code: import multiprocessing def f(x): return 0

[issue10376] ZipFile unzip is unbuffered

2010-11-09 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: The Unzip module is always unbuffered (tested v.3.1.2 Windows XP, 32-bit). This means that if one has to do many small reads it is a lot slower than reading a chunk of data to a buffer and then reading from that buffer. It seems

[issue10376] ZipFile unzip is unbuffered

2010-11-09 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: I should clarify that this is the zipfile constructor I am using: zipfile.ZipFile(filename, mode='r', allowZip64=True); -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue11990] redirected output - stdout writes newline as \n in windows

2011-05-03 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: In windows, 64-bit, python *mostly* writes only a \n to stdout even though it's mode is 'w'. However it sometimes writes a \r\n on certain print statements and erratically when I have multiple processes writing to stdout. Output

[issue11990] redirected output - stdout writes newline as \n in windows

2011-05-03 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: Sorry there isn't more info but I'm really busy right now In fact a workaround would be appreciated if known. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11990

[issue11990] redirected output - stdout writes newline as \n in windows

2011-05-03 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: Nevermind, I have a workaround that didn't require rewriting all the print statements but its in the C# code not the python code -- ___ Python tracker rep...@bugs.python.org http

[issue11990] redirected output - stdout writes newline as \n in windows

2011-05-04 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: Yes and no, I can give you a single process single child example that just shows that python 3.2 uses binary output while python 3.1 used system default when piping, but trying to reproduce the multiprocessing output inconsistencies

[issue12020] Attribute error with flush on stdout,stderr

2011-05-06 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: When upgrading from Python 3.1 to Python 3.2 I noticed that when my program closed it printed out a non-consequential AttributeError Exception. My program had a custom class that replaced stdout and stderr for use in a piped

[issue12020] Attribute error with flush on stdout,stderr

2011-05-06 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: You are right, when I add: def flush(self): pass; the error goes away. When I have this: def flush(): pass; I get: Exception TypeError: 'flush() takes no arguments (1 given)' in __main__.FlushFile object

[issue11990] redirected output - stdout writes newline as \n in windows

2011-05-16 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: I would like to add in windows, input now adds a \r at the end which wasn't in 3.1. It doesn't do it in idle. This is using just the regular console window that opens up when you double click. I'm guessing this is related

[issue13678] way to prevent accidental variable overriding

2011-12-29 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: In python is currently there a way to elegantly throw an error if a variable is already in the current scope? For example: def longfunc(self, filename): FILE = open(filename); header = FILE.readline(); ... bunch

[issue13678] way to prevent accidental variable overriding

2011-12-29 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: For starters, this would be most efficient implementation: def unique(varname, value, scope): assert(not varname in scope); scope[varname] = value; Usage: unique('b', 1, locals()); print(b); But you can't put that in a loop

[issue15702] Multiprocessing Pool deadlocks on join after empty map operation

2012-08-16 Thread James Hutchison
New submission from James Hutchison: Following code deadlocks on Windows 7 64-bit, Python 3.2.3 If you have a pool issue a map operation over an empty iterable then try to join later, it will deadlock. If there is no map operation or blah in the code below isn't empty, it does not deadlock

[issue14478] Decimal hashing very slow, could be cached

2012-04-02 Thread James Hutchison
New submission from James Hutchison jamesghutchi...@gmail.com: Tested on 3.2 Note that I noticed that Decimal is supposed to be faster in 3.3 but I thought I would bring this to light just in case its still relevant Decimal hashing is very slow, even for simple numbers. I found by caching

[issue14478] Decimal hashing very slow, could be cached

2012-04-02 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: If I increase the cycles increased 10x with 3.2 I get: int: 0.421313354492 Decimal: 24.20299983024597 CachingDecimal: 1.7809998989105225 The sample you have provided is basically what I'm using. See attached What about worst

[issue14478] Decimal hashing very slow, could be cached

2012-04-02 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: 100x should be e100 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14478

[issue14478] Decimal hashing very slow, could be cached

2012-04-05 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: I presume you mean in 3.2? Have you looked at the source code for that decorator? It's fundamentally a try/except but with a lot more unnecessary bloat than is needed for caching a single int result from a function with no arguments

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-06 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: This is an issue for me (Python 3.2). I have a custom pool that sends arguments for a function call over a pipe. I cannot send another pipe as an argument. Tim's workaround also does not work for me (win xp 32bit and 64bit) From

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-06 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: err, is it possible to edit out those file paths? I didn't intend them to be in the message. I'd appreciate it if someone with the privileges to do so could remove them. -- ___ Python

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-07 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: @pitrou You can just delete my original post. I'll repost an edited version here for reference original post with paths removed: This is an issue for me (Python 3.2). I have a custom pool that sends arguments for a function call

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-07 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: Shouldn't reduce_pipe_connection just be an alias for reduce_connection in unix so that using reduce_pipe_connection would work for both win and unix? My understanding after looking at the code is that reduce_pipe_connection isn't

[issue14478] Decimal hashing very slow, could be cached

2012-04-10 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: In the patch: This: +except AttributeError: +pass should be: +except: everything inside except statement Checking for the AttributeError is very slightly slower. Not by a lot, but I think if we're going

[issue10376] ZipFile unzip is unbuffered

2012-05-01 Thread James Hutchison
James Hutchison jamesghutchi...@gmail.com added the comment: See attached, which will open a zipfile that contains one file and reads it a bunch of times using unbuffered and buffered idioms. This was tested on windows using python 3.2 You're in charge of coming up with a file to test

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
New submission from James Hutchison: Windows 7 64-bit, Python 3.2.3 This is a very odd issue and I haven't figured out what caused it. I have a python script that runs continuously. When it receives a request to do a task, it creates a new thread (not a new process), does the task, then sends

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: This is the traceback I was getting where it was just a script that simply made an SMTP connection then closed it. This fails before it attempts to connect to the server. Traceback (most recent call last): File C:\tmp\manysmtptest.py, line 8, in module

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: That makes no sense. Why does: s = socket.socket() s.bind(('',50007)) s.listen(1); s.close(); fix the issue then? Re-opening, this issue should be understood because having such an operation randomly fail is unacceptable for a production system. How does

[issue15780] IDLE (windows) with PYTHONPATH and multiple python versions

2012-08-24 Thread James Hutchison
New submission from James Hutchison: One issue I've encountered is someone else's software setting PYTHONPATH to their install directory of python. We have some old software that installs and uses python 2.3 scripts and unfortunately this prevents the IDLE shortcuts for newer versions

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: It's from the example. http://docs.python.org/library/socket.html#example -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15779

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: The firewall is disabled for my machine. So the options are: 1. Port was in-use: possible except that is normally a different error 2. Port was firewalled: firewall was disabled 3. Port mis-use: not likely because this wouldn't be random 4. Port

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: I can connect to all of the IPs for my server without issue. Found this: Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4.0 with SP4 and later), another application, service, or kernel mode driver

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
Changes by James Hutchison jamesghutchi...@gmail.com: -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15779 ___ ___ Python

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
James Hutchison added the comment: Looks to me like python grabs an outgoing port number via unrandom means and if it happens to map to a port taken by a service that demands exclusive access, then it returns the WSAEACCESS error instead of WSAEADDRINUSE. Because this is a fairly new feature

[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison
Changes by James Hutchison jamesghutchi...@gmail.com: -- components: +Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15779 ___ ___ Python

[issue16031] relative import headaches

2012-09-24 Thread James Hutchison
New submission from James Hutchison: This might even be a bug I've stumbled upon but I'm listing it as an enhancement for now. I really feel that relative imports in Python should just work. Regardless of the __name__, I should be able to import below me. Likewise, it should work even