[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2021-07-30 Thread Danny Lin
Danny Lin added the comment: It should be emphasized that it may happen on a **file operation**... So at least be something like: "On some platforms, it may also be raised if a file operation involves an attempt to open or traverse a non-directory file as if it were a dire

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2021-07-30 Thread Danny Lin
Danny Lin added the comment: @Andrei Kulakov: That statement is mainly for illustration that such behavior may vary across platforms. I use a rather vague statement as I'm not totally sure it applies if (and only if) running on POSIX. A more accurate statement is welcome as long as it's

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2021-07-30 Thread Danny Lin
Danny Lin added the comment: @Andrei Kulakov: I was commenting on the previous version. The revised version (f2ae30b0de3c4ba1f16fc2a430cf22b447c062ed) seems ok to me. Another question: would it be better if we add "on some platforms" for the part that the error may raise on a file

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2021-07-30 Thread Danny Lin
Danny Lin added the comment: > I've put up a PR that expands the docs for NotADirectoryError here: > https://github.com/python/cpython/pull/27471/files Thank you. Wouldn't it be more clear if an example is provided? Like: (e.g. `/path/to` does not exist when running `open('/path/t

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2020-10-20 Thread Danny Lin
Danny Lin added the comment: > Really? It's not obvious that finding a file would involve directory > operations? Not in some senses, and that's possibly why Windows does not raise NotADirectoryError in such case. I agree that it's a platform-specific implementation detail. H

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2020-10-20 Thread Danny Lin
Danny Lin added the comment: I don't think a general developer would expect that open('/path/to/file/somename.txt') implies a directory operation, and it also doesn't on Windows. I suggest that a further notice be added to NotADirectoryError, such as: Raised when a directory operation

[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2020-10-20 Thread Danny Lin
Danny Lin added the comment: By writing "except FileNotFoundError:", the intention is to catch an error when the file being opened is not found, and don't catch an error for other cases, such as an existing file without adequate permission. Writing "except OSError:" c

[issue37529] Mimetype module duplicates

2020-09-17 Thread Danny Lin
Danny Lin added the comment: It doesn't seem so... In Python 3.8.5 this code is still seen in mimetypes.py (line 492-504): '.bmp': 'image/bmp', '.gif': 'image/gif', '.ief': 'image/ief', '.jpg': 'image/jpeg', '.jpe': 'image/jpeg

[issue41737] Improper NotADirectoryError when opening a file under a fake directory

2020-09-08 Thread Danny Lin
Danny Lin added the comment: I'm not so familiar about the spec. If such behavior is confirmed due to implementation difference across OSes, and it's also not desirable to change the mapping of the OS error to Python exception, we can simplify left it as-is. However, this behavior

[issue41738] MIME type for *.zip becomes application/x-zip-compressed on Windows

2020-09-07 Thread Danny Lin
New submission from Danny Lin : On Windows, command "python -m mimetypes foo.zip" outputs "type: application/x-zip-compressed encoding: None", while it's "type: application/zip encoding: None" on Linux. According to the mimetype.py in CPython source

[issue41737] Improper NotADirectoryError when opening a file under a fake directory

2020-09-07 Thread Danny Lin
New submission from Danny Lin : On Linux (tested on Ubuntu 16.04), if "/path/to/file" is an existing file, the code: open('/path/to/file/somename.txt') raises NotADirectoryError: [Errno 20] Not a directory: '/path/to/file/somename.txt' On Windows, similar code: open

[issue33649] asyncio docs overhaul

2018-09-17 Thread Danny Hermes
Change by Danny Hermes : -- pull_requests: +8809 ___ Python tracker <https://bugs.python.org/issue33649> ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: [PSF-Community] Python Events in 2017, Need your help.

2017-01-09 Thread Danny Adair
Thanks Stephane, Kiwi PyCon 2017 will be in Auckland, New Zealand in September - exact dates and location not yet determined. I'll submit it when they are. Cheers, Danny On Mon, Jan 9, 2017 at 10:54 PM, Stephane Wirtel via PSF-Community <psf-commun...@python.org> wrote: > Dear

[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
Danny Yoo added the comment: Alternatively, change the representation of flag values from integers to some class extension that supports the common bitwise operators. As a very rough sketch: >>> class FlagInt(int): ... def __or__(self, other): ... return FlagInt(int(se

[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
Danny Yoo added the comment: Ugh. I suddenly realize that this is complicated by the fact that flag values are themselves represented as integers, and Python's type system isn't rich enough to label flag values as a distinct type for the purposes. It may be worthwhile to add a warning

[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
New submission from Danny Yoo: This comes from diagnosing a beginner's question on Python-tutor. https://mail.python.org/pipermail/tutor/2016-December/110066.html It appears that re.sub is not checking whether the count argument is integer or not, and silently accepts a nonsensical argument

[issue23306] zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
Danny Yoo added the comment: Unfortunately, fixing just zlib.crc32 isn't quite enough for our purposes. We still will see OverflowErrow in zipfile if compression is selected. Demonstration code: import zipfile ## Possible workaround: monkey

[issue23306] zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
New submission from Danny Yoo: Reproduction steps: --- $ python2.7 -c import zlib;zlib.crc32('a'*(131)) Traceback (most recent call last): File string, line 1, in module OverflowError: size does not fit in an int --- We ran into this bug in zlib.crc32 when using zipfile.writestr

[issue23306] Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
Changes by Danny Yoo danny...@google.com: -- title: zlib.crc32 raises OverflowError at argument-parsing time on large strings - Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings ___ Python tracker rep

Re: [Tutor] Convert Qstring to string in windows

2014-10-16 Thread Danny Yoo
On Thu, Oct 16, 2014 at 8:21 AM, C@rlos cmfer...@estudiantes.uci.cu wrote: I have been tryed to convert a Qstring text to string on python, in linux that work fine but in windows when qstring contine á,é,í,ó,ú the converted text is not correct, contine extranger characters, this qstring text

Kiwi PyCon 2013 Call for Proposals is now open! (closes 01 June)

2013-05-10 Thread Danny Adair
first! The deadline for proposal submission is Saturday 01 June 2013. For more information please visit http://nz.pycon.org/call-for-proposals/ Looking forward to seeing you in Auckland in September! -- Danny W. Adair Event Director Kiwi PyCon 2013 -- http://mail.python.org/mailman/listinfo

regular expression

2011-08-16 Thread Danny Wong (dannwong)
Hi All, If I get multiline standard output from a command. How can I retrieve this part of the string (1006) Example: #Committing... #Workspace: (1003) My OS_8.12.0 Work - (1004) OS_8.12.0 # Component: (1005) he-Group - (1004) OS_8.12.0 #Outgoing: # Change sets: #(1006)

subprocess.Popen question

2011-08-16 Thread Danny Wong (dannwong)
Hi All, I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the next command. Any ideas? Thanks. CMD_OUTPUT =

RE: regular expression

2011-08-16 Thread Danny Wong (dannwong)
. Thanks again. -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 16, 2011 12:26 AM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: regular expression On Tue, Aug 16, 2011 at 12:00 AM, Danny Wong

subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
Hi All, I'm trying to execute some external commands from multiple database. I'm using threads and subprocess.Popen ( from docs, all the popen* functions are deprecated and I was told to use subprocess.Popen) to execute the external commands in parallel, but the commands seems to hang. My

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
: print Error Executing %s % command + \n -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 09, 2011 11:47 PM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: subprocess.Popen and thread module On Tue

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
[mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 09, 2011 11:53 PM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: subprocess.Popen and thread module On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) dannw...@cisco.com wrote: Hi All,   I'm trying

python module to determine if a machine is idle/free

2011-08-03 Thread Danny Wong (dannwong)
Hi all, I have 5 server machines that are using to process information. I would like to write a quick server python script that determines which of the machines are not in use. Any recommendations on which python module I should use to detect if a machine is not performing idle

Seeking an example on using Queue to update variable while threading

2011-07-27 Thread Danny Wong (dannwong)
Hi Python experts, I'm trying to use a dict structure to store and update information from X number of threads. How do I share this dict structure between threads? I heard of using a queue, but I'm not familiar with how it works. Does anyone have an example of using a queue to store

virtualenv problem on win32

2011-04-13 Thread Danny Shevitz
\python.exe -c #!python \\\Bootstra...sys.argv[1:]) c:\python27\lib\site...ols-0.6c11-py2.7.egg failed with error code 1 ### does anyone know what is going on? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

calling 64 bit routines from 32 bit matlab on Mac OS X

2011-03-15 Thread Danny Shevitz
some commercial 3rd party C extension code that is 64 bit. Am I just out of luck or is there something that I can do? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: attach to process by pid?

2011-03-09 Thread Danny Shevitz
process has some kind of communication(s) interface; eg: * some kind of listening socket * some kind of I/O (pipe, stdin/stdout) It does have a stdin/stdout. How do I access it? thanks, D -- http://mail.python.org/mailman/listinfo/python-list

Re: attach to process by pid?

2011-03-09 Thread Danny Shevitz
Have a look at the SIMPL toolkit. http://www.icanprogram.com/06py/lesson1/lesson1.html This should be able to do exactly what you want. bob Does this work on Mac OS X? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

attach to process by pid?

2011-03-08 Thread Danny Shevitz
Howdy, Is there any way to attach to an already running process by pid? I want to send commands from python to an application that is already running. I don't want to give the command name to subprocess.Popen. thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

how to communicate in python with an external process

2011-03-07 Thread Danny Shevitz
python code and at some point later, repeat the process of attaching to the persistent matlab pid... I am familiar with subprocess.Popen, but I don't understand how to attach to a pid, as opposed to creating a new matlab instance every time. Any enlightenment would be appreciated. thanks, Danny

Re: how to communicate in python with an external process

2011-03-07 Thread Danny Shevitz
in the same directory as the egg when I do this. I am certainly doing something stupid, but don't know what it is. thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugger - fails to continue with breakpoint set

2010-09-27 Thread Danny Levinson
Does this describe the problem you are having? http://bugs.python.org/issue5294 -- http://mail.python.org/mailman/listinfo/python-list

IOError and Try Again to loop the loop.

2010-07-11 Thread The Danny Bos
to start again? I mean, in Terminal it dies anyway, so I have to start it again by hand, which is a pain as it dies so sporadically. Can I automate this error, catch it and just get it to restart the loop? Thanks for your time and energy, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: IOError and Try Again to loop the loop.

2010-07-11 Thread The Danny Bos
: print IOError; Retrying... pass print Done On Jul 12, 12:33 pm, MRAB pyt...@mrabarnett.plus.com wrote: The Danny Bos wrote: Heya, I'm running a py script that simply grabs an image, creates a thumbnail and uploads it to s3. I'm simply logging into ssh and running

Re: IOError and Try Again to loop the loop.

2010-07-11 Thread The Danny Bos
11, 2010 at 8:13 PM, The Danny Bos danny...@gmail.com wrote: Thanks gang, I'm gonna paste what I've put together, doesn't seem right. Am I way off? Here's my code.  - It goes through a table Item  - Matches that Item ID to an API call  - Grabs the data, saves it and creates

Re: MODULE FOR I, P FRAME

2010-02-24 Thread DANNY
On Feb 24, 3:11 am, Rhodri James rho...@wildebst.demon.co.uk wrote: On Tue, 23 Feb 2010 10:39:21 -, DANNY danijel.gv...@gmail.com wrote: @James I am thinkinhg about effect of errors that are within the sequence of P frames. Where the P frames have only the information about the changes

Re: MODULE FOR I, P FRAME

2010-02-23 Thread DANNY
@James I am thinkinhg about effect of errors that are within the sequence of P frames. Where the P frames have only the information about the changes in previous frames, so that errors are present until the next I frame. So I would like to see how is this seen in different GoP sized clips. @Tim

Re: MODULE FOR I, P FRAME

2010-02-22 Thread DANNY
On Feb 21, 1:54 am, Tim Roberts t...@probo.com wrote: DANNY danijel.gv...@gmail.com wrote: If I want to have a MPEG-4/10 coded video and stream it through the network and than have the same video on the client side, what should I use and of course I don't want to have raw MPEG data, because

[issue7971] hidraw Linux module

2010-02-19 Thread Danny Milosavljevic
Danny Milosavljevic danny_m...@yahoo.com added the comment: Usage example: import hidraw import os hidraw.get_info(os.open(/dev/hidraw0, os.O_RDONLY)) hidraw.Info(3, 0x0E20, 0x0200) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

Re: MODULE FOR I, P FRAME

2010-02-15 Thread DANNY
On Feb 16, 12:53 am, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sun, 14 Feb 2010 10:07:35 -, DANNY danijel.gv...@gmail.com wrote: Hy, first thanks for your response! Well I am thinkin on coding in MPEG4/10, but I would just encode the video in that encoding, then stream

MODULE FOR I, P FRAME

2010-02-11 Thread DANNY
Hello! I am currently developing a simple video player in python, and my problem is that i can't find a module which has a function that can determine if frame(image) is I or P coded (MPEG coding). I have been using PIL but I couldnt find anything that could help me with that problem. Thanks for

geospatial python and how to convert multilinestrings to kml

2009-03-03 Thread Danny Shevitz
. Is there a pythonic way (some existing module) to convert PostGIS MultiLineStrings to a KML file format? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

problem doing unpickle in an exec statement

2008-07-23 Thread Danny Shevitz
) fp.close() print result = , result ''' # create the new include_fun include_fun = create_fun(code_text) # run it include_fun(file_name) # Can anyone enlighten me what I need to do to exec_pickle.py to get this to work? thanks, Danny -- http

Re: how to convert a multiline string to an anonymous function?

2008-04-30 Thread Danny Shevitz
Thanks All! you've solved my problem. D -- http://mail.python.org/mailman/listinfo/python-list

how to convert a multiline string to an anonymous function?

2008-04-29 Thread Danny Shevitz
, but I'm stuck just the same... thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

instance method questions

2007-08-22 Thread Danny
method? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

problem with psqlite2 return types

2007-07-18 Thread Danny
, paramList) Any ideas? TIA, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: Common Python Idioms

2006-12-07 Thread Danny Colligan
http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: IEC Controller and head element

2006-11-30 Thread Danny Scaleno
/index.php Great library ! Danny using IEC Controller, anybody knows how to capture the head part of an html page like this one? html head script language='javascript' Object=window.open('test.html','test1','name=test1'); Object.focus() /script head body/body /html it seems IEC

IEC Controller and head element

2006-11-28 Thread Danny Scaleno
the body part. I need to parse the string inside the tag script Actually, IEC return the ie.Document object, but how do I know which methods and properties are available for it ? Thank you Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: Yield

2006-11-16 Thread Danny Colligan
are generators used that are clearly superior to alternatives? Thanks in advance, Danny On Nov 16, 3:14 am, John Machin [EMAIL PROTECTED] wrote: On 16/11/2006 7:00 PM, Fredrik Lundh wrote: John Machin wrote: I would like to thanks Fredrik for his contribution to improve that. Call me crazy

Re: Yield

2006-11-16 Thread Danny Colligan
Danny Colligan On Nov 16, 10:49 am, Richard Brodie [EMAIL PROTECTED] wrote: Danny Colligan [EMAIL PROTECTED] wrote in messagenews:[EMAIL PROTECTED] Now that we're on the subject, what are the advantages of using generators over, say, list comprehensions or for loops? It seems to me

newbie: minidom

2006-11-10 Thread Danny Scalenotti
I'm not able to get out of this ... from xml.dom.minidom import getDOMImplementation impl = getDOMImplementation() // default UTF-8 doc = impl.createDocument(None, test,None) root = doc.documentElement root.setAttribute('myattrib', '5') print root.toxml() I obtain test myattrib=5/

Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Danny Colligan
to assign to a list in a for loop (with as little code as used above) without using enumerate? Thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Danny Colligan
I see. Thanks for the helpful response. Danny Duncan Booth wrote: Danny Colligan [EMAIL PROTECTED] wrote: In the following code snippet, I attempt to assign 10 to every index in the list a and fail because when I try to assign number to 10, number is a deep copy of the ith index

Hiding / showing windows in Macs

2006-09-19 Thread Sinang, Danny
Hello, How do we hide and show windows in Macs ? Regards, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: Zipping Files to user defined Directory

2006-09-02 Thread Danny Milosavljevic
output. I don't know TurboGears though. cheers, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Help] os listdir access denied when run as a service

2006-05-25 Thread Danny Yoo
On Thu, 25 May 2006, Thomas Thomas wrote: I am trying to access a mapped network drive folder. everything works fine normally. But when i run the application as service I am getting the error The error is on the line: for filename in os.listdir(folder):#line 25 and I have to

While loop - print several times but on 1 line.

2006-01-26 Thread Danny
Hello there. I'm creating a little text changer in Python. In the program there is a while loop. The problem is that a while loop will have 1 print statement and it will loop until it gets to the end of the text. Example: num = 5 // Set num to 5 while num = 1: // loop 5 times. print

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Danny
I think I should paste some of the programs code a little more of what I want... var = 0 while var = 5: print a[t[var]] var = var +1 a is a dectionary (very big) and t is a string of text. (if that's important right now). I'm just trying to make the value of a[t[var]] print on one

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Danny
Great! It's been solved. The line, as Glaudio said has a , at the end and that makes it go onto one line, thanks so much man! var = 0 while = 5: print a[t[var]], var = var +1 prints perfectly, thanks so much guys. -- http://mail.python.org/mailman/listinfo/python-list

Changing numbers into characters using dictionaries

2006-01-26 Thread Danny
C:/Documents and Settings/Danny/My Documents/python/changetext.py, line 9, in ? var = str(a[t[something]]) KeyError: '7704' I've explained what is needed to happen in the comments. Also, if any of you can think of a better way to do this can you possibly tell me this? Thanks. -- http

Re: [Baypiggies] BayPIGgies: December 8, 7:30pm (IronPort)

2005-12-05 Thread Danny Yoo
Advance notice: We need speakers for January and later. Please send e-mail to [EMAIL PROTECTED] if you want to suggest an agenda (or volunteer to give a presentation). Correction: that email address should be '[EMAIL PROTECTED]'. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] how to convert between type string and token

2005-11-14 Thread Danny Yoo
On Mon, 14 Nov 2005, enas khalil wrote: hello all [program cut] Hi Enas, You may want to try talking with NTLK folks about this, as what you're dealing with is a specialized subject. Also, have you gone through the tokenization tutorial in:

Re: append one file to another

2005-07-12 Thread Danny Nodal
Its been a while since I last coded in Python, so please make sure you test it before trying it so you don't clobber your existing file. Although it may not be more effecient than what you are doing now or has been suggested already, it sure cuts down on the typing.

Re: cursor positioning

2005-07-11 Thread Danny Milosavljevic
clean code. Hope that helps cheers, Danny -- http://mail.python.org/mailman/listinfo/python-list

socket.listen() backlog value

2005-03-11 Thread Sinang, Danny
the problems are reported. My question is, is our socket.listen(10) enough ? Should I increase it ? What is the maximum value for our particular server operating system ? Regards,Danny SinangBusiness Process Reengineering Tel: +632-855-8686 Fax: +632-855-8630www.spipublisherservices.com CONFIDE

python tutorial/projects

2005-02-22 Thread Danny
Does anyone know of a good python tutorial? I was also looking for some non-trivial projects to do in python. Basically I would like to claim on my resume, that I know python, with out bad karma. Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: [Mingw-users] Problem with msvcrt60 vs. msvcr71 vs. strdup/free

2004-12-21 Thread Danny Smith
.. Patches to facilitate switching to an alternative msvcr*.dll could be submitted to gcc. Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Help] Programming help

2004-12-06 Thread Danny Yoo
On Mon, 6 Dec 2004, Alfred Canoy wrote: Please help me out:(.. I've been trying to figure this out for 2 days now.. I don't know what to use to print all the list of numbers. I hve know idea how should I do this. I tried a lot of trial error for the the def, dict, .list( ). have no luck.