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

Crashing with wildcard on Windows #109

Open
iagocanalejas opened this issue May 23, 2019 · 5 comments
Open

Crashing with wildcard on Windows #109

iagocanalejas opened this issue May 23, 2019 · 5 comments

Comments

@iagocanalejas
Copy link

Tried:

pycco apps/*.py 
pycco apps\*.py 

The result is always:

Traceback (most recent call last):
  File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\workspace\venv\Scripts\pycco.exe\__main__.py", line 9, in <module>
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 631, in main
    skip=args.skip_bad_files)
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 533, in process
    next_file()
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 517, in next_file
    with open(dest, "wb") as f:
OSError: [Errno 22] Invalid argument: 'docs\\*.html'

My project structure is something like:

- apps
  - common
  - core
  - more_modules
- docs
@subsetpark
Copy link
Member

Hi there, sorry to say I don’t have access to a Windows machine to test this. However if you want to submit a fix I’d be delighted to review it.

@roycechan
Copy link

Tried:

pycco apps/*.py 
pycco apps\*.py 

The result is always:

Traceback (most recent call last):
  File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\workspace\venv\Scripts\pycco.exe\__main__.py", line 9, in <module>
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 631, in main
    skip=args.skip_bad_files)
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 533, in process
    next_file()
  File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 517, in next_file
    with open(dest, "wb") as f:
OSError: [Errno 22] Invalid argument: 'docs\\*.html'

My project structure is something like:

- apps
  - common
  - core
  - more_modules
- docs

am running into this error too on windows

@kapau774
Copy link

kapau774 commented Aug 26, 2019

I am a bit lazy to merge those changes to the master branch, but this works for me in def main():
import glob
...

    if os.name == 'nt' and args.sources:
        n = []
        for i in args.sources:
            n += glob.glob(i)
    else:
        n = args.sources

    process(n, outdir=outdir, preserve_paths=args.paths,
            language=args.language, index=args.generate_index,
            skip=args.skip_bad_files)

KaiPrince added a commit to KaiPrince/pycco that referenced this issue Mar 22, 2021
Taken from:
pycco-docs#109 (comment)

Co-Authored-By: kapau774 <25779644+kapau774@users.noreply.github.com>
@veeralakrishna
Copy link

I have the same issue, is there any fix?

@daniel-daum
Copy link

daniel-daum commented Sep 13, 2022

OS: Windows 10
Python: 3.10.4
Pip: 22.2.2
Pycco: 0.6.0
Tested: 13 Sep 2022

I know this has been open since 2019 but I just ran into the same issue today after I installed Pycco. The docs at https://pycco-docs.github.io/pycco/ say "you can run it from the command-line: pycco src/*.py" however, when using the * wildcard it returns OSError: [Errno 22] Invalid argument: 'docs\\*.html'

I was able to get it to run by just removing the * wildcard. Running pycco src/ or pycco src/ -p worked just fine for me. It generated docs for all the .py files in the sub directories. I would try just passing the folder names that you want pycco to generate docs for without the *.

Potential solution for original poster : pycco apps/ instead of pycco apps/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants