New submission from David M. :
Awaiting multiple times on a single task that failed with an exception results
in an unbounded increase in memory usage. Enough repeated "await"s of the task
can result in an OOM.
The same pattern on a task that didn't raise an exception behaves a
David M Noriega added the comment:
Oops, thats what I get for running with scissors.
Yes, the cert file is in pem format. Its the same file in use on my ldap server
and all my servers and workstations that authenticate against it. I have an
existing python 2.x script using the python-ldap
New submission from David M Noriega:
When trying to use python3-ldap package on Windows 7, found I could not get a
TLS connection to work and traced it to its use of ssl.wrap_socket. Trying out
the following simple socket test fails
import socket
import ssl
sock = socket.socket()
sock.connect
the problem was: ActivePython does not install debug libraries, so you must
link with release libraries in your project. but if you run the debug version,
you're linking against debug libraries which conflict with the ones linked to
by python.
fixed by running the release version.
I find i'm having this problem, but the solution you found isn't quite specific
enough for me to be able to follow it.
I'm embedding Python27 in my app. I have users install ActivePython27 in order
to take advantage of python in my app, so the python installation can't be
touched as it's on
note that when the script is called, i DO see this in the output window:
'kJams 2 Debug.exe': Loaded 'C:\Python27\Lib\site-packages\win32\win32api.pyd'
'kJams 2 Debug.exe': Loaded 'C:\Windows\SysWOW64\pywintypes27.dll'
'kJams 2 Debug.exe': Unloaded
I am very sorry that I have offended you to such a degree you feel it necessary
to publicly eviscerate me.
Perhaps I could have worded it like this: So far I have not seen any troubles
including unicode characters in my strings, they *seem* to be fine for my
use-case. What kind of trouble
Thank you for your thoughtful and thorough response. I now understand much
better what you (and apparently the others) were warning me against and I will
certainly consider that moving forward.
I very much appreciate your help as I learn about python and embedding and all
these crazy encoding
i am already doing (3), and all is working perfectly. bytestring literals are
fine, i'm not sure what this trouble is that you speak of.
note that i'm not using PyRun_AnyFile(), i'm loading the script myself, assumed
as utf8 (which was my original problem, i had assumed it was macRoman), then
i'm sorry this is so confusing, let me try to re-state the problem in as clear
a way as i can.
I have a C++ program, with very well tested unicode support. All logging is
done in utf8. I have conversion routines that work flawlessly, so i can assure
you there is nothing wrong with logging
fair enough. I can provide further proof of strangeness.
here is my latest script: this is saved on disk as a UTF8 encoded file, and
when viewing as UTF8, it shows the correct characters.
==
# -*- coding: utf-8 -*-
import time, kjams, kjams_lib
def log_success(msg, successB,
i got it!! OMG! so sorry for the confusion, but i learned a lot, and i can
share the result:
the CORRECT code *was* what i had assumed. the Python side has always been
correct (no need to put u in front of strings, it is known that the bytes are
utf8 bytes)
it was my run script function
I see you are using Python 2
correct
Firstly, in Python 2, the compiler assumes that the source code is encoded in
ASCII
gar, i must have been looking at doc for v3, as i thought it was all assumed to
be utf8
# -*- coding: utf-8 -*-
okay, did that, still no change
you need to use u ...
What _are_ you using?
i have scripts in a file, that i am invoking into my embedded python within a
C++ program. there is no terminal involved. the print statement has been
redirected (via sys.stdout) to my custom print class, which does not specify
encoding, so i tried the suggestion above
note everything works great if i use Ascii, but:
in my utf8-encoded script i have this:
print frøânçïé
in my embedded C++ i have this:
PyObject* CPython_Script::print(PyObject *args)
{
PyObject*resultObjP = NULL;
const char
Hi all,
This is an old thread, but I'm having the same behavior in my terminal when
I run some code but kill the process in the terminal (Ctrl-C). The code has
two prime suspects (from a simple google search):
1. Creates ssh port forward via the subprocess module
i was able to get what i wanted by simply iterating over the tupile instead of
using ParseTupile, then just query the type, then convert the type to C and
move on to the next. totally great, now i can pass N different argument types
to a single function, and have the C side deal gracefully
I'd like to be able to use PyArg_ParseTuple() in a generic way.
for example, i'd like to have all commands start with 1 integer parameter, and
this commandID will inform me of what parameters come next (via LUT).
knowing that i can then call ParseTuple again with the proper parameters.
like
okay, well that might turn out to be useful, except i don't quite know how to
use it, and there are no from scratch instructions.
i managed to download py2exe-0.6.9.zip and unzip it, but how does one
install this package? (yes, still a newb at that)
then, once installed, how do i say include
Okay, i'm really surprised nobody knows how to do this. and frankly i'm amazed
at the utter lack of documentation. but i've figured it out, and it's all
working beautifully.
if you want the code, go here:
http://karaoke.kjams.com/wiki/Python
--
yes, i've looked there, and all over google. i'm quite expert at embedding at
this point.
however nowhere i have looked has had instructions for this this is how you
package up your .exe with all the necessary python modules necessary to
actually run on a user's system that does not have
nooobody knw
the trouble a s...
--
http://mail.python.org/mailman/listinfo/python-list
in my C++ app, on the main thread i init python, init threads, then call
PyEval_SaveThread(), since i'm not going to do any more python on the main
thread.
then when the user invokes a script, i launch a preemptive thread
(boost::threads), and from there, i have this:
static int
in my app i initialize python on the main thread, then immediately call
PyEval_SaveThread() because i do no further python stuff on the main thread.
then, for each script i want to run, i use boost::threads to create a new
thread, then on that thread i ensure the GIL, do my stuff, then release
does nobody know how to do this?
does nobody know where proper documentation on this is?
--
http://mail.python.org/mailman/listinfo/python-list
okay, i have simplified it: here is the code
==
import time
def main():
while True:
print i'm alive
time.sleep(0.25)
#-
if __name__ == __main__:
main()
no, there is no time.py anywhere (except perhaps as the actual python library
originally imported)
did you understand that the function works perfectly, looping as it should, up
until the time i run a second script on a separate thread?
--
http://mail.python.org/mailman/listinfo/python-list
DOH! as my second thread, i had been using a sample script that i had
copy-pasted without much looking at it. guess what? it prints the time. and
yes, it did from time import time, which explains it all.
thanks for the hints here, that helped me figure it out!
--
Okay the link problem was solved: i had installed a 64bit python and my app is
32bit.
i'm using ActivePython installer from here:
http://www.activestate.com/activepython/downloads
it seems that now the problem is that this does not install the _d versions of
the .lib. :(
does anyone know
what must i include in my app package if i'm embedding python?
i tried including *everything* in the DLLs directory, but my app still
crashes as soon as i attempt to initialize python.
this is on a system that does not have python installed, as most of my users
won't have it. is it actually a
well, umm, gosh, now i feel quite silly. that was easy. okay that's done.
next: i'd like to redirect the output of any print statements to my C
function:
voidLog(const unsigned char *utf8_cstrP);
on the mac, python output sys.stdout goes into the debug console if you're in
the
i don't use stdout in my own code, my code goes to my own log file. i want the
output from any python code to go to my existing log file, so log statements
from my app and any python code are intermingled in that one file.
my updated code is here, which now bridges my python print function to
http://karaoke.kjams.com/wiki/Python
nevermind, i got it, it's working now (see link for code)
--
http://mail.python.org/mailman/listinfo/python-list
Now for Windows: same thing, i think i must create a .dll, right?
you should already have a python.dll in your installation
i can find python27.lib in the libs folder, but there is no
python27_d.lib, and there is no python27.dll in the DLLs folder?
are there instructions for creating (or
update: okay so the python27.dll is in /windows/system32 so ignore that
i've set my include directory correct, so i can compile
i've set my additional libraries directory to the libs directory (where the
.lib files are. (note: NOT including Lib directory, cuz that's full of .py
files and
i'm targeting Mac and Windows. Let's skip the thing about it should work when
my app isn't running, just assume it's going to be embedded, no pipes or
sockets necessary.
For Mac, I understand i need to create (?) a python.dylib, but i find no
directions for that at the expected location:
i'd like my app to be available to python while it's running.
for example, say my app is FooBar.app.
when my FooBar.app is running, now there is a python interface available to
python, and the user can write python scripts to make use of it.
with their scripts, they can control my running
Literally any idea will help, pen and paper, printing off all the code
and doing some sort of highlighting session - anything!
I keep reading bits of code and thinking well where the hell has that
been defined and what does it mean to find it was inherited from 3
modules up the chain.
I
Roy Smith r...@panix.com
As part of our initial interview screen, we give applicants some small
coding problems to do. One of the things we see a lot is what you could
call Java code smell. This is our clue that the person is really a
Java hacker at heart who just dabbles in Python
Νίκος Γκρ33κ nikos.gr...@gmail.com :
What paramstyle are you using?
Yes it is Chris, but i'am not sure what exactly are you asking me.
Please if you cna pout it even simper for me, thank you.
For instance:
import MySQLdb
MySQLdb.paramstyle
'format'
FWIW and HTH,
DC
--
New submission from David M. Cooke:
The following segfaults:
class A(int):
def __repr__(self):
raise Exception()
a = A()
d = {a : 1}
repr(d)
This is with Python 3.3.0, running on Mac OS 10.7.5, from MacPorts:
Python 3.3.0 (default, Sep 29 2012, 08:16:08)
[GCC 4.2.1 Compatible
d...@davea.name
On 10/23/2012 11:23 AM, David M Chess wrote:
We have a TimedRotatingFileHandler with when='midnight'
You give us no clue what's in this class, or how it comes up with the
filenames used.
Sorry if I was unclear. This isn't my own subclass of
TimedRotatingFileHandler
w...@mac.com
Something like:
Does a log file exist? - No - First run; create log file continue
|
Yes
|
Read backwards looking for date change, copy lines after change
to new file, delete from old file.
Yep, I'm concluding that also.
It just wasn't clear
Okay, next silly question. :)
We have a very simple multi-threaded system where a request comes in,
starts running in a thread, and then (zero, one, or two times per request)
gets to a serialization point, where the code does:
with lock:
do_critical_section_stuff_that_might_take_awhile()
Lovely, thanks for the ideas! I remember considering having release()
pick the next thread to notify, where all the waiters were sitting on
separate Conditions or whatever; not sure why I didn't pursue it to the
end. Probably distracted by something shiny; or insufficient brainpower.
:)
We have a TimedRotatingFileHandler with when='midnight'.
This works great, splitting the log information across files by date, as
long as the process is actually up at midnight.
But now the users have noticed that if the process isn't up at midnight,
they can end up with lines from two (or I
jorge jaoro...@estudiantes.uci.cu
I'm programming a server that most send a message to each client
connected to it and nothing else. this is obviously a base of what i
want to do. the thing is, I made a class wich contains the Handler class
for the ThreadingTCPServer and starts the
If you (the programmer) want a function that asks the user to enter a
literal at the input prompt, you'll have to write a post-processing for
it, which looks for prefixes, for quotes, for backslashes, etc., and
encodes the result. There very well may be such a decoder in the Python
library,
greatly appreciated.
DC
David M. Chess
IBM Watson Research Center
--
http://mail.python.org/mailman/listinfo/python-list
New submission from David M. Rogers dmr...@sandia.gov:
Python Devs,
There is an issue relating to variable lookup using exec from within
multiprocessing's fork()-ed process. I'm attempting to use the forked process
as a generic remote python shell, but exec is unable to reach variables
that might help me out here? I would really
appreciate your input.
Thank you,
David M Covey Sr.
ad...@daffitt.com
--
http://mail.python.org/mailman/listinfo/python-list
David M. Beazley beaz...@users.sourceforge.net added the comment:
An apology on the delay. Things have been rather hectic.
Regarding a patch, I don't really have a patch so much as a suggested
procedure. Basically, I'm suggesting that the maintainers of the
library documentation simply do
New submission from David M. Beazley beaz...@users.sourceforge.net:
Consider a socket that has had a file-like wrapper placed around it
using makefile()
# s is a socket created previously
f = s.makefile()
Now, suppose that this socket has had a timeout placed on it.
s.settimeout(15)
If you
On 11/13/2009 3:26 PM, Aahz wrote:
Ken Thompson's classic paper on bootstrapped malware
finally gets a rebuttal:
http://lwn.net/Articles/360040/
thanks for pointing this out.
-- david
--
http://mail.python.org/mailman/listinfo/python-list
On 11/12/2009 11:26 AM, Dave Angel wrote:
Try http://fireftp.mozdev.org/
in the past i found this to be buggy. i'd recommend
something different.
what is your OS?
-- david
--
http://mail.python.org/mailman/listinfo/python-list
html5lib has several implementations for several languages, it
may actually be worth it to generate lexers for each language from one
specification file.
Take care,
David M. Cooke david.m.co...@gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 11, 3:05 am, Chris Rebert c...@rebertia.com wrote:
On Wed, Jun 10, 2009 at 5:53 PM, Mensanatormensana...@aol.com wrote:
On Jun 10, 5:24 pm, David Wilson d...@botanicus.net wrote:
Hi,
During a fun coding session yesterday, I came across a problem that I
thought was already solved
On Jun 11, 12:59 am, Jack Diederich jackd...@gmail.com wrote:
On Wed, Jun 10, 2009 at 6:24 PM, David Wilsond...@botanicus.net wrote:
During a fun coding session yesterday, I came across a problem that I
thought was already solved by itertools, but on investigation it seems
it isn't.
The
On Jun 10, 11:24 pm, David Wilson d...@botanicus.net wrote:
Hi,
During a fun coding session yesterday, I came across a problem that I
thought was already solved by itertools, but on investigation it seems
it isn't.
The problem is simple: given one or more ordered sequences, return
only the
On 5/16/2009 5:26 PM, Aahz wrote:
On Sat, May 16, 2009, Pete wrote:
python-concurre...@googlegroups.com is a new email list
for discussion of concurrency issues in python.
Is there some reason you chose not to create a list on
python.org? I'm not joining the list because Google
requires
David M. Beazley beaz...@users.sourceforge.net added the comment:
Placing a note in the standard library documentation would be a start.
Just say in Python 3.0 it always returns the result as an unsigned
integer whereas in Python 2.6 a 32-bit signed integer is returned.
Although
New submission from David M. Beazley beaz...@users.sourceforge.net:
The result of binascii.crc32() is different on the same input in Python
2.6/3.0. For example:
Python 2.6:
binascii.crc32('Hello')
-137262718
Python 3.0:
binascii.crc32(b'Hello')
4157704578
--
components: Library
David M. Beazley beaz...@users.sourceforge.net added the comment:
Can someone PLEASE make sure this gets documented someplace.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4903
David M. Beazley beaz...@users.sourceforge.net added the comment:
One further followup just to make sure I'm clear.
Is it always safe to pass the result of locals() into exec and extract
the result as shown in my example?
Since I'm writing about this in a book, I just want to make
New submission from David M. Beazley beaz...@users.sourceforge.net:
Please forgive me, but I'm really trying to wrap my brain around the
behavior of exec() in Python 3. Here's a quote from the documentation:
In all cases, if the optional parts are omitted, the code is
executed
New submission from David M. Beazley beaz...@users.sourceforge.net:
In the ctypes reference / Finding shared libraries section of the ctypes
documentation, the find_library() function is described as being located
in ctypes.util. However, it's formal description right below that lists
New submission from David M. Beazley beaz...@users.sourceforge.net:
Documentation for the json module in Python 2.6 and Python 3.0 doesn't
have any description for load() or loads() even though both functions are
used in the examples.
--
assignee: georg.brandl
components
New submission from David M. Beazley beaz...@users.sourceforge.net:
The json module is described as having an interface similar to pickle:
json.dump()
json.dumps()
json.load()
json.loads()
I think it would be a WISE idea to add a huge warning message to the
documentation
New submission from David M. Beazley beaz...@users.sourceforge.net:
The strict parameter to JSONDecoder() is undocumented and is confusing
because someone might assume it has something to do with the encoding
parameter or the general handling of parsing errors (which it doesn't).
As far as I
David M. Beazley beaz...@users.sourceforge.net added the comment:
Just consider me to be an impartial outside reviewer. Hypothetically,
let's say I'm a Python programmer who knows a thing or two about
standard library modules (like pickle), but I'm new to JSON so I come
looking at the json
David M. Beazley beaz...@users.sourceforge.net added the comment:
Thanks! Hopefully I'm not giving you too much work to do :-).
Cheers,
Dave
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4783
New submission from David M. Beazley beaz...@users.sourceforge.net:
Not a bug, but a question to developers:
Is xml.etree.ElementTree going to be the only standard library module in
Python 3.0 that doesn't follow the standard Python 3.0 module naming
conventions? (e.g., socketserver
New submission from David M. Beazley beaz...@users.sourceforge.net:
Documentation for the email package needs to be more clear about the
usage of strings and bytes. In particular:
1. All operations that parse email messages such as message_from_file()
or message_from_string() operate
New submission from David M. Beazley beaz...@users.sourceforge.net:
The documentation describes classes such as
email.mime.MIMEText()
email.mime.MIMEMultipart()
email.mime.MIMEApplication()
etc...
However, it's confusing because none of these classes are actually found
in email.mime.
Suggest
New submission from David M. Beazley beaz...@users.sourceforge.net:
The email.generator.Generator class does not work correctly message
objects created with binary data (MIMEImage, MIMEAudio, MIMEApplication,
etc.). For example:
from email.mime.image import MIMEImage
data = open(IMG.jpg,rb
New submission from David M. Beazley beaz...@users.sourceforge.net:
The whole point of base64 encoding is to safely encode binary data into
text characters. Thus, the base64.b64decode() function should equally
accept text strings or binary strings as input. For example, there is a
reasonable
David M. Beazley beaz...@users.sourceforge.net added the comment:
Note: This problem applies to all of the other decoders/encoders in the
base64 too (b16, b32, etc.)
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4769
New submission from David M. Beazley beaz...@users.sourceforge.net:
See Issue 4869 for a related bug.
Most of the functions in binascii are meant to go from binary data to
textual representations (hex digits, base64, binhex, etc.). There are
numerous problems:
1. Misleading error messages
David M. Beazley beaz...@users.sourceforge.net added the comment:
Given the low-level nature of this module, I can understand the
motivation to make it all bytes.
However, I'm going to respectfully disagree with that and claim that
making binascii all bytes really goes against the whole
New submission from David M. Beazley beaz...@users.sourceforge.net:
The hashlib documentation has incorrect examples showing the use of the
hexdigest() method:
hashlib.sha224(bNobody inspects the spammish
repetition).hexdigest()
b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
David M. Beazley beaz...@users.sourceforge.net added the comment:
The digest() method of hashes does produce bytes (correct). The
hexdigest() method produces a string, but it is also shown as producing
bytes in the examples.
___
Python tracker rep
New submission from David M. Beazley beaz...@users.sourceforge.net:
A file-like object u returned by the urlopen() function in both Python
2.6/3.0 has a method info() that returns a 'HTTPMessage' object. For
example:
::: Python 2.6
from urllib2 import urlopen
u = urlopen(http
David M. Beazley beaz...@users.sourceforge.net added the comment:
Verified that 2to3 does not fix this.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4773
David M. Beazley beaz...@users.sourceforge.net added the comment:
Just a followup comment to note that adding support for
sendmsg()/recvmsg() is what you need to do file descriptor passing
between processes on Unix---another technique for writing network servers
New submission from David M. Beazley beaz...@users.sourceforge.net:
I have recently completed a pretty thorough survey of library
documentation for Python 3.0 in conjunction with an update I'm making to
my book. This issue is not so much a bug as a documentation request.
For all
David M. Beazley beaz...@users.sourceforge.net added the comment:
Bump. This functionality seems to be needed if anyone is going to be
messing around with advanced features of IPv6. As it stands, the socket
module in Python 2.6/3.0 is incomplete without this.
--
nosy: +beazley
New submission from David M. Beazley beaz...@users.sourceforge.net:
The documentation for asynchat needs to be more precise in its use of
strings vs. bytes. Unless the undocumented use_encoding attribute is
set, it seems that all data should be bytes throughout (e.g., the
terminator, inputs
New submission from David M. Beazley beaz...@users.sourceforge.net:
The documentation for Proxy Objects in the multiprocessing module
describes a method _call_method and gives various examples. The only
problem is that the method is actually called _callmethod (i.e., no
underscore between
David M. Beazley beaz...@users.sourceforge.net added the comment:
The _get_value() method is also in error. It's called _getvalue() in
the source code.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4694
New submission from David M. Beazley beaz...@users.sourceforge.net:
In the Address Formats part of the Listeners and Clients section of
the documentation for the multiprocessing module, AF_PIPE addresses are
described as having this format:
r'ServerName\\pipe\\PipeName'
However
New submission from David M. Beazley beaz...@users.sourceforge.net:
The ConfigParser module defines a variety of custom exceptions, many of
which take more than one argument (e.g., InterpolationError,
NoOptionError, etc.). However, none of these exceptions properly set
the .args attribute
David M. Beazley beaz...@users.sourceforge.net added the comment:
I wish I shared your optimism about this, but I don't. Here's a short
explanation why.
The problem of I/O and the associated interface between hardware, the
operating system kernel, and user applications is one of the most
David M. Beazley beaz...@users.sourceforge.net added the comment:
Good luck with that. Most people who get bright ideas such as gee,
maybe I'll write my own version of X where X is some part of the
standard C library pertaining to I/O, end up fighting a losing battle.
Of course, I'd love
David M. Beazley beaz...@users.sourceforge.net added the comment:
I agree with Raymond. For binary reads, I'll go farther and say that
even a 10% slowdown in performance would be surprising if not
unacceptable to some people. I know that as hard as it might be for
everyone to believe
New submission from David M. Beazley [EMAIL PROTECTED]:
The documentation for the apply() and apply_async() methods of a Pool
object might emphasize that these operations execute func(*args,**kwargs)
in only one of the pool workers and that func() is not being executed in
parallel on all
David M. Beazley [EMAIL PROTECTED] added the comment:
Actually, you shouldn't discount the potential usefulness of running
apply() in all of the worker nodes. A lot of people coming from
parallel programming know about things like global broadcasts,
reductions, and so forth. For example
David M. Beazley [EMAIL PROTECTED] added the comment:
I've done some profiling and the performance of reading line-by-line is
considerably worse in Python 3 than in Python 2. For example, this
code:
for line in open(somefile.txt):
pass
Ran 35 times slower in Python 3.0 than Python 2.6
David M. Beazley [EMAIL PROTECTED] added the comment:
Tried this using projects/python/branches/release30-maint and using the
patch that was just attached. With a 66MB input file, here are the
results of this code fragment:
for line in open(BIGFILE):
pass
Python 2.6: 0.67s
Python 3.0
David M. Beazley [EMAIL PROTECTED] added the comment:
Just as one other followup, if you change the code in the last example
to use binary mode like this:
for line in open(BIG,rb):
pass
You get the following results:
Python 2.6: 0.64s
Python 3.0: 42.26s (66 times slower
David M. Beazley [EMAIL PROTECTED] added the comment:
Just checked it with branches/py3k and the performance is the same.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4561
1 - 100 of 157 matches
Mail list logo