This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Bug in os module
Type: behavior Stage:
Components: Windows Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Johano, eryksun, paul.moore, steve.dower, steven.daprano, terry.reedy, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2016-01-11 21:35 by Johano, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
os-bug.PNG Johano, 2016-01-11 21:35 Bug in os-module!
Messages (5)
msg258023 - (view) Author: Hana Larsen (Johano) Date: 2016-01-11 21:35
I get a error in the stardard module "os" (I use Python 3.5.1 64bit for Windows 10!)
What is wrong and have someone a patch
See the "os-bug.PNG"-file.
msg258037 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-01-11 22:57
The "yield from" syntax was added in Python 3.3, so somehow you're using the 3.5 standard library with either an old 3.x or 2.x version. The older version shouldn't use 3.5's standard library, unless you have either PYTHONHOME or PYTHONPATH defined. Generally neither of these variables should be defined, especially not PYTHONHOME. In the command prompt run "set PYTHON" to list all environment variables that start with "PYTHON".

You also appear to be running with the 3.5 site-packages as the working directory. Even without the other problems, I recommend against this since the current directory has precedence in sys.path. You're moving site-packages to the head of the list, in front of the standard library. For example:

    C:\Program Files\Python35\Lib\site-packages>type subprocess.py
    print("This isn't the subprocess you're looking for.")

    C:\Program Files\Python35\Lib\site-packages>py -3 -c "import subprocess"
    This isn't the subprocess you're looking for.

Save your scripts in the top-level Scripts directory or a directory in your user profile. Generally leave everything under Lib alone, to be managed by pip and other installers.
msg258083 - (view) Author: Hana Larsen (Johano) Date: 2016-01-12 08:57
I thank you much for thisse answer!
I Python is in "C:\Python35\" in the root of C-Drive (OS)
=-O
Den 11-01-2016 kl. 23:57 skrev Eryk Sun:
> Eryk Sun added the comment:
>
> The "yield from" syntax was added in Python 3.3, so somehow you're using the 3.5 standard library with either an old 3.x or 2.x version. The older version shouldn't use 3.5's standard library, unless you have either PYTHONHOME or PYTHONPATH defined. Generally neither of these variables should be defined, especially not PYTHONHOME. In the command prompt run "set PYTHON" to list all environment variables that start with "PYTHON".
>
> You also appear to be running with the 3.5 site-packages as the working directory. Even without the other problems, I recommend against this since the current directory has precedence in sys.path. You're moving site-packages to the head of the list, in front of the standard library. For example:
>
>      C:\Program Files\Python35\Lib\site-packages>type subprocess.py
>      print("This isn't the subprocess you're looking for.")
>
>      C:\Program Files\Python35\Lib\site-packages>py -3 -c "import subprocess"
>      This isn't the subprocess you're looking for.
>
> Save your scripts in the top-level Scripts directory or a directory in your user profile. Generally leave everything under Lib alone, to be managed by pip and other installers.
>
> ----------
> nosy: +eryksun
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue26086>
> _______________________________________
>
msg258380 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-01-16 10:37
Hana, when responding, please delete the quoted previous message.  On the web page, your response directly follows that messages, so the quotation is redundant and annoying.

Please write and either copy into a message or upload a **minimum** program that shows the error -- one that we can quickly read and test.  Also copy the first line that appears in an interactive shell, the one that looks like "Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32"
msg260107 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2016-02-11 14:34
I don't see any conclusive evidence that this is a bug in the Python interpreter, so I'm going to close the issue.

Hana, if you are still having this problem, please join the main python mailing list https://mail.python.org/mailman/listinfo/python-list or newsgroup comp.lang.python, and we should be able to help you there. (But please don't post screen shots, copy and paste the text of the exception into your message.)
History
Date User Action Args
2022-04-11 14:58:26adminsetgithub: 70274
2016-02-11 14:34:22steven.dapranosetstatus: open -> closed

nosy: + steven.daprano
messages: + msg260107

resolution: not a bug
2016-01-16 10:37:06terry.reedysettitle: Bug in standardmodule os -> Bug in os module
nosy: + terry.reedy

messages: + msg258380

type: crash -> behavior
2016-01-12 08:57:38Johanosetmessages: + msg258083
2016-01-11 22:58:08eryksunsetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows
2016-01-11 22:57:44eryksunsetnosy: + eryksun
messages: + msg258037
2016-01-11 21:35:25Johanocreate