Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Syntax Warning in Windows10 (within virtual python environment) #34

Open
ccllaa opened this issue Mar 23, 2020 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@ccllaa
Copy link

ccllaa commented Mar 23, 2020

Command: (venv) C:\Program Files\Python\grabbags-master>grabbags --no-system-files C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data

The data directory contains three subdirectories that I would like to bag.

Error message:
C:\Program Files\Python\grabbags-master\venv\Scripts\bagit.py:629: SyntaxWarning: "is not" with a literal. Did you mean "!="? if not manifest_filename.find("tagmanifest-") is -1: 2020-03-23 15:41:42,904 - INFO - Cleaning C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001 of system files 2020-03-23 15:41:42,906 - WARNING - Removing C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001\Code\.DS_Store 2020-03-23 15:41:42,907 - WARNING - Removing C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001\Code\TV-BOT_2.0_code_h-ek\.DS_Store 2020-03-23 15:41:42,965 - INFO - Creating bag for directory C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001 2020-03-23 15:41:42,995 - INFO - Creating data directory 2020-03-23 15:41:42,997 - INFO - Moving Code to C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001\tmpg3fpd9_5\Code 2020-03-23 15:41:42,999 - ERROR - An error occurred creating a bag in C:\Users\User\Dropbox\HeK_Claudia\grabbag_tests\data\S0001_001 Traceback (most recent call last): File "C:\Program Files\Python\grabbags-master\venv\Scripts\bagit.py", line 224, in make_bag os.rename(f, new_f) PermissionError: [WinError 5] Access is denied: 'Code' -> 'C:\\Users\\User\\Dropbox\\HeK_Claudia\\grabbag_tests\\data\\S0001_001\\tmpg3fpd9_5\\Code' Traceback (most recent call last): File "C:\Program Files\Python\grabbags-master\venv\Scripts\grabbags-script.py", line 11, in <module> load_entry_point('grabbags', 'console_scripts', 'grabbags')() File "c:\program files\python\grabbags-master\grabbags\grabbags.py", line 280, in main make_bag(bag_dir, args) File "c:\program files\python\grabbags-master\grabbags\grabbags.py", line 227, in make_bag bag = bagit.make_bag( File "C:\Program Files\Python\grabbags-master\venv\Scripts\bagit.py", line 224, in make_bag os.rename(f, new_f) PermissionError: [WinError 5] Access is denied: 'Code' -> 'C:\\Users\\User\\Dropbox\\HeK_Claudia\\grabbag_tests\\data\\S0001_001\\tmpg3fpd9_5\\Code'

@jfarbowitz
Copy link
Member

Still getting a python error in windows as of version 0.0.2. Maybe we can focus on fixing that? The other issue looks like it may be a specific permissions issue with the person's computer

C:\>grabbags C:\Users\farboj\Desktop\empty
c:\users\farboj\appdata\local\programs\python\python38\lib\site-packages\bagit-1.7.0-py3.8.egg\EGG-INFO\scripts\bagit.py:629: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not manifest_filename.find("tagmanifest-") is -1:
2021-04-16 17:04:03,494 - WARNING - C:\Users\farboj\Desktop\empty\empty is an empty directory. Skipped.
2021-04-16 17:04:03,494 - INFO - 0 bags created successfully

C:\>grabbags -v
c:\users\farboj\appdata\local\programs\python\python38\lib\site-packages\bagit-1.7.0-py3.8.egg\EGG-INFO\scripts\bagit.py:629: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not manifest_filename.find("tagmanifest-") is -1:
0.0.2

@jfarbowitz
Copy link
Member

Using the same arguments, cannot reproduce the issue on my Windows 10 machine.

@jfarbowitz jfarbowitz changed the title Does not make any bags (stops at the first bag) in Windows10 (within virtual python environment) Throws Python Error in Windows10 (within virtual python environment) Apr 16, 2021
@jfarbowitz jfarbowitz added bug Something isn't working and removed Needs Verification labels Apr 16, 2021
@jfarbowitz jfarbowitz changed the title Throws Python Error in Windows10 (within virtual python environment) Python Syntax Warning in Windows10 (within virtual python environment) Apr 16, 2021
@jfarbowitz jfarbowitz added enhancement New feature or request and removed bug Something isn't working labels Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants