[issue33428] pathlib.Path.glob does not follow symlinks

2018-05-16 Thread Brian Sheldon
Brian Sheldon <brianmshel...@gmail.com> added the comment: Windows does not implement symlinks as junctions. Windows has hardlinks, symlinks and junctions which are all distinctly different in behaviour. I don't doubt that this is a Windows-specific issue, although I have not tested

[issue33428] pathlib.Path.glob does not follow symlinks

2018-05-05 Thread Brian Sheldon
Change by Brian Sheldon <brianmshel...@gmail.com>: -- type: -> behavior ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33428> ___ _

[issue33428] pathlib.Path.glob does not follow symlinks

2018-05-05 Thread Brian Sheldon
New submission from Brian Sheldon <brianmshel...@gmail.com>: Given a `pathlib.Path` that contains symlinked subfolders, `Path.glob` (and `.rglob`) do not follow symlinks. This is not consistent with `glob.glob` which does. For example given the following: C:\Folder C:\Folder\Subfolde

[issue33392] pathlib .glob('*/') returns files as well as directories

2018-05-04 Thread Brian Sheldon
Brian Sheldon <brianmshel...@gmail.com> added the comment: This appears to be a duplicate of #22276 -- nosy: +brianmsheldon ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

Re: netCDF4 variable manipulation

2012-02-21 Thread Sheldon
On Feb 21, 12:53 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 20 Feb 2012 12:37:22 -0800, Sheldon wrote: Hi, I'm trying to read a netCDF4 variable from a file (no problem) and then scale it before writing over the original variable in the file. I'm using

netCDF4 variable manipulation

2012-02-20 Thread Sheldon
Hi, I'm trying to read a netCDF4 variable from a file (no problem) and then scale it before writing over the original variable in the file. I'm using python 2.7 and the latest netCDF4 module. It's not that I keep getting an error message but I want to do this without using for loops and all the

RE: Password prompt with mask

2008-08-05 Thread Neuberger, Sheldon N.
Could I write my own if one does not exist? Take a look at the getpass.py module. It's very short. The windows version of the getpass function can be trivially modified to echo something. The unix version is just as short but a bit more complicated. def win_getpass(prompt='Password: ',

ntlm authentication

2008-07-21 Thread Neuberger, Sheldon N.
Is there any way to make urllib2 handle NTLM authentication? Sheldon Neuberger -- http://mail.python.org/mailman/listinfo/python-list

RE: Writing a program under GNU/Linux for MS Windows.

2008-07-18 Thread Neuberger, Sheldon N.
If you're just writing Python code then it will run unmodified on his Windows machine. Are you planning on using other languages too? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Levi Campbell Sent: Friday, July 18, 2008 4:27 PM To:

urllib2 http authentication/redirection/cookie issue

2008-07-14 Thread Neuberger, Sheldon N.
get an HTTP 401 exception. Any help would be much appreciated. Code and traceback follows. Regards, Sheldon Neuberger -- cj = cookielib.LWPCookieJar() cookie_handler = urllib2.HTTPCookieProcessor(cj) passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm() passmgr.add_password

PyType_IsSubtype ()

2007-01-05 Thread Sheldon
/lib/python2.3/site-packages/Numeric/ranlib.so Symbols already loaded for /usr/lib/python2.3/site-packages/Numeric/lapack_lite.so Symbols already loaded for /usr/lib/python2.3/lib-dynload/time.so Symbols already loaded for /data/proj_ns1/safworks/sheldon/MSG_PPS_COMP/c_codes/msgppsarea.so Symbols

Re: PyType_IsSubtype ()

2007-01-05 Thread Sheldon
Martin v. Löwis skrev: Sheldon schrieb: Can anyone tell me what this error mean: #0 0x4008376e in PyType_IsSubtype () from /usr/lib/libpython2.3.so.1.0 It's not an error. It is just a frame from the backtrace. To understand the crash better, one would need to see more frames from

Py_BuildValue or PyList_SetItem()

2007-01-03 Thread Sheldon
, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c, refcnt 0 at 0x80d885c Any help is appreciated! /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_BuildValue or PyList_SetItem()

2007-01-03 Thread Sheldon
Jack Diederich skrev: On Wed, Jan 03, 2007 at 01:16:38PM -0800, Sheldon wrote: I have a function that creates python objects out of C arrays and returns them to Python. Below is a working example that I later want to expand to return 12 arrays back to Python. The problem is that when I

Re: Core dump revisited

2006-12-19 Thread Sheldon
Nick Craig-Wood skrev: Sheldon [EMAIL PROTECTED] wrote: Sheldon skrev: Wonderful! Now I know how to used gdb with python. Good! The are results area posted below. Since I am new at this I could used some help in interpreting the problem. What I do know is this: my allocation

Cpoying a PyList to a C string array

2006-12-19 Thread Sheldon
Hi, The code below is a rookie attempt to copy a python list of strings to a string array in C. It works to some extent but results in memory problems when trying to free the C string array. Does anyone know how to do this properly? ***

Re: Core dump revisited

2006-12-19 Thread Sheldon
Duncan Booth skrev: Sheldon [EMAIL PROTECTED] wrote: I am new to this and copied this code from a colleague. So, it corrupts the pointer. How do I do this properly? Here is at least part of your problem: msgop = PyList_GetItem(work.msgobj, i); work.msg_scenes[i

Re: Core dump revisited

2006-12-19 Thread Sheldon
Nick Craig-Wood skrev: Sheldon [EMAIL PROTECTED] wrote: Man. You are good. This is most insight I have had from anyone. :-) I did initialize the arrays with PyObjects and today, after hours of debugging and now with your insight, I think the problem lies here: Good! You need

Re: Cpoying a PyList to a C string array

2006-12-19 Thread Sheldon
Klaas skrev: Sheldon wrote: The code below is a rookie attempt to copy a python list of strings to a string array in C. It works to some extent but results in memory problems when trying to free the C string array. Does anyone know how to do this properly? You have numerous problems

Re: Core dump revisited

2006-12-18 Thread Sheldon
Nick Craig-Wood skrev: Sheldon [EMAIL PROTECTED] wrote: gdb msgppscomp.py core.3203 Run gdb python Then type run msgppscomp.py at the gdb prompt. When it crashes, type bt for a back trace. This will pinpoint exactly where it crashes. Hopefully that will make things

Re: Core dump revisited

2006-12-18 Thread Sheldon
Nick Craig-Wood skrev: Sheldon [EMAIL PROTECTED] wrote: gdb msgppscomp.py core.3203 Run gdb python Then type run msgppscomp.py at the gdb prompt. When it crashes, type bt for a back trace. This will pinpoint exactly where it crashes. Hopefully that will make things

Core dump revisited

2006-12-17 Thread Sheldon
to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i586-mandrake-linux-gnu.../data/proj_ns1/safworks/sheldon/msgppscomp.py: not in executable format: File format not recognized Core was generated by `python msgppscomp.py

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], Sheldon wrote: Now I am wondering if the problem is in Python and the wrapper? Does anybody have any idea or experience with this? I am running on Mandrake10 using python 2.3. I am not exactly sure which C wrapper I am using as I

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Fredrik Lundh wrote: Sheldon wrote: I am very new at this C extensions in Python so my term wrapper was probably a misnomer. Perhaps glue is better or the interface that allows the exchange of data between Python and C. Yes, I am using python objects in my C extension. Tell me where I

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Fredrik Lundh wrote: Sheldon wrote: I am very new at this C extensions in Python so my term wrapper was probably a misnomer. Perhaps glue is better or the interface that allows the exchange of data between Python and C. Yes, I am using python objects in my C extension. Tell me where I

function for allocating memory for string array

2006-11-17 Thread Sheldon
== NULL) { // Memory for the Col fprintf(stderr, Failed to allocate memory\n); exit(EXIT_FAILURE); } } return array; } static void MemoryFreeStr(int Col, char*** array) { int i; for (i = 0; i 15; i++) { free((*array)[i]); } free(*array); } Thanks, Sheldon -- http

C extensions and memory leakage

2006-11-16 Thread Sheldon
person. thanks in advance, /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

C wrapper

2006-11-07 Thread Sheldon
Hi, Can anyone give me some idea as to what this error means? ImportError: dynamic module does not define init function I am new at this and there is still a lot to learn. Any help is appreciated, /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: C wrapper

2006-11-07 Thread Sheldon
Farshid Lashkari skrev: Sheldon wrote: Can anyone give me some idea as to what this error means? ImportError: dynamic module does not define init function I am new at this and there is still a lot to learn. Any help is appreciated, Take a look at the documentation for creating

Re: C wrapper

2006-11-07 Thread Sheldon
Robert Kern skrev: Sheldon wrote: This function is there and is called init_mymodule() but I have other functions that are not static. Is the module's name _mymodule? Or is it mymodule? -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma

Re: C wrapper

2006-11-07 Thread Sheldon
number crunching. Now I just need to connect it to my python program. Should the initmsgpps_functions() be the only function in the file? Then how do I connect my C module to my Python program? /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: C wrapper

2006-11-07 Thread Sheldon
Gabriel Genellina skrev: At Tuesday 7/11/2006 17:27, Sheldon wrote: Here is the file/module name: _msgpps_functions.c Here is the initfunction: PyMODINIT_FUNC init_msgpps_functions(void) { PyObject* m; m=Py_InitModule(_msgpps_functions,_msgpps_functionsMethods); ErrorObject

Re: Resuming a program's execution after correcting error

2006-10-04 Thread Sheldon
MRAB wrote: Sheldon wrote: MRAB wrote: Sheldon wrote: Hi. Does anyone know if one can resume a python script at the error point after the error is corrected? I have a large program that take forever if I have to restart from scratch everytime. The error was the data

Re: Resuming a program's execution after correcting error

2006-10-03 Thread Sheldon
is very large and it is being modified often. Any advice on how to save the variables. /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Resuming a program's execution after correcting error

2006-10-03 Thread Sheldon
MRAB wrote: Sheldon wrote: Hi. Does anyone know if one can resume a python script at the error point after the error is corrected? I have a large program that take forever if I have to restart from scratch everytime. The error was the data writing a file so it seemed such a waste

Continuing after error

2006-09-28 Thread Sheldon
Hi, Does anyone know if it is possible to resume the execution of a program after it stops at an error in the code and the error was corrected? Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Resuming a program's execution after correcting error

2006-09-28 Thread Sheldon
be recalculated again. Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Printing UTF-8

2006-09-21 Thread sheldon . regular
I am new to unicode so please bear with my stupidity. I am doing the following in a Python IDE called Wing with Python 23. s = äöü print s äöü print s äöü s '\xc3\xa4\xc3\xb6\xc3\xbc' s.decode('utf-8') u'\xe4\xf6\xfc' u = s.decode('utf-8') u u'\xe4\xf6\xfc' print u.encode('utf-8')

Concatenating arrays

2006-08-24 Thread Sheldon
a 1 does it horizontally. But the results does not reflect this. What am I missing here? I am using Numeric. Any help is appreciated, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: concatenate Numeric

2006-07-10 Thread Sheldon
Robert Kern skrev: Sheldon wrote: Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by concatenating them at the bottom and then concatenating

Re: concatenate Numeric

2006-07-10 Thread Sheldon
Robert Kern wrote: Sheldon wrote: Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by concatenating them at the bottom and then concatenating them

Re: concatenate Numeric

2006-07-10 Thread Sheldon
Robert Kern skrev: Sheldon wrote: Thanks again for showing me this. I have been trying to read up on reduce() as I have never used it before. I would like to know what it does. So far my search has found nothing that I can grasp. The reference library notes are estoteric at best. Can

concatenate Numeric

2006-07-09 Thread Sheldon
)) values is incorrect. Does anyone knows why this is so? If I was doing something wrong then Matlab would not have returned correct values. Any help is appreciated! /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: concatenate Numeric

2006-07-09 Thread Sheldon
Sheldon skrev: Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by concatenating them at the bottom and then concatenating them side by side: for ind

Re: Numeric help!

2006-07-03 Thread Sheldon
Carl Banks wrote: Sheldon wrote: average(compress(ravel(equal(wk,z)),ravel(sattmp)),axis=None) This is much more compact and elegant. Thanks for pointing this out. I don't know why average() returned a divide by zero error and to avoid this I inserted this if statement. Now it works

Classes and global statements

2006-07-03 Thread Sheldon
instead of passing them back and forth. After trying this it did work! My question is why? Another way to solve this problem is to make the variable I need global in the class that they are created. Does anyone have a better way in mind? Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo

Re: Classes and global statements

2006-07-03 Thread Sheldon
Simon Forman skrev: Sheldon wrote: Hi, I have a series of classes that are all within the same file. Each is called at different times by the main script. Now I have discovered that I need several variables returned to the main script. Simple, right? I thought so and simply returned

Re: Classes and global statements

2006-07-03 Thread Sheldon
Scott David Daniels skrev: Sheldon wrote: Hi, I have a series of classes that are all within the same file. Each is called at different times by the main script. Now I have discovered that I need several variables returned to the main script. Simple, right? I thought so and simply

Re: Numeric help!

2006-06-30 Thread Sheldon
Carl Banks wrote: Sheldon wrote: Carl Banks wrote: I'm not sufficiently sure this isn't a homework problem, so here's a partial answer. [snip] My days as a student is over for the most part. I am learning python on my own and Numeric is not properly documented so I am learning

Re: Numeric help!

2006-06-29 Thread Sheldon
wrong. I am not using the original arrays, only the copies and when a new z is chosen then these are recreated. Care to help out with this? /Sheldon Carl Banks wrote: Sheldon wrote: Hi, I have the following loop that I think can be written to run faster in Numeric. I am currently using

Numeric help!

2006-06-28 Thread Sheldon
the sum of the values count += 1 # count the occurrences tmp_array[0,index] = round(mbias/count,1) # store the mean tmp_array[1,index] = z index += 1 Any help would be greatly appreciated! Sincerely, Sheldon -- http://mail.python.org

array manipulation without for loops

2006-06-25 Thread Sheldon
this without using for loops? Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: array manipulation without for loops

2006-06-25 Thread Sheldon
Hi Gary, I am really trying to cut the time down as I have 600+ arrays with dimensions (1215,1215) to compare and I do a lot more things with the arrays. If I understand you correctly, there is no way around a for loop? /Sheldon Gary Herron wrote: Sheldon wrote: Hi, I have two arrays

Re: array manipulation without for loops

2006-06-25 Thread Sheldon
of these arrays at the same time. I cannot install Numpy due to my working conditions. Sorry I should have made it clear that is was Numeric I was working with. /Sheldon Alex Martelli wrote: Sheldon [EMAIL PROTECTED] wrote: Hi Gary, I am really trying to cut the time down as I have 600+ arrays

Re: array manipulation without for loops

2006-06-25 Thread Sheldon
into it when I get back to work tomorrow. Bye for now, Sheldon Alex Martelli wrote: Sheldon [EMAIL PROTECTED] wrote: Alex, I am using Numeric and have created 3 arrays: zero((1215,1215),Float) Two arrays are compared and one is used to hold the mean difference between the two compared

Re: array manipulation without for loops

2006-06-25 Thread Sheldon
: print x [10 1 30 3 50] putmask(x, [1,0,1,0,1], [-1,-2]) print x [-1 1 -1 3 -1] Can you explain why the -2 didn't factor in? /Sheldon Sheldon wrote: Hi Alex, I will code this in a little while and get back to you. Terrific! I saw this function but I skipped over it without realizing what

Re: OverflowError: math range error...

2006-06-23 Thread Sheldon
Thanks for the tips! I am going to look into this some more. /Sheldon Simon Forman skrev: Sheldon wrote: Hi, I have a written a script that will check to see if the divisor is zero before executing but python will not allow this: if statistic_array[0:4] 0.0: statistic_array[0,0

Re: OverflowError: math range error...

2006-06-23 Thread Sheldon
. /Sheldon Robert Kern skrev: Sheldon wrote: Hi, I have a written a script that will check to see if the divisor is zero before executing but python will not allow this: if statistic_array[0:4] 0.0: statistic_array[0,0:4] = int(multiply(divide(statistic_array[0,0:4

Re: comparing two arrays

2006-06-22 Thread Sheldon
Thanks Diez, It will take a little while for this one to sink in but it gets the job done now and will for future cases. /Sheldon Diez B. Roggisch skrev: print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == y))] instead. Diez Hi Diez, I wish I say that I

Re: comparing two arrays

2006-06-22 Thread Sheldon
Thanks Diez, It will take a little while for this one to sink in but it gets the job done now and will for future cases. /Sheldon Diez B. Roggisch skrev: print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == y))] instead. Diez Hi Diez, I wish I say that I

OverflowError: math range error...

2006-06-22 Thread Sheldon
is complaining: statistic_array[0,0:4] = int(multiply(divide(statistic_array[0,0:4],statistic_array[0,4]),1.0))/100.0 OverflowError: math range error and how do I get around this problem? This stupid because there is a if statement preventing this dividing by zero. Sincerely, Sheldon -- http

Re: comparing two arrays

2006-06-20 Thread Sheldon
. Diez Hi Diez, I wish I say that I understood what you wrote here but I can't. Do you mind explaining a little more? /sheldon -- http://mail.python.org/mailman/listinfo/python-list

comparing two arrays

2006-06-19 Thread Sheldon
) 0 Numeric.where(a==b,1,0) 0 Numeric.where(a==6 and b==6,1,0) 0 The where() statement is also worhtless here. Does anyone have any suggestion on how to do this? Thanks in advance, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

python and HDF

2006-06-15 Thread Sheldon
which is called baseline but when python reads it, it returns baselin instead. Does anyone have any idea why this is happening? Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: python and HDF

2006-06-15 Thread Sheldon
Marc 'BlackJack' Rintsch skrev: In [EMAIL PROTECTED], Sheldon wrote: I am using a HLHDF C wrapper to extract data from HDF (version 5) files. I can view the contents with IDL, for example, and read the attributes in the HDF file. There is one attribute that I extracted and only

printing all variables

2006-06-12 Thread Sheldon
Good day, I would like to know if there is a way to print all the variables set in a python program with having to write print variable on all? sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: printing all variables

2006-06-12 Thread Sheldon
Duncan Booth skrev: Sheldon wrote: Good day, I would like to know if there is a way to print all the variables set in a python program with having to write print variable on all? Not all the variables in a program (that would be rather more than you want), but you can print all

ftputil.py

2006-05-24 Thread Sheldon
would be greatly appreciated! Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: ftputil.py

2006-05-24 Thread Sheldon
Thanks! Sheldon -- http://mail.python.org/mailman/listinfo/python-list

GRIB to images

2006-04-24 Thread Sheldon
Hi, I am interesseted on reading some GRIB files using python and then converting the fields to gif images. Does anyone know if this is possible or have a program that does this? /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

reading binary data written in C

2006-03-22 Thread Sheldon
, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: reading binary data written in C

2006-03-22 Thread Sheldon
Thanks, I later discovered that it was a big edian binary as well. Sheldon -- http://mail.python.org/mailman/listinfo/python-list

writing arrays to binary file

2006-01-25 Thread Sheldon
anyone have any ideas of how to improve this by writing the 2D array in binary form? Thanks, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: writing arrays to binary file

2006-01-25 Thread Sheldon
Thanks Travis, I don't have the new NumPy yet but this tofile() method should work fine. /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading from input file.

2006-01-13 Thread Sheldon
Sorry Mike, after seeing so many experts beat up others for not being as smart as they are, I intrepreted your words incorrectly - my apologies. I am not in the least bit against impproving my programming. I liked what you did and thanks for the pointers. Sheldon -- http://mail.python.org

Re: Exception Handling

2006-01-12 Thread Sheldon
handling using the function RAISE: try: Call C except: raise my_error. A catch-all error is RuntimeError; try this first. try: call C except RuntimeError, r: print r You can read up on it here: http://docs.python.org/api/standardExceptions.html Cheers, Sheldon -- http://mail.python.org

Re: Reading from input file.

2006-01-12 Thread Sheldon
So Mike if you can do better then do it then! There are many ways do solve a problem, perhaps you have not learned that yet. At first this guy didn't know what to do, so he had to begin somewhere. Now you can take him much further, I am sure but the journey might not be so pleasant. Your attitude

Re: Exception Handling

2006-01-12 Thread Sheldon
was executed without error or -1 for an error. We have not tried to catch the error from the C-code. Sorry. Perhaps some else knows how. cheers, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading from input file.

2006-01-11 Thread Sheldon
, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

syntax error

2006-01-10 Thread Sheldon
anyone point me in the right direction? What triggers such erroneous errors in Python? Sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax error

2006-01-10 Thread Sheldon
Hi Rod, This sounds very interesting. I am checking the previous lines and will get back to you. Thanks, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax error

2006-01-10 Thread Sheldon
Hi Rod, You were right. The error was on the previous line. I will remember that. Thanks for your help! Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax error

2006-01-10 Thread Sheldon
Hi Fredrik, I am using python 2.3.3 I am checking now the previous lines for errors. Thanks, Sheldon -- http://mail.python.org/mailman/listinfo/python-list