Comments (15)
The same issue arises while trying to build the example project.
from django-bakery.
Can confirm that I am also running into this.
python manage.py build
Traceback (most recent call last):
File "manage.py", line 24, in <module>
main()
File "manage.py", line 20, in main
execute_from_command_line(sys.argv)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\bakery\management\commands\build.py", line 97, in handle
self.set_options(*args, **options)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\bakery\management\commands\build.py", line 143, in set_options
if not self.fs.exists(self.build_dir):
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\fs\base.py", line 491, in exists
self.getinfo(path)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\fs\osfs.py", line 273, in getinfo
_path = self.validatepath(path)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\fs\osfs.py", line 661, in validatepath
return super(OSFS, self).validatepath(path)
File "C:\dev\Django Projects\FJS_Services_Site\lib\site-packages\fs\base.py", line 1477, in validatepath
raise errors.InvalidCharsInPath(path)
fs.errors.InvalidCharsInPath: path 'C:\dev\Django Projects\FJS_Services_Site\src\storage/private/static_build/site/build/' contains invalid characters
settings file (inherits from base settings file)
from .base import *
import os
INSTALLED_APPS += [
'bakery',
]
BUILD_DIR = os.path.join(BASE_DIR, 'storage/private/static_build/site/build/')
BAKERY_VIEWS = [
'app_views.views.HomeView',
'app_views.views.HomeToBeginView',
'app_views.views.ServicesView',
'app_views.views.UseCasesView',
'app_views.views.AboutMeView',
'app_views.views.ContactView',
'app_views.views.SuccessView',
]
from django-bakery.
Is there a unicode or special character in your file name?
from django-bakery.
There is not.
from django-bakery.
Even if there was, there should be some code to filter that out. Something like:
file_path_str = [insert string code here]
file_path = file_path_str.encode('ascii', 'ignore').decode('unicode_escape')
from django-bakery.
Hmm. Any idea what's causing it? Can you give me some more information about your config or data inputs that might help us sleuth this out?
from django-bakery.
I believe this is a coding error on part of the module. My configurations are fairly standard for a Django project. In the base setting file, I define the base directory as follows:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
This allows me to refer to file and folder locations using relative paths, freeing me to develop within Windows and Linux environments.
from django-bakery.
I don't doubt there's a bug, I'm just struggling to find it so we can craft a patch. All of my tests are currently passing. So I suspect there is something I'm missing.
What is the path that is failing?
from django-bakery.
Are all of you guys on Windows?
from django-bakery.
I am on Windows 10. But my system should be OS-agnostic.
from django-bakery.
I'm on Windows 10. Maybe it's got something to do with my storage drive being F instead of C? That's the only reason I can think of why it's complaining of invalid characters in the path. I have two drives, one for my Windows installation which is an SSD, and one for general storage which is an HDD.
from django-bakery.
Just to throw my voice into the mix. I'm experiencing this issue, too. Python 3.7 in virtual environment on, windows 10.
I also can't seem to get a relative path off the project to write where I want. Specifying ./build
not only tries to write to C:\build
it also tries to find the static files at /static
when they're in <PROJECTDIR>/static
.
EDIT:
I don't know enough about osfs but just playing around a bit I noticed that changing the string osfs:///
(triple slash) to osfs://
got it at least using relative instead of off the root (C:\
in my case). I'll dig a bit more.
EDIT 2:
Okay so it looks like PyFilesystem
doesn't accept any non-forward slash delimited paths, by design. Since django-bakery
wants to support multiple filesystems (through BAKERY_FILESYSTEM
) we would need to map all Windows paths into the unix styled ones before use. I could take a stab at a PR if this is expected to affect many people and would be useful. If not, I'll probably just run things from within a Docker container.
from django-bakery.
@jaycle, in my government workplace, most developers are expected to work on Windows, and Docker is not permitted nor is WSL (Windows sub-system for Linux). A pull request would enable me to use django-bakery for a number of projects rather than django-distill. I prefer to user interface of django-bakery because a lot less boilerplate will be needed.
from django-bakery.
This line, https://github.com/datadesk/django-bakery/blob/2c9c495e4e8faca7b81fa57635d1631933f14171/bakery/views/base.py#L150, is problematic. If PyFilesystem will not allow backslash, then paths must be concatenated without using os.path.separator
.
from django-bakery.
fs.errors.InvalidCharsInPath: path 'F:\workplace\scrapysite\wlwcms\builds' contains invalid characters
good product~
from django-bakery.
Related Issues (20)
- Relative path to the build directory is treated like absolute HOT 5
- BuildableModel doesn't work HOT 1
- Allow rendering function views HOT 1
- Bakery doesn't run `MIDDLEWARE_CLASSES`/`MIDDLEWARES` on build HOT 3
- Build fails when I add messages HOT 2
- Incremental builds through change detection? HOT 1
- Excluding model media from build HOT 1
- Gzip corrupts buildserver response
- Working with Digital Ocean Spaces
- Need some way to figure out if the page is being generated statically HOT 4
- Integration with django-storages (AWS S3)
- page parameters
- Scaling memory consumption?
- Fix build command on Windows HOT 6
- Add Django 4.0 support
- Broken link HOT 1
- BUILD_DIR fails if it you give it a `pathlib.Path`
- Add an option to run AutoPublishingBuildableModel tasks without celery
- Integrate publish command with django-storages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-bakery.