[Python-Dev] Re: Issue: 92359 - Python 3.10 IDLE 64-bit doesn't open any files names code (code.py, code.pyw) - found a partial fix but looking for input

2022-05-13 Thread Guido van Rossum
So the "current working directory" is the directory containing the file,
right? That would explain the behavior.

Probably "Edit with IDLE" should be changed. I have no idea where that is
defined.

In 3.11 we should be able to make that use the new -P option, which doesn't
insert the working directory at the front of sys.path.

On Fri, May 13, 2022 at 6:50 PM  wrote:

> Hello,
>Link to the github issue page is here
> https://github.com/python/cpython/issues/92359
>
>This bug has been lurking in waiting for roughly 7 years or possibly
> longer.  The root issue is that the "Edit with IDLE" context menu executes
> idle with `python.exe -m idlelib` which puts the current working directory
> in sys.path but inside idlelib it has a `from code import ...` statement.
>   A kind of ugly hack is sitting in my fork of cpython here
> https://github.com/devdave/cpython/blob/issue_92359/Lib/idlelib/__main__.py
> .  All I did was put the Lib directory at the front of sys.path.
> Perhaps this is the best solution?  I don't know.
>
>Would appreciate any ideas for an alternative fix (ex perhaps changing
> how "Edit with IDLE" works?) or like I said, perhaps my fix is the best
> option because of how simple it is?
>
> Thanks,
>DevDave
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/NKMXPIQPISOPOV6OGASKXV4DEDZUH355/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/XF3IRRYDYAHV7YAV4YNRB6EY3HVKDEBM/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Issue: 92359 - Python 3.10 IDLE 64-bit doesn't open any files names code (code.py, code.pyw) - found a partial fix but looking for input

2022-05-13 Thread Terry Reedy

On 5/13/2022 9:20 PM, ward.dav...@gmail.com wrote:


https://github.com/python/cpython/issues/92359


This is a specific (and now closed) example of import shadowing.  The 
general issue is the subject of

https://github.com/python/cpython/issues/67997


--
Terry Jan Reedy

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CISOOPMNJGBLFTVV4X5WJHTMFMX6IHEW/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Issue: 92359 - Python 3.10 IDLE 64-bit doesn't open any files names code (code.py, code.pyw) - found a partial fix but looking for input

2022-05-13 Thread ward . davidj
Hello,
   Link to the github issue page is here 
https://github.com/python/cpython/issues/92359

   This bug has been lurking in waiting for roughly 7 years or possibly longer. 
 The root issue is that the "Edit with IDLE" context menu executes idle with 
`python.exe -m idlelib` which puts the current working directory in sys.path 
but inside idlelib it has a `from code import ...` statement.A kind of ugly 
hack is sitting in my fork of cpython here 
https://github.com/devdave/cpython/blob/issue_92359/Lib/idlelib/__main__.py .  
All I did was put the Lib directory at the front of sys.path.
Perhaps this is the best solution?  I don't know.

   Would appreciate any ideas for an alternative fix (ex perhaps changing how 
"Edit with IDLE" works?) or like I said, perhaps my fix is the best option 
because of how simple it is?

Thanks, 
   DevDave
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/NKMXPIQPISOPOV6OGASKXV4DEDZUH355/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Starting a new thread

2022-05-13 Thread Guido van Rossum
Thinking about it, it's actually a fine design to have a decorator that
turns a regular function into one that starts a thread -- from the caller's
POV it's no different than having a function that explicitly starts a
thread, and it could be a nice shorthand if you do this all the time. (You
have to document it in either case.)

That said, I don't think we need this 3-line decorator in the stdlib.

--Guido


On Thu, May 12, 2022 at 10:40 PM Serhiy Storchaka 
wrote:

> 10.05.22 18:12, Barney Stratford пише:
> > This has a couple of advantages. I don’t have to import the threading
> module all over my code. I can use the neater syntax of function calls. The
> function’s definition makes it clear it’s returning a new thread since it’s
> decorated. It gets the plumbing out of the way so I an concentrate more on
> what my code does and less in how it does it.
>
> I do not see advantages. You definitely need to import the threading
> module or other module depending on the threading module in which you
> define the decorator. And you need to decorate the function. It will not
> save you a line of code.
>
> If you need to run a lot of functions in threads, note that a thread has
> some starting cost. Consider using concurrent.futures.ThreadPoolExecutor.
>
> If you only run few long living threads, the syntax of starting them
> does not matter, in comparison with the rest of your code.
>
> Also, it looks wrong to me to mix two different things: what code to
> execute and how to run it. If we need a neater syntax, I would propose:
>
>  t = threading.start_thread(func, *args, **kwargs)
>
> But I am not sure that it is worth to add such three-line function in
> the stdlib.
>
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/RBIAWP2J3NTYMLIS3W6CKX44G5QIBXAU/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/DWPTNN2SZAPEP3HIAVAQ24BUYEDJSSF4/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Summary of Python tracker Issues

2022-05-13 Thread Brett Cannon
Can we shut this down or unsubscribe the weekly email?

On Fri, May 13, 2022 at 11:13 AM Python tracker 
wrote:

>
> ACTIVITY SUMMARY (2022-05-06 - 2022-05-13)
> Python tracker at https://bugs.python.org/
>
> To view or respond to any of the issues listed below, click on the issue.
> Do NOT respond to this message.
>
> Issues counts and deltas:
>   open7146 ( +0)
>   closed 51841 ( +0)
>   total  58987 ( +0)
>
> Open issues with patches: 2890
>
>
> Most recent 15 issues with no replies (15)
> ==
>
> #47258: Python 3.10 hang at exit in drop_gil() (due to resource warnin
> https://bugs.python.org/issue47258
>
> #47256: re: limit the maximum capturing group to 1,073,741,823, reduce
> https://bugs.python.org/issue47256
>
> #47253: LOAD_GLOBAL instruction with wrong source position
> https://bugs.python.org/issue47253
>
> #47252: socket.makefile documentation is missing data regarding the 'b
> https://bugs.python.org/issue47252
>
> #47251: Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE
> https://bugs.python.org/issue47251
>
> #47244: email.utils.formataddr does not respect double spaces
> https://bugs.python.org/issue47244
>
> #47242: Annoying white bar in IDLE (line 457 in sidebar.py)
> https://bugs.python.org/issue47242
>
> #47241: [C API] Move the PyCodeObject structure to the internal C API
> https://bugs.python.org/issue47241
>
> #47238: Python threading.Event().wait() depends on the system time
> https://bugs.python.org/issue47238
>
> #47236: Document types.CodeType.replace() changes about co_exceptionta
> https://bugs.python.org/issue47236
>
> #47228: Document that na??ve datetime objects represent local time
> https://bugs.python.org/issue47228
>
> #47222: subprocess.Popen() should allow capturing output and sending i
> https://bugs.python.org/issue47222
>
> #47219: asyncio with two interpreter instances
> https://bugs.python.org/issue47219
>
> #47218: adding name to lzmafile
> https://bugs.python.org/issue47218
>
> #47217: adding name to BZ2File
> https://bugs.python.org/issue47217
>
>
>
> Most recent 15 issues waiting for review (15)
> =
>
> #47256: re: limit the maximum capturing group to 1,073,741,823, reduce
> https://bugs.python.org/issue47256
>
> #47255: Many broken :meth: roles in the docs
> https://bugs.python.org/issue47255
>
> #47254: enhanced dir?
> https://bugs.python.org/issue47254
>
> #47251: Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE
> https://bugs.python.org/issue47251
>
> #47243: Duplicate entry in 'Objects/unicodetype_db.h'
> https://bugs.python.org/issue47243
>
> #47233: show_caches option affects code positions reported by dis.get_
> https://bugs.python.org/issue47233
>
> #47222: subprocess.Popen() should allow capturing output and sending i
> https://bugs.python.org/issue47222
>
> #47218: adding name to lzmafile
> https://bugs.python.org/issue47218
>
> #47217: adding name to BZ2File
> https://bugs.python.org/issue47217
>
> #47216: adding mtime option to gzip open()
> https://bugs.python.org/issue47216
>
> #47215: Add "unstable" frame stack api
> https://bugs.python.org/issue47215
>
> #47208: Support libffi implementations that cannot support invocations
> https://bugs.python.org/issue47208
>
> #47205: posix.sched_{get|set}affinity(-1) no longer returns ProcessLoo
> https://bugs.python.org/issue47205
>
> #47200: Add ZipInfo.mode property
> https://bugs.python.org/issue47200
>
> #47199: multiprocessing: micro-optimize Connection.send_bytes() method
> https://bugs.python.org/issue47199
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/LEYLS2TYSZ4NVDFLTDSQUT25C2Y4QG2O/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/C53WJXVWHZNGLTTPFQXHUWIZCYF2FBP7/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Summary of Python tracker Issues

2022-05-13 Thread Python tracker

ACTIVITY SUMMARY (2022-05-06 - 2022-05-13)
Python tracker at https://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open7146 ( +0)
  closed 51841 ( +0)
  total  58987 ( +0)

Open issues with patches: 2890 


Most recent 15 issues with no replies (15)
==

#47258: Python 3.10 hang at exit in drop_gil() (due to resource warnin
https://bugs.python.org/issue47258

#47256: re: limit the maximum capturing group to 1,073,741,823, reduce
https://bugs.python.org/issue47256

#47253: LOAD_GLOBAL instruction with wrong source position
https://bugs.python.org/issue47253

#47252: socket.makefile documentation is missing data regarding the 'b
https://bugs.python.org/issue47252

#47251: Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE
https://bugs.python.org/issue47251

#47244: email.utils.formataddr does not respect double spaces
https://bugs.python.org/issue47244

#47242: Annoying white bar in IDLE (line 457 in sidebar.py)
https://bugs.python.org/issue47242

#47241: [C API] Move the PyCodeObject structure to the internal C API 
https://bugs.python.org/issue47241

#47238: Python threading.Event().wait() depends on the system time
https://bugs.python.org/issue47238

#47236: Document types.CodeType.replace() changes about co_exceptionta
https://bugs.python.org/issue47236

#47228: Document that na??ve datetime objects represent local time
https://bugs.python.org/issue47228

#47222: subprocess.Popen() should allow capturing output and sending i
https://bugs.python.org/issue47222

#47219: asyncio with two interpreter instances
https://bugs.python.org/issue47219

#47218: adding name to lzmafile
https://bugs.python.org/issue47218

#47217: adding name to BZ2File
https://bugs.python.org/issue47217



Most recent 15 issues waiting for review (15)
=

#47256: re: limit the maximum capturing group to 1,073,741,823, reduce
https://bugs.python.org/issue47256

#47255: Many broken :meth: roles in the docs
https://bugs.python.org/issue47255

#47254: enhanced dir?
https://bugs.python.org/issue47254

#47251: Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE
https://bugs.python.org/issue47251

#47243: Duplicate entry in 'Objects/unicodetype_db.h'
https://bugs.python.org/issue47243

#47233: show_caches option affects code positions reported by dis.get_
https://bugs.python.org/issue47233

#47222: subprocess.Popen() should allow capturing output and sending i
https://bugs.python.org/issue47222

#47218: adding name to lzmafile
https://bugs.python.org/issue47218

#47217: adding name to BZ2File
https://bugs.python.org/issue47217

#47216: adding mtime option to gzip open()
https://bugs.python.org/issue47216

#47215: Add "unstable" frame stack api
https://bugs.python.org/issue47215

#47208: Support libffi implementations that cannot support invocations
https://bugs.python.org/issue47208

#47205: posix.sched_{get|set}affinity(-1) no longer returns ProcessLoo
https://bugs.python.org/issue47205

#47200: Add ZipInfo.mode property
https://bugs.python.org/issue47200

#47199: multiprocessing: micro-optimize Connection.send_bytes() method
https://bugs.python.org/issue47199
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/LEYLS2TYSZ4NVDFLTDSQUT25C2Y4QG2O/
Code of Conduct: http://python.org/psf/codeofconduct/