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 wor
Changes by James Hutchison :
--
components: +Windows
___
Python tracker
<http://bugs.python.org/issue15779>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 "fe
Changes by James Hutchison :
--
status: closed -> open
___
Python tracker
<http://bugs.python.org/issue15779>
___
___
Python-bugs-list mailing list
Unsubscri
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 is
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 w
James Hutchison added the comment:
It's from the example.
http://docs.python.org/library/socket.html#example
--
___
Python tracker
<http://bugs.python.org/is
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 v
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
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",
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
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 dea
James Hutchison 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 it on. Sorry.
Example o
James Hutchison added the comment:
In the patch:
This:
+except AttributeError:
+pass
should be:
+except:
Checking for the AttributeError is very slightly slower. Not by a lot, but I
think if we're going for speed we might as well be as fast as possible. I
James Hutchison 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
defined for
James Hutchison 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 over a pipe. I cannot
James Hutchison 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 trac
James Hutchison 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 what I can tell,
James Hutchison 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. Its actually
James Hutchison added the comment:
100x should be e100
--
___
Python tracker
<http://bugs.python.org/issue14478>
___
___
Python-bugs-list mailing list
Unsub
James Hutchison 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 case hash calcul
New submission from James Hutchison :
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 the
hash result, there is
James Hutchison 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 els
New submission from James Hutchison :
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 of code ...
childfiles
James Hutchison 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 to the is
James Hutchison 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 at 0x00C2
New submission from James Hutchison :
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 program
(it flushed the buffer
James Hutchison 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
would be... difficult
James Hutchison 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
<http://bugs.python.org/is
James Hutchison 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
<http://bugs.python.o
New submission from James Hutchison :
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 looks fine
James Hutchison added the comment:
I should clarify that this is the zipfile constructor I am using:
zipfile.ZipFile(filename, mode='r', allowZip64=True);
--
___
Python tracker
<http://bugs.python.o
New submission from James Hutchison :
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 logical
that the unzip
New submission from James Hutchison :
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;
if __name__ == '__m
James Hutchison 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 data
str
New submission from James Hutchison :
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&
New submission from James Hutchison :
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 highlight a break
New submission from James Hutchison :
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
38 matches
Mail list logo