[python-win32] Bug reporting

2018-02-17 Thread Max Slimmer
Bob,

I'm pretty sure adodbapi is now part of the pywin32 project. And pywin32
moved to github  a little bit ago.
Maybe Vernon can confirm or deny but I think submitting issues there is the
preferred route.

--Max III

On Sat, Feb 17, 2018 at 9:00 AM,  wrote:

> Send python-win32 mailing list submissions to
> python-win32@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/python-win32
> or, via email, send a message with subject or body 'help' to
> python-win32-requ...@python.org
>
> You can reach the person managing the list at
> python-win32-ow...@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of python-win32 digest..."
>
> Today's Topics:
>
>1. sudo.py -- publish to pypi or gist? (Vernon D. Cole)
>2. Bug reports (Bob Kline)
>
>
> -- Forwarded message --
> From: "Vernon D. Cole" 
> To: python-win32 
> Cc:
> Bcc:
> Date: Fri, 16 Feb 2018 21:01:37 -0700
> Subject: [python-win32] sudo.py -- publish to pypi or gist?
> I finished work on a new module today -- it is called "sudo.py" and does
> pretty much what you would expect.
>
> If executed as a main program, on Linux or MacOS, it just runs "sudo"
> which is not very exciting. On Windows, it requests elevation and runs a
> command as an Administrator, which is a capability I have been wanting for
> years.
>
> Or you can call it at the beginning of a Python program like this:
> >>> import sudo
> >>> sudo.run_elevated()  # run this script as an Administrator
> which creates a new window (on Windows) and runs the script (from the top)
> with elevated privileges.
>
> Of course it requires PyWin32 to perform all this magic on Windows.
>
> I want to publish it -- but in what form?
> If you care, please respond to this poll.
> 
> --
> Vernon Cole
>
>
>
> -- Forwarded message --
> From: Bob Kline 
> To: python-win32 
> Cc:
> Bcc:
> Date: Sat, 17 Feb 2018 08:16:17 -0500
> Subject: [python-win32] Bug reports
> According to SourceForge [1]:
>
> > Best Way to Get Help
> > Python DB-API 2.0 module for ADO says the best way to get help with its
> software is by using its ticket tracker: Bugs. [2]
>
> Is this true? I posted a bug report [3] a couple of weeks ago and I
> still haven't seen even an acknowledgment that the report has been
> seen. Is there another bug tracker somewhere I should be using? Has
> the project silently migrated to GitHub?
>
> Thanks!
>
> [1] https://sourceforge.net/projects/adodbapi/
> [2] http://sourceforge.net/p/adodbapi/bugs, which redirects to
> https://sourceforge.net/p/adodbapi/bugs/
> [3] https://sourceforge.net/p/adodbapi/bugs/27/
>
> --
> Bob Kline
> http://www.rksystems.com
> mailto:bkl...@rksystems.com
>
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] sudo module

2018-02-17 Thread Max Slimmer
Vernon,

This sounds really useful. I'm voting for pypi package. Package management
is getting so much better and pypi seems to be pretty standard.

--Max III

On Sat, Feb 17, 2018 at 9:00 AM,  wrote:

> Send python-win32 mailing list submissions to
> python-win32@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/python-win32
> or, via email, send a message with subject or body 'help' to
> python-win32-requ...@python.org
>
> You can reach the person managing the list at
> python-win32-ow...@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of python-win32 digest..."
>
> Today's Topics:
>
>1. sudo.py -- publish to pypi or gist? (Vernon D. Cole)
>2. Bug reports (Bob Kline)
>
>
> -- Forwarded message --
> From: "Vernon D. Cole" 
> To: python-win32 
> Cc:
> Bcc:
> Date: Fri, 16 Feb 2018 21:01:37 -0700
> Subject: [python-win32] sudo.py -- publish to pypi or gist?
> I finished work on a new module today -- it is called "sudo.py" and does
> pretty much what you would expect.
>
> If executed as a main program, on Linux or MacOS, it just runs "sudo"
> which is not very exciting. On Windows, it requests elevation and runs a
> command as an Administrator, which is a capability I have been wanting for
> years.
>
> Or you can call it at the beginning of a Python program like this:
> >>> import sudo
> >>> sudo.run_elevated()  # run this script as an Administrator
> which creates a new window (on Windows) and runs the script (from the top)
> with elevated privileges.
>
> Of course it requires PyWin32 to perform all this magic on Windows.
>
> I want to publish it -- but in what form?
> If you care, please respond to this poll.
> 
> --
> Vernon Cole
>
>
>
> -- Forwarded message --
> From: Bob Kline 
> To: python-win32 
> Cc:
> Bcc:
> Date: Sat, 17 Feb 2018 08:16:17 -0500
> Subject: [python-win32] Bug reports
> According to SourceForge [1]:
>
> > Best Way to Get Help
> > Python DB-API 2.0 module for ADO says the best way to get help with its
> software is by using its ticket tracker: Bugs. [2]
>
> Is this true? I posted a bug report [3] a couple of weeks ago and I
> still haven't seen even an acknowledgment that the report has been
> seen. Is there another bug tracker somewhere I should be using? Has
> the project silently migrated to GitHub?
>
> Thanks!
>
> [1] https://sourceforge.net/projects/adodbapi/
> [2] http://sourceforge.net/p/adodbapi/bugs, which redirects to
> https://sourceforge.net/p/adodbapi/bugs/
> [3] https://sourceforge.net/p/adodbapi/bugs/27/
>
> --
> Bob Kline
> http://www.rksystems.com
> mailto:bkl...@rksystems.com
>
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Max Slimmer
Coincidentally I ran into this issue last week. From what I could gather
the MS SQL data type can accept values with no more than millisecond
precision. This is true using parameterized statements through adodbapi and
also T-SQL and implicit conversion from char to datetime. The type accepts
up to seven places (nano seconds).

If you don’t mind losing some precision you can do something like this:

import datetime
import adodbapi
class MyTimeconverter(adodbapi.pythonDateTimeConverter):

def DateObjectToIsoFormatString(self, obj):
'''
Round microsecond part of datetime object to three decimal places.
'''
s = super(adodbapi.pythonDateTimeConverter,
self).DateObjectToIsoFormatString(obj)
try:
dt, micros = s.rsplit('.', 1)
except ValueError:
return s
micros = str(round(float('.' + micros), 3))[1:5]
return dt + micros
# Bind datetime.datetime parameters as string
adodbapi.typeMap[datetime.datetime] = adodbapi.adBSTR# Patch on our
datetime converter
adodbapi.adodbapi.dateconverter = MyTimeconverter()

Or maybe you can use datetime2.

—Max III
​
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] adodbapi changing autocommit

2016-10-25 Thread Max Slimmer
Vernon,
Yes, that is what I'm saying, I just didn't want to come out shouting
"bug". I tried setting up the package test at one point but got stuck
somewhere so I'm not sure I'm the person to file the PR (or whatever the
process is). But, I'd be happy to file it using whatever the appropriate
procedure is (if where we're at isn't enough :)).

On Mon, Oct 24, 2016 at 2:57 PM, Vernon D. Cole <vernondc...@gmail.com>
wrote:

> Wait a bit...  Did I just hear that there is a difference in operation
> between starting a connection with autocommit=false and turning autocommit
> off during a session?  If so, I think that's a bug.  PEP-249 has no hook
> for explicitly starting a transaction, so adodbapi needs to always have
> done BeginTrans before any meaningful operation.  Am I missing something?
> --
> Vernon Cole
>
>
> On Mon, Oct 24, 2016 at 11:10 AM, Tim Roberts <t...@probo.com> wrote:
>
>> Max Slimmer wrote:
>> > The adodbapi documentation and code implies that with autocommit =
>> > False I should only have to call commit (and possibly rollback) and if
>> > using the connection as a context manager not even those are required.
>> > If autocommit = False is passed on the initial connect the __init__ of
>> > the connector handles BeginTrans and subsequent commit and rollbacks
>> > also leave me with an open trans.
>>
>> Ah, I missed that subtle distinction.  Your modification seems reasonable.
>>
>> --
>> Tim Roberts, t...@probo.com
>> Providenza & Boekelheide, Inc.
>>
>> ___
>> python-win32 mailing list
>> python-win32@python.org
>> https://mail.python.org/mailman/listinfo/python-win32
>>
>
>


-- 
--Max III
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] adodbapi changing autocommit

2016-10-23 Thread Max Slimmer III
Setting connection.autocommit = False does not cause a 
connection.connector.BeginTrans() and so any subsequent 
connection.commit() raises an exception that there is no open 
transaction. Is this by design and I'm supposed to explicitly call 
BeginTrans() when switching autocommit off?


Thanks,
Max
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Passing an object to a process

2012-03-14 Thread Max Slimmer
depends what you mean by share logger object, you might be able to
have logger on both apps share a common log file.
OTH if you want realtime events, I pass a socket from one app to
another and have implemented a proxy dialog so one app writes to the
progress dialog proxy and it in turn sends data to a handler on the
other system via the socket where the actual progress dialog shows
progress.

max



On Wed, Mar 14, 2012 at 11:53 AM, Tony Cappellini cappy2...@gmail.com wrote:

 On Windows XP - I've got a program running which has spawned a process using
 os.spawnv().

 My program has a logger object instantiated that I want to pass to the
 process that was spawned.
 I need to log errors seen by the process, to the same logfile that the
 program uses for logging.

 I have the handle, thread ID, and process id of the process, but I see no
 way to share the logger object using these values.

 How can I pass a logger instance to the process, from the program which
 spawned the process?

 For legacy compatibility reasons, I'm stuck with an older version of Python
 that doesn't have the subprocess module and other features that are
 available with more modern releases of Python.


 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Passing an object to a process

2012-03-14 Thread Max Slimmer
If you are really just logging, use separate loggers/files, sync the
clocks, and timestamp records, then merge when you are ready to
process if you need timeline related results.


On Wed, Mar 14, 2012 at 1:29 PM, Preston Landers pland...@gmail.com wrote:
 On Wed, Mar 14, 2012 at 2:55 PM, Tony Cappellini cappy2...@gmail.com wrote:

 in which objects can truly move from one process to another is
 recreating them in the other process.  Even fork() makes copies of
  everything.

 Recreating an object in another process means it's a different object, not a
 shared one.

 Yeah, I know.  I was trying to make that point.  There's no real way
 for the same object to exist in multiple processes other than SYSV
 shared mem.

 Truly shared memory (i.e, SYSV style) is tricky, not very portable,
 and usually the wrong answer in my experience. As fas as I know stock
 Python doesn't support that, and definitely never will on Windows.

 The point is that you need to figure out what problem you're really
 trying to solve (logging to one file from multiple processes, it
 sounds like) and then find the best / simplest approach, which I can
 tell you definitely doesn't involve SYSV shared memory.   It's
 probably just creating separate logging objects in each process,
 pointing to the same file, and protected by file locking if necessary.


 Have you tried pickle or other techniques of serialization? Not sure
 offhand if the logger module supports pickle but it might.

 Yes. I've just tried this, even though I expected it not to work.

 If process A pickles a logger object, and process B unpickles it,
 referencing of an object in a different process is meaningless.

 In my case, when the process attempted to write to the logger, no entries
 were seen in the logfile. Surprisingly, no exceptions occurred- but this
 could just be a coincidence.

 Probably because the logger object, when serialized, saves a reference
 to an open filehandle, which won't be automatically transfered to the
 other process.

 (There might ultimately be a way to make that work by inheriting
 filehandles, but again, if you can find something simpler...)



 That may work, and with less effort than my original idea.

 But if two processes write to the logfile at the same time (especially on a
 multicore machine),
 hard-to-read logfiles may result.
 it's worth a try.

 Yes, that type of thing can occur, but you can also get around that
 with simple file locking.  By the way, that same problem certainly
 exists even if you somehow shared the object between two processes -
 what if the two processes made a log call at the same time?

 File locking may introduce some performance issues if the logging is
 very frequent, but usually you can find ways to mitigate that.

 The main app I work on uses log files extensively, and the same file
 is appended to by unrelated processes without a locking mechanism.
 Occasionally you do see some interleaving of log entries but in my
 experience it's fairly rare and in my particular case we don't care
 much about that anyway.

 regards,
 Preston
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] python card

2011-10-15 Thread Max Slimmer
pythoncard is not an application it is a library that contains some tools to
enable you to create gui applications if I recall by dragging components
 onto a canvas. I will never put anything into start menu.  Go to
http://pythoncard.sourceforge.net/windows_installation.html and follow all
the steps including installing python wxpython and pythoncard, then do the
step in Confirming Installation, Open the folder called minimal in
Python25\Lib\site-packages\PythonCard\samples. Find the icon labeled
minimal.py and double-click it  this should popup a sample app you will
also find tutorial etc on this site.

max



On Fri, Oct 14, 2011 at 7:23 PM, dwayne owen wolfman1...@hotmail.comwrote:

  I have just download python card and I don’t know it is me but I am not
 get it in my start programs menu I have read the start ups and the read me
 but I can not get to start up want do I do and I do not see code Editor I
 'am  going by the book Beginning python Peter Norton,Alex Samuel,David Aitel
 and all them so if you can help that would be grate














 think you and god bless

 wolfmana1...@hotmail.com

 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Problems with adodbapi

2011-10-03 Thread Max Slimmer
I am trying to access a sqlbase database, In the past I had no problem, but
after re-installing python and win32 etc and therefore getting latest
version of adodbapi I get the following symptom

When I do cursor.execute(select xxx from sometable) and xxx contains one
of the following columns as described by the cursor.description attribute:
(u'STATELVDINCODE', 200, None, 2, 255, 255, False)
(u'LCLTYWRKEDINCODE', 200, None, 4, 255, 255, False)
(u'LCLTYLVDINCODE', 200, None, 4, 255, 255, False)
(u'EZLMEMPLOYEEID', 200, None, 32, 255, 255, False)

By going back to version 2.2.5 I no longer get this failure.  I have tried
to walk into the code and have yet to determine just where it is failing, It
fails in the execute setup, but doesn't error, just returns -1.  can you
give me an idea where to look in the code, maybe some exception is getting
caught and not returned?

A second problem with a different (foxpro) database, is field type 131
adDBDate is getting converted to a datetime and the value returned is
datetime.datetime(, MM, dd, hh, mm) I would prefer to get datetime.date
objects,

Thanks for any piinters. I will try to find just where things are going
astray, but as yet not familiar with the code.

max
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32